savara SVN: r203 - in tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src: test/org/jboss/savara/tools/bpel/model/component and 1 other directory.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-03-21 09:22:30 -0400 (Sun, 21 Mar 2010)
New Revision: 203
Modified:
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/CatchAll.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Else.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Elseif.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ForEach.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/If.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/ForEachTest.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/IfTest.java
Log:
Add more tests for getting uri.
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/CatchAll.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/CatchAll.java 2010-03-19 23:11:21 UTC (rev 202)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/CatchAll.java 2010-03-21 13:22:30 UTC (rev 203)
@@ -96,7 +96,7 @@
String ret="";
if (elem instanceof BPELActivity) {
- ret += "@activity";
+ ret = "@activity";
}
return(ret);
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Else.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Else.java 2010-03-19 23:11:21 UTC (rev 202)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Else.java 2010-03-21 13:22:30 UTC (rev 203)
@@ -94,5 +94,15 @@
return(m_activity);
}
+ protected String getLocalURIPart(BPELElement elem) {
+ String ret="";
+
+ if (elem instanceof BPELActivity) {
+ ret = "@activity";
+ }
+
+ return(ret);
+ }
+
private BPELElement m_activity;
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Elseif.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Elseif.java 2010-03-19 23:11:21 UTC (rev 202)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Elseif.java 2010-03-21 13:22:30 UTC (rev 203)
@@ -124,6 +124,16 @@
return(m_activity);
}
+ protected String getLocalURIPart(BPELElement elem) {
+ String ret="";
+
+ if (elem instanceof BPELActivity) {
+ ret = "@activity";
+ }
+
+ return(ret);
+ }
+
private Condition m_condition;
private BPELElement m_activity;
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ForEach.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ForEach.java 2010-03-19 23:11:21 UTC (rev 202)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ForEach.java 2010-03-21 13:22:30 UTC (rev 203)
@@ -110,5 +110,15 @@
getSource().setComponentURI(getURI());
}
+ protected String getLocalURIPart(BPELElement elem) {
+ String ret="";
+
+ if (elem instanceof Scope) {
+ ret += "@scope";
+ }
+
+ return(ret);
+ }
+
private Scope m_scope=null;
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/If.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/If.java 2010-03-19 23:11:21 UTC (rev 202)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/If.java 2010-03-21 13:22:30 UTC (rev 203)
@@ -265,6 +265,21 @@
return(m_elsePath);
}
+ protected String getLocalURIPart(BPELElement elem) {
+ String ret="";
+
+ if (elem instanceof Elseif) {
+ int pos=getElseIfPaths().indexOf(elem);
+ ret = "@elseif."+pos;
+ } else if (elem instanceof Else) {
+ ret = "@else";
+ } else {
+ ret = "@activity";
+ }
+
+ return(ret);
+ }
+
private static Log logger=LogFactory.getLog(If.class);
private Condition m_condition=null;
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/ForEachTest.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/ForEachTest.java 2010-03-19 23:11:21 UTC (rev 202)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/ForEachTest.java 2010-03-21 13:22:30 UTC (rev 203)
@@ -127,4 +127,87 @@
getLocalName());
}
}
+
+ public void testGetURI() {
+ BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+ String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+ "<forEach xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+ "<startCounterValue/>"+
+ "<finalCounterValue/>"+
+ "<completionCondition/>"+
+ "<scope>"+
+ "<sequence>"+
+ "<receive/>"+
+ "</sequence>"+
+ "</scope>"+
+ "</forEach>"+
+ "<sequence/>"+
+ "</process>";
+
+ org.w3c.dom.Element elem=null;
+
+ try {
+ javax.xml.parsers.DocumentBuilderFactory factory=
+ javax.xml.parsers.DocumentBuilderFactory.newInstance();
+
+ factory.setNamespaceAware(true);
+
+ javax.xml.parsers.DocumentBuilder builder=
+ factory.newDocumentBuilder();
+
+ java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+
+ org.w3c.dom.Document doc=builder.parse(is);
+ elem = doc.getDocumentElement();
+
+ is.close();
+ } catch(Exception e) {
+ e.printStackTrace();
+ fail("Failed to convert to doc");
+ }
+
+ Process component=new Process(model, elem);
+
+ BPELActivity topact=component.getActivity();
+
+ if ((topact instanceof ForEach) == false) {
+ fail("Top level activity is not ForEach");
+ }
+
+ ForEach fe=(ForEach)topact;
+
+ Scope innerScope=fe.getScope();
+
+ if (innerScope == null) {
+ fail("Inner scope not set");
+ }
+
+ if ((innerScope.getActivity() instanceof Sequence) == false) {
+ fail("Inner scope activity is not a sequence");
+ }
+
+ Sequence seq=(Sequence)innerScope.getActivity();
+
+ if (seq.getActivities().size() != 1) {
+ fail("Expecting 1 child activities: "+
+ seq.getActivities().size());
+ }
+
+ if ((seq.getActivities().get(0) instanceof Receive) == false) {
+ fail("First activity should be receive");
+ }
+
+ Receive recv=(Receive)seq.getActivities().get(0);
+
+ String uri=recv.getURI();
+
+ if (uri == null) {
+ fail("URI is null");
+ }
+
+ if (uri.equals("//@activity/@scope/@activity/(a)activities.0") == false) {
+ fail("URI is invalid: "+uri);
+ }
+ }
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/IfTest.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/IfTest.java 2010-03-19 23:11:21 UTC (rev 202)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/IfTest.java 2010-03-21 13:22:30 UTC (rev 203)
@@ -868,4 +868,319 @@
getFirstChild().getLocalName());
}
}
+
+ public void testGetURIIf() {
+ BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+ String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+ "<sequence>"+
+ "<if xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+ "<condition/>"+
+ "<sequence>"+
+ "<receive/>"+
+ "</sequence>"+
+ "<elseif>"+
+ "<condition/>"+
+ "<sequence>"+
+ "<invoke/>"+
+ "</sequence>"+
+ "</elseif>"+
+ "<elseif>"+
+ "<condition/>"+
+ "<sequence>"+
+ "<reply/>"+
+ "</sequence>"+
+ "</elseif>"+
+ "<else>"+
+ "<sequence>"+
+ "<throw/>"+
+ "</sequence>"+
+ "</else>"+
+ "</if>"+
+ "</sequence>"+
+ "</process>";
+
+ org.w3c.dom.Element elem=null;
+
+ try {
+ javax.xml.parsers.DocumentBuilderFactory factory=
+ javax.xml.parsers.DocumentBuilderFactory.newInstance();
+
+ factory.setNamespaceAware(true);
+
+ javax.xml.parsers.DocumentBuilder builder=
+ factory.newDocumentBuilder();
+
+ java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+
+ org.w3c.dom.Document doc=builder.parse(is);
+ elem = doc.getDocumentElement();
+
+ is.close();
+ } catch(Exception e) {
+ e.printStackTrace();
+ fail("Failed to convert to doc");
+ }
+
+ Process component=new Process(model, elem);
+
+ BPELActivity topact=component.getActivity();
+
+ if ((topact instanceof Sequence) == false) {
+ fail("Top level activity is not Sequence");
+ }
+
+ Sequence seq=(Sequence)topact;
+
+ if (seq.getActivities().size() != 1) {
+ fail("Should have 1 activity: "+seq.getActivities().size());
+ }
+
+ if ((seq.getActivities().get(0) instanceof If) == false) {
+ fail("Activty should be If");
+ }
+
+ If ifelem=(If)seq.getActivities().get(0);
+
+ if ((ifelem.getActivity() instanceof Sequence) == false) {
+ fail("Inner scope activity is not a sequence");
+ }
+
+ Sequence innerseq=(Sequence)ifelem.getActivity();
+
+ if (innerseq.getActivities().size() != 1) {
+ fail("Expecting 1 child activities: "+
+ innerseq.getActivities().size());
+ }
+
+ if ((innerseq.getActivities().get(0) instanceof Receive) == false) {
+ fail("First activity should be receive");
+ }
+
+ Receive recv=(Receive)innerseq.getActivities().get(0);
+
+ String uri=recv.getURI();
+
+ if (uri == null) {
+ fail("URI is null");
+ }
+
+ if (uri.equals("//@activity/@activities.0/@activity/(a)activities.0") == false) {
+ fail("URI is invalid: "+uri);
+ }
+ }
+
+ public void testGetURIIfElseIf() {
+ BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+ String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+ "<sequence>"+
+ "<if xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+ "<condition/>"+
+ "<sequence>"+
+ "<receive/>"+
+ "</sequence>"+
+ "<elseif>"+
+ "<condition/>"+
+ "<sequence>"+
+ "<invoke/>"+
+ "</sequence>"+
+ "</elseif>"+
+ "<elseif>"+
+ "<condition/>"+
+ "<sequence>"+
+ "<reply/>"+
+ "</sequence>"+
+ "</elseif>"+
+ "<else>"+
+ "<sequence>"+
+ "<throw/>"+
+ "</sequence>"+
+ "</else>"+
+ "</if>"+
+ "</sequence>"+
+ "</process>";
+
+ org.w3c.dom.Element elem=null;
+
+ try {
+ javax.xml.parsers.DocumentBuilderFactory factory=
+ javax.xml.parsers.DocumentBuilderFactory.newInstance();
+
+ factory.setNamespaceAware(true);
+
+ javax.xml.parsers.DocumentBuilder builder=
+ factory.newDocumentBuilder();
+
+ java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+
+ org.w3c.dom.Document doc=builder.parse(is);
+ elem = doc.getDocumentElement();
+
+ is.close();
+ } catch(Exception e) {
+ e.printStackTrace();
+ fail("Failed to convert to doc");
+ }
+
+ Process component=new Process(model, elem);
+
+ BPELActivity topact=component.getActivity();
+
+ if ((topact instanceof Sequence) == false) {
+ fail("Top level activity is not Sequence");
+ }
+
+ Sequence seq=(Sequence)topact;
+
+ if (seq.getActivities().size() != 1) {
+ fail("Should have 1 activity: "+seq.getActivities().size());
+ }
+
+ if ((seq.getActivities().get(0) instanceof If) == false) {
+ fail("Activty should be If");
+ }
+
+ If ifelem=(If)seq.getActivities().get(0);
+
+ if (ifelem.getElseIfPaths().size() != 2) {
+ fail("Expecting 2 elseIf paths: "+ifelem.getElseIfPaths().size());
+ }
+
+ Elseif eif=ifelem.getElseIfPaths().get(1);
+
+ if ((eif.getActivity() instanceof Sequence) == false) {
+ fail("ElseIf activity not a sequence");
+ }
+
+ Sequence innerseq=(Sequence)eif.getActivity();
+
+ if (innerseq.getActivities().size() != 1) {
+ fail("Expecting 1 child activities: "+
+ innerseq.getActivities().size());
+ }
+
+ if ((innerseq.getActivities().get(0) instanceof Reply) == false) {
+ fail("First activity should be Reply");
+ }
+
+ Reply reply=(Reply)innerseq.getActivities().get(0);
+
+ String uri=reply.getURI();
+
+ if (uri == null) {
+ fail("URI is null");
+ }
+
+ if (uri.equals("//@activity/@activities.0/@elseif.1/@activity/(a)activities.0") == false) {
+ fail("URI is invalid: "+uri);
+ }
+ }
+
+ public void testGetURIIfElse() {
+ BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+ String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+ "<sequence>"+
+ "<if xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+ "<condition/>"+
+ "<sequence>"+
+ "<receive/>"+
+ "</sequence>"+
+ "<elseif>"+
+ "<condition/>"+
+ "<sequence>"+
+ "<invoke/>"+
+ "</sequence>"+
+ "</elseif>"+
+ "<elseif>"+
+ "<condition/>"+
+ "<sequence>"+
+ "<reply/>"+
+ "</sequence>"+
+ "</elseif>"+
+ "<else>"+
+ "<sequence>"+
+ "<throw/>"+
+ "</sequence>"+
+ "</else>"+
+ "</if>"+
+ "</sequence>"+
+ "</process>";
+
+ org.w3c.dom.Element elem=null;
+
+ try {
+ javax.xml.parsers.DocumentBuilderFactory factory=
+ javax.xml.parsers.DocumentBuilderFactory.newInstance();
+
+ factory.setNamespaceAware(true);
+
+ javax.xml.parsers.DocumentBuilder builder=
+ factory.newDocumentBuilder();
+
+ java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+
+ org.w3c.dom.Document doc=builder.parse(is);
+ elem = doc.getDocumentElement();
+
+ is.close();
+ } catch(Exception e) {
+ e.printStackTrace();
+ fail("Failed to convert to doc");
+ }
+
+ Process component=new Process(model, elem);
+
+ BPELActivity topact=component.getActivity();
+
+ if ((topact instanceof Sequence) == false) {
+ fail("Top level activity is not Sequence");
+ }
+
+ Sequence seq=(Sequence)topact;
+
+ if (seq.getActivities().size() != 1) {
+ fail("Should have 1 activity: "+seq.getActivities().size());
+ }
+
+ if ((seq.getActivities().get(0) instanceof If) == false) {
+ fail("Activty should be If");
+ }
+
+ If ifelem=(If)seq.getActivities().get(0);
+
+ if (ifelem.getElsePath() == null) {
+ fail("Else not set");
+ }
+
+ Else els=ifelem.getElsePath();
+
+ if ((els.getActivity() instanceof Sequence) == false) {
+ fail("Else activity not a sequence");
+ }
+
+ Sequence innerseq=(Sequence)els.getActivity();
+
+ if (innerseq.getActivities().size() != 1) {
+ fail("Expecting 1 child activities: "+
+ innerseq.getActivities().size());
+ }
+
+ if ((innerseq.getActivities().get(0) instanceof Throw) == false) {
+ fail("First activity should be Throw");
+ }
+
+ Throw thr=(Throw)innerseq.getActivities().get(0);
+
+ String uri=thr.getURI();
+
+ if (uri == null) {
+ fail("URI is null");
+ }
+
+ if (uri.equals("//@activity/@activities.0/@else/@activity/(a)activities.0") == false) {
+ fail("URI is invalid: "+uri);
+ }
+ }
}
14 years, 1 month
savara SVN: r202 - in tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src: test/org/jboss/savara/tools/bpel/model/component and 1 other directory.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-03-19 19:11:21 -0400 (Fri, 19 Mar 2010)
New Revision: 202
Modified:
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/EventHandlers.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/OnAlarm.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/OnEvent.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Scope.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/EventHandlersTest.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/FaultHandlersTest.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/OnAlarmTest.java
Log:
Added tests for event and fault handlers.
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/EventHandlers.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/EventHandlers.java 2010-03-19 21:42:31 UTC (rev 201)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/EventHandlers.java 2010-03-19 23:11:21 UTC (rev 202)
@@ -211,6 +211,18 @@
ConversionContext context) {
}
+ protected String getLocalURIPart(BPELElement elem) {
+ String ret="";
+
+ if (elem instanceof OnEvent) {
+ ret += "@onEvent."+getOnEvents().indexOf(elem);
+ } else if (elem instanceof OnAlarm) {
+ ret += "@onAlarm."+getOnAlarms().indexOf(elem);
+ }
+
+ return(ret);
+ }
+
private java.util.List<OnEvent> m_onEvents=
new java.util.Vector<OnEvent>();
private java.util.List<OnAlarm> m_onAlarms=
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/OnAlarm.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/OnAlarm.java 2010-03-19 21:42:31 UTC (rev 201)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/OnAlarm.java 2010-03-19 23:11:21 UTC (rev 202)
@@ -42,7 +42,16 @@
org.w3c.dom.Element activity) {
super(model, activity);
- m_activity = findChildActivity();
+ //m_activity = findChildActivity();
+
+ BPELElement elem=findChildActivity();
+
+ java.util.List<BPELElement> elems=findChildElements(BPELActivity.class);
+
+ if (elem instanceof Scope) {
+ m_scope = (Scope)elem;
+ }
+
}
/**
@@ -68,8 +77,8 @@
public void setUntil(Until cond) {
org.w3c.dom.Element insertBefore=null;
- if (m_activity != null) {
- insertBefore = m_activity.getDOMElement();
+ if (m_scope != null) {
+ insertBefore = m_scope.getDOMElement();
}
setChildElement(findChildElement(Until.UNTIL),
@@ -105,8 +114,8 @@
public void setFor(For cond) {
org.w3c.dom.Element insertBefore=null;
- if (m_activity != null) {
- insertBefore = m_activity.getDOMElement();
+ if (m_scope != null) {
+ insertBefore = m_scope.getDOMElement();
}
setChildElement(findChildElement(For.FOR),
@@ -135,13 +144,13 @@
}
/**
- * This method sets the activity associated with
- * the 'else' construct.
+ * This method sets the scope associated with
+ * the 'onEvent' construct.
*
- * @param act The activity
+ * @param scope The scope
*/
- public void setActivity(BPELElement act) {
- m_activity = act;
+ public void setScope(Scope scope) {
+ m_scope = scope;
BPELElement existing=findChildActivity();
org.w3c.dom.Element existingElem=null;
@@ -152,19 +161,30 @@
org.w3c.dom.Element insertBefore=null;
- setChildElement(existingElem, act,
+ setChildElement(existingElem, scope,
insertBefore);
}
/**
- * This method returns the activity associated with
- * the 'else' construct.
+ * This method returns the scope associated with
+ * the 'onEvent' construct.
*
- * @return The activity
+ * @return The scope
*/
- public BPELElement getActivity() {
- return(m_activity);
+ public Scope getScope() {
+ return(m_scope);
}
- private BPELElement m_activity;
+ protected String getLocalURIPart(BPELElement elem) {
+ String ret="";
+
+ if (elem instanceof Scope) {
+ ret += "@scope";
+ }
+
+ return(ret);
+ }
+
+ private Scope m_scope;
+ //private BPELElement m_activity;
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/OnEvent.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/OnEvent.java 2010-03-19 21:42:31 UTC (rev 201)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/OnEvent.java 2010-03-19 23:11:21 UTC (rev 202)
@@ -177,5 +177,15 @@
}
+ protected String getLocalURIPart(BPELElement elem) {
+ String ret="";
+
+ if (elem instanceof Scope) {
+ ret += "@scope";
+ }
+
+ return(ret);
+ }
+
private Scope m_scope;
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java 2010-03-19 21:42:31 UTC (rev 201)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java 2010-03-19 23:11:21 UTC (rev 202)
@@ -874,6 +874,8 @@
ret += "@activity";
} else if (elem instanceof FaultHandlers) {
ret += "@faultHandlers";
+ } else if (elem instanceof EventHandlers) {
+ ret += "@eventHandlers";
}
return(ret);
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Scope.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Scope.java 2010-03-19 21:42:31 UTC (rev 201)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Scope.java 2010-03-19 23:11:21 UTC (rev 202)
@@ -646,6 +646,20 @@
}
}
+ protected String getLocalURIPart(BPELElement elem) {
+ String ret="";
+
+ if (elem instanceof BPELActivity) {
+ ret += "@activity";
+ } else if (elem instanceof FaultHandlers) {
+ ret += "@faultHandlers";
+ } else if (elem instanceof EventHandlers) {
+ ret += "@eventHandlers";
+ }
+
+ return(ret);
+ }
+
private org.w3c.dom.Element m_partnerLinksElem=null;
private org.w3c.dom.Element m_variablesElem=null;
private org.w3c.dom.Element m_messageExchangesElem=null;
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/EventHandlersTest.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/EventHandlersTest.java 2010-03-19 21:42:31 UTC (rev 201)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/EventHandlersTest.java 2010-03-19 23:11:21 UTC (rev 202)
@@ -216,4 +216,192 @@
getLocalName());
}
}
+
+ public void testGetURIOnEvent() {
+ BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+ String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+ "<scope>"+
+ "<eventHandlers>"+
+ "<onEvent>"+
+ "<scope>"+
+ "<sequence>"+
+ "<receive/>"+
+ "</sequence>"+
+ "</scope>"+
+ "</onEvent>"+
+ "</eventHandlers>"+
+ "<sequence/>"+
+ "</scope>"+
+ "</process>";
+
+ org.w3c.dom.Element elem=null;
+
+ try {
+ javax.xml.parsers.DocumentBuilderFactory factory=
+ javax.xml.parsers.DocumentBuilderFactory.newInstance();
+
+ factory.setNamespaceAware(true);
+
+ javax.xml.parsers.DocumentBuilder builder=
+ factory.newDocumentBuilder();
+
+ java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+
+ org.w3c.dom.Document doc=builder.parse(is);
+ elem = doc.getDocumentElement();
+
+ is.close();
+ } catch(Exception e) {
+ e.printStackTrace();
+ fail("Failed to convert to doc");
+ }
+
+ Process component=new Process(model, elem);
+
+ BPELActivity topact=component.getActivity();
+
+ if ((topact instanceof Scope) == false) {
+ fail("Top level activity is not scope");
+ }
+
+ Scope scope=(Scope)topact;
+
+ if (scope.getEventHandlers() == null) {
+ fail("Event handlers not set");
+ }
+
+ if (scope.getEventHandlers().getOnEvents().size() != 1) {
+ fail("Event handlers should have 1 onEvent: "+scope.getEventHandlers().getOnEvents().size());
+ }
+
+ OnEvent one=scope.getEventHandlers().getOnEvents().get(0);
+
+ Scope innerScope=one.getScope();
+
+ if (innerScope == null) {
+ fail("Inner scope not set");
+ }
+
+ if ((innerScope.getActivity() instanceof Sequence) == false) {
+ fail("Inner scope activity is not a sequence");
+ }
+
+ Sequence seq=(Sequence)innerScope.getActivity();
+
+ if (seq.getActivities().size() != 1) {
+ fail("Expecting 1 child activities: "+
+ seq.getActivities().size());
+ }
+
+ if ((seq.getActivities().get(0) instanceof Receive) == false) {
+ fail("First activity should be receive");
+ }
+
+ Receive recv=(Receive)seq.getActivities().get(0);
+
+ String uri=recv.getURI();
+
+ if (uri == null) {
+ fail("URI is null");
+ }
+
+ if (uri.equals("//@activity/@eventHandlers/@onEvent.0/@scope/@activity/(a)activities.0") == false) {
+ fail("URI is invalid: "+uri);
+ }
+ }
+
+ public void testGetURIOnAlarm() {
+ BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+ String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+ "<scope>"+
+ "<eventHandlers>"+
+ "<onAlarm>"+
+ "<scope>"+
+ "<sequence>"+
+ "<receive/>"+
+ "</sequence>"+
+ "</scope>"+
+ "</onAlarm>"+
+ "</eventHandlers>"+
+ "<sequence/>"+
+ "</scope>"+
+ "</process>";
+
+ org.w3c.dom.Element elem=null;
+
+ try {
+ javax.xml.parsers.DocumentBuilderFactory factory=
+ javax.xml.parsers.DocumentBuilderFactory.newInstance();
+
+ factory.setNamespaceAware(true);
+
+ javax.xml.parsers.DocumentBuilder builder=
+ factory.newDocumentBuilder();
+
+ java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+
+ org.w3c.dom.Document doc=builder.parse(is);
+ elem = doc.getDocumentElement();
+
+ is.close();
+ } catch(Exception e) {
+ e.printStackTrace();
+ fail("Failed to convert to doc");
+ }
+
+ Process component=new Process(model, elem);
+
+ BPELActivity topact=component.getActivity();
+
+ if ((topact instanceof Scope) == false) {
+ fail("Top level activity is not scope");
+ }
+
+ Scope scope=(Scope)topact;
+
+ if (scope.getEventHandlers() == null) {
+ fail("Event handlers not set");
+ }
+
+ if (scope.getEventHandlers().getOnAlarms().size() != 1) {
+ fail("Event handlers should have 1 onAlarm: "+scope.getEventHandlers().getOnAlarms().size());
+ }
+
+ OnAlarm one=scope.getEventHandlers().getOnAlarms().get(0);
+
+ Scope innerScope=one.getScope();
+
+ if (innerScope == null) {
+ fail("Inner scope not set");
+ }
+
+ if ((innerScope.getActivity() instanceof Sequence) == false) {
+ fail("Inner scope activity is not a sequence");
+ }
+
+ Sequence seq=(Sequence)innerScope.getActivity();
+
+ if (seq.getActivities().size() != 1) {
+ fail("Expecting 1 child activities: "+
+ seq.getActivities().size());
+ }
+
+ if ((seq.getActivities().get(0) instanceof Receive) == false) {
+ fail("First activity should be receive");
+ }
+
+ Receive recv=(Receive)seq.getActivities().get(0);
+
+ String uri=recv.getURI();
+
+ if (uri == null) {
+ fail("URI is null");
+ }
+
+ if (uri.equals("//@activity/@eventHandlers/@onAlarm.0/@scope/@activity/(a)activities.0") == false) {
+ fail("URI is invalid: "+uri);
+ }
+ }
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/FaultHandlersTest.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/FaultHandlersTest.java 2010-03-19 21:42:31 UTC (rev 201)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/FaultHandlersTest.java 2010-03-19 23:11:21 UTC (rev 202)
@@ -231,7 +231,6 @@
}
}
-
public void testGetURICatch() {
BPELLanguageModel model=new DefaultBPELLanguageModel(null);
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/OnAlarmTest.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/OnAlarmTest.java 2010-03-19 21:42:31 UTC (rev 201)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/OnAlarmTest.java 2010-03-19 23:11:21 UTC (rev 202)
@@ -43,7 +43,7 @@
String xml="<onAlarm xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">" +
"<until>"+expr1+"</until>"+
- "<sequence/></onAlarm>";
+ "<scope/></onAlarm>";
org.w3c.dom.Element elem=null;
try {
@@ -87,13 +87,9 @@
expr1+"' but got '"+result+"'");
}
- if (component.getActivity() == null) {
- fail("No activity");
+ if (component.getScope() == null) {
+ fail("No scope");
}
-
- if ((component.getActivity() instanceof Sequence) == false) {
- fail("Activity is not a sequence");
- }
}
public void testBuildOnAlarmFor() {
@@ -103,7 +99,7 @@
String xml="<onAlarm xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
"<for>"+expr1+"</for>"+
- "<sequence/>"+
+ "<scope/>"+
"</onAlarm>";
org.w3c.dom.Element elem=null;
@@ -148,13 +144,9 @@
expr1+"' but got '"+result+"'");
}
- if (component.getActivity() == null) {
+ if (component.getScope() == null) {
fail("No activity");
}
-
- if ((component.getActivity() instanceof Sequence) == false) {
- fail("Activity is not a sequence");
- }
}
public void testSetUntilNew() {
@@ -688,20 +680,16 @@
expr1+"' but got '"+result+"'");
}
- Sequence sub=new Sequence(model);
- component.setActivity(sub);
+ Scope sub=new Scope(model);
+ component.setScope(sub);
- if (component.getActivity() == null) {
- fail("No activity");
+ if (component.getScope() == null) {
+ fail("No scope");
}
- if ((component.getActivity() instanceof Sequence) == false) {
- fail("Activity is not a sequence");
- }
-
if (component.getDOMElement().getChildNodes().item(1).
- getLocalName().equals(Sequence.SEQUENCE) == false) {
- fail("Second element was not a sequence: "+
+ getLocalName().equals(Scope.SCOPE) == false) {
+ fail("Second element was not a scope: "+
component.getDOMElement().getChildNodes().item(1).
getLocalName());
}
@@ -758,20 +746,16 @@
expr1+"' but got '"+result+"'");
}
- Sequence sub=new Sequence(model);
- component.setActivity(sub);
+ Scope sub=new Scope(model);
+ component.setScope(sub);
- if (component.getActivity() == null) {
- fail("No activity");
+ if (component.getScope() == null) {
+ fail("No Scope");
}
- if ((component.getActivity() instanceof Sequence) == false) {
- fail("Activity is not a sequence");
- }
-
if (component.getDOMElement().getChildNodes().item(1).
- getLocalName().equals(Sequence.SEQUENCE) == false) {
- fail("Second element was not a sequence: "+
+ getLocalName().equals(Scope.SCOPE) == false) {
+ fail("Second element was not a Scope: "+
component.getDOMElement().getChildNodes().item(1).
getLocalName());
}
@@ -783,7 +767,7 @@
String expr1="Test Expression 1";
String xml="<onAlarm xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">" +
- "<sequence/>"+
+ "<scope/>"+
"</onAlarm>";
org.w3c.dom.Element elem=null;
@@ -817,14 +801,10 @@
fail("Until condition should not be set");
}
- if (component.getActivity() == null) {
- fail("No activity");
+ if (component.getScope() == null) {
+ fail("No Scope");
}
- if ((component.getActivity() instanceof Sequence) == false) {
- fail("Activity is not a sequence");
- }
-
For cond=new For(model);
cond.setExpression(expr1);
@@ -849,8 +829,8 @@
}
if (component.getDOMElement().getChildNodes().item(1).
- getLocalName().equals(Sequence.SEQUENCE) == false) {
- fail("Second element was not a sequence: "+
+ getLocalName().equals(Scope.SCOPE) == false) {
+ fail("Second element was not a Scope: "+
component.getDOMElement().getChildNodes().item(1).
getLocalName());
}
@@ -862,7 +842,7 @@
String expr1="Test Expression 1";
String xml="<onAlarm xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">" +
- "<sequence/>"+
+ "<scope/>"+
"</onAlarm>";
org.w3c.dom.Element elem=null;
@@ -896,14 +876,10 @@
fail("Until condition should not be set");
}
- if (component.getActivity() == null) {
- fail("No activity");
+ if (component.getScope() == null) {
+ fail("No Scope");
}
- if ((component.getActivity() instanceof Sequence) == false) {
- fail("Activity is not a sequence");
- }
-
Until cond=new Until(model);
cond.setExpression(expr1);
@@ -928,8 +904,8 @@
}
if (component.getDOMElement().getChildNodes().item(1).
- getLocalName().equals(Sequence.SEQUENCE) == false) {
- fail("Second element was not a sequence: "+
+ getLocalName().equals(Scope.SCOPE) == false) {
+ fail("Second element was not a Scope: "+
component.getDOMElement().getChildNodes().item(1).
getLocalName());
}
14 years, 1 month
savara SVN: r201 - in tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src: test/org/jboss/savara/tools/bpel/model/component and 1 other directory.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-03-19 17:42:31 -0400 (Fri, 19 Mar 2010)
New Revision: 201
Modified:
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/BPELElementFactory.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Catch.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/CatchAll.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Exit.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/FaultHandlers.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Flow.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ForEach.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/If.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Invoke.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Pick.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/RepeatUntil.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Reply.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Rethrow.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Scope.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Sequence.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Throw.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Wait.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/While.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/FaultHandlersTest.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/SequenceTest.java
Log:
SAVARA-11 - added support for navigation in Eclipse BPEL editor. Added some tests, but need to add more.
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/BPELElementFactory.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/BPELElementFactory.java 2010-03-18 23:14:37 UTC (rev 200)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/BPELElementFactory.java 2010-03-19 21:42:31 UTC (rev 201)
@@ -57,8 +57,8 @@
ret = (BPELElement)con.newInstance(new Object[]{model, elem});
} catch(Exception e) {
- logger.error("Unable to find BPEL element class '"+
- clsName+"'", e);
+ logger.warn("Unable to find BPEL element class '"+
+ clsName+"'");
}
return(ret);
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Catch.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Catch.java 2010-03-18 23:14:37 UTC (rev 200)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Catch.java 2010-03-19 21:42:31 UTC (rev 201)
@@ -71,7 +71,7 @@
*
* @param act The activity
*/
- public void setActivity(BPELElement act) {
+ public void setActivity(BPELActivity act) {
m_activity = act;
BPELElement existing=findChildActivity();
@@ -93,7 +93,7 @@
*
* @return The activity
*/
- public BPELElement getActivity() {
+ public BPELActivity getActivity() {
return(m_activity);
}
@@ -173,5 +173,15 @@
getDOMElement().getAttribute(FAULT_MESSAGE_ELEMENT):null);
}
- private BPELElement m_activity;
+ protected String getLocalURIPart(BPELElement elem) {
+ String ret="";
+
+ if (elem instanceof BPELActivity) {
+ ret += "@activity";
+ }
+
+ return(ret);
+ }
+
+ private BPELActivity m_activity;
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/CatchAll.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/CatchAll.java 2010-03-18 23:14:37 UTC (rev 200)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/CatchAll.java 2010-03-19 21:42:31 UTC (rev 201)
@@ -66,7 +66,7 @@
*
* @param act The activity
*/
- public void setActivity(BPELElement act) {
+ public void setActivity(BPELActivity act) {
m_activity = act;
BPELElement existing=findChildActivity();
@@ -88,9 +88,19 @@
*
* @return The activity
*/
- public BPELElement getActivity() {
+ public BPELActivity getActivity() {
return(m_activity);
}
- private BPELElement m_activity;
+ protected String getLocalURIPart(BPELElement elem) {
+ String ret="";
+
+ if (elem instanceof BPELActivity) {
+ ret += "@activity";
+ }
+
+ return(ret);
+ }
+
+ private BPELActivity m_activity;
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Exit.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Exit.java 2010-03-18 23:14:37 UTC (rev 200)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Exit.java 2010-03-19 21:42:31 UTC (rev 201)
@@ -76,6 +76,7 @@
*/
protected void convertActivity(java.util.List<Activity> activities,
ConversionContext context) {
+ getSource().setComponentURI(getURI());
}
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/FaultHandlers.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/FaultHandlers.java 2010-03-18 23:14:37 UTC (rev 200)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/FaultHandlers.java 2010-03-19 21:42:31 UTC (rev 201)
@@ -128,6 +128,18 @@
public void convert(List<Activity> activities, ConversionContext context) {
}
+ protected String getLocalURIPart(BPELElement elem) {
+ String ret="";
+
+ if (elem instanceof Catch) {
+ ret += "@catch."+getCatchPaths().indexOf(elem);
+ } else if (elem instanceof CatchAll) {
+ ret += "@catchAll";
+ }
+
+ return(ret);
+ }
+
private static Log logger=LogFactory.getLog(FaultHandlers.class);
private CatchAll m_catchAll=null;
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Flow.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Flow.java 2010-03-18 23:14:37 UTC (rev 200)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Flow.java 2010-03-19 21:42:31 UTC (rev 201)
@@ -238,6 +238,7 @@
*/
protected void convertActivity(java.util.List<Activity> activities,
ConversionContext context) {
+ getSource().setComponentURI(getURI());
// If links have been defined, represent them as boolean
// variables that can be tested using a 'when' clause
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ForEach.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ForEach.java 2010-03-18 23:14:37 UTC (rev 200)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ForEach.java 2010-03-19 21:42:31 UTC (rev 201)
@@ -107,6 +107,7 @@
*/
protected void convertActivity(java.util.List<Activity> activities,
ConversionContext context) {
+ getSource().setComponentURI(getURI());
}
private Scope m_scope=null;
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/If.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/If.java 2010-03-18 23:14:37 UTC (rev 200)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/If.java 2010-03-19 21:42:31 UTC (rev 201)
@@ -105,6 +105,7 @@
*/
protected void convertActivity(java.util.List<Activity> activities,
ConversionContext context) {
+ getSource().setComponentURI(getURI());
org.scribble.conversation.model.If elem=
new org.scribble.conversation.model.If();
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Invoke.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Invoke.java 2010-03-18 23:14:37 UTC (rev 200)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Invoke.java 2010-03-19 21:42:31 UTC (rev 201)
@@ -117,6 +117,7 @@
*/
protected void convertActivity(java.util.List<Activity> activities,
ConversionContext context) {
+ getSource().setComponentURI(getURI());
convertRequest(activities, context);
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Pick.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Pick.java 2010-03-18 23:14:37 UTC (rev 200)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Pick.java 2010-03-19 21:42:31 UTC (rev 201)
@@ -243,6 +243,7 @@
*/
protected void convertActivity(java.util.List<Activity> activities,
ConversionContext context) {
+ getSource().setComponentURI(getURI());
org.scribble.conversation.model.If elem=
new org.scribble.conversation.model.If();
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java 2010-03-18 23:14:37 UTC (rev 200)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java 2010-03-19 21:42:31 UTC (rev 201)
@@ -872,6 +872,8 @@
if (elem instanceof BPELActivity) {
ret += "@activity";
+ } else if (elem instanceof FaultHandlers) {
+ ret += "@faultHandlers";
}
return(ret);
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/RepeatUntil.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/RepeatUntil.java 2010-03-18 23:14:37 UTC (rev 200)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/RepeatUntil.java 2010-03-19 21:42:31 UTC (rev 201)
@@ -86,6 +86,7 @@
*/
protected void convertActivity(java.util.List<Activity> activities,
ConversionContext context) {
+ getSource().setComponentURI(getURI());
}
/**
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Reply.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Reply.java 2010-03-18 23:14:37 UTC (rev 200)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Reply.java 2010-03-19 21:42:31 UTC (rev 201)
@@ -118,6 +118,8 @@
*/
protected void convertActivity(java.util.List<Activity> activities,
ConversionContext context) {
+ getSource().setComponentURI(getURI());
+
ConversationInteraction interaction=new ConversationInteraction();
interaction.derivedFrom(this);
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Rethrow.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Rethrow.java 2010-03-18 23:14:37 UTC (rev 200)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Rethrow.java 2010-03-19 21:42:31 UTC (rev 201)
@@ -76,6 +76,7 @@
*/
protected void convertActivity(java.util.List<Activity> activities,
ConversionContext context) {
+ getSource().setComponentURI(getURI());
}
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Scope.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Scope.java 2010-03-18 23:14:37 UTC (rev 200)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Scope.java 2010-03-19 21:42:31 UTC (rev 201)
@@ -529,6 +529,7 @@
*/
protected void convertActivity(java.util.List<Activity> activities,
ConversionContext context) {
+ getSource().setComponentURI(getURI());
// Add variables to the context
for (int i=0; i < m_variables.size(); i++) {
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Sequence.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Sequence.java 2010-03-18 23:14:37 UTC (rev 200)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Sequence.java 2010-03-19 21:42:31 UTC (rev 201)
@@ -138,6 +138,7 @@
*/
protected void convertActivity(java.util.List<Activity> activities,
ConversionContext context) {
+ getSource().setComponentURI(getURI());
for (int i=0; i < m_activities.size(); i++) {
m_activities.get(i).convert(activities, context);
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Throw.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Throw.java 2010-03-18 23:14:37 UTC (rev 200)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Throw.java 2010-03-19 21:42:31 UTC (rev 201)
@@ -117,6 +117,7 @@
*/
protected void convertActivity(java.util.List<Activity> activities,
ConversionContext context) {
+ getSource().setComponentURI(getURI());
}
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Wait.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Wait.java 2010-03-18 23:14:37 UTC (rev 200)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Wait.java 2010-03-19 21:42:31 UTC (rev 201)
@@ -142,6 +142,7 @@
*/
protected void convertActivity(java.util.List<Activity> activities,
ConversionContext context) {
+ getSource().setComponentURI(getURI());
}
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/While.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/While.java 2010-03-18 23:14:37 UTC (rev 200)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/While.java 2010-03-19 21:42:31 UTC (rev 201)
@@ -86,6 +86,7 @@
*/
protected void convertActivity(java.util.List<Activity> activities,
ConversionContext context) {
+ getSource().setComponentURI(getURI());
org.scribble.conversation.model.While elem=
new org.scribble.conversation.model.While();
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/FaultHandlersTest.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/FaultHandlersTest.java 2010-03-18 23:14:37 UTC (rev 200)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/FaultHandlersTest.java 2010-03-19 21:42:31 UTC (rev 201)
@@ -230,4 +230,163 @@
getLocalName());
}
}
+
+
+ public void testGetURICatch() {
+ BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+ String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+ "<faultHandlers>"+
+ "<catch>"+
+ "<sequence>"+
+ "<receive/>"+
+ "</sequence>"+
+ "</catch>"+
+ "</faultHandlers>"+
+ "</process>";
+
+ org.w3c.dom.Element elem=null;
+
+ try {
+ javax.xml.parsers.DocumentBuilderFactory factory=
+ javax.xml.parsers.DocumentBuilderFactory.newInstance();
+
+ factory.setNamespaceAware(true);
+
+ javax.xml.parsers.DocumentBuilder builder=
+ factory.newDocumentBuilder();
+
+ java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+
+ org.w3c.dom.Document doc=builder.parse(is);
+ elem = doc.getDocumentElement();
+
+ is.close();
+ } catch(Exception e) {
+ e.printStackTrace();
+ fail("Failed to convert to doc");
+ }
+
+ Process component=new Process(model, elem);
+
+ FaultHandlers fhs=component.getFaultHandlers();
+
+ if (fhs == null) {
+ fail("No fault handlers");
+ }
+
+ if (fhs.getCatchPaths().size() != 1) {
+ fail("Expecting one catch: "+fhs.getCatchPaths().size());
+ }
+
+ Catch c=fhs.getCatchPaths().get(0);
+
+ BPELActivity act=c.getActivity();
+
+ if ((act instanceof Sequence) == false) {
+ fail("Activity is not a sequence");
+ }
+
+ Sequence seq=(Sequence)act;
+
+ if (seq.getActivities().size() != 1) {
+ fail("Expecting 1 child activities: "+
+ seq.getActivities().size());
+ }
+
+ if ((seq.getActivities().get(0) instanceof Receive) == false) {
+ fail("First activity should be receive");
+ }
+
+ Receive recv=(Receive)seq.getActivities().get(0);
+
+ String uri=recv.getURI();
+
+ if (uri == null) {
+ fail("URI is null");
+ }
+
+ if (uri.equals("//@faultHandlers/@catch.0/@activity/(a)activities.0") == false) {
+ fail("URI is invalid: "+uri);
+ }
+ }
+
+ public void testGetURICatchAll() {
+ BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+ String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+ "<faultHandlers>"+
+ "<catchAll>"+
+ "<sequence>"+
+ "<receive/>"+
+ "</sequence>"+
+ "</catchAll>"+
+ "</faultHandlers>"+
+ "</process>";
+
+ org.w3c.dom.Element elem=null;
+
+ try {
+ javax.xml.parsers.DocumentBuilderFactory factory=
+ javax.xml.parsers.DocumentBuilderFactory.newInstance();
+
+ factory.setNamespaceAware(true);
+
+ javax.xml.parsers.DocumentBuilder builder=
+ factory.newDocumentBuilder();
+
+ java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+
+ org.w3c.dom.Document doc=builder.parse(is);
+ elem = doc.getDocumentElement();
+
+ is.close();
+ } catch(Exception e) {
+ e.printStackTrace();
+ fail("Failed to convert to doc");
+ }
+
+ Process component=new Process(model, elem);
+
+ FaultHandlers fhs=component.getFaultHandlers();
+
+ if (fhs == null) {
+ fail("No fault handlers");
+ }
+
+ if (fhs.getCatchAll() == null) {
+ fail("CatchAll not set");
+ }
+
+ CatchAll c=fhs.getCatchAll();
+
+ BPELActivity act=c.getActivity();
+
+ if ((act instanceof Sequence) == false) {
+ fail("Activity is not a sequence");
+ }
+
+ Sequence seq=(Sequence)act;
+
+ if (seq.getActivities().size() != 1) {
+ fail("Expecting 1 child activities: "+
+ seq.getActivities().size());
+ }
+
+ if ((seq.getActivities().get(0) instanceof Receive) == false) {
+ fail("First activity should be receive");
+ }
+
+ Receive recv=(Receive)seq.getActivities().get(0);
+
+ String uri=recv.getURI();
+
+ if (uri == null) {
+ fail("URI is null");
+ }
+
+ if (uri.equals("//@faultHandlers/@catchAll/@activity/(a)activities.0") == false) {
+ fail("URI is invalid: "+uri);
+ }
+ }
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/SequenceTest.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/SequenceTest.java 2010-03-18 23:14:37 UTC (rev 200)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/component/SequenceTest.java 2010-03-19 21:42:31 UTC (rev 201)
@@ -262,4 +262,72 @@
getLocalName());
}
}
+
+ public void testGetURI() {
+ BPELLanguageModel model=new DefaultBPELLanguageModel(null);
+
+ String xml="<process xmlns=\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\">"+
+ "<sequence>"+
+ "<receive/>"+
+ "<invoke/>"+
+ "</sequence>"+
+ "</process>";
+
+ org.w3c.dom.Element elem=null;
+
+ try {
+ javax.xml.parsers.DocumentBuilderFactory factory=
+ javax.xml.parsers.DocumentBuilderFactory.newInstance();
+
+ factory.setNamespaceAware(true);
+
+ javax.xml.parsers.DocumentBuilder builder=
+ factory.newDocumentBuilder();
+
+ java.io.InputStream is=new java.io.ByteArrayInputStream(xml.getBytes());
+
+ org.w3c.dom.Document doc=builder.parse(is);
+ elem = doc.getDocumentElement();
+
+ is.close();
+ } catch(Exception e) {
+ e.printStackTrace();
+ fail("Failed to convert to doc");
+ }
+
+ Process component=new Process(model, elem);
+
+ BPELActivity act=component.getActivity();
+
+ if ((act instanceof Sequence) == false) {
+ fail("Activity is not a sequence");
+ }
+
+ Sequence seq=(Sequence)act;
+
+ if (seq.getActivities().size() != 2) {
+ fail("Expecting 2 child activities: "+
+ seq.getActivities().size());
+ }
+
+ if ((seq.getActivities().get(0) instanceof Receive) == false) {
+ fail("First activity should be receive");
+ }
+
+ if ((seq.getActivities().get(1) instanceof Invoke) == false) {
+ fail("Second activity should be invoke");
+ }
+
+ Invoke invoke=(Invoke)seq.getActivities().get(1);
+
+ String uri=invoke.getURI();
+
+ if (uri == null) {
+ fail("URI is null");
+ }
+
+ if (uri.equals("//@activity/(a)activities.1") == false) {
+ fail("URI is invalid: "+uri);
+ }
+ }
}
14 years, 1 month
savara SVN: r200 - in tools/eclipse/trunk/plugins: org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component and 2 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-03-18 19:14:37 -0400 (Thu, 18 Mar 2010)
New Revision: 200
Modified:
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/editor/BPELEditorManager.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/BPELElement.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Receive.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Sequence.java
tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/META-INF/MANIFEST.MF
tools/eclipse/trunk/plugins/org.scribble.conversation.parser/META-INF/MANIFEST.MF
Log:
Added initial ability to focus on 'receive' tasks within sequence. Also removed remaining links to protocol based definitions.
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/editor/BPELEditorManager.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/editor/BPELEditorManager.java 2010-03-17 19:33:58 UTC (rev 199)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/editor/BPELEditorManager.java 2010-03-18 23:14:37 UTC (rev 200)
@@ -19,6 +19,7 @@
//import org.eclipse.emf.ecore.EValidator;
import org.jboss.savara.tools.bpel.model.BPELNotation;
+import org.jboss.savara.tools.bpel.model.component.BPELElement;
import org.scribble.extensions.RegistryInfo;
import org.scribble.model.ModelReference;
import org.scribble.model.SourceRef;
@@ -95,9 +96,23 @@
*/
@Override
public void enrich(ModelIssue issue) {
+ String uri=issue.getModelObject().getSource().getComponentURI();
+ issue.getProperties().put("address.model", uri);
+
+ /*
+ if (issue.getModelObject() instanceof BPELElement) {
+ String uri=((BPELElement)issue.getModelObject()).getURI();
+
+ if (uri != null) {
+ issue.getProperties().put("address.model", uri);
+ }
+ }
+ */
+
// Set the EMF URI attribute
//issue.getProperties().put(EValidator.URI_ATTRIBUTE, "//@activity/(a)activities.0");
+ //issue.getProperties().put("address.model", "//@activity/(a)activities.0");
// issue.getModelObject().getSource().getComponentURI());
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/BPELElement.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/BPELElement.java 2010-03-17 19:33:58 UTC (rev 199)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/BPELElement.java 2010-03-18 23:14:37 UTC (rev 200)
@@ -297,6 +297,85 @@
public abstract void convert(java.util.List<Activity> activities,
ConversionContext context);
+ /**
+ * This method returns the URI fragment to the activity within the
+ * BPEL model.
+ *
+ * @return The URI
+ */
+ public String getURI() {
+ String ret="";
+
+ BPELElement parent=null;
+
+ if (getParent() != null) {
+ if (getParent() instanceof BPELElement) {
+ parent = (BPELElement)getParent();
+ }
+ } else if (getDOMElement().getParentNode() instanceof org.w3c.dom.Element) {
+ parent = BPELElementFactory.createBPELElement(getModel(),
+ (org.w3c.dom.Element)getDOMElement().getParentNode());
+ }
+
+ if (parent != null) {
+ ret = parent.getParentURI(this);
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method recursively builds up the URI using the local URI
+ * parts for each BPEL element up to the root node.
+ *
+ * @param elem The child element
+ * @return The URI for the parent element
+ */
+ protected String getParentURI(BPELElement elem) {
+ String ret="";
+
+ BPELElement parent=null;
+
+ if (getParent() != null) {
+ if (getParent() instanceof BPELElement) {
+ parent = (BPELElement)getParent();
+ }
+ } else if (elem.getDOMElement().getParentNode() instanceof org.w3c.dom.Element) {
+ parent = BPELElementFactory.createBPELElement(getModel(),
+ (org.w3c.dom.Element)getDOMElement().getParentNode());
+ }
+
+ if (parent != null) {
+ ret = parent.getParentURI(this)+"/"+getLocalURIPart(elem);
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method returns the URI part associated with the supplied child element.
+ *
+ * @param elem The child element
+ * @return The URI part
+ */
+ protected String getLocalURIPart(BPELElement elem) {
+ return("");
+ }
+
+ public int hashCode() {
+ return(m_element.hashCode());
+ }
+
+ public boolean equals(Object obj) {
+ boolean ret=false;
+
+ if (obj instanceof BPELElement) {
+ ret = m_element.equals(((BPELElement)obj).getDOMElement());
+ }
+
+ return(ret);
+ }
+
private static Log logger = LogFactory.getLog(BPELElement.class);
private BPELLanguageModel m_model=null;
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java 2010-03-17 19:33:58 UTC (rev 199)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java 2010-03-18 23:14:37 UTC (rev 200)
@@ -867,6 +867,16 @@
return(ret);
}
+ protected String getParentURI(BPELElement elem) {
+ String ret="//";
+
+ if (elem instanceof BPELActivity) {
+ ret += "@activity";
+ }
+
+ return(ret);
+ }
+
private static Log logger = LogFactory.getLog(Process.class);
private org.w3c.dom.Element m_partnerLinksElem=null;
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Receive.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Receive.java 2010-03-17 19:33:58 UTC (rev 199)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Receive.java 2010-03-18 23:14:37 UTC (rev 200)
@@ -130,6 +130,8 @@
*/
protected void convertActivity(java.util.List<Activity> activities,
ConversionContext context) {
+ getSource().setComponentURI(getURI());
+
ConversationInteraction interaction=new ConversationInteraction();
interaction.derivedFrom(this);
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Sequence.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Sequence.java 2010-03-17 19:33:58 UTC (rev 199)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Sequence.java 2010-03-18 23:14:37 UTC (rev 200)
@@ -144,6 +144,11 @@
}
}
+ protected String getLocalURIPart(BPELElement elem) {
+ int pos=getActivities().indexOf(elem);
+ return("@activities."+pos);
+ }
+
private java.util.List<BPELActivity> m_activities=
new java.util.Vector<BPELActivity>();
}
Modified: tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/META-INF/MANIFEST.MF
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/META-INF/MANIFEST.MF 2010-03-17 19:33:58 UTC (rev 199)
+++ tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/META-INF/MANIFEST.MF 2010-03-18 23:14:37 UTC (rev 200)
@@ -13,23 +13,14 @@
org.junit;resolution:=optional
Bundle-ActivationPolicy: lazy
Scribble-Extensions: org.scribble.conversation.comparator.ConversationComparatorRule,
- org.scribble.conversation.comparator.ConversationModelProtocolModelComparatorRule,
- org.scribble.conversation.comparator.IfChoiceComparatorRule,
org.scribble.conversation.comparator.IfComparatorRule,
org.scribble.conversation.comparator.ConditionalBlockComparatorRule,
org.scribble.conversation.comparator.ParallelComparatorRule,
- org.scribble.conversation.comparator.ParallelProtocolParallelComparatorRule,
org.scribble.conversation.comparator.SpawnComparatorRule,
- org.scribble.conversation.comparator.SpawnProtocolSpawnComparatorRule,
org.scribble.conversation.comparator.TryEscapeComparatorRule,
org.scribble.conversation.comparator.InterruptBlockComparatorRule,
org.scribble.conversation.comparator.CatchBlockComparatorRule,
- org.scribble.conversation.comparator.TryEscapeProtocolComparatorRule,
- org.scribble.conversation.comparator.InterruptBlockProtocolComparatorRule,
- org.scribble.conversation.comparator.CatchBlockProtocolComparatorRule,
org.scribble.conversation.comparator.RaiseComparatorRule,
- org.scribble.conversation.comparator.RaiseProtocolComparatorRule,
- org.scribble.conversation.comparator.WhenChoiceComparatorRule,
org.scribble.conversation.comparator.WhenComparatorRule,
org.scribble.conversation.comparator.WhileComparatorRule,
org.scribble.conversation.comparator.model.transform.ConversationStatelessTransformationRule,
Modified: tools/eclipse/trunk/plugins/org.scribble.conversation.parser/META-INF/MANIFEST.MF
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.conversation.parser/META-INF/MANIFEST.MF 2010-03-17 19:33:58 UTC (rev 199)
+++ tools/eclipse/trunk/plugins/org.scribble.conversation.parser/META-INF/MANIFEST.MF 2010-03-18 23:14:37 UTC (rev 200)
@@ -12,7 +12,6 @@
Scribble-Extensions: org.scribble.conversation.parser.ConversationKeyWordProvider,
org.scribble.conversation.parser.ConversationParserRule,
org.scribble.conversation.parser.ConversationReferenceParserRule,
- org.scribble.conversation.parser.ProtocolImplementsReferenceParserRule,
org.scribble.conversation.parser.ConversationInteractionParserRule,
org.scribble.conversation.parser.IfParserRule,
org.scribble.conversation.parser.WhenParserRule,
14 years, 1 month
Build failed in Hudson: savara-eclipse-tool #25
by jboss-qa-internal@redhat.com
See <http://hudson.qa.jboss.com/hudson/job/savara-eclipse-tool/25/changes>
Changes:
[objectiser] Remove unnecessary protocol plugins.
[objectiser] Initial work on handling BPEL error focus (SAVARA-11). This currently focuses on the text - just need to work out how to focus on graphical nodes, which may required the EMF URI.
------------------------------------------
[...truncated 466 lines...]
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[java] at org.apache.tools.ant.Task.perform(Task.java:348)
[java] at org.apache.tools.ant.Target.execute(Target.java:357)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[java] at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[java] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[java] at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
[java] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:662)
[java] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:534)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.eclipse.ant.core.AntRunner.run(AntRunner.java:513)
[java] at org.eclipse.ant.core.AntRunner.start(AntRunner.java:600)
[java] at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
[java] at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
[java] at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
[java] at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
[java] at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
[java] at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
[java] at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
[java] at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
[java] Caused by: <http://hudson.qa.jboss.com/hudson/job/savara-eclipse-tool/ws/eclipse/plug...>:70: The following error occurred while executing this line:
[java] <http://hudson.qa.jboss.com/hudson/job/savara-eclipse-tool/ws/eclipse/plug...>:180: <http://hudson.qa.jboss.com/hudson/job/savara-eclipse-tool/ws/eclipse/plug...> not found.
[java] at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:508)
[java] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:418)
[java] at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[java] at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[java] at org.apache.tools.ant.Task.perform(Task.java:348)
[java] at org.apache.tools.ant.Target.execute(Target.java:357)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[java] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
[java] at org.eclipse.ant.internal.core.ant.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:30)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
[java] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
[java] ... 49 more
[java] Caused by: <http://hudson.qa.jboss.com/hudson/job/savara-eclipse-tool/ws/eclipse/plug...>:180: <http://hudson.qa.jboss.com/hudson/job/savara-eclipse-tool/ws/eclipse/plug...> not found.
[java] at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:434)
[java] at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:431)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[java] at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[java] at org.apache.tools.ant.Task.perform(Task.java:348)
[java] at org.apache.tools.ant.Target.execute(Target.java:357)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[java] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
[java] at org.eclipse.ant.internal.core.ant.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:30)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
[java] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
[java] ... 63 more
[java] --- Nested Exception ---
[java] <http://hudson.qa.jboss.com/hudson/job/savara-eclipse-tool/ws/eclipse/plug...>:70: The following error occurred while executing this line:
[java] <http://hudson.qa.jboss.com/hudson/job/savara-eclipse-tool/ws/eclipse/plug...>:180: <http://hudson.qa.jboss.com/hudson/job/savara-eclipse-tool/ws/eclipse/plug...> not found.
[java] at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:508)
[java] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:418)
[java] at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[java] at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[java] at org.apache.tools.ant.Task.perform(Task.java:348)
[java] at org.apache.tools.ant.Target.execute(Target.java:357)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[java] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
[java] at org.eclipse.ant.internal.core.ant.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:30)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
[java] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[java] at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[java] at org.apache.tools.ant.Task.perform(Task.java:348)
[java] at org.apache.tools.ant.Target.execute(Target.java:357)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[java] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
[java] at org.eclipse.ant.internal.core.ant.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:30)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
[java] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
[java] at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[java] at org.apache.tools.ant.Task.perform(Task.java:348)
[java] at org.apache.tools.ant.Target.execute(Target.java:357)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[java] at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[java] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[java] at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
[java] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:662)
[java] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:534)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.eclipse.ant.core.AntRunner.run(AntRunner.java:513)
[java] at org.eclipse.ant.core.AntRunner.start(AntRunner.java:600)
[java] at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
[java] at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
[java] at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
[java] at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
[java] at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
[java] at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
[java] at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
[java] at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
[java] Caused by: <http://hudson.qa.jboss.com/hudson/job/savara-eclipse-tool/ws/eclipse/plug...>:180: <http://hudson.qa.jboss.com/hudson/job/savara-eclipse-tool/ws/eclipse/plug...> not found.
[java] at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:434)
[java] at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:431)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[java] at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[java] at org.apache.tools.ant.Task.perform(Task.java:348)
[java] at org.apache.tools.ant.Target.execute(Target.java:357)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[java] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
[java] at org.eclipse.ant.internal.core.ant.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:30)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
[java] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
[java] ... 63 more
[java] --- Nested Exception ---
[java] <http://hudson.qa.jboss.com/hudson/job/savara-eclipse-tool/ws/eclipse/plug...>:180: <http://hudson.qa.jboss.com/hudson/job/savara-eclipse-tool/ws/eclipse/plug...> not found.
[java] at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:434)
[java] at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:431)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[java] at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[java] at org.apache.tools.ant.Task.perform(Task.java:348)
[java] at org.apache.tools.ant.Target.execute(Target.java:357)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[java] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
[java] at org.eclipse.ant.internal.core.ant.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:30)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
[java] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
[java] at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[java] at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[java] at org.apache.tools.ant.Task.perform(Task.java:348)
[java] at org.apache.tools.ant.Target.execute(Target.java:357)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[java] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
[java] at org.eclipse.ant.internal.core.ant.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:30)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
[java] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[java] at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[java] at org.apache.tools.ant.Task.perform(Task.java:348)
[java] at org.apache.tools.ant.Target.execute(Target.java:357)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[java] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
[java] at org.eclipse.ant.internal.core.ant.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:30)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
[java] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
[java] at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[java] at org.apache.tools.ant.Task.perform(Task.java:348)
[java] at org.apache.tools.ant.Target.execute(Target.java:357)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[java] at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[java] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[java] at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
[java] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:662)
[java] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:534)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.eclipse.ant.core.AntRunner.run(AntRunner.java:513)
[java] at org.eclipse.ant.core.AntRunner.start(AntRunner.java:600)
[java] at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
[java] at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
[java] at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
[java] at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
[java] at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
[java] at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
[java] at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
[java] at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An Ant BuildException has occured: Java returned: 13
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 30 seconds
[INFO] Finished at: Tue Mar 16 18:33:36 EDT 2010
[INFO] Final Memory: 11M/31M
[INFO] ------------------------------------------------------------------------
Archiving artifacts
14 years, 1 month
savara SVN: r199 - in tools/eclipse/trunk/plugins: org.jboss.savara.tools.bpel/META-INF and 2 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-03-17 15:33:58 -0400 (Wed, 17 Mar 2010)
New Revision: 199
Modified:
tools/eclipse/trunk/plugins/eclipse-build/customTargets.xml
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/META-INF/MANIFEST.MF
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/editor/BPELEditorManager.java
tools/eclipse/trunk/plugins/org.scribble.feature/feature.xml
Log:
Fix the build problems.
Modified: tools/eclipse/trunk/plugins/eclipse-build/customTargets.xml
===================================================================
--- tools/eclipse/trunk/plugins/eclipse-build/customTargets.xml 2010-03-15 23:07:29 UTC (rev 198)
+++ tools/eclipse/trunk/plugins/eclipse-build/customTargets.xml 2010-03-17 19:33:58 UTC (rev 199)
@@ -177,34 +177,6 @@
<fileset dir="${builder}/../org.scribble.pi4soa.cdm"/>
</copy>
- <copy todir="${buildDirectory}/plugins/org.scribble.protocol.comparator">
- <fileset dir="${builder}/../org.scribble.protocol.comparator"/>
- </copy>
-
- <copy todir="${buildDirectory}/plugins/org.scribble.protocol.eclipse">
- <fileset dir="${builder}/../org.scribble.protocol.eclipse"/>
- </copy>
-
- <copy todir="${buildDirectory}/plugins/org.scribble.protocol.export.text">
- <fileset dir="${builder}/../org.scribble.protocol.export.text"/>
- </copy>
-
- <copy todir="${buildDirectory}/plugins/org.scribble.protocol.model">
- <fileset dir="${builder}/../org.scribble.protocol.model"/>
- </copy>
-
- <copy todir="${buildDirectory}/plugins/org.scribble.protocol.parser">
- <fileset dir="${builder}/../org.scribble.protocol.parser"/>
- </copy>
-
- <copy todir="${buildDirectory}/plugins/org.scribble.protocol.projector">
- <fileset dir="${builder}/../org.scribble.protocol.projector"/>
- </copy>
-
- <copy todir="${buildDirectory}/plugins/org.scribble.protocol.validation">
- <fileset dir="${builder}/../org.scribble.protocol.validation"/>
- </copy>
-
</target>
<target name="testPostSetup" if="mavenTestPhase">
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/META-INF/MANIFEST.MF
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/META-INF/MANIFEST.MF 2010-03-15 23:07:29 UTC (rev 198)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/META-INF/MANIFEST.MF 2010-03-17 19:33:58 UTC (rev 199)
@@ -19,8 +19,7 @@
org.scribble.pi4soa.cdm;resolution:=optional,
org.scribble.contract.model,
org.jboss.savara.tools.wsdl,
- org.eclipse.ui.ide,
- org.eclipse.stp.bpmn.diagram;resolution:=optional
+ org.eclipse.ui.ide
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: www.jboss.org
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/editor/BPELEditorManager.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/editor/BPELEditorManager.java 2010-03-15 23:07:29 UTC (rev 198)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/editor/BPELEditorManager.java 2010-03-17 19:33:58 UTC (rev 199)
@@ -68,16 +68,16 @@
(org.eclipse.core.resources.IFile)res);
try {
- org.eclipse.ui.IEditorPart part=page.openEditor(input,
- "org.eclipse.stp.bpmn.diagram.part.BpmnDiagramEditorID");
+// org.eclipse.ui.IEditorPart part=page.openEditor(input,
+// "org.eclipse.stp.bpmn.diagram.part.BpmnDiagramEditorID");
- if (part instanceof org.eclipse.stp.bpmn.diagram.part.BpmnDiagramEditor) {
- org.eclipse.stp.bpmn.diagram.part.BpmnDiagramEditor editor=
- (org.eclipse.stp.bpmn.diagram.part.BpmnDiagramEditor)part;
+// if (part instanceof org.eclipse.stp.bpmn.diagram.part.BpmnDiagramEditor) {
+// org.eclipse.stp.bpmn.diagram.part.BpmnDiagramEditor editor=
+// (org.eclipse.stp.bpmn.diagram.part.BpmnDiagramEditor)part;
System.out.println("FOCUS ON: "+sref.getComponentURI());
//editor.showComponent(sref.getComponentURI());
- }
+// }
} catch(Exception e) {
e.printStackTrace();
@@ -97,7 +97,8 @@
public void enrich(ModelIssue issue) {
// Set the EMF URI attribute
- //issue.getProperties().put(EValidator.URI_ATTRIBUTE,
+ //issue.getProperties().put(EValidator.URI_ATTRIBUTE, "//@activity/(a)activities.0");
// issue.getModelObject().getSource().getComponentURI());
+
}
}
Modified: tools/eclipse/trunk/plugins/org.scribble.feature/feature.xml
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.feature/feature.xml 2010-03-15 23:07:29 UTC (rev 198)
+++ tools/eclipse/trunk/plugins/org.scribble.feature/feature.xml 2010-03-17 19:33:58 UTC (rev 199)
@@ -144,53 +144,4 @@
version="0.0.0"
unpack="false"/>
- <plugin
- id="org.scribble.protocol.comparator"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.scribble.protocol.eclipse"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.scribble.protocol.export.text"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.scribble.protocol.model"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.scribble.protocol.parser"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.scribble.protocol.projector"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.scribble.protocol.validation"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
</feature>
14 years, 1 month
savara SVN: r198 - tools/eclipse/trunk/plugins.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-03-15 19:07:29 -0400 (Mon, 15 Mar 2010)
New Revision: 198
Removed:
tools/eclipse/trunk/plugins/org.scribble.protocol.comparator/
tools/eclipse/trunk/plugins/org.scribble.protocol.eclipse/
tools/eclipse/trunk/plugins/org.scribble.protocol.export.text/
tools/eclipse/trunk/plugins/org.scribble.protocol.feature/
tools/eclipse/trunk/plugins/org.scribble.protocol.model/
tools/eclipse/trunk/plugins/org.scribble.protocol.parser/
tools/eclipse/trunk/plugins/org.scribble.protocol.projector/
tools/eclipse/trunk/plugins/org.scribble.protocol.validation/
Log:
Remove unnecessary protocol plugins.
14 years, 1 month
savara SVN: r197 - in tools/eclipse/trunk/plugins: org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel and 8 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-03-15 19:03:53 -0400 (Mon, 15 Mar 2010)
New Revision: 197
Added:
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/editor/
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/editor/BPELEditorManager.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/util/
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/util/InteractionUtilTest.java
Removed:
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/util/InteractionUtilTest.java
Modified:
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/META-INF/MANIFEST.MF
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/DefaultBPELLanguageModel.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/AbstractInteraction.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/BPELElement.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Invoke.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Receive.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Reply.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/util/XMLUtils.java
tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/util/XMLUtilsTest.java
tools/eclipse/trunk/plugins/org.scribble.pi4soa.cdm/META-INF/MANIFEST.MF
Log:
Initial work on handling BPEL error focus (SAVARA-11). This currently focuses on the text - just need to work out how to focus on graphical nodes, which may required the EMF URI.
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/META-INF/MANIFEST.MF
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/META-INF/MANIFEST.MF 2010-03-15 18:06:05 UTC (rev 196)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/META-INF/MANIFEST.MF 2010-03-15 23:03:53 UTC (rev 197)
@@ -18,7 +18,9 @@
org.scribble.expression.xpath,
org.scribble.pi4soa.cdm;resolution:=optional,
org.scribble.contract.model,
- org.jboss.savara.tools.wsdl
+ org.jboss.savara.tools.wsdl,
+ org.eclipse.ui.ide,
+ org.eclipse.stp.bpmn.diagram;resolution:=optional
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: www.jboss.org
@@ -32,4 +34,5 @@
org.jboss.savara.tools.bpel.model.change.IfModelChangeRule,
org.jboss.savara.tools.bpel.model.change.RunModelChangeRule,
org.jboss.savara.tools.bpel.model.change.SpawnModelChangeRule,
- org.jboss.savara.tools.bpel.model.change.ConversationInteractionModelChangeRule
+ org.jboss.savara.tools.bpel.model.change.ConversationInteractionModelChangeRule,
+ org.jboss.savara.tools.bpel.editor.BPELEditorManager
Added: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/editor/BPELEditorManager.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/editor/BPELEditorManager.java (rev 0)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/editor/BPELEditorManager.java 2010-03-15 23:03:53 UTC (rev 197)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.jboss.savara.tools.bpel.editor;
+
+//import org.eclipse.emf.ecore.EValidator;
+import org.jboss.savara.tools.bpel.model.BPELNotation;
+import org.scribble.extensions.RegistryInfo;
+import org.scribble.model.ModelReference;
+import org.scribble.model.SourceRef;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.editor.*;
+
+/**
+ * This is the BPEL editor implementation of the EditorManager
+ * interface.
+ */
+(a)RegistryInfo(extension=EditorManager.class,notation=BPELNotation.NOTATION_CODE)
+public class BPELEditorManager extends AbstractEditorManager {
+
+ /**
+ * This method focuses the editor on the specified source,
+ * identified by the model reference and source reference.
+ *
+ * @param mref The model reference
+ * @param sref The component source reference
+ * @param prop Additional properties
+ */
+ public void focus(ModelReference mref, SourceRef sref,
+ java.util.Map<String,Object> props) {
+ String uri=null;
+ org.eclipse.core.resources.IFile file=
+ org.scribble.eclipse.model.admin.OSGIModelRepository.getFile(mref);
+
+ if (file == null || file.exists() == false) {
+ file = org.scribble.eclipse.model.admin.OSGIModelRepository.getGlobalFile(mref);
+ }
+
+ if (file != null && file.exists()) {
+ uri = file.getFullPath().toPortableString();
+ }
+
+ if (uri != null) {
+ org.eclipse.ui.IWorkbenchPage page=
+ org.eclipse.ui.PlatformUI.getWorkbench().
+ getActiveWorkbenchWindow().getActivePage();
+
+ org.eclipse.core.resources.IResource res=
+ org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().findMember(uri);
+
+ if (res instanceof org.eclipse.core.resources.IFile) {
+ org.eclipse.ui.part.FileEditorInput input=
+ new org.eclipse.ui.part.FileEditorInput(
+ (org.eclipse.core.resources.IFile)res);
+
+ try {
+ org.eclipse.ui.IEditorPart part=page.openEditor(input,
+ "org.eclipse.stp.bpmn.diagram.part.BpmnDiagramEditorID");
+
+ if (part instanceof org.eclipse.stp.bpmn.diagram.part.BpmnDiagramEditor) {
+ org.eclipse.stp.bpmn.diagram.part.BpmnDiagramEditor editor=
+ (org.eclipse.stp.bpmn.diagram.part.BpmnDiagramEditor)part;
+
+ System.out.println("FOCUS ON: "+sref.getComponentURI());
+ //editor.showComponent(sref.getComponentURI());
+ }
+
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ /**
+ * This method enriches the set of properties required
+ * by the editor, using the properties associated with
+ * the model issue.
+ *
+ * @param issue The model issue
+ */
+ @Override
+ public void enrich(ModelIssue issue) {
+
+ // Set the EMF URI attribute
+ //issue.getProperties().put(EValidator.URI_ATTRIBUTE,
+ // issue.getModelObject().getSource().getComponentURI());
+ }
+}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/DefaultBPELLanguageModel.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/DefaultBPELLanguageModel.java 2010-03-15 18:06:05 UTC (rev 196)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/DefaultBPELLanguageModel.java 2010-03-15 23:03:53 UTC (rev 197)
@@ -47,8 +47,8 @@
public DefaultBPELLanguageModel(ModelReference source, org.w3c.dom.Element elem,
String contents) {
m_source = source;
+ m_contents = contents;
m_bpelProcess = new Process(this, elem);
- m_contents = contents;
Namespace ns=new Namespace();
ns.setName(source.getNamespace());
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/AbstractInteraction.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/AbstractInteraction.java 2010-03-15 18:06:05 UTC (rev 196)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/AbstractInteraction.java 2010-03-15 23:03:53 UTC (rev 197)
@@ -146,6 +146,7 @@
protected TypeReference createTypeReference(String type, ConversionContext context) {
TypeReference ret=new TypeReference();
+ ret.derivedFrom(this);
if (type != null) {
int index=-1;
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/BPELElement.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/BPELElement.java 2010-03-15 18:06:05 UTC (rev 196)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/BPELElement.java 2010-03-15 23:03:53 UTC (rev 197)
@@ -21,6 +21,7 @@
import org.scribble.model.admin.ModelListener;
import org.apache.commons.logging.*;
import org.jboss.savara.tools.bpel.model.*;
+import org.jboss.savara.tools.bpel.util.XMLUtils;
/**
* This is the generic BPEL element class.
@@ -43,8 +44,9 @@
m_element = elem;
- // TODO: Set the start/end position information
+ // Set the start/end position information
// in the source details
+ XMLUtils.setStartAndEndPosition(this, model.getOriginalContents(), elem);
getSource().setObject(this);
}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Invoke.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Invoke.java 2010-03-15 18:06:05 UTC (rev 196)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Invoke.java 2010-03-15 23:03:53 UTC (rev 197)
@@ -145,6 +145,7 @@
scope.getFaultHandlers().getCatchAll() != null)) {
org.scribble.conversation.model.If te=
new org.scribble.conversation.model.If();
+ te.derivedFrom(this);
activities.add(te);
@@ -206,6 +207,7 @@
ConversionContext context) {
// Create interaction for request
ConversationInteraction interaction=new ConversationInteraction();
+ interaction.derivedFrom(this);
Variable var=context.getVariable(getInputVariable());
@@ -235,6 +237,7 @@
// Create interaction for request
ConversationInteraction interaction=new ConversationInteraction();
+ interaction.derivedFrom(this);
Variable var=context.getVariable(getOutputVariable());
@@ -264,6 +267,7 @@
// Create interaction for request
ConversationInteraction interaction=new ConversationInteraction();
+ interaction.derivedFrom(this);
TypeReference tref=null;
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Receive.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Receive.java 2010-03-15 18:06:05 UTC (rev 196)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Receive.java 2010-03-15 23:03:53 UTC (rev 197)
@@ -131,12 +131,15 @@
protected void convertActivity(java.util.List<Activity> activities,
ConversionContext context) {
ConversationInteraction interaction=new ConversationInteraction();
+ interaction.derivedFrom(this);
Variable var=context.getVariable(getVariable());
TypeReference tref=createTypeReference(var.getMessageType(), context);
MessageSignature ms=new MessageSignature();
+ ms.derivedFrom(this);
+
ms.setOperation(getOperation());
ms.getTypes().add(tref);
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Reply.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Reply.java 2010-03-15 18:06:05 UTC (rev 196)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Reply.java 2010-03-15 23:03:53 UTC (rev 197)
@@ -119,12 +119,15 @@
protected void convertActivity(java.util.List<Activity> activities,
ConversionContext context) {
ConversationInteraction interaction=new ConversationInteraction();
+ interaction.derivedFrom(this);
Variable var=context.getVariable(getVariable());
TypeReference tref=createTypeReference(var.getMessageType(), context);
MessageSignature ms=new MessageSignature();
+ ms.derivedFrom(this);
+
ms.setOperation(getOperation());
ms.getTypes().add(tref);
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/util/XMLUtils.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/util/XMLUtils.java 2010-03-15 18:06:05 UTC (rev 196)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/util/XMLUtils.java 2010-03-15 23:03:53 UTC (rev 197)
@@ -19,11 +19,14 @@
import java.io.ByteArrayOutputStream;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
+import org.scribble.model.ModelObject;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
@@ -170,6 +173,24 @@
return(ret);
}
+ public static Node getNode(String text) throws Exception {
+ Node ret=null;
+
+ // Transform the text representation to DOM
+ DocumentBuilderFactory fact=DocumentBuilderFactory.newInstance();
+ fact.setNamespaceAware(true);
+
+ java.io.InputStream xmlstr=
+ new java.io.ByteArrayInputStream(text.getBytes());
+
+ DocumentBuilder builder=fact.newDocumentBuilder();
+ org.w3c.dom.Document doc=builder.parse(xmlstr);
+
+ ret = doc.getDocumentElement();
+
+ return(ret);
+ }
+
/**
* This method returns the localname part of the supplied
* qualified name.
@@ -207,4 +228,73 @@
return(prefix);
}
+
+ /**
+ * This method calculates the start and end position of a supplied DOM element, within
+ * the supplied text contents, and sets the values on the supplied ModelObject.
+ *
+ * @param obj The ModelObject to be initialized
+ * @param contents The text contents
+ * @param elem The DOM element to be located in the text
+ */
+ public static void setStartAndEndPosition(ModelObject obj, String contents, org.w3c.dom.Element elem) {
+
+ if (contents != null) {
+ org.w3c.dom.NodeList nl=elem.getOwnerDocument().getElementsByTagName(elem.getNodeName());
+ int elempos=-1;
+
+ for (int i=0; elempos == -1 && i < nl.getLength(); i++) {
+ if (nl.item(i) == elem) {
+ elempos = i;
+ }
+ }
+
+ if (elempos != -1) {
+ int startpos=-1;
+
+ for (int i=0; i <= elempos; i++) {
+ int val1=contents.indexOf("<"+elem.getNodeName()+">", startpos+1);
+ int val2=contents.indexOf("<"+elem.getNodeName()+" ", startpos+1);
+
+ if (val1 == -1 && val2 != -1) {
+ startpos = val2;
+ } else if (val1 != -1 && val2 == -1) {
+ startpos = val1;
+ } else if (val1 == -1 && val2 == -1) {
+ // TODO: Error condition
+ break;
+ } else if (val1 > val2) {
+ startpos = val2;
+ } else {
+ startpos = val1;
+ }
+ }
+
+ if (startpos != -1) {
+ obj.getSource().setStartPosition(startpos);
+
+ // Check if single node
+ int p1=contents.indexOf('>', startpos);
+
+ if (p1 != -1 && contents.charAt(p1-1) == '/') {
+ obj.getSource().setEndPosition(p1);
+ } else {
+
+ org.w3c.dom.NodeList enl=elem.getElementsByTagName(elem.getNodeName());
+
+ int endpos=startpos;
+ String nodetxt="</"+elem.getNodeName()+">";
+
+ for (int i=0; endpos != -1 && i <= enl.getLength(); i++) {
+ endpos = contents.indexOf(nodetxt, endpos+1);
+ }
+
+ if (endpos != -1) {
+ obj.getSource().setEndPosition(endpos+nodetxt.length()-1);
+ }
+ }
+ }
+ }
+ }
+ }
}
Copied: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/util/InteractionUtilTest.java (from rev 193, tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/util/InteractionUtilTest.java)
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/util/InteractionUtilTest.java (rev 0)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/model/util/InteractionUtilTest.java 2010-03-15 23:03:53 UTC (rev 197)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.jboss.savara.tools.bpel.model.util;
+
+import junit.framework.TestCase;
+
+import org.scribble.conversation.model.*;
+import org.scribble.model.*;
+
+public class InteractionUtilTest extends TestCase {
+
+ public void testIsFirstInteractionSingleInteraction() {
+ ConversationModel cm=new ConversationModel();
+ Conversation c=new Conversation();
+ cm.setConversation(c);
+
+ Interaction i1=new Interaction();
+
+ c.getBlock().getContents().add(i1);
+
+ if (org.scribble.model.util.InteractionUtil.isInitialInteraction(i1) == false) {
+ fail("Interaction should be first in conversation");
+ }
+ }
+
+ public void testIsFirstInteractionSecondInteraction() {
+ ConversationModel cm=new ConversationModel();
+ Conversation c=new Conversation();
+ cm.setConversation(c);
+
+ Interaction i1=new Interaction();
+ Interaction i2=new Interaction();
+
+ c.getBlock().getContents().add(i1);
+ c.getBlock().getContents().add(i2);
+
+ if (org.scribble.model.util.InteractionUtil.isInitialInteraction(i2)) {
+ fail("Interaction should NOT be first in conversation");
+ }
+ }
+
+ public void testIsFirstInteractionIfElse() {
+ ConversationModel cm=new ConversationModel();
+ Conversation c=new Conversation();
+ cm.setConversation(c);
+
+ If choice=new If();
+ c.getBlock().getContents().add(choice);
+
+ Block b=choice.createNewPath();
+
+ Interaction i1=new Interaction();
+
+ b.getContents().add(i1);
+
+ Block b2=choice.createNewPath();
+
+ Interaction i2=new Interaction();
+ Interaction i3=new Interaction();
+
+ b2.getContents().add(i2);
+ b2.getContents().add(i3);
+
+ if (org.scribble.model.util.InteractionUtil.isInitialInteraction(i1) == false) {
+ fail("Interaction should be first in conversation");
+ }
+
+ if (org.scribble.model.util.InteractionUtil.isInitialInteraction(i2) == false) {
+ fail("Interaction should be first in conversation");
+ }
+
+ if (org.scribble.model.util.InteractionUtil.isInitialInteraction(i3)) {
+ fail("Interaction should NOT be first in conversation");
+ }
+ }
+}
Deleted: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/util/InteractionUtilTest.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/util/InteractionUtilTest.java 2010-03-15 18:06:05 UTC (rev 196)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/util/InteractionUtilTest.java 2010-03-15 23:03:53 UTC (rev 197)
@@ -1,91 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.jboss.savara.tools.bpel.util;
-
-import junit.framework.TestCase;
-
-import org.scribble.conversation.model.*;
-import org.scribble.model.*;
-
-public class InteractionUtilTest extends TestCase {
-
- public void testIsFirstInteractionSingleInteraction() {
- ConversationModel cm=new ConversationModel();
- Conversation c=new Conversation();
- cm.setConversation(c);
-
- Interaction i1=new Interaction();
-
- c.getBlock().getContents().add(i1);
-
- if (org.scribble.model.util.InteractionUtil.isInitialInteraction(i1) == false) {
- fail("Interaction should be first in conversation");
- }
- }
-
- public void testIsFirstInteractionSecondInteraction() {
- ConversationModel cm=new ConversationModel();
- Conversation c=new Conversation();
- cm.setConversation(c);
-
- Interaction i1=new Interaction();
- Interaction i2=new Interaction();
-
- c.getBlock().getContents().add(i1);
- c.getBlock().getContents().add(i2);
-
- if (org.scribble.model.util.InteractionUtil.isInitialInteraction(i2)) {
- fail("Interaction should NOT be first in conversation");
- }
- }
-
- public void testIsFirstInteractionIfElse() {
- ConversationModel cm=new ConversationModel();
- Conversation c=new Conversation();
- cm.setConversation(c);
-
- If choice=new If();
- c.getBlock().getContents().add(choice);
-
- Block b=choice.createNewPath();
-
- Interaction i1=new Interaction();
-
- b.getContents().add(i1);
-
- Block b2=choice.createNewPath();
-
- Interaction i2=new Interaction();
- Interaction i3=new Interaction();
-
- b2.getContents().add(i2);
- b2.getContents().add(i3);
-
- if (org.scribble.model.util.InteractionUtil.isInitialInteraction(i1) == false) {
- fail("Interaction should be first in conversation");
- }
-
- if (org.scribble.model.util.InteractionUtil.isInitialInteraction(i2) == false) {
- fail("Interaction should be first in conversation");
- }
-
- if (org.scribble.model.util.InteractionUtil.isInitialInteraction(i3)) {
- fail("Interaction should NOT be first in conversation");
- }
- }
-}
Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/util/XMLUtilsTest.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/util/XMLUtilsTest.java 2010-03-15 18:06:05 UTC (rev 196)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/test/org/jboss/savara/tools/bpel/util/XMLUtilsTest.java 2010-03-15 23:03:53 UTC (rev 197)
@@ -18,6 +18,7 @@
package org.jboss.savara.tools.bpel.util;
import org.jboss.savara.tools.bpel.util.XMLUtils;
+import org.scribble.model.ModelObject;
import junit.framework.TestCase;
@@ -51,4 +52,121 @@
fail("Failed: "+e);
}
}
+
+ public void testSetStartAndEndPosition() {
+ String xml="<root><myelem></myelem><myelem></myelem></root>";
+
+ try {
+ org.w3c.dom.Element node=(org.w3c.dom.Element)XMLUtils.getNode(xml);
+
+ org.w3c.dom.NodeList nl=node.getElementsByTagName("myelem");
+
+ if (nl.getLength() != 2) {
+ fail("Should be two elements: "+nl.getLength());
+ }
+
+ ModelObject obj=new ModelObject(){};
+
+ XMLUtils.setStartAndEndPosition(obj, xml, (org.w3c.dom.Element)nl.item(1));
+
+ if (obj.getSource().getStartPosition() != 23) {
+ fail("Start position should be 23: "+obj.getSource().getStartPosition());
+ }
+
+ if (obj.getSource().getEndPosition() != 39) {
+ fail("End position should be 39: "+obj.getSource().getEndPosition());
+ }
+
+ } catch(Exception e) {
+ fail("Failed: "+e);
+ }
+ }
+
+ public void testSetStartAndEndPositionWithNS() {
+ String xml="<bpel:root xmlns:bpel=\"myns\" ><bpel:myelem></bpel:myelem><bpel:myelem></bpel:myelem></bpel:root>";
+
+ try {
+ org.w3c.dom.Element node=(org.w3c.dom.Element)XMLUtils.getNode(xml);
+
+ org.w3c.dom.NodeList nl=node.getElementsByTagNameNS("myns", "myelem");
+
+ if (nl.getLength() != 2) {
+ fail("Should be two elements: "+nl.getLength());
+ }
+
+ ModelObject obj=new ModelObject(){};
+
+ XMLUtils.setStartAndEndPosition(obj, xml, (org.w3c.dom.Element)nl.item(1));
+
+ if (obj.getSource().getStartPosition() != 57) {
+ fail("Start position should be 57: "+obj.getSource().getStartPosition());
+ }
+
+ if (obj.getSource().getEndPosition() != 83) {
+ fail("End position should be 83: "+obj.getSource().getEndPosition());
+ }
+
+ } catch(Exception e) {
+ fail("Failed: "+e);
+ }
+ }
+
+ public void testSetStartAndEndPositionSingleNodeWithNS() {
+ String xml="<bpel:root xmlns:bpel=\"myns\" ><bpel:myelem attr=\"1\" /><bpel:myelem attr=\"2\" /></bpel:root>";
+
+ try {
+ org.w3c.dom.Element node=(org.w3c.dom.Element)XMLUtils.getNode(xml);
+
+ org.w3c.dom.NodeList nl=node.getElementsByTagNameNS("myns", "myelem");
+
+ if (nl.getLength() != 2) {
+ fail("Should be two elements: "+nl.getLength());
+ }
+
+ ModelObject obj=new ModelObject(){};
+
+ XMLUtils.setStartAndEndPosition(obj, xml, (org.w3c.dom.Element)nl.item(1));
+
+ if (obj.getSource().getStartPosition() != 54) {
+ fail("Start position should be 54: "+obj.getSource().getStartPosition());
+ }
+
+ if (obj.getSource().getEndPosition() != 77) {
+ fail("End position should be 77: "+obj.getSource().getEndPosition());
+ }
+
+ } catch(Exception e) {
+ fail("Failed: "+e);
+ }
+ }
+
+ public void testSetStartAndEndPositionWithChildAndNS() {
+ String xml="<bpel:root xmlns:bpel=\"myns\" ><bpel:myelem></bpel:myelem>" +
+ "<bpel:myelem><bpel:myelem></bpel:myelem></bpel:myelem></bpel:root>";
+
+ try {
+ org.w3c.dom.Element node=(org.w3c.dom.Element)XMLUtils.getNode(xml);
+
+ org.w3c.dom.NodeList nl=node.getElementsByTagNameNS("myns", "myelem");
+
+ if (nl.getLength() != 3) {
+ fail("Should be three elements: "+nl.getLength());
+ }
+
+ ModelObject obj=new ModelObject(){};
+
+ XMLUtils.setStartAndEndPosition(obj, xml, (org.w3c.dom.Element)nl.item(1));
+
+ if (obj.getSource().getStartPosition() != 57) {
+ fail("Start position should be 57: "+obj.getSource().getStartPosition());
+ }
+
+ if (obj.getSource().getEndPosition() != 110) {
+ fail("End position should be 110: "+obj.getSource().getEndPosition());
+ }
+
+ } catch(Exception e) {
+ fail("Failed: "+e);
+ }
+ }
}
Modified: tools/eclipse/trunk/plugins/org.scribble.pi4soa.cdm/META-INF/MANIFEST.MF
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.pi4soa.cdm/META-INF/MANIFEST.MF 2010-03-15 18:06:05 UTC (rev 196)
+++ tools/eclipse/trunk/plugins/org.scribble.pi4soa.cdm/META-INF/MANIFEST.MF 2010-03-15 23:03:53 UTC (rev 197)
@@ -19,7 +19,7 @@
org.eclipse.ui.views.properties.tabbed;resolution:=optional,
org.scribble.expression.xpath,
org.scribble.eclipse;resolution:=optional,
- org.scribble.contract.model;bundle-version="0.1.0"
+ org.scribble.contract.model
Scribble-Extensions: org.scribble.pi4soa.cdm.parser.CDMTokenizer,
org.scribble.pi4soa.cdm.parser.CDMModelParserRule,
org.scribble.pi4soa.cdm.model.CDMNotation,
14 years, 1 month
savara SVN: r196 - in tools/eclipse/trunk/plugins: org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator and 4 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-03-15 14:06:05 -0400 (Mon, 15 Mar 2010)
New Revision: 196
Removed:
tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/CatchBlockProtocolComparatorRule.java
tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/ConversationModelProtocolModelComparatorRule.java
tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/IfChoiceComparatorRule.java
tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/InterruptBlockProtocolComparatorRule.java
tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/ParallelProtocolParallelComparatorRule.java
tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/RaiseProtocolComparatorRule.java
tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/SpawnProtocolSpawnComparatorRule.java
tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/TryEscapeProtocolComparatorRule.java
tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/WhenChoiceComparatorRule.java
tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/CatchBlockProtocolComparatorRuleTest.java
tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/ConversationModelProtocolModelComparatorRuleTest.java
tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/IfChoiceComparatorRuleTest.java
tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/InterruptBlockProtocolComparatorRuleTest.java
tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/ParallelProtocolParallelComparatorRuleTest.java
tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/RaiseProtocolComparatorRuleTest.java
tools/eclipse/trunk/plugins/org.scribble.conversation.parser/src/java/org/scribble/conversation/parser/ProtocolImplementsReferenceParserRule.java
Modified:
tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/META-INF/MANIFEST.MF
tools/eclipse/trunk/plugins/org.scribble.conversation.model/META-INF/MANIFEST.MF
tools/eclipse/trunk/plugins/org.scribble.conversation.parser/META-INF/MANIFEST.MF
Log:
Remove unnecessary plugins.
Modified: tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/META-INF/MANIFEST.MF
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/META-INF/MANIFEST.MF 2010-03-13 19:12:26 UTC (rev 195)
+++ tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/META-INF/MANIFEST.MF 2010-03-15 18:06:05 UTC (rev 196)
@@ -9,7 +9,6 @@
Require-Bundle: org.scribble.core,
org.scribble.conversation.model,
org.scribble.conformance,
- org.scribble.protocol.model,
org.eclipse.core.runtime;resolution:=optional,
org.junit;resolution:=optional
Bundle-ActivationPolicy: lazy
Deleted: tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/CatchBlockProtocolComparatorRule.java
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/CatchBlockProtocolComparatorRule.java 2010-03-13 19:12:26 UTC (rev 195)
+++ tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/CatchBlockProtocolComparatorRule.java 2010-03-15 18:06:05 UTC (rev 196)
@@ -1,109 +0,0 @@
-/*
- * Copyright 2007-8 Pi4 Technologies Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Change History:
- * 10 Nov 2008 : Initial version created by gary
- */
-package org.scribble.conversation.comparator;
-
-import org.scribble.comparator.*;
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelListener;
-import org.scribble.extensions.RegistryInfo;
-
-/**
- * This class provides the CatchBlock comparator rule.
- */
-(a)RegistryInfo(extension=ComparatorRule.class)
-public class CatchBlockProtocolComparatorRule implements ComparatorRule {
-
- /**
- * This method determines whether the comparison rule is
- * associated with the supplied type.
- *
- * @param obj The object to check
- * @return Whether the object is of a type supported by the
- * comparison rule
- */
- public boolean isTypeSupported(ModelObject obj) {
- boolean ret=false;
-
- try {
- ret = (obj instanceof org.scribble.conversation.model.CatchBlock ||
- obj instanceof org.scribble.protocol.model.CatchBlock);
- } catch(java.lang.Throwable t) {
- // Ignore
- }
-
- return(ret);
- }
-
- /**
- * This method determines whether the comparison rule is
- * appropriate for the supplied model objects.
- *
- * @param main The main model object to be compared
- * @param ref The reference model object to be compared against
- * @return Whether the rule is relevant for the
- * model objects
- */
- public boolean isComparisonSupported(ModelObject main, ModelObject ref) {
- boolean ret=false;
-
- try {
- ret = (main instanceof org.scribble.conversation.model.CatchBlock &&
- ref instanceof org.scribble.protocol.model.CatchBlock);
- } catch(java.lang.Throwable t) {
- // Ignore
- }
-
- return(ret);
- }
-
- /**
- * This method compares a model object against a reference
- * component to determine if they are equal.
- *
- * @param context The context
- * @param main The main model object
- * @param reference The reference model object
- * @param l The model listener
- * @param deep Perform a deep compare
- * @return Whether the model objects are comparable
- */
- public boolean compare(ComparatorContext context, ModelObject main,
- ModelObject reference, ModelListener l, boolean deep) {
- boolean ret=false;
- org.scribble.conversation.model.CatchBlock maincb=
- (org.scribble.conversation.model.CatchBlock)main;
- org.scribble.protocol.model.CatchBlock refcb=
- (org.scribble.protocol.model.CatchBlock)reference;
-
- if (deep == false) {
-
- if (maincb.getType() != null &&
- refcb.getType() != null) {
- ret = context.compare(maincb.getType(),
- refcb.getType(), l, deep);
- } else {
- ret = true;
- }
- }
-
- return(ret);
- }
-
-}
Deleted: tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/ConversationModelProtocolModelComparatorRule.java
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/ConversationModelProtocolModelComparatorRule.java 2010-03-13 19:12:26 UTC (rev 195)
+++ tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/ConversationModelProtocolModelComparatorRule.java 2010-03-15 18:06:05 UTC (rev 196)
@@ -1,116 +0,0 @@
-/*
- * Copyright 2007-8 Pi4 Technologies Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Change History:
- * 31 Jan 2008 : Initial version created by gary
- */
-package org.scribble.conversation.comparator;
-
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelListener;
-import org.scribble.comparator.*;
-import org.scribble.extensions.RegistryInfo;
-import org.scribble.conformance.model.BehaviourList;
-import org.scribble.conversation.model.*;
-import org.scribble.protocol.model.*;
-
-/**
- * This class provides the Conversation model to protocol
- * model comparator rule, for comparing models for
- * implementation conformance.
- */
-(a)RegistryInfo(extension=ComparatorRule.class,notation=ConversationNotation.NOTATION_CODE)
-public class ConversationModelProtocolModelComparatorRule implements ComparatorRule {
-
- /**
- * This method determines whether the comparison rule is
- * associated with the supplied type.
- *
- * @param obj The object to check
- * @return Whether the object is of a type supported by the
- * comparison rule
- */
- public boolean isTypeSupported(ModelObject obj) {
- boolean ret=false;
-
- try {
- ret = (obj instanceof ConversationModel ||
- obj instanceof ProtocolModel);
- } catch(java.lang.Throwable t) {
- // Ignore
- }
-
- return(ret);
- }
-
- /**
- * This method determines whether the comparison rule is
- * appropriate for the supplied model objects.
- *
- * @param main The main model object to be compared
- * @param ref The reference model object to be compared against
- * @return Whether the rule is relevant for the
- * model objects
- */
- public boolean isComparisonSupported(ModelObject main, ModelObject ref) {
- boolean ret=false;
-
- try {
- ret = (main instanceof ConversationModel &&
- ref instanceof ProtocolModel);
- } catch(java.lang.Throwable t) {
- // Ignore
- }
-
- return(ret);
- }
-
- /**
- * This method compares a model object against a reference
- * component to determine if they are equal.
- *
- * @param context The context
- * @param main The main model object
- * @param reference The reference model object
- * @param l The model listener
- * @param deep Perform a deep compare
- * @return Whether the model objects are comparable
- */
- public boolean compare(ComparatorContext context, ModelObject main,
- ModelObject reference, ModelListener l, boolean deep) {
- boolean ret=false;
- ConversationModel mainModel=(ConversationModel)main;
- ProtocolModel refModel=(ProtocolModel)reference;
-
- // Check if model names are comparable, taking into account
- // mapping information provided by the context
- // TODO: Use context information for mapping conversation name and
- // roles
-
- if (deep && mainModel.getConversation() != null &&
- refModel.getProtocol() != null) {
- ret = true;
-
- // Build list of behaviours
- BehaviourList mainBehaviourList=BehaviourList.createBehaviourList(mainModel.getConversation().getBlock());
- BehaviourList refBehaviourList=BehaviourList.createBehaviourList(refModel.getProtocol().getBlock());
-
- context.compare(mainBehaviourList, refBehaviourList, l, true);
- }
-
- return(ret);
- }
-}
Deleted: tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/IfChoiceComparatorRule.java
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/IfChoiceComparatorRule.java 2010-03-13 19:12:26 UTC (rev 195)
+++ tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/IfChoiceComparatorRule.java 2010-03-15 18:06:05 UTC (rev 196)
@@ -1,108 +0,0 @@
-/*
- * Copyright 2007-8 Pi4 Technologies Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Change History:
- * 1 Feb 2008 : Initial version created by gary
- */
-package org.scribble.conversation.comparator;
-
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelListener;
-import org.scribble.comparator.*;
-import org.scribble.extensions.RegistryInfo;
-import org.scribble.conversation.model.*;
-import org.scribble.protocol.model.*;
-
-/**
- * This class provides the Conversation If to Protocol
- * Choice comparator rule.
- */
-(a)RegistryInfo(extension=ComparatorRule.class,notation=ConversationNotation.NOTATION_CODE)
-public class IfChoiceComparatorRule implements ComparatorRule {
-
- /**
- * This method determines whether the comparison rule is
- * associated with the supplied type.
- *
- * @param obj The object to check
- * @return Whether the object is of a type supported by the
- * comparison rule
- */
- public boolean isTypeSupported(ModelObject obj) {
- boolean ret=false;
-
- try {
- ret = (obj instanceof If || obj instanceof Choice);
- } catch(java.lang.Throwable t) {
- // Ignore
- }
-
- return(ret);
- }
-
- /**
- * This method determines whether the comparison rule is
- * appropriate for the supplied model objects.
- *
- * @param main The main model object to be compared
- * @param ref The reference model object to be compared against
- * @return Whether the rule is relevant for the
- * model objects
- */
- public boolean isComparisonSupported(ModelObject main, ModelObject ref) {
- boolean ret=false;
-
- try {
- ret = (main instanceof If &&
- ref instanceof Choice);
- } catch(java.lang.Throwable t) {
- // Ignore
- }
-
- return(ret);
- }
-
- /**
- * This method compares a model object against a reference
- * component to determine if they are equal.
- *
- * @param context The context
- * @param main The main model object
- * @param reference The reference model object
- * @param l The model listener
- * @param deep Perform a deep compare
- * @return Whether the model objects are comparable
- */
- public boolean compare(ComparatorContext context, ModelObject main,
- ModelObject reference, ModelListener l, boolean deep) {
- boolean ret=false;
- //If mainc=(If)main;
- //Choice refc=(Choice)reference;
-
- if (deep == false) {
- // Shallow, so return true as both choice
- ret = true;
- } else {
-
- // TODO: Decide how children should be dealt with
-
- // Check children - however not defined how the comparison
- // should be done between multi-path
- }
-
- return(ret);
- }
-}
Deleted: tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/InterruptBlockProtocolComparatorRule.java
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/InterruptBlockProtocolComparatorRule.java 2010-03-13 19:12:26 UTC (rev 195)
+++ tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/InterruptBlockProtocolComparatorRule.java 2010-03-15 18:06:05 UTC (rev 196)
@@ -1,98 +0,0 @@
-/*
- * Copyright 2007-8 Pi4 Technologies Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Change History:
- * 10 Nov 2008 : Initial version created by gary
- */
-package org.scribble.conversation.comparator;
-
-import org.scribble.comparator.*;
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelListener;
-import org.scribble.extensions.RegistryInfo;
-
-/**
- * This class provides the InterruptBlock comparator rule.
- */
-(a)RegistryInfo(extension=ComparatorRule.class)
-public class InterruptBlockProtocolComparatorRule implements ComparatorRule {
-
- /**
- * This method determines whether the comparison rule is
- * associated with the supplied type.
- *
- * @param obj The object to check
- * @return Whether the object is of a type supported by the
- * comparison rule
- */
- public boolean isTypeSupported(ModelObject obj) {
- boolean ret=false;
-
- try {
- ret = (obj instanceof org.scribble.conversation.model.InterruptBlock ||
- obj instanceof org.scribble.protocol.model.InterruptBlock);
- } catch(java.lang.Throwable t) {
- // Ignore
- }
-
- return(ret);
- }
-
- /**
- * This method determines whether the comparison rule is
- * appropriate for the supplied model objects.
- *
- * @param main The main model object to be compared
- * @param ref The reference model object to be compared against
- * @return Whether the rule is relevant for the
- * model objects
- */
- public boolean isComparisonSupported(ModelObject main, ModelObject ref) {
- boolean ret=false;
-
- try {
- ret = (main instanceof org.scribble.conversation.model.InterruptBlock &&
- ref instanceof org.scribble.protocol.model.InterruptBlock);
- } catch(java.lang.Throwable t) {
- // Ignore
- }
-
- return(ret);
- }
-
- /**
- * This method compares a model object against a reference
- * component to determine if they are equal.
- *
- * @param context The context
- * @param main The main model object
- * @param reference The reference model object
- * @param l The model listener
- * @param deep Perform a deep compare
- * @return Whether the model objects are comparable
- */
- public boolean compare(ComparatorContext context, ModelObject main,
- ModelObject reference, ModelListener l, boolean deep) {
- boolean ret=false;
-
- if (deep == false) {
- ret = true;
- }
-
- return(ret);
- }
-
-}
Deleted: tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/ParallelProtocolParallelComparatorRule.java
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/ParallelProtocolParallelComparatorRule.java 2010-03-13 19:12:26 UTC (rev 195)
+++ tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/ParallelProtocolParallelComparatorRule.java 2010-03-15 18:06:05 UTC (rev 196)
@@ -1,107 +0,0 @@
-/*
- * Copyright 2007-8 Pi4 Technologies Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Change History:
- * 17 Jul 2008 : Initial version created by gary
- */
-package org.scribble.conversation.comparator;
-
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelListener;
-import org.scribble.comparator.*;
-import org.scribble.conversation.model.ConversationNotation;
-import org.scribble.extensions.RegistryInfo;
-
-/**
- * This class provides the Conversation Parallel to a Protocol
- * Parallel comparator rule.
- */
-(a)RegistryInfo(extension=ComparatorRule.class,
- notation=ConversationNotation.NOTATION_CODE)
-public class ParallelProtocolParallelComparatorRule implements ComparatorRule {
-
- /**
- * This method determines whether the comparison rule is
- * associated with the supplied type.
- *
- * @param obj The object to check
- * @return Whether the object is of a type supported by the
- * comparison rule
- */
- public boolean isTypeSupported(ModelObject obj) {
- boolean ret=false;
-
- try {
- ret = (obj instanceof org.scribble.conversation.model.Parallel ||
- obj instanceof org.scribble.protocol.model.Parallel);
- } catch(java.lang.Throwable t) {
- // Ignore
- }
-
- return(ret);
- }
-
- /**
- * This method determines whether the comparison rule is
- * appropriate for the supplied model objects.
- *
- * @param main The main model object to be compared
- * @param ref The reference model object to be compared against
- * @return Whether the rule is relevant for the
- * model objects
- */
- public boolean isComparisonSupported(ModelObject main, ModelObject ref) {
- boolean ret=false;
-
- try {
- ret = (main instanceof org.scribble.conversation.model.Parallel &&
- ref instanceof org.scribble.protocol.model.Parallel);
- } catch(java.lang.Throwable t) {
- // Ignore
- }
-
- return(ret);
- }
-
- /**
- * This method compares a model object against a reference
- * component to determine if they are equal.
- *
- * @param context The context
- * @param main The main model object
- * @param reference The reference model object
- * @param l The model listener
- * @param deep Perform a deep compare
- * @return Whether the model objects are comparable
- */
- public boolean compare(ComparatorContext context, ModelObject main,
- ModelObject reference, ModelListener l, boolean deep) {
- boolean ret=false;
-
- if (deep == false) {
- // Shallow, so return true as compatible parallel types
- ret = true;
- } else {
-
- // TODO: Decide how children should be dealt with
-
- // Check children - however not defined how the comparison
- // should be done between multi-path
- }
-
- return(ret);
- }
-}
Deleted: tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/RaiseProtocolComparatorRule.java
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/RaiseProtocolComparatorRule.java 2010-03-13 19:12:26 UTC (rev 195)
+++ tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/RaiseProtocolComparatorRule.java 2010-03-15 18:06:05 UTC (rev 196)
@@ -1,115 +0,0 @@
-/*
- * Copyright 2007-8 Pi4 Technologies Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Change History:
- * 10 Nov 2008 : Initial version created by gary
- */
-package org.scribble.conversation.comparator;
-
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelListener;
-import org.scribble.comparator.*;
-import org.scribble.conversation.model.*;
-import org.scribble.extensions.RegistryInfo;
-
-/**
- * This class provides the Conversation Raise to a Protocol
- * Raise comparator rule.
- */
-(a)RegistryInfo(extension=ComparatorRule.class,notation=ConversationNotation.NOTATION_CODE)
-public class RaiseProtocolComparatorRule implements ComparatorRule {
-
- /**
- * This method determines whether the comparison rule is
- * associated with the supplied type.
- *
- * @param obj The object to check
- * @return Whether the object is of a type supported by the
- * comparison rule
- */
- public boolean isTypeSupported(ModelObject obj) {
- boolean ret=false;
-
- try {
- ret = (obj instanceof org.scribble.conversation.model.Raise ||
- obj instanceof org.scribble.protocol.model.Raise);
- } catch(java.lang.Throwable t) {
- // Ignore
- }
-
- return(ret);
- }
-
- /**
- * This method determines whether the comparison rule is
- * appropriate for the supplied model objects.
- *
- * @param main The main model object to be compared
- * @param ref The reference model object to be compared against
- * @return Whether the rule is relevant for the
- * model objects
- */
- public boolean isComparisonSupported(ModelObject main, ModelObject ref) {
- boolean ret=false;
-
- try {
- ret = (main instanceof org.scribble.conversation.model.Raise &&
- ref instanceof org.scribble.protocol.model.Raise);
- } catch(java.lang.Throwable t) {
- // Ignore
- }
-
- return(ret);
- }
-
- /**
- * This method compares a model object against a reference
- * component to determine if they are equal.
- *
- * @param context The context
- * @param main The main model object
- * @param reference The reference model object
- * @param l The model listener
- * @param deep Perform a deep compare
- * @return Whether the model objects are comparable
- */
- public boolean compare(ComparatorContext context, ModelObject main,
- ModelObject reference, ModelListener l, boolean deep) {
- boolean ret=false;
- org.scribble.conversation.model.Raise raisem=
- (org.scribble.conversation.model.Raise)main;
- org.scribble.protocol.model.Raise raiseref=
- (org.scribble.protocol.model.Raise)reference;
-
- if (deep == false) {
-
- if (raisem.getType() != null &&
- raiseref.getType() != null) {
- ret = context.compare(raisem.getType(),
- raiseref.getType(), l, deep);
-
- // TODO: Check role is appropriate
- // May depend whether global or local models
- // If local models, then only matters whether
- // projected role is either present or absent
- // in both lists - if global, then may need
- // to be matched lists
- }
- }
-
- return(ret);
- }
-}
Deleted: tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/SpawnProtocolSpawnComparatorRule.java
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/SpawnProtocolSpawnComparatorRule.java 2010-03-13 19:12:26 UTC (rev 195)
+++ tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/SpawnProtocolSpawnComparatorRule.java 2010-03-15 18:06:05 UTC (rev 196)
@@ -1,96 +0,0 @@
-/*
- * Copyright 2007-8 Pi4 Technologies Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Change History:
- * 20 Aug 2008 : Initial version created by gary
- */
-package org.scribble.conversation.comparator;
-
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelListener;
-import org.scribble.comparator.*;
-import org.scribble.conversation.model.ConversationNotation;
-import org.scribble.extensions.RegistryInfo;
-
-/**
- * This class provides the Conversation Spawn to a Protocol
- * Spawn comparator rule.
- */
-(a)RegistryInfo(extension=ComparatorRule.class,
- notation=ConversationNotation.NOTATION_CODE)
-public class SpawnProtocolSpawnComparatorRule implements ComparatorRule {
-
- /**
- * This method determines whether the comparison rule is
- * associated with the supplied type.
- *
- * @param obj The object to check
- * @return Whether the object is of a type supported by the
- * comparison rule
- */
- public boolean isTypeSupported(ModelObject obj) {
- boolean ret=false;
-
- try {
- ret = (obj instanceof org.scribble.conversation.model.Spawn ||
- obj instanceof org.scribble.protocol.model.Spawn);
- } catch(java.lang.Throwable t) {
- // Ignore
- }
-
- return(ret);
- }
-
- /**
- * This method determines whether the comparison rule is
- * appropriate for the supplied model objects.
- *
- * @param main The main model object to be compared
- * @param ref The reference model object to be compared against
- * @return Whether the rule is relevant for the
- * model objects
- */
- public boolean isComparisonSupported(ModelObject main, ModelObject ref) {
- boolean ret=false;
-
- try {
- ret = (main instanceof org.scribble.conversation.model.Spawn &&
- ref instanceof org.scribble.protocol.model.Spawn);
- } catch(java.lang.Throwable t) {
- // Ignore
- }
-
- return(ret);
- }
-
- /**
- * This method compares a model object against a reference
- * component to determine if they are equal.
- *
- * @param context The context
- * @param main The main model object
- * @param reference The reference model object
- * @param l The model listener
- * @param deep Perform a deep compare
- * @return Whether the model objects are comparable
- */
- public boolean compare(ComparatorContext context, ModelObject main,
- ModelObject reference, ModelListener l, boolean deep) {
- boolean ret=true;
-
- return(ret);
- }
-}
Deleted: tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/TryEscapeProtocolComparatorRule.java
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/TryEscapeProtocolComparatorRule.java 2010-03-13 19:12:26 UTC (rev 195)
+++ tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/TryEscapeProtocolComparatorRule.java 2010-03-15 18:06:05 UTC (rev 196)
@@ -1,106 +0,0 @@
-/*
- * Copyright 2007-8 Pi4 Technologies Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Change History:
- * 10 Nov 2008 : Initial version created by gary
- */
-package org.scribble.conversation.comparator;
-
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelListener;
-import org.scribble.comparator.*;
-import org.scribble.extensions.RegistryInfo;
-import org.scribble.conversation.model.*;
-
-/**
- * This class provides the Conversation TryEscape to Protocol
- * TryEscape comparator rule.
- */
-(a)RegistryInfo(extension=ComparatorRule.class,notation=ConversationNotation.NOTATION_CODE)
-public class TryEscapeProtocolComparatorRule implements ComparatorRule {
-
- /**
- * This method determines whether the comparison rule is
- * associated with the supplied type.
- *
- * @param obj The object to check
- * @return Whether the object is of a type supported by the
- * comparison rule
- */
- public boolean isTypeSupported(ModelObject obj) {
- boolean ret=false;
-
- try {
- ret = (obj instanceof org.scribble.conversation.model.TryEscape ||
- obj instanceof org.scribble.protocol.model.TryEscape);
- } catch(java.lang.Throwable t) {
- // Ignore
- }
-
- return(ret);
- }
-
- /**
- * This method determines whether the comparison rule is
- * appropriate for the supplied model objects.
- *
- * @param main The main model object to be compared
- * @param ref The reference model object to be compared against
- * @return Whether the rule is relevant for the
- * model objects
- */
- public boolean isComparisonSupported(ModelObject main, ModelObject ref) {
- boolean ret=false;
-
- try {
- ret = (main instanceof org.scribble.conversation.model.TryEscape &&
- ref instanceof org.scribble.protocol.model.TryEscape);
- } catch(java.lang.Throwable t) {
- // Ignore
- }
-
- return(ret);
- }
-
- /**
- * This method compares a model object against a reference
- * component to determine if they are equal.
- *
- * @param context The context
- * @param main The main model object
- * @param reference The reference model object
- * @param l The model listener
- * @param deep Perform a deep compare
- * @return Whether the model objects are comparable
- */
- public boolean compare(ComparatorContext context, ModelObject main,
- ModelObject reference, ModelListener l, boolean deep) {
- boolean ret=false;
-
- if (deep == false) {
- // Shallow, so return true as both choice
- ret = true;
- } else {
-
- // TODO: Decide how children should be dealt with
-
- // Check children - however not defined how the comparison
- // should be done between multi-path
- }
-
- return(ret);
- }
-}
Deleted: tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/WhenChoiceComparatorRule.java
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/WhenChoiceComparatorRule.java 2010-03-13 19:12:26 UTC (rev 195)
+++ tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/java/org/scribble/conversation/comparator/WhenChoiceComparatorRule.java 2010-03-15 18:06:05 UTC (rev 196)
@@ -1,106 +0,0 @@
-/*
- * Copyright 2007-8 Pi4 Technologies Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Change History:
- * 17 Jul 2008 : Initial version created by gary
- */
-package org.scribble.conversation.comparator;
-
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelListener;
-import org.scribble.comparator.*;
-import org.scribble.extensions.RegistryInfo;
-import org.scribble.conversation.model.*;
-import org.scribble.protocol.model.*;
-
-/**
- * This class provides the Conversation When to Protocol
- * Choice comparator rule.
- */
-(a)RegistryInfo(extension=ComparatorRule.class,notation=ConversationNotation.NOTATION_CODE)
-public class WhenChoiceComparatorRule implements ComparatorRule {
-
- /**
- * This method determines whether the comparison rule is
- * associated with the supplied type.
- *
- * @param obj The object to check
- * @return Whether the object is of a type supported by the
- * comparison rule
- */
- public boolean isTypeSupported(ModelObject obj) {
- boolean ret=false;
-
- try {
- ret = (obj instanceof When || obj instanceof Choice);
- } catch(java.lang.Throwable t) {
- // Ignore
- }
-
- return(ret);
- }
-
- /**
- * This method determines whether the comparison rule is
- * appropriate for the supplied model objects.
- *
- * @param main The main model object to be compared
- * @param ref The reference model object to be compared against
- * @return Whether the rule is relevant for the
- * model objects
- */
- public boolean isComparisonSupported(ModelObject main, ModelObject ref) {
- boolean ret=false;
-
- try {
- ret = (main instanceof When &&
- ref instanceof Choice);
- } catch(java.lang.Throwable t) {
- // Ignore
- }
-
- return(ret);
- }
-
- /**
- * This method compares a model object against a reference
- * component to determine if they are equal.
- *
- * @param context The context
- * @param main The main model object
- * @param reference The reference model object
- * @param l The model listener
- * @param deep Perform a deep compare
- * @return Whether the model objects are comparable
- */
- public boolean compare(ComparatorContext context, ModelObject main,
- ModelObject reference, ModelListener l, boolean deep) {
- boolean ret=false;
-
- if (deep == false) {
- // Shallow, so return true as types compatible
- ret = true;
- } else {
-
- // TODO: Decide how children should be dealt with
-
- // Check children - however not defined how the comparison
- // should be done between multi-path
- }
-
- return(ret);
- }
-}
Deleted: tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/CatchBlockProtocolComparatorRuleTest.java
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/CatchBlockProtocolComparatorRuleTest.java 2010-03-13 19:12:26 UTC (rev 195)
+++ tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/CatchBlockProtocolComparatorRuleTest.java 2010-03-15 18:06:05 UTC (rev 196)
@@ -1,213 +0,0 @@
-/*
- * Copyright 2005-9 Pi4 Technologies Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Change History:
- * 1 Mar 2009 : Initial version created by gary
- */
-package org.scribble.conversation.comparator;
-
-import org.scribble.extensions.RegistryFactory;
-import org.scribble.model.*;
-import org.scribble.model.admin.DefaultModelListener;
-import org.scribble.comparator.*;
-import org.scribble.conversation.model.CatchBlock;
-
-import junit.framework.TestCase;
-
-public class CatchBlockProtocolComparatorRuleTest extends TestCase {
-
- private static final String TEST_NOTATION = "test";
-
- public void testCompareSameCatchType() {
- CatchBlockProtocolComparatorRule rule=
- new CatchBlockProtocolComparatorRule();
-
- RegistryFactory.setRegistry(null);
-
- DefaultModelListener l=new DefaultModelListener();
-
- java.util.List<ComparatorRule> rules=
- new java.util.Vector<ComparatorRule>();
-
- rules.add(new TypeReferenceComparatorRule());
-
- DefaultComparatorContext context=
- new DefaultComparatorContext(new ModelReference(TEST_NOTATION),
- new ModelReference(TEST_NOTATION), rules);
-
- org.scribble.conversation.model.CatchBlock main=
- new org.scribble.conversation.model.CatchBlock();
- TypeReference mainType=new TypeReference();
- mainType.setLocalpart("catchType");
- main.setType(mainType);
-
- org.scribble.protocol.model.CatchBlock reference=
- new org.scribble.protocol.model.CatchBlock();
- TypeReference refType=new TypeReference();
- refType.setLocalpart("catchType");
- reference.setType(refType);
-
- boolean result=rule.compare(context, main, reference, l, false);
-
- if (l.getErrors().size() > 0) {
- fail("No errors expected");
- }
-
- if (result == false) {
- fail("Comparator should NOT have failed");
- }
- }
-
- public void testCompareDiffTypes() {
- CatchBlockProtocolComparatorRule rule=
- new CatchBlockProtocolComparatorRule();
-
- RegistryFactory.setRegistry(null);
-
- DefaultModelListener l=new DefaultModelListener();
-
- java.util.List<ComparatorRule> rules=
- new java.util.Vector<ComparatorRule>();
-
- rules.add(new TypeReferenceComparatorRule());
-
- DefaultComparatorContext context=
- new DefaultComparatorContext(new ModelReference(TEST_NOTATION),
- new ModelReference(TEST_NOTATION), rules);
-
- org.scribble.conversation.model.CatchBlock main=
- new org.scribble.conversation.model.CatchBlock();
- TypeReference mainType=new TypeReference();
- mainType.setLocalpart("catchType1");
- main.setType(mainType);
-
- org.scribble.protocol.model.CatchBlock reference=
- new org.scribble.protocol.model.CatchBlock();
- TypeReference refType=new TypeReference();
- refType.setLocalpart("catchType2");
- reference.setType(refType);
-
- boolean result=rule.compare(context, main, reference, l, false);
-
- if (l.getErrors().size() != 1) {
- fail("One error expected");
- }
-
- if (result == true) {
- fail("Comparator should have failed");
- }
- }
-
- public void testCompareMissingMainCatchType() {
- CatchBlockProtocolComparatorRule rule=
- new CatchBlockProtocolComparatorRule();
-
- RegistryFactory.setRegistry(null);
-
- DefaultModelListener l=new DefaultModelListener();
-
- java.util.List<ComparatorRule> rules=
- new java.util.Vector<ComparatorRule>();
-
- rules.add(new TypeReferenceComparatorRule());
-
- DefaultComparatorContext context=
- new DefaultComparatorContext(new ModelReference(TEST_NOTATION),
- new ModelReference(TEST_NOTATION), rules);
-
- org.scribble.conversation.model.CatchBlock main=
- new org.scribble.conversation.model.CatchBlock();
-
- org.scribble.protocol.model.CatchBlock reference=
- new org.scribble.protocol.model.CatchBlock();
- TypeReference refType=new TypeReference();
- refType.setLocalpart("catchType");
- reference.setType(refType);
-
- boolean result=rule.compare(context, main, reference, l, false);
-
- if (l.getErrors().size() > 0) {
- fail("No errors expected");
- }
-
- if (result == false) {
- fail("Comparator should NOT have failed");
- }
- }
-
- public void testCompareMissingRefCatchType() {
- CatchBlockProtocolComparatorRule rule=
- new CatchBlockProtocolComparatorRule();
-
- RegistryFactory.setRegistry(null);
-
- DefaultModelListener l=new DefaultModelListener();
-
- java.util.List<ComparatorRule> rules=
- new java.util.Vector<ComparatorRule>();
-
- rules.add(new TypeReferenceComparatorRule());
-
- DefaultComparatorContext context=
- new DefaultComparatorContext(new ModelReference(TEST_NOTATION),
- new ModelReference(TEST_NOTATION), rules);
-
- org.scribble.conversation.model.CatchBlock main=
- new org.scribble.conversation.model.CatchBlock();
- TypeReference mainType=new TypeReference();
- mainType.setLocalpart("catchType");
- main.setType(mainType);
-
- org.scribble.protocol.model.CatchBlock reference=
- new org.scribble.protocol.model.CatchBlock();
-
- boolean result=rule.compare(context, main, reference, l, false);
-
- if (l.getErrors().size() > 0) {
- fail("No errors expected");
- }
-
- if (result == false) {
- fail("Comparator should NOT have failed");
- }
- }
-
- public void testIsSupportedProtocolRefConvMain() {
- CatchBlockProtocolComparatorRule rule=
- new CatchBlockProtocolComparatorRule();
-
- boolean result=rule.isComparisonSupported(
- new org.scribble.conversation.model.CatchBlock(),
- new org.scribble.protocol.model.CatchBlock());
-
- if (result == false) {
- fail("Should be supported");
- }
- }
-
- public void testIsSupportedProtocolMainConvRef() {
- CatchBlockProtocolComparatorRule rule=
- new CatchBlockProtocolComparatorRule();
-
- boolean result=rule.isComparisonSupported(
- new org.scribble.protocol.model.CatchBlock(),
- new org.scribble.conversation.model.CatchBlock());
-
- if (result == true) {
- fail("Should NOT be supported");
- }
- }
-}
Deleted: tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/ConversationModelProtocolModelComparatorRuleTest.java
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/ConversationModelProtocolModelComparatorRuleTest.java 2010-03-13 19:12:26 UTC (rev 195)
+++ tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/ConversationModelProtocolModelComparatorRuleTest.java 2010-03-15 18:06:05 UTC (rev 196)
@@ -1,86 +0,0 @@
-/*
- * Copyright 2005-9 Pi4 Technologies Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Change History:
- * 3 Mar 2009 : Initial version created by gary
- */
-package org.scribble.conversation.comparator;
-
-import org.scribble.extensions.RegistryFactory;
-import org.scribble.model.*;
-import org.scribble.conversation.model.*;
-import org.scribble.protocol.model.*;
-import org.scribble.model.admin.DefaultModelListener;
-import org.scribble.comparator.*;
-import org.scribble.conformance.comparator.*;
-
-import junit.framework.TestCase;
-
-public class ConversationModelProtocolModelComparatorRuleTest extends TestCase {
-
- private static final String TEST_NOTATION = "test";
-
- public void testCompare() {
- ConversationModelProtocolModelComparatorRule rule=
- new ConversationModelProtocolModelComparatorRule();
-
- RegistryFactory.setRegistry(null);
-
- DefaultModelListener l=new DefaultModelListener();
-
- java.util.List<ComparatorRule> rules=
- new java.util.Vector<ComparatorRule>();
-
- rules.add(new BehaviourListComparatorRule());
- rules.add(new BlockComparatorRule());
-
- DefaultComparatorContext context=
- new DefaultComparatorContext(new ModelReference(TEST_NOTATION),
- new ModelReference(TEST_NOTATION), rules);
-
- ConversationModel main=new ConversationModel();
- Conversation mainConversation=new Conversation();
- main.setConversation(mainConversation);
-
- LocatedName mainName=new LocatedName();
- mainName.setName("modelName");
- Role mainRole=new Role();
- mainRole.setName("roleName");
- mainName.setRole(mainRole);
- mainConversation.setLocatedName(mainName);
-
- ProtocolModel reference=new ProtocolModel();
- Protocol refProtocol=new Protocol();
- reference.setProtocol(refProtocol);
-
- LocatedName refName=new LocatedName();
- refName.setName("modelName");
- Role refRole=new Role();
- refRole.setName("roleName");
- refName.setRole(refRole);
- refProtocol.setLocatedName(refName);
-
- boolean result=rule.compare(context, main, reference, l, true);
-
- if (l.getErrors().size() > 0) {
- fail("No errors expected");
- }
-
- if (result == false) {
- fail("Comparator should NOT have failed");
- }
- }
-}
Deleted: tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/IfChoiceComparatorRuleTest.java
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/IfChoiceComparatorRuleTest.java 2010-03-13 19:12:26 UTC (rev 195)
+++ tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/IfChoiceComparatorRuleTest.java 2010-03-15 18:06:05 UTC (rev 196)
@@ -1,64 +0,0 @@
-/*
- * Copyright 2005-9 Pi4 Technologies Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Change History:
- * 3 Mar 2009 : Initial version created by gary
- */
-package org.scribble.conversation.comparator;
-
-import org.scribble.extensions.RegistryFactory;
-import org.scribble.model.*;
-import org.scribble.conversation.model.*;
-import org.scribble.protocol.model.*;
-import org.scribble.model.admin.DefaultModelListener;
-import org.scribble.comparator.*;
-
-import junit.framework.TestCase;
-
-public class IfChoiceComparatorRuleTest extends TestCase {
-
- private static final String TEST_NOTATION = "test";
-
- public void testCompareShallow() {
- IfChoiceComparatorRule rule=
- new IfChoiceComparatorRule();
-
- RegistryFactory.setRegistry(null);
-
- DefaultModelListener l=new DefaultModelListener();
-
- java.util.List<ComparatorRule> rules=
- new java.util.Vector<ComparatorRule>();
-
- DefaultComparatorContext context=
- new DefaultComparatorContext(new ModelReference(TEST_NOTATION),
- new ModelReference(TEST_NOTATION), rules);
-
- If main=new If();
-
- Choice reference=new Choice();
-
- boolean result=rule.compare(context, main, reference, l, false);
-
- if (l.getErrors().size() > 0) {
- fail("No errors expected");
- }
-
- if (result == false) {
- fail("Comparator should NOT have failed");
- }
- }
-}
Deleted: tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/InterruptBlockProtocolComparatorRuleTest.java
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/InterruptBlockProtocolComparatorRuleTest.java 2010-03-13 19:12:26 UTC (rev 195)
+++ tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/InterruptBlockProtocolComparatorRuleTest.java 2010-03-15 18:06:05 UTC (rev 196)
@@ -1,67 +0,0 @@
-/*
- * Copyright 2005-9 Pi4 Technologies Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Change History:
- * 3 Mar 2009 : Initial version created by gary
- */
-package org.scribble.conversation.comparator;
-
-import org.scribble.extensions.RegistryFactory;
-import org.scribble.model.*;
-import org.scribble.model.admin.DefaultModelListener;
-import org.scribble.comparator.*;
-
-import junit.framework.TestCase;
-
-public class InterruptBlockProtocolComparatorRuleTest extends TestCase {
-
- private static final String TEST_NOTATION = "test";
-
- public void testCompareShallow() {
- InterruptBlockComparatorRule rule=
- new InterruptBlockComparatorRule();
-
- RegistryFactory.setRegistry(null);
-
- DefaultModelListener l=new DefaultModelListener();
-
- java.util.List<ComparatorRule> rules=
- new java.util.Vector<ComparatorRule>();
-
- DefaultComparatorContext context=
- new DefaultComparatorContext(new ModelReference(TEST_NOTATION),
- new ModelReference(TEST_NOTATION), rules);
-
- org.scribble.conversation.model.InterruptBlock main=
- new org.scribble.conversation.model.InterruptBlock();
-
- org.scribble.protocol.model.InterruptBlock reference=
- new org.scribble.protocol.model.InterruptBlock();
-
- boolean result=rule.compare(context, main, reference, l, false);
-
- if (l.getErrors().size() > 0) {
- fail("No errors expected");
- }
-
- if (result == false) {
- fail("Comparator should NOT have failed");
- }
- }
-
- // TODO: If defined in both, may need to check expressions
- // are compatible
-}
Deleted: tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/ParallelProtocolParallelComparatorRuleTest.java
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/ParallelProtocolParallelComparatorRuleTest.java 2010-03-13 19:12:26 UTC (rev 195)
+++ tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/ParallelProtocolParallelComparatorRuleTest.java 2010-03-15 18:06:05 UTC (rev 196)
@@ -1,64 +0,0 @@
-/*
- * Copyright 2005-9 Pi4 Technologies Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Change History:
- * 3 Mar 2009 : Initial version created by gary
- */
-package org.scribble.conversation.comparator;
-
-import org.scribble.extensions.RegistryFactory;
-import org.scribble.model.*;
-import org.scribble.model.admin.DefaultModelListener;
-import org.scribble.comparator.*;
-
-import junit.framework.TestCase;
-
-public class ParallelProtocolParallelComparatorRuleTest extends TestCase {
-
- private static final String TEST_NOTATION = "test";
-
- public void testCompareShallow() {
- ParallelProtocolParallelComparatorRule rule=
- new ParallelProtocolParallelComparatorRule();
-
- RegistryFactory.setRegistry(null);
-
- DefaultModelListener l=new DefaultModelListener();
-
- java.util.List<ComparatorRule> rules=
- new java.util.Vector<ComparatorRule>();
-
- DefaultComparatorContext context=
- new DefaultComparatorContext(new ModelReference(TEST_NOTATION),
- new ModelReference(TEST_NOTATION), rules);
-
- org.scribble.conversation.model.Parallel main=
- new org.scribble.conversation.model.Parallel();
-
- org.scribble.protocol.model.Parallel reference=
- new org.scribble.protocol.model.Parallel();
-
- boolean result=rule.compare(context, main, reference, l, false);
-
- if (l.getErrors().size() > 0) {
- fail("No errors expected");
- }
-
- if (result == false) {
- fail("Comparator should NOT have failed");
- }
- }
-}
Deleted: tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/RaiseProtocolComparatorRuleTest.java
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/RaiseProtocolComparatorRuleTest.java 2010-03-13 19:12:26 UTC (rev 195)
+++ tools/eclipse/trunk/plugins/org.scribble.conversation.comparator/src/test/org/scribble/conversation/comparator/RaiseProtocolComparatorRuleTest.java 2010-03-15 18:06:05 UTC (rev 196)
@@ -1,212 +0,0 @@
-/*
- * Copyright 2005-9 Pi4 Technologies Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Change History:
- * 3 Mar 2009 : Initial version created by gary
- */
-package org.scribble.conversation.comparator;
-
-import org.scribble.extensions.RegistryFactory;
-import org.scribble.model.*;
-import org.scribble.model.admin.DefaultModelListener;
-import org.scribble.comparator.*;
-
-import junit.framework.TestCase;
-
-public class RaiseProtocolComparatorRuleTest extends TestCase {
-
- private static final String TEST_NOTATION = "test";
-
- public void testCompareSameRaiseType() {
- RaiseProtocolComparatorRule rule=
- new RaiseProtocolComparatorRule();
-
- RegistryFactory.setRegistry(null);
-
- DefaultModelListener l=new DefaultModelListener();
-
- java.util.List<ComparatorRule> rules=
- new java.util.Vector<ComparatorRule>();
-
- rules.add(new TypeReferenceComparatorRule());
-
- DefaultComparatorContext context=
- new DefaultComparatorContext(new ModelReference(TEST_NOTATION),
- new ModelReference(TEST_NOTATION), rules);
-
- org.scribble.conversation.model.Raise main=
- new org.scribble.conversation.model.Raise();
- TypeReference mainType=new TypeReference();
- mainType.setLocalpart("RaiseType");
- main.setType(mainType);
-
- org.scribble.protocol.model.Raise reference=
- new org.scribble.protocol.model.Raise();
- TypeReference refType=new TypeReference();
- refType.setLocalpart("RaiseType");
- reference.setType(refType);
-
- boolean result=rule.compare(context, main, reference, l, false);
-
- if (l.getErrors().size() > 0) {
- fail("No errors expected");
- }
-
- if (result == false) {
- fail("Comparator should NOT have failed");
- }
- }
-
- public void testCompareDiffRaiseTypes() {
- RaiseProtocolComparatorRule rule=
- new RaiseProtocolComparatorRule();
-
- RegistryFactory.setRegistry(null);
-
- DefaultModelListener l=new DefaultModelListener();
-
- java.util.List<ComparatorRule> rules=
- new java.util.Vector<ComparatorRule>();
-
- rules.add(new TypeReferenceComparatorRule());
-
- DefaultComparatorContext context=
- new DefaultComparatorContext(new ModelReference(TEST_NOTATION),
- new ModelReference(TEST_NOTATION), rules);
-
- org.scribble.conversation.model.Raise main=
- new org.scribble.conversation.model.Raise();
- TypeReference mainType=new TypeReference();
- mainType.setLocalpart("RaiseType1");
- main.setType(mainType);
-
- org.scribble.protocol.model.Raise reference=
- new org.scribble.protocol.model.Raise();
- TypeReference refType=new TypeReference();
- refType.setLocalpart("RaiseType2");
- reference.setType(refType);
-
- boolean result=rule.compare(context, main, reference, l, false);
-
- if (l.getErrors().size() != 1) {
- fail("One error expected");
- }
-
- if (result == true) {
- fail("Comparator should have failed");
- }
- }
-
- public void testCompareMissingMainRaiseType() {
- RaiseProtocolComparatorRule rule=
- new RaiseProtocolComparatorRule();
-
- RegistryFactory.setRegistry(null);
-
- DefaultModelListener l=new DefaultModelListener();
-
- java.util.List<ComparatorRule> rules=
- new java.util.Vector<ComparatorRule>();
-
- rules.add(new TypeReferenceComparatorRule());
-
- DefaultComparatorContext context=
- new DefaultComparatorContext(new ModelReference(TEST_NOTATION),
- new ModelReference(TEST_NOTATION), rules);
-
- org.scribble.conversation.model.Raise main=
- new org.scribble.conversation.model.Raise();
-
- org.scribble.protocol.model.Raise reference=
- new org.scribble.protocol.model.Raise();
- TypeReference refType=new TypeReference();
- refType.setLocalpart("RaiseType");
- reference.setType(refType);
-
- boolean result=rule.compare(context, main, reference, l, false);
-
- if (l.getErrors().size() > 0) {
- fail("No errors expected");
- }
-
- if (result == true) {
- fail("Comparator should have failed");
- }
- }
-
- public void testCompareMissingRefRaiseType() {
- RaiseProtocolComparatorRule rule=
- new RaiseProtocolComparatorRule();
-
- RegistryFactory.setRegistry(null);
-
- DefaultModelListener l=new DefaultModelListener();
-
- java.util.List<ComparatorRule> rules=
- new java.util.Vector<ComparatorRule>();
-
- rules.add(new TypeReferenceComparatorRule());
-
- DefaultComparatorContext context=
- new DefaultComparatorContext(new ModelReference(TEST_NOTATION),
- new ModelReference(TEST_NOTATION), rules);
-
- org.scribble.conversation.model.Raise main=
- new org.scribble.conversation.model.Raise();
- TypeReference mainType=new TypeReference();
- mainType.setLocalpart("RaiseType");
- main.setType(mainType);
-
- org.scribble.protocol.model.Raise reference=
- new org.scribble.protocol.model.Raise();
-
- boolean result=rule.compare(context, main, reference, l, false);
-
- if (l.getErrors().size() > 0) {
- fail("No errors expected");
- }
-
- if (result == true) {
- fail("Comparator should have failed");
- }
- }
-
- public void testIsSupportedProtocolRefConvMain() {
- RaiseProtocolComparatorRule rule=
- new RaiseProtocolComparatorRule();
-
- boolean result=rule.isComparisonSupported(
- new org.scribble.conversation.model.Raise(),
- new org.scribble.protocol.model.Raise());
-
- if (result == false) {
- fail("Should be supported");
- }
- }
-
- public void testIsSupportedProtocolMainConvRef() {
- RaiseProtocolComparatorRule rule=
- new RaiseProtocolComparatorRule();
-
- boolean result=rule.isComparisonSupported(
- new org.scribble.protocol.model.Raise(),
- new org.scribble.conversation.model.Raise());
-
- if (result == true) {
- fail("Should NOT be supported");
- }
- }
-}
Modified: tools/eclipse/trunk/plugins/org.scribble.conversation.model/META-INF/MANIFEST.MF
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.conversation.model/META-INF/MANIFEST.MF 2010-03-13 19:12:26 UTC (rev 195)
+++ tools/eclipse/trunk/plugins/org.scribble.conversation.model/META-INF/MANIFEST.MF 2010-03-15 18:06:05 UTC (rev 196)
@@ -6,8 +6,7 @@
Bundle-Activator: org.scribble.conversation.model.osgi.Activator
Bundle-Vendor: www.scribble.org
Import-Package: org.osgi.framework;version="1.3.0"
-Require-Bundle: org.scribble.core,
- org.scribble.protocol.model
+Require-Bundle: org.scribble.core
Eclipse-LazyStart: true
Export-Package: org.scribble.conversation.model
Scribble-Extensions: org.scribble.conversation.model.ConversationNotation
Modified: tools/eclipse/trunk/plugins/org.scribble.conversation.parser/META-INF/MANIFEST.MF
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.conversation.parser/META-INF/MANIFEST.MF 2010-03-13 19:12:26 UTC (rev 195)
+++ tools/eclipse/trunk/plugins/org.scribble.conversation.parser/META-INF/MANIFEST.MF 2010-03-15 18:06:05 UTC (rev 196)
@@ -7,8 +7,7 @@
Bundle-Vendor: www.scribble.org
Import-Package: org.osgi.framework;version="1.3.0"
Require-Bundle: org.scribble.core,
- org.scribble.conversation.model,
- org.scribble.protocol.model
+ org.scribble.conversation.model
Bundle-ActivationPolicy: lazy
Scribble-Extensions: org.scribble.conversation.parser.ConversationKeyWordProvider,
org.scribble.conversation.parser.ConversationParserRule,
Deleted: tools/eclipse/trunk/plugins/org.scribble.conversation.parser/src/java/org/scribble/conversation/parser/ProtocolImplementsReferenceParserRule.java
===================================================================
--- tools/eclipse/trunk/plugins/org.scribble.conversation.parser/src/java/org/scribble/conversation/parser/ProtocolImplementsReferenceParserRule.java 2010-03-13 19:12:26 UTC (rev 195)
+++ tools/eclipse/trunk/plugins/org.scribble.conversation.parser/src/java/org/scribble/conversation/parser/ProtocolImplementsReferenceParserRule.java 2010-03-15 18:06:05 UTC (rev 196)
@@ -1,54 +0,0 @@
-/*
- * Copyright 2007-8 Pi4 Technologies Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Change History:
- * 1 Feb 2008 : Initial version created by gary
- */
-package org.scribble.conversation.parser;
-
-import org.scribble.extensions.*;
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelListener;
-import org.scribble.conversation.model.*;
-import org.scribble.protocol.model.*;
-import org.scribble.parser.*;
-
-/**
- * This class provides the parser rule for the Protocol Implements Reference.
- */
-(a)RegistryInfo(extension=ParserRule.class,notation=ConversationNotation.NOTATION_CODE)
-public class ProtocolImplementsReferenceParserRule extends AbstractImplementsReferenceParserRule {
-
- public static final String UNRESOLVED_CONVERSATION_REFS = "UNRESOLVED_CONVERSATION_REFS";
-
- /**
- * The default constructor.
- */
- public ProtocolImplementsReferenceParserRule() {
- }
-
- /**
- * This method returns the notation that should be used for the
- * 'implements' reference.
- *
- * @param context The parser context
- * @param l The model listener
- * @return The notation code
- */
- protected String getNotation(ParserContext context, ModelListener l) {
- return(ProtocolNotation.NOTATION_CODE);
- }
-}
14 years, 1 month