summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2012-07-17 08:17:24 (EDT)
committer Manik Kishore2012-07-19 01:37:54 (EDT)
commit4b9aaaab03bab3609cc6a5d526eafb9e34d2ca98 (patch)
treee08d17f994142829bc2a048f22db0bbdad7f7d49
parent9b3ad26fcd7bcbb67677b71bf57caed82dbd19d0 (diff)
downloadorg.eclipse.stardust.ide-4b9aaaab03bab3609cc6a5d526eafb9e34d2ca98.zip
org.eclipse.stardust.ide-4b9aaaab03bab3609cc6a5d526eafb9e34d2ca98.tar.gz
org.eclipse.stardust.ide-4b9aaaab03bab3609cc6a5d526eafb9e34d2ca98.tar.bz2
CRNT-25176 Create Cross Modeling testcases
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@57716 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.java57
1 files changed, 34 insertions, 23 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
index fd6a5fa..6f08e4e 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
@@ -1,63 +1,74 @@
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.strategy.ModelManagementHelper;
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.eclipse.stardust.model.xpdl.carnot.ProcessDefinitionType;
+import org.eclipse.stardust.model.xpdl.xpdl2.ExternalPackage;
+import org.eclipse.stardust.model.xpdl.xpdl2.ExternalPackages;
import org.junit.Before;
import org.junit.Test;
-
public class CrossModelSupportModelBuilderTest
{
-
+
+ private InMemoryModelManagementStrategy strategy;
@Before
public void initCrossModeling()
- {
- ModelManagementStrategy strategy = new InMemoryModelManagementStrategy();
+ {
+ strategy = new InMemoryModelManagementStrategy();
ModelManagementHelper.getInstance().setModelManagementStrategy(strategy);
-
+
ModelType providerModel = newBpmModel().withName("ProviderModel").build();
ModelType consumerModel = newBpmModel().withName("ConsumerModel").build();
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, "ProvidedComposite", "ProvidedComposite");
- ProcessDefinitionType providedProcess = MBFacade.createProcess(providerModel, "ProvidedProcess", "ProvidedProcess");
- ProcessDefinitionType consumerProcess = MBFacade.createProcess(consumerModel, "ConsumerProcess", "ConsumerProcess");
- MBFacade.createStructuredData(consumerModel, "ProviderModel", "ProvidedComposite1", "ProvidedComposite1", "ProvidedComposite");
+ MBFacade.createPrimitiveData(providerModel, "ProvidedPrimitive",
+ "ProvidedPrimitive", ModelerConstants.STRING_PRIMITIVE_DATA_TYPE);
+ 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);
+ MBFacade.createActivity("ConsumerModel", consumerProcess, "Subprocess", null,
+ "ProvidedProcess1", "ProvidedProcess1", null,
+ "ProviderModel:ProvidedProcess", maxOid);
byte[] modelContent = XpdlModelIoUtils.saveModel(consumerModel);
System.out.println(new String(modelContent));
}
@Test
- public void verifyStringVariable()
+ public void verifyExternalPackagesForSingleConnection()
{
- //Todo: Verify things here and in other verify methods
+ ModelType model = strategy.loadModel("ConsumerModel");
+
+ ExternalPackages externalPackages = model.getExternalPackages();
+ assertThat(externalPackages, not(is(nullValue())));
+ assertThat(externalPackages.getExternalPackage().size(), is(1));
+
+ ExternalPackage externalPackage = externalPackages.getExternalPackage().get(0);
+ assertThat(externalPackage.getHref(), is("ProviderModel"));
+ assertThat(externalPackage.getId(), is("ProviderModel"));
+ assertThat(externalPackage.getName(), is("ProviderModel"));
}
+
+
}