Author: objectiser
Date: 2010-08-10 06:28:46 -0400 (Tue, 10 Aug 2010)
New Revision: 905
Modified:
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/ActivityInterface.java
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/impl/ActivityImpl.java
trunk/console/bpel2svg/src/test/java/org/jboss/soa/bpel/bpel2svg/BPEL2SVGUtilTest.java
Log:
Additional tests to derive correct activity from line numbers in BPEL definition.
Modified:
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/ActivityInterface.java
===================================================================
---
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/ActivityInterface.java 2010-08-09
16:47:54 UTC (rev 904)
+++
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/ActivityInterface.java 2010-08-10
10:28:46 UTC (rev 905)
@@ -28,10 +28,27 @@
public List<ActivityInterface> getSubActivities();
+ /**
+ * The starting line number associated with the activity.
+ *
+ * @return The start line number
+ */
public int getStartLineNumber();
+ /**
+ * The end line number associated with the activity.
+ *
+ * @return The end line number, or -1 if could not be determined
+ */
public int getEndLineNumber();
+ /**
+ * This method returns the activity located at the specified
+ * line number.
+ *
+ * @param lineNumber The line number
+ * @return The activity, or null if not found
+ */
public ActivityInterface getActivityAtLineNumber(int lineNumber);
public SVGDimension getDimensions() ;
Modified:
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/impl/ActivityImpl.java
===================================================================
---
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/impl/ActivityImpl.java 2010-08-09
16:47:54 UTC (rev 904)
+++
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/impl/ActivityImpl.java 2010-08-10
10:28:46 UTC (rev 905)
@@ -146,10 +146,20 @@
return displayName;
}
+ /**
+ * The starting line number associated with the activity.
+ *
+ * @return The start line number
+ */
public int getStartLineNumber() {
return(startLineNumber);
}
+ /**
+ * The end line number associated with the activity.
+ *
+ * @return The end line number, or -1 if could not be determined
+ */
public int getEndLineNumber() {
int ret=-1;
@@ -172,6 +182,13 @@
return(ret);
}
+ /**
+ * This method returns the activity located at the specified
+ * line number.
+ *
+ * @param lineNumber The line number
+ * @return The activity, or null if not found
+ */
public ActivityInterface getActivityAtLineNumber(int lineNumber) {
ActivityInterface ret=null;
Modified:
trunk/console/bpel2svg/src/test/java/org/jboss/soa/bpel/bpel2svg/BPEL2SVGUtilTest.java
===================================================================
---
trunk/console/bpel2svg/src/test/java/org/jboss/soa/bpel/bpel2svg/BPEL2SVGUtilTest.java 2010-08-09
16:47:54 UTC (rev 904)
+++
trunk/console/bpel2svg/src/test/java/org/jboss/soa/bpel/bpel2svg/BPEL2SVGUtilTest.java 2010-08-10
10:28:46 UTC (rev 905)
@@ -20,9 +20,14 @@
import static org.junit.Assert.*;
import org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface;
+import org.wso2.carbon.bpel.ui.bpel2svg.AssignInterface;
+import org.wso2.carbon.bpel.ui.bpel2svg.IfInterface;
import org.wso2.carbon.bpel.ui.bpel2svg.ReceiveInterface;
+import org.wso2.carbon.bpel.ui.bpel2svg.ReplyInterface;
import org.wso2.carbon.bpel.ui.bpel2svg.SVGInterface;
import org.wso2.carbon.bpel.ui.bpel2svg.SequenceInterface;
+import org.wso2.carbon.bpel.ui.bpel2svg.ThrowInterface;
+import org.wso2.carbon.bpel.ui.bpel2svg.WhileInterface;
public class BPEL2SVGUtilTest {
@@ -95,6 +100,86 @@
checkActivityAtLine("bpel/Math.bpel", 61, ReceiveInterface.class);
}
+ @org.junit.Test
+ public void testMathGetLineNum64Assign() {
+ checkActivityAtLine("bpel/Math.bpel", 64, AssignInterface.class);
+ }
+
+ @org.junit.Test
+ public void testMathGetLineNum72AssignStill() {
+ checkActivityAtLine("bpel/Math.bpel", 72, AssignInterface.class);
+ }
+
+ @org.junit.Test
+ public void testMathGetLineNum88Switch() {
+ checkActivityAtLine("bpel/Math.bpel", 88, IfInterface.class);
+ }
+
+ @org.junit.Test
+ public void testMathGetLineNum118Sequence() {
+ checkActivityAtLine("bpel/Math.bpel", 118, SequenceInterface.class);
+ }
+
+ @org.junit.Test
+ public void testMathGetLineNum119Assign() {
+ checkActivityAtLine("bpel/Math.bpel", 119, AssignInterface.class);
+ }
+
+ @org.junit.Test
+ public void testMathGetLineNum132Sequence() {
+ checkActivityAtLine("bpel/Math.bpel", 132, SequenceInterface.class);
+ }
+
+ @org.junit.Test
+ public void testMathGetLineNum133Switch() {
+ checkActivityAtLine("bpel/Math.bpel", 133, IfInterface.class);
+ }
+
+ @org.junit.Test
+ public void testMathGetLineNum146Sequence() {
+ checkActivityAtLine("bpel/Math.bpel", 146, SequenceInterface.class);
+ }
+
+ @org.junit.Test
+ public void testMathGetLineNum147Assign() {
+ checkActivityAtLine("bpel/Math.bpel", 147, AssignInterface.class);
+ }
+
+ @org.junit.Test
+ public void testMathGetLineNum168Throw() {
+ checkActivityAtLine("bpel/Math.bpel", 168, ThrowInterface.class);
+ }
+
+ @org.junit.Test
+ public void testMathGetLineNum177Sequence() {
+ checkActivityAtLine("bpel/Math.bpel", 177, SequenceInterface.class);
+ }
+
+ @org.junit.Test
+ public void testMathGetLineNum178Assign() {
+ checkActivityAtLine("bpel/Math.bpel", 178, AssignInterface.class);
+ }
+
+ @org.junit.Test
+ public void testMathGetLineNum186While() {
+ checkActivityAtLine("bpel/Math.bpel", 186, WhileInterface.class);
+ }
+
+ @org.junit.Test
+ public void testMathGetLineNum188Assign() {
+ checkActivityAtLine("bpel/Math.bpel", 188, AssignInterface.class);
+ }
+
+ @org.junit.Test
+ public void testMathGetLineNum229Assign() {
+ checkActivityAtLine("bpel/Math.bpel", 229, AssignInterface.class);
+ }
+
+ @org.junit.Test
+ public void testMathGetLineNum253Reply() {
+ checkActivityAtLine("bpel/Math.bpel", 253, ReplyInterface.class);
+ }
+
public void checkActivityAtLine(String filename, int lineNo, Class<?> type) {
java.io.InputStream is=ClassLoader.getSystemResourceAsStream(filename);