summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2012-07-17 04:00:30 (EDT)
committerManik Kishore2012-07-19 01:37:48 (EDT)
commitd5b628dbb3e2752f939cd16db06d8b765b39cf7b (patch)
treebba6cb197dcbe9ec8eebd09d1af25cfaafa3516b
parent7a67734a5e4348d1c04578bc70a5c4f2469cc548 (diff)
downloadorg.eclipse.stardust.ide-d5b628dbb3e2752f939cd16db06d8b765b39cf7b.zip
org.eclipse.stardust.ide-d5b628dbb3e2752f939cd16db06d8b765b39cf7b.tar.gz
org.eclipse.stardust.ide-d5b628dbb3e2752f939cd16db06d8b765b39cf7b.tar.bz2
CRNT-25176 Create Cross Modeling testcases
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@57698 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--model/org.eclipse.stardust.model.xpdl.builder/src/test/java/org/eclipse/stardust/model/xpdl/builder/CrossModelSupportModelBuilderTest.java60
1 files changed, 60 insertions, 0 deletions
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
new file mode 100644
index 0000000..f8dc667
--- /dev/null
+++ b/model/org.eclipse.stardust.model.xpdl.builder/src/test/java/org/eclipse/stardust/model/xpdl/builder/CrossModelSupportModelBuilderTest.java
@@ -0,0 +1,60 @@
+package org.eclipse.stardust.model.xpdl.builder;
+
+import static junit.framework.Assert.assertTrue;
+import static org.eclipse.stardust.engine.api.model.PredefinedConstants.ADMINISTRATOR_ROLE;
+import static org.eclipse.stardust.engine.api.model.PredefinedConstants.DEFAULT_CONTEXT;
+import static org.eclipse.stardust.model.xpdl.builder.BpmModelBuilder.newBpmModel;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+
+import org.eclipse.stardust.model.xpdl.builder.BpmActivityDef;
+import org.eclipse.stardust.model.xpdl.builder.BpmActivitySequenceDef;
+import org.eclipse.stardust.model.xpdl.builder.BpmModelDef;
+import org.eclipse.stardust.model.xpdl.builder.BpmProcessDef;
+import org.eclipse.stardust.model.xpdl.builder.strategy.ModelManagementHelper;
+import org.eclipse.stardust.model.xpdl.builder.strategy.ModelManagementStrategy;
+import org.eclipse.stardust.model.xpdl.builder.strategy.InMemoryModelManagementStrategy;
+import org.eclipse.stardust.model.xpdl.builder.utils.MBFacade;
+import org.eclipse.stardust.model.xpdl.builder.utils.ModelerConstants;
+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.junit.Before;
+import org.junit.Test;
+
+
+public class CrossModelSupportModelBuilderTest
+{
+
+ private ModelType model;
+
+ @Before
+ public void initHelloWorldModel()
+ {
+ // specify transitions explicitly
+ 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.createPrimitiveData(providerModel, "ProvidedPrimitive", "ProvidedPrimitive", ModelerConstants.STRING_PRIMITIVE_DATA_TYPE);
+ MBFacade.createTypeDeclaration(providerModel, "ProvidedTypeDeclaration", "ProvidedTypeDeclaration");
+ MBFacade.createStructuredData(consumerModel, "ProviderModel", "ProvidedComposite1", "ProvidedComposite1", "ProvidedTypeDeclaration");
+ byte[] modelContent = XpdlModelIoUtils.saveModel(consumerModel);
+ System.out.println(new String(modelContent));
+ }
+
+ @Test
+ public void verifyStringVariable()
+ {
+ /*DataType aString = XpdlModelUtils.findElementById(model.getData(), "Name");
+
+ assertThat(aString, not(is(nullValue())));
+ assertTrue(aString.isSetElementOid());*/
+ }
+
+}