// Path: src/main/java/org/wmaop/aop/interceptor/FlowPosition.java
// public class FlowPosition {
// 
// 	public final String packageName;
// 	public final String serviceName;
// 	public final String fqname;
// 	private InterceptPoint interceptPoint;
// 	
// 	public FlowPosition(InterceptPoint point, String fqname) {
// 		interceptPoint = point;
// 		if (fqname == null) {
// 			serviceName = "";
// 			packageName = "";
// 			this.fqname = "";
// 		} else {
// 			this.fqname = fqname;
// 			int pkgsep = fqname.lastIndexOf(':');
// 			if (pkgsep == -1) {
// 				serviceName = fqname;
// 				packageName = "";
// 			} else {
// 				serviceName = fqname.substring(pkgsep + 1);
// 				packageName = fqname.substring(0, pkgsep);
// 			}
// 		}
// 	}
// 	
// 	@Override
// 	public String toString() {
// 		return fqname;
// 	}
// 
// 	public void setInterceptPoint(InterceptPoint point) {
// 		interceptPoint = point;
// 	}
// 
// 	public InterceptPoint getInterceptPoint() {
// 		return interceptPoint;
// 	}
// 
// 	public String getPackageName() {
// 		return packageName;
// 	}
// 
// 	public String getServiceName() {
// 		return serviceName;
// 	}
// 
// 	public String getFqname() {
// 		return fqname;
// 	}
// }
// 
// Path: src/main/java/org/wmaop/aop/interceptor/InterceptPoint.java
// public enum InterceptPoint {
// 		BEFORE,INVOKE,AFTER;
// 
// }


import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.wmaop.aop.interceptor.FlowPosition;
import org.wmaop.aop.interceptor.InterceptPoint;
package org.wmaop.pipeline;



public class PipelinePositionTest {

	@Test
	public void shouldExtractPackageName() {
		assertEquals("pub", new FlowPosition(InterceptPoint.INVOKE, "pub:foo").packageName);
		assertEquals("", new FlowPosition(InterceptPoint.INVOKE, "").packageName);
	}

	@Test
	public void shouldExtractServiceName() {
		assertEquals("foo", new FlowPosition(InterceptPoint.INVOKE, "pub:foo").serviceName);
// Path: src/main/java/org/wmaop/aop/interceptor/FlowPosition.java
// public class FlowPosition {
// 
// 	public final String packageName;
// 	public final String serviceName;
// 	public final String fqname;
// 	private InterceptPoint interceptPoint;
// 	
// 	public FlowPosition(InterceptPoint point, String fqname) {
// 		interceptPoint = point;
// 		if (fqname == null) {
// 			serviceName = "";
// 			packageName = "";
// 			this.fqname = "";
// 		} else {
// 			this.fqname = fqname;
// 			int pkgsep = fqname.lastIndexOf(':');
// 			if (pkgsep == -1) {
// 				serviceName = fqname;
// 				packageName = "";
// 			} else {
// 				serviceName = fqname.substring(pkgsep + 1);
// 				packageName = fqname.substring(0, pkgsep);
// 			}
// 		}
// 	}
// 	
// 	@Override
// 	public String toString() {
// 		return fqname;
// 	}
// 
// 	public void setInterceptPoint(InterceptPoint point) {
// 		interceptPoint = point;
// 	}
// 
// 	public InterceptPoint getInterceptPoint() {
// 		return interceptPoint;
// 	}
// 
// 	public String getPackageName() {
// 		return packageName;
// 	}
// 
// 	public String getServiceName() {
// 		return serviceName;
// 	}
// 
// 	public String getFqname() {
// 		return fqname;
// 	}
// }
// 
// Path: src/main/java/org/wmaop/aop/interceptor/InterceptPoint.java
// public enum InterceptPoint {
// 		BEFORE,INVOKE,AFTER;
// 
// }


// Path: src/test/java/org/wmaop/pipeline/PipelinePositionTest.java
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.wmaop.aop.interceptor.FlowPosition;
import org.wmaop.aop.interceptor.InterceptPoint;

package org.wmaop.pipeline;



public class PipelinePositionTest {

	@Test
	public void shouldExtractPackageName() {
		assertEquals("pub", new FlowPosition(InterceptPoint.INVOKE, "pub:foo").packageName);
		assertEquals("", new FlowPosition(InterceptPoint.INVOKE, "").packageName);
	}

	@Test
	public void shouldExtractServiceName() {
		assertEquals("foo", new FlowPosition(InterceptPoint.INVOKE, "pub:foo").serviceName);
		assertEquals("", new FlowPosition(InterceptPoint.INVOKE, "").serviceName);