summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2012-07-17 05:50:58 (EDT)
committerManik Kishore2012-07-19 01:37:50 (EDT)
commitcced6558fbc0cc3c42c50c0980dcc9685c2b59f5 (patch)
tree38c264a4b57d3a5e35275eff18b98ed52c052131
parent6bf148dc5a14b4f2def28d3ffd9d14e83ff3888c (diff)
downloadorg.eclipse.stardust.ide-cced6558fbc0cc3c42c50c0980dcc9685c2b59f5.zip
org.eclipse.stardust.ide-cced6558fbc0cc3c42c50c0980dcc9685c2b59f5.tar.gz
org.eclipse.stardust.ide-cced6558fbc0cc3c42c50c0980dcc9685c2b59f5.tar.bz2
CRNT-25176 Create Cross Modeling testcases
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@57706 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/MBFacade.java6
-rw-r--r--model/org.eclipse.stardust.model.xpdl.builder/src/test/java/org/eclipse/stardust/model/xpdl/builder/CrossModelSupportModelBuilderTest.java24
2 files changed, 19 insertions, 11 deletions
diff --git a/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/MBFacade.java b/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/MBFacade.java
index c58c203..801a316 100644
--- a/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/MBFacade.java
+++ b/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/MBFacade.java
@@ -16,6 +16,7 @@ import static org.eclipse.stardust.model.xpdl.builder.BpmModelBuilder.newManualA
import static org.eclipse.stardust.model.xpdl.builder.BpmModelBuilder.newManualTrigger;
import static org.eclipse.stardust.model.xpdl.builder.BpmModelBuilder.newPrimitiveVariable;
import static org.eclipse.stardust.model.xpdl.builder.BpmModelBuilder.newProcessDefinition;
+import static org.eclipse.stardust.model.xpdl.builder.BpmModelBuilder.newRole;
import static org.eclipse.stardust.model.xpdl.builder.BpmModelBuilder.newRouteActivity;
import static org.eclipse.stardust.model.xpdl.builder.BpmModelBuilder.newStructVariable;
import static org.eclipse.stardust.model.xpdl.builder.BpmModelBuilder.newSubProcessActivity;
@@ -220,6 +221,11 @@ public class MBFacade
parentLaneSymbol.getActivitySymbol().add(activitySymbol);
return activitySymbol;
}
+
+ public static void createRole(ModelType model, String roleID, String roleName)
+ {
+ RoleType role = newRole(model).withIdAndName(roleID, roleName).build();
+ }
public static ActivityType createActivity(String modelId,
ProcessDefinitionType processDefinition, String activityType,
diff --git a/model/org.eclipse.stardust.model.xpdl.builder/src/test/java/org/eclipse/stardust/model/xpdl/builder/CrossModelSupportModelBuilderTest.java b/model/org.eclipse.stardust.model.xpdl.builder/src/test/java/org/eclipse/stardust/model/xpdl/builder/CrossModelSupportModelBuilderTest.java
index f8dc667..bc820c9 100644
--- a/model/org.eclipse.stardust.model.xpdl.builder/src/test/java/org/eclipse/stardust/model/xpdl/builder/CrossModelSupportModelBuilderTest.java
+++ b/model/org.eclipse.stardust.model.xpdl.builder/src/test/java/org/eclipse/stardust/model/xpdl/builder/CrossModelSupportModelBuilderTest.java
@@ -22,28 +22,33 @@ import org.eclipse.stardust.model.xpdl.builder.utils.XpdlModelIoUtils;
import org.eclipse.stardust.model.xpdl.builder.utils.XpdlModelUtils;
import org.eclipse.stardust.model.xpdl.carnot.DataType;
import org.eclipse.stardust.model.xpdl.carnot.ModelType;
+import org.eclipse.stardust.model.xpdl.carnot.ProcessDefinitionType;
import org.junit.Before;
import org.junit.Test;
public class CrossModelSupportModelBuilderTest
{
-
- private ModelType model;
+
@Before
- public void initHelloWorldModel()
- {
- // specify transitions explicitly
+ public void initCrossModeling()
+ {
ModelType providerModel = newBpmModel().withName("ProviderModel").build();
ModelType consumerModel = newBpmModel().withName("ConsumerModel").build();
ModelManagementStrategy strategy = new InMemoryModelManagementStrategy();
ModelManagementHelper.getInstance().setModelManagementStrategy(strategy);
strategy.loadModels().add(consumerModel);
strategy.loadModels().add(providerModel);
+ MBFacade.createRole(providerModel, "Adminitrator", "Administrator");
+ MBFacade.createRole(consumerModel, "Adminitrator", "Administrator");
MBFacade.createPrimitiveData(providerModel, "ProvidedPrimitive", "ProvidedPrimitive", ModelerConstants.STRING_PRIMITIVE_DATA_TYPE);
- MBFacade.createTypeDeclaration(providerModel, "ProvidedTypeDeclaration", "ProvidedTypeDeclaration");
- MBFacade.createStructuredData(consumerModel, "ProviderModel", "ProvidedComposite1", "ProvidedComposite1", "ProvidedTypeDeclaration");
+ MBFacade.createTypeDeclaration(providerModel, "ProvidedComposite", "ProvidedComposite");
+ ProcessDefinitionType providedProcess = MBFacade.createProcess(providerModel, "ProvidedProcess", "ProvidedProcess");
+ ProcessDefinitionType consumerProcess = MBFacade.createProcess(consumerModel, "ConsumerProcess", "ConsumerProcess");
+ MBFacade.createStructuredData(consumerModel, "ProviderModel", "ProvidedComposite1", "ProvidedComposite1", "ProvidedComposite");
+ long maxOid = XpdlModelUtils.getMaxUsedOid(consumerModel);
+ MBFacade.createActivity("ConsumerModel", consumerProcess, "Subprocess", null, "ProvidedProcess1", "ProvidedProcess1", null, "ProviderModel:ProvidedProcess", maxOid);
byte[] modelContent = XpdlModelIoUtils.saveModel(consumerModel);
System.out.println(new String(modelContent));
}
@@ -51,10 +56,7 @@ public class CrossModelSupportModelBuilderTest
@Test
public void verifyStringVariable()
{
- /*DataType aString = XpdlModelUtils.findElementById(model.getData(), "Name");
-
- assertThat(aString, not(is(nullValue())));
- assertTrue(aString.isSetElementOid());*/
+ //Todo: Verify things here and in other verify methods
}
}