diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-12-05 00:48:31 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-12-05 00:48:31 +0000 |
commit | f44c07576a61f6f4915ea8fd2aa5af9fee71745f (patch) | |
tree | da023390d4bb97f353cdff9e6ca11a3f2eb9236b /java/sca/itest/conversations/src/test | |
parent | 10a9f2e5c0be26d6a44f1f90b677b9c5b7f985a9 (diff) |
Convert, clean and bring up a set of itests
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@723537 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/itest/conversations/src/test')
6 files changed, 389 insertions, 314 deletions
diff --git a/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationIdTestCase.java b/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationIdTestCase.java index 3e750bdd1e..e64a9acbe2 100644 --- a/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationIdTestCase.java +++ b/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationIdTestCase.java @@ -19,8 +19,10 @@ package org.apache.tuscany.sca.itest.conversational; - -import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.apache.tuscany.sca.node.Contribution; +import org.apache.tuscany.sca.node.ContributionLocationHelper; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -28,25 +30,25 @@ import org.junit.Test; public class ConversationIdTestCase { - private SCADomain domain; + private Node node; @Before public void setUp() throws Exception { - domain = SCADomain.newInstance("conversationId.composite"); - + String location = ContributionLocationHelper.getContributionLocation("conversationId.composite"); + node = NodeFactory.newInstance().createNode("conversationId.composite", new Contribution("c1", location)); + node.start(); } @After public void tearDown() throws Exception { - if (domain != null) { - domain.close(); + if (node != null) { + node.stop(); } } @Test public void testConversationId() { - ConversationIdService service = - domain.getService(ConversationIdService.class, "ConversationIdComponent"); + ConversationIdService service = node.getService(ConversationIdService.class, "ConversationIdComponent"); Assert.assertNotNull(service.getCIDField()); Assert.assertNotNull(service.getCIDSetter()); } diff --git a/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationLifetimeTestCase.java b/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationLifetimeTestCase.java index 326a833a42..2b1aea3ff3 100644 --- a/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationLifetimeTestCase.java +++ b/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationLifetimeTestCase.java @@ -19,25 +19,30 @@ package org.apache.tuscany.sca.itest.conversational; -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.junit.After; +import org.apache.tuscany.sca.node.Contribution; +import org.apache.tuscany.sca.node.ContributionLocationHelper; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; +import org.junit.AfterClass; import org.junit.Assert; -import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; public class ConversationLifetimeTestCase { - private SCADomain domain; + private static Node node; - @Before - public void setUp() throws Exception { - domain = SCADomain.newInstance("conversationLifetime.composite"); + @BeforeClass + public static void setUp() throws Exception { + String location = ContributionLocationHelper.getContributionLocation("conversationLifetime.composite"); + node = NodeFactory.newInstance().createNode("conversationLifetime.composite", new Contribution("c1", location)); + node.start(); } - @After - public void tearDown() throws Exception { - if (domain != null) { - domain.close(); + @AfterClass + public static void tearDown() throws Exception { + if (node != null) { + node.stop(); } } @@ -64,7 +69,7 @@ public class ConversationLifetimeTestCase { */ @Test public void getConversationID() { - CService service = domain.getService(CService.class, "ConversationalCComponent"); + CService service = node.getService(CService.class, "ConversationalCComponent"); service.getState(); Assert.assertNull(service.getConversationID()); } @@ -76,12 +81,12 @@ public class ConversationLifetimeTestCase { @Test public void getConversationID2() { String userProvidedID = "A conversation ID"; - CService service = domain.getService(CService.class, "ConversationalCComponent"); + CService service = node.getService(CService.class, "ConversationalCComponent"); service.setConversationID(userProvidedID); service.getState(); Assert.assertEquals(service.getConversationID(), userProvidedID); } - + /** * Whether the conversation ID is chosen by the user or is generated by the system, the client * may access the conversation ID by calling getConversationID() on the current conversation object. @@ -89,13 +94,13 @@ public class ConversationLifetimeTestCase { */ @Test public void getConversationID3() { - String userProvidedID = "A conversation ID"; - CService service = domain.getService(CService.class, "ConversationalCComponent"); + String userProvidedID = "A conversation ID 3"; + CService service = node.getService(CService.class, "ConversationalCComponent"); service.setConversationID(userProvidedID); service.getState(); Assert.assertEquals(service.getConversationObjectConversationId(), userProvidedID); } - + /** * Whether the conversation ID is chosen by the user or is generated by the system, the client * may access the conversation ID by calling getConversationID() on the current conversation object. @@ -103,11 +108,11 @@ public class ConversationLifetimeTestCase { */ @Test public void getConversationID4() { - CService service = domain.getService(CService.class, "ConversationalCComponent"); + CService service = node.getService(CService.class, "ConversationalCComponent"); service.getState(); Assert.assertNotNull(service.getConversationObjectConversationId()); - } - + } + /** * Java Common Annotations and APIs 1.00 Specification line 494-495 Verify: * If a method is invoked on a service reference after an @@ -116,7 +121,7 @@ public class ConversationLifetimeTestCase { */ @Test public void implicitStartNewConversationAfterEnd() { - CService service = domain.getService(CService.class, "ConversationalCComponent"); + CService service = node.getService(CService.class, "ConversationalCComponent"); service.getState(); Object firstID = service.getConversationObjectConversationId(); service.endConversationViaAnnotatedMethod(); @@ -132,7 +137,7 @@ public class ConversationLifetimeTestCase { */ @Test public void implicitStartNewConversationAfterEnd2() { - CService service = domain.getService(CService.class, "ConversationalCComponent"); + CService service = node.getService(CService.class, "ConversationalCComponent"); service.getState(); Object firstID = service.getConversationObjectConversationId(); service.endConversation(); @@ -148,12 +153,12 @@ public class ConversationLifetimeTestCase { */ @Test public void nullConversationIDAfterEndConversation() { - CService service = domain.getService(CService.class, "ConversationalCComponent"); + CService service = node.getService(CService.class, "ConversationalCComponent"); service.getState(); service.endConversationViaAnnotatedMethod(); Assert.assertNull(service.getConversationObjectConversationId()); } - + /** * Java Common Annotations and APIs 1.00 Specification line 495-497 Verify: * If ServiceReference.getConversationID() is called after the @@ -162,7 +167,7 @@ public class ConversationLifetimeTestCase { */ @Test public void nullConversationIDAfterEndConversation1a() { - CService service = domain.getService(CService.class, "ConversationalCComponent"); + CService service = node.getService(CService.class, "ConversationalCComponent"); service.setConversationID("User provided ID"); service.getState(); service.endConversationViaAnnotatedMethod(); @@ -178,12 +183,12 @@ public class ConversationLifetimeTestCase { */ @Test public void nullConversationIDAfterEndConversation2() { - CService service = domain.getService(CService.class, "ConversationalCComponent"); + CService service = node.getService(CService.class, "ConversationalCComponent"); service.getState(); service.endConversation(); Assert.assertNull(service.getConversationObjectConversationId()); } - + /** * Java Common Annotations and APIs 1.00 Specification line 495-497 Verify: If * ServiceReference.getConversationID() is called after the @@ -193,7 +198,7 @@ public class ConversationLifetimeTestCase { */ @Test public void nullConversationIDAfterEndConversation2a() { - CService service = domain.getService(CService.class, "ConversationalCComponent"); + CService service = node.getService(CService.class, "ConversationalCComponent"); service.setConversationID("User provided ID"); service.getState(); service.endConversation(); diff --git a/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationUniqueIdTestCase.java b/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationUniqueIdTestCase.java index 431962221a..f9bb69aa30 100644 --- a/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationUniqueIdTestCase.java +++ b/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationUniqueIdTestCase.java @@ -19,11 +19,15 @@ package org.apache.tuscany.sca.itest.conversational; -import org.apache.tuscany.sca.host.embedded.SCADomain; import org.apache.tuscany.sca.itest.TestResult; +import org.apache.tuscany.sca.node.Contribution; +import org.apache.tuscany.sca.node.ContributionLocationHelper; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; import org.junit.After; import org.junit.Assert; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; /** @@ -31,29 +35,32 @@ import org.junit.Test; */ public class ConversationUniqueIdTestCase { - private SCADomain domain; + private Node node; @Before public void setUp() throws Exception { - domain = SCADomain.newInstance("ConversationUniqueId.composite"); + String location = ContributionLocationHelper.getContributionLocation("ConversationUniqueId.composite"); + node = NodeFactory.newInstance().createNode("ConversationUniqueId.composite", new Contribution("c1", location)); + node.start(); } @After public void tearDown() throws Exception { - if (domain != null) { - domain.close(); + if (node != null) { + node.stop(); } } + @Ignore("I'm seeing NPE in GammaImpl.hasNext()") @Test public void testConversationUniqueId() { - Alpha alpha = domain.getService(Alpha.class, "Alpha"); + Alpha alpha = node.getService(Alpha.class, "Alpha"); int numConversations = 3; - - for(int i = 0; i < numConversations; ++i) { + + for (int i = 0; i < numConversations; ++i) { alpha.run(5); } - + // Wait for the conversations to complete while (TestResult.getCompleted() < numConversations) { try { @@ -61,9 +68,9 @@ public class ConversationUniqueIdTestCase { } catch (InterruptedException e) { } } - + Assert.assertEquals(TestResult.results.size(), numConversations); - for(Boolean value : TestResult.results.values()) { + for (Boolean value : TestResult.results.values()) { Assert.assertTrue(value); } } diff --git a/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalAgeTestCase.java b/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalAgeTestCase.java index cc31c77873..58afba0d10 100644 --- a/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalAgeTestCase.java +++ b/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalAgeTestCase.java @@ -19,29 +19,33 @@ package org.apache.tuscany.sca.itest.conversational; -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.junit.After; +import org.apache.tuscany.sca.node.Contribution; +import org.apache.tuscany.sca.node.ContributionLocationHelper; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; +import org.junit.AfterClass; import org.junit.Assert; -import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.osoa.sca.ConversationEndedException; public class ConversationalAgeTestCase { - private SCADomain domain; - - @Before - public void setUp() throws Exception { - System.setProperty("org.apache.tuscany.sca.core.scope.ConversationalScopeContainer.ReaperInterval", "2"); - domain = SCADomain.newInstance("ConversationAge.composite"); + private static Node node; + @BeforeClass + public static void setUp() throws Exception { + System.setProperty("org.apache.tuscany.sca.core.conversation.ConversationManager.ReaperInterval", "2"); + String location = ContributionLocationHelper.getContributionLocation("ConversationAge.composite"); + node = NodeFactory.newInstance().createNode("ConversationAge.composite", new Contribution("c1", location)); + node.start(); } - @After - public void tearDown() throws Exception { - System.clearProperty("org.apache.tuscany.sca.core.scope.ConversationalScopeContainer.ReaperInterval"); - if (domain != null) { - domain.close(); + @AfterClass + public static void tearDown() throws Exception { + System.clearProperty("org.apache.tuscany.sca.core.conversation.ConversationManager.ReaperInterval"); + if (node != null) { + node.stop(); } } @@ -49,7 +53,7 @@ public class ConversationalAgeTestCase { public void testMaxAge() throws InterruptedException { ConversationalService conversationalService = - domain.getService(ConversationalService.class, "ConversationAgeComponent"); + node.getService(ConversationalService.class, "ConversationAgeComponent"); Assert.assertEquals(0, conversationalService.retrieveCount()); conversationalService.initializeCount(42); @@ -67,7 +71,7 @@ public class ConversationalAgeTestCase { public void testAgeExpired() throws InterruptedException { ConversationalService conversationalService = - domain.getService(ConversationalService.class, "ConversationAgeComponent"); + node.getService(ConversationalService.class, "ConversationAgeComponent"); Assert.assertEquals(0, conversationalService.retrieveCount()); conversationalService.initializeCount(42); @@ -86,7 +90,7 @@ public class ConversationalAgeTestCase { public void testMaxIdle() throws InterruptedException { ConversationalService conversationalService = - domain.getService(ConversationalService.class, "ConversationIdleComponent"); + node.getService(ConversationalService.class, "ConversationIdleComponent"); Assert.assertEquals(0, conversationalService.retrieveCount()); conversationalService.initializeCount(42); diff --git a/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalJ2SETestCase.java b/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalJ2SETestCase.java index 8480e04028..ee1bf84fc4 100644 --- a/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalJ2SETestCase.java +++ b/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalJ2SETestCase.java @@ -19,7 +19,10 @@ package org.apache.tuscany.sca.itest.conversational; -import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.apache.tuscany.sca.node.Contribution; +import org.apache.tuscany.sca.node.ContributionLocationHelper; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -27,25 +30,26 @@ import org.junit.Test; public class ConversationalJ2SETestCase { - private SCADomain domain; + private Node node; @Before public void setUp() throws Exception { - domain = SCADomain.newInstance("conversational.composite"); - + String location = ContributionLocationHelper.getContributionLocation("conversational.composite"); + node = NodeFactory.newInstance().createNode("conversational.composite", new Contribution("c1", location)); + node.start(); } @After public void tearDown() throws Exception { - if (domain != null) { - domain.close(); + if (node != null) { + node.stop(); } } @Test public void testStatefulConversation() { ConversationalService conversationalService = - domain.getService(ConversationalService.class, "ConversationalServiceStateful"); + node.getService(ConversationalService.class, "ConversationalServiceStateful"); conversationalService.initializeCount(1); Assert.assertEquals(1, conversationalService.retrieveCount()); @@ -66,7 +70,7 @@ public class ConversationalJ2SETestCase { @Test public void testStatelessConversation() { ConversationalService conversationalService = - domain.getService(ConversationalService.class, "ConversationalServiceStateless"); + node.getService(ConversationalService.class, "ConversationalServiceStateless"); conversationalService.initializeCount(1); Assert.assertEquals(1, conversationalService.retrieveCount()); diff --git a/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalTestCase.java b/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalTestCase.java index da359bc296..56bca7ac78 100644 --- a/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalTestCase.java +++ b/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalTestCase.java @@ -19,9 +19,6 @@ package org.apache.tuscany.sca.itest.conversational;
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulImpl;
import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulNonConversationalCallbackImpl;
import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatelessImpl;
@@ -29,63 +26,71 @@ import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceReq import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulImpl;
import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulNonConversationalCallbackImpl;
import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatelessImpl;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
import org.junit.AfterClass;
+import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
public class ConversationalTestCase {
- private static SCADomain domain;
+ private static Node node;
private static ConversationalClient conversationalStatelessClientStatelessService;
private static ConversationalClient conversationalStatelessClientStatefulService;
private static ConversationalClient conversationalStatefulClientStatelessService;
- private static ConversationalClient conversationalStatefulClientStatefulService;
+ private static ConversationalClient conversationalStatefulClientStatefulService;
private static ConversationalClient conversationalStatelessClientRequestService;
- private static ConversationalClient conversationalStatefulClientNonConversationalCallbackStatelessService;
+ private static ConversationalClient conversationalStatefulClientNonConversationalCallbackStatelessService;
@BeforeClass
public static void setUp() throws Exception {
- try {
- domain = SCADomain.newInstance("conversational.composite");
-
- conversationalStatelessClientStatelessService = domain.getService(ConversationalClient.class,
- "ConversationalStatelessClientStatelessService");
-
- conversationalStatelessClientStatefulService = domain.getService(ConversationalClient.class,
- "ConversationalStatelessClientStatefulService");
-
- conversationalStatefulClientStatelessService = domain.getService(ConversationalClient.class,
- "ConversationalStatefulClientStatelessService");
-
- conversationalStatefulClientStatefulService = domain.getService(ConversationalClient.class,
- "ConversationalStatefulClientStatefulService");
- conversationalStatelessClientRequestService = domain.getService(ConversationalClient.class,
- "ConversationalStatelessClientRequestService");
- conversationalStatefulClientNonConversationalCallbackStatelessService = domain.getService(ConversationalClient.class,
- "ConversationalStatefulClientNonConversationalCallbackStatefulService");
-
- } catch(Exception ex) {
- System.err.println(ex.toString());
- }
-
+ try {
+ String location = ContributionLocationHelper.getContributionLocation("conversational.composite");
+ node = NodeFactory.newInstance().createNode("conversational.composite", new Contribution("c1", location));
+ node.start();
+
+ conversationalStatelessClientStatelessService =
+ node.getService(ConversationalClient.class, "ConversationalStatelessClientStatelessService");
+
+ conversationalStatelessClientStatefulService =
+ node.getService(ConversationalClient.class, "ConversationalStatelessClientStatefulService");
+
+ conversationalStatefulClientStatelessService =
+ node.getService(ConversationalClient.class, "ConversationalStatefulClientStatelessService");
+
+ conversationalStatefulClientStatefulService =
+ node.getService(ConversationalClient.class, "ConversationalStatefulClientStatefulService");
+ conversationalStatelessClientRequestService =
+ node.getService(ConversationalClient.class, "ConversationalStatelessClientRequestService");
+ conversationalStatefulClientNonConversationalCallbackStatelessService =
+ node.getService(ConversationalClient.class,
+ "ConversationalStatefulClientNonConversationalCallbackStatefulService");
+
+ } catch (Exception ex) {
+ System.err.println(ex.toString());
+ }
+
}
@AfterClass
public static void tearDown() throws Exception {
- domain.close();
+ node.stop();
}
-
+
private void resetCallStack() {
-
+
// reset the place where we record the sequence of calls passing
// through each component instance
ConversationalServiceStatelessImpl.calls = new StringBuffer();
- ConversationalServiceStatefulImpl.calls = new StringBuffer();
- ConversationalClientStatelessImpl.calls = new StringBuffer();
- ConversationalClientStatefulImpl.calls = new StringBuffer();
+ ConversationalServiceStatefulImpl.calls = new StringBuffer();
+ ConversationalClientStatelessImpl.calls = new StringBuffer();
+ ConversationalClientStatefulImpl.calls = new StringBuffer();
ConversationalClientStatefulNonConversationalCallbackImpl.calls = new StringBuffer();
ConversationalServiceStatefulNonConversationalCallbackImpl.calls = new StringBuffer();
-
+
}
// stateless client stateful service tests
@@ -94,91 +99,96 @@ public class ConversationalTestCase { public void testStatelessStatefulConversationFromInjectedReference() {
int count = conversationalStatelessClientStatefulService.runConversationFromInjectedReference();
Assert.assertEquals(2, count);
- }
-
+ }
+
@Test
public void testStatelessStatefulConversationFromInjectedReference2() {
int count = conversationalStatelessClientStatefulService.runConversationFromInjectedReference2();
Assert.assertEquals(2, count);
- }
-
+ }
+
@Test
public void testStatelessStatefulConversationFromServiceReference() {
int count = conversationalStatelessClientStatefulService.runConversationFromServiceReference();
Assert.assertEquals(2, count);
- }
-
+ }
+
@Test
public void testStatelessStatefulConversationWithUserDefinedConversationId() {
int count = conversationalStatelessClientStatefulService.runConversationWithUserDefinedConversationId();
Assert.assertEquals(2, count);
- }
-
+ }
+
@Test
public void testStatelessStatefulConversationCheckUserDefinedConversationId() {
- String conversationId = conversationalStatelessClientStatefulService.runConversationCheckUserDefinedConversationId();
+ String conversationId =
+ conversationalStatelessClientStatefulService.runConversationCheckUserDefinedConversationId();
Assert.assertEquals("MyConversation2", conversationId);
- }
-
+ }
+
@Test
public void testStatelessStatefulConversationCheckingScope() {
resetCallStack();
conversationalStatelessClientStatefulService.runConversationCheckingScope();
- Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,destroy,",
+ Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,destroy,",
ConversationalServiceStatefulImpl.calls.toString());
- }
+ }
@Test
public void testStatelessStatefulConversationWithCallback() {
resetCallStack();
int count = conversationalStatelessClientStatefulService.runConversationWithCallback();
Assert.assertEquals(0, count);
-
- Assert.assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,destroy,",
- ConversationalClientStatelessImpl.calls.toString());
- }
-
+
+ Assert
+ .assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,destroy,",
+ ConversationalClientStatelessImpl.calls.toString());
+ }
+
//@Test
public void testStatelessStatefulConversationHavingPassedReference() {
int count = conversationalStatelessClientStatefulService.runConversationHavingPassedReference();
Assert.assertEquals(3, count);
- }
-
+ }
+
@Test
public void testStatelessStatefulConversationBusinessException() {
String message = conversationalStatelessClientStatefulService.runConversationBusinessException();
Assert.assertEquals("Business Exception", message);
- }
-
+ }
+
@Test
public void testStatelessStatefulConversationBusinessExceptionCallback() {
String message = conversationalStatelessClientStatefulService.runConversationBusinessExceptionCallback();
Assert.assertEquals("Business Exception", message);
- }
-
+ }
+
@Test
public void testStatelessStatefulConversationCallingEndedConversation() {
int count = conversationalStatelessClientStatefulService.runConversationCallingEndedConversation();
Assert.assertEquals(0, count);
- }
-
+ }
+
@Test
public void testStatelessStatefulConversationCallingEndedConversationCallback() {
int count = conversationalStatelessClientStatefulService.runConversationCallingEndedConversationCallback();
Assert.assertEquals(0, count);
- }
-
+ }
+
@Test
public void testStatelessStatefulConversationCallingEndedConversationCheckConversationId() {
- String id = conversationalStatelessClientStatefulService.runConversationCallingEndedConversationCheckConversationId();
+ String id =
+ conversationalStatelessClientStatefulService.runConversationCallingEndedConversationCheckConversationId();
Assert.assertEquals(null, id);
- }
-
+ }
+
//@Test
public void testStatelessStatefulConversationCallingEndedConversationCallbackCheckConversationId() {
- String id = conversationalStatelessClientStatefulService.runConversationCallingEndedConversationCallbackCheckConversationId();
+ String id =
+ conversationalStatelessClientStatefulService
+ .runConversationCallingEndedConversationCallbackCheckConversationId();
Assert.assertEquals(null, id);
- }
+ }
// stateless client stateless service tests
// ========================================
@@ -186,77 +196,85 @@ public class ConversationalTestCase { public void testStatelessStatelessConversationFromInjectedReference() {
int count = conversationalStatelessClientStatelessService.runConversationFromInjectedReference();
Assert.assertEquals(2, count);
- }
+ }
@Test
public void testStatelessStatelessConversationFromInjectedReference2() {
int count = conversationalStatelessClientStatelessService.runConversationFromInjectedReference2();
Assert.assertEquals(2, count);
- }
-
+ }
+
@Test
public void testStatelessStatelessConversationFromServiceReference() {
int count = conversationalStatelessClientStatelessService.runConversationFromServiceReference();
Assert.assertEquals(2, count);
- }
-
+ }
+
@Test
public void testStatelessStatelessConversationWithUserDefinedConversationId() {
int count = conversationalStatelessClientStatelessService.runConversationWithUserDefinedConversationId();
Assert.assertEquals(2, count);
- }
+ }
+
@Test
public void testStatelessStatelessConversationCheckUserDefinedConversationId() {
- String conversationId = conversationalStatelessClientStatelessService.runConversationCheckUserDefinedConversationId();
+ String conversationId =
+ conversationalStatelessClientStatelessService.runConversationCheckUserDefinedConversationId();
Assert.assertEquals("MyConversation2", conversationId);
- }
-
+ }
+
@Test
public void testStatelessStatelessConversationCheckingScope() {
resetCallStack();
conversationalStatelessClientStatelessService.runConversationCheckingScope();
- Assert.assertEquals("init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,",
- ConversationalServiceStatelessImpl.calls.toString());
- }
-
+ Assert
+ .assertEquals("init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,",
+ ConversationalServiceStatelessImpl.calls.toString());
+ }
+
@Test
public void testStatelessStatelessConversationWithCallback() {
resetCallStack();
int count = conversationalStatelessClientStatelessService.runConversationWithCallback();
Assert.assertEquals(0, count);
-
- Assert.assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,destroy,",
- ConversationalClientStatelessImpl.calls.toString());
+
+ Assert
+ .assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,destroy,",
+ ConversationalClientStatelessImpl.calls.toString());
}
+
//@Test
public void testStatelessStatelessConversationHavingPassedReference() {
int count = conversationalStatelessClientStatelessService.runConversationHavingPassedReference();
Assert.assertEquals(3, count);
- }
+ }
@Test
public void testStatelessStatelessConversationCallingEndedConversation() {
int count = conversationalStatelessClientStatelessService.runConversationCallingEndedConversation();
Assert.assertEquals(-999, count);
- }
-
+ }
+
@Test
public void testStatelessStatelessConversationCallingEndedConversationCallback() {
int count = conversationalStatelessClientStatelessService.runConversationCallingEndedConversationCallback();
Assert.assertEquals(0, count);
- }
-
+ }
+
@Test
public void testStatelessStatelessConversationCallingEndedConversationCheckConversationId() {
- String id = conversationalStatelessClientStatelessService.runConversationCallingEndedConversationCheckConversationId();
+ String id =
+ conversationalStatelessClientStatelessService.runConversationCallingEndedConversationCheckConversationId();
Assert.assertEquals(null, id);
- }
-
+ }
+
//@Test
public void testStatelessStatelessConversationCallingEndedConversationCallbackCheckConversationId() {
- String id = conversationalStatelessClientStatelessService.runConversationCallingEndedConversationCallbackCheckConversationId();
+ String id =
+ conversationalStatelessClientStatelessService
+ .runConversationCallingEndedConversationCallbackCheckConversationId();
Assert.assertEquals(null, id);
- }
+ }
// stateful client stateful service tests
// ======================================
@@ -264,348 +282,384 @@ public class ConversationalTestCase { public void testStatefulStatefulConversationFromInjectedReference() {
int count = conversationalStatefulClientStatefulService.runConversationFromInjectedReference();
Assert.assertEquals(2, count);
- }
-
+ }
+
@Test
public void testStatefulStatefulConversationFromInjectedReference2() {
int count = conversationalStatefulClientStatefulService.runConversationFromInjectedReference2();
Assert.assertEquals(2, count);
- }
-
+ }
+
@Test
public void testStatefulStatefulConversationFromServiceReference() {
int count = conversationalStatefulClientStatefulService.runConversationFromServiceReference();
Assert.assertEquals(2, count);
- }
-
+ }
+
@Test
public void testStatefulStatefulConversationWithUserDefinedConversationId() {
int count = conversationalStatefulClientStatefulService.runConversationWithUserDefinedConversationId();
Assert.assertEquals(2, count);
- }
-
+ }
+
@Test
public void testStatefulStatefulConversationCheckUserDefinedConversationId() {
- String conversationId = conversationalStatefulClientStatefulService.runConversationCheckUserDefinedConversationId();
+ String conversationId =
+ conversationalStatefulClientStatefulService.runConversationCheckUserDefinedConversationId();
Assert.assertEquals("MyConversation2", conversationId);
- }
-
+ }
+
@Test
public void testStatefulStatefulConversationCheckingScope() {
resetCallStack();
conversationalStatefulClientStatefulService.runConversationCheckingScope();
- Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,destroy,",
+ Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,destroy,",
ConversationalServiceStatefulImpl.calls.toString());
- }
+ }
@Test
public void testStatefulStatefulConversationWithCallback() {
resetCallStack();
int count = conversationalStatefulClientStatefulService.runConversationWithCallback();
Assert.assertEquals(4, count);
-
- Assert.assertEquals("init,runConversationWithCallback,initializeCount,incrementCount,retrieveCount,endConversation,destroy,",
- ConversationalClientStatefulImpl.calls.toString());
- }
-
+
+ Assert
+ .assertEquals("init,runConversationWithCallback,initializeCount,incrementCount,retrieveCount,endConversation,destroy,",
+ ConversationalClientStatefulImpl.calls.toString());
+ }
+
//@Test
public void testStatefulStatefulConversationHavingPassedReference() {
int count = conversationalStatefulClientStatefulService.runConversationHavingPassedReference();
Assert.assertEquals(3, count);
- }
-
+ }
+
@Test
public void testStatefulStatefulConversationCallingEndedConversation() {
int count = conversationalStatefulClientStatefulService.runConversationCallingEndedConversation();
Assert.assertEquals(0, count);
- }
+ }
@Test
public void testStatefulStatefulConversationCallingEndedConversationCallback() {
int count = conversationalStatefulClientStatefulService.runConversationCallingEndedConversationCallback();
Assert.assertEquals(0, count);
- }
-
+ }
+
@Test
public void testStatefulStatefulConversationCallingEndedConversationCheckConversationId() {
- String id = conversationalStatefulClientStatefulService.runConversationCallingEndedConversationCheckConversationId();
+ String id =
+ conversationalStatefulClientStatefulService.runConversationCallingEndedConversationCheckConversationId();
Assert.assertEquals(null, id);
- }
-
+ }
+
@Test
public void testStatefulStatefulConversationCallingEndedConversationCallbackCheckConversationId() {
- String id = conversationalStatefulClientStatefulService.runConversationCallingEndedConversationCallbackCheckConversationId();
+ String id =
+ conversationalStatefulClientStatefulService
+ .runConversationCallingEndedConversationCallbackCheckConversationId();
Assert.assertEquals(null, id);
- }
-
+ }
+
// stateful client stateless service tests
// =======================================
@Test
public void testStatefulStatelessConversationFromInjectedReference() {
int count = conversationalStatefulClientStatelessService.runConversationFromInjectedReference();
Assert.assertEquals(2, count);
- }
-
+ }
+
@Test
public void testStatefulStatelessConversationFromInjectedReference2() {
int count = conversationalStatefulClientStatelessService.runConversationFromInjectedReference2();
Assert.assertEquals(2, count);
- }
-
+ }
+
@Test
public void testStatefulStatelessConversationFromServiceReference() {
int count = conversationalStatefulClientStatelessService.runConversationFromServiceReference();
Assert.assertEquals(2, count);
- }
-
+ }
+
@Test
public void testStatefulStatelessConversationWithUserDefinedConversationId() {
int count = conversationalStatefulClientStatelessService.runConversationWithUserDefinedConversationId();
Assert.assertEquals(2, count);
- }
+ }
@Test
public void testStatefulStatelessConversationCheckUserDefinedConversationId() {
- String conversationId = conversationalStatefulClientStatelessService.runConversationCheckUserDefinedConversationId();
+ String conversationId =
+ conversationalStatefulClientStatelessService.runConversationCheckUserDefinedConversationId();
Assert.assertEquals("MyConversation2", conversationId);
- }
-
+ }
+
@Test
public void testStatefulStatelessConversationCheckingScope() {
resetCallStack();
conversationalStatefulClientStatelessService.runConversationCheckingScope();
- Assert.assertEquals("init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,",
- ConversationalServiceStatelessImpl.calls.toString());
- }
+ Assert
+ .assertEquals("init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,",
+ ConversationalServiceStatelessImpl.calls.toString());
+ }
@Test
public void testStatefulStatelessConversationWithCallback() {
resetCallStack();
int count = conversationalStatefulClientStatelessService.runConversationWithCallback();
Assert.assertEquals(4, count);
-
- Assert.assertEquals("init,runConversationWithCallback,initializeCount,incrementCount,retrieveCount,endConversation,destroy,",
- ConversationalClientStatefulImpl.calls.toString());
- }
-
+
+ Assert
+ .assertEquals("init,runConversationWithCallback,initializeCount,incrementCount,retrieveCount,endConversation,destroy,",
+ ConversationalClientStatefulImpl.calls.toString());
+ }
+
//@Test
public void testStatefulStatelessConversationHavingPassedReference() {
int count = conversationalStatefulClientStatelessService.runConversationHavingPassedReference();
Assert.assertEquals(3, count);
- }
-
+ }
+
@Test
public void testStatefulStatelessConversationCallingEndedConversation() {
int count = conversationalStatefulClientStatelessService.runConversationCallingEndedConversation();
Assert.assertEquals(-999, count);
- }
-
+ }
+
@Test
public void testStatefulStatelessConversationCallingEndedConversationCallback() {
int count = conversationalStatefulClientStatelessService.runConversationCallingEndedConversationCallback();
Assert.assertEquals(0, count);
- }
-
+ }
+
@Test
public void testStatefulStatelessConversationCallingEndedConversationCheckConversationId() {
- String id = conversationalStatefulClientStatelessService.runConversationCallingEndedConversationCheckConversationId();
+ String id =
+ conversationalStatefulClientStatelessService.runConversationCallingEndedConversationCheckConversationId();
Assert.assertEquals(null, id);
- }
-
+ }
+
@Test
public void testStatefulStatelessConversationCallingEndedConversationCallbackCheckConversationId() {
- String id = conversationalStatefulClientStatelessService.runConversationCallingEndedConversationCallbackCheckConversationId();
+ String id =
+ conversationalStatefulClientStatelessService
+ .runConversationCallingEndedConversationCallbackCheckConversationId();
Assert.assertEquals(null, id);
- }
-
+ }
+
// stateless client request scope service tests
// ============================================
@Test
public void testStatelessRequestConversationFromInjectedReference() {
int count = conversationalStatelessClientRequestService.runConversationFromInjectedReference();
Assert.assertEquals(2, count);
- }
-
+ }
+
@Test
public void testStatelessRequestConversationFromInjectedReference2() {
int count = conversationalStatelessClientRequestService.runConversationFromInjectedReference2();
Assert.assertEquals(1, count);
- }
-
+ }
+
@Test
public void testStatelessRequestConversationFromServiceReference() {
int count = conversationalStatelessClientRequestService.runConversationFromServiceReference();
Assert.assertEquals(2, count);
- }
-
+ }
+
@Test
public void testStatelessRequestConversationWithUserDefinedConversationId() {
int count = conversationalStatelessClientRequestService.runConversationWithUserDefinedConversationId();
Assert.assertEquals(2, count);
- }
-
+ }
+
//@Test
public void testStatelessRequestConversationCheckUserDefinedConversationId() {
- String conversationId = conversationalStatelessClientRequestService.runConversationCheckUserDefinedConversationId();
+ String conversationId =
+ conversationalStatelessClientRequestService.runConversationCheckUserDefinedConversationId();
Assert.assertEquals("MyConversation2", conversationId);
- }
-
+ }
+
@Test
public void testStatelessRequestConversationCheckingScope() {
resetCallStack();
- ConversationalServiceRequestImpl.calls = new StringBuffer();
- conversationalStatelessClientRequestService.runConversationCheckingScope();
- Assert.assertEquals("initializeCount,incrementCount,retrieveCount,endConversation,",
- ConversationalServiceRequestImpl.calls.toString());
- }
+ ConversationalServiceRequestImpl.calls = new StringBuffer();
+ conversationalStatelessClientRequestService.runConversationCheckingScope();
+ Assert.assertEquals("initializeCount,incrementCount,retrieveCount,endConversation,",
+ ConversationalServiceRequestImpl.calls.toString());
+ }
@Test
public void testStatelessRequestConversationWithCallback() {
resetCallStack();
- ConversationalClientStatelessImpl.calls = new StringBuffer();
+ ConversationalClientStatelessImpl.calls = new StringBuffer();
int count = conversationalStatelessClientRequestService.runConversationWithCallback();
Assert.assertEquals(0, count);
-
- Assert.assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,destroy,",
- ConversationalClientStatelessImpl.calls.toString());
- }
-
+
+ Assert
+ .assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,destroy,",
+ ConversationalClientStatelessImpl.calls.toString());
+ }
+
//@Test
public void testStatelessRequestConversationHavingPassedReference() {
int count = conversationalStatelessClientRequestService.runConversationHavingPassedReference();
Assert.assertEquals(3, count);
- }
-
+ }
+
@Test
public void testStatelessRequestConversationBusinessException() {
String message = conversationalStatelessClientRequestService.runConversationBusinessException();
Assert.assertEquals("Business Exception", message);
- }
-
+ }
+
@Test
public void testStatelessRequestConversationBusinessExceptionCallback() {
String message = conversationalStatelessClientRequestService.runConversationBusinessExceptionCallback();
Assert.assertEquals("Business Exception", message);
- }
-
+ }
+
@Test
public void testStatelessRequestConversationCallingEndedConversation() {
int count = conversationalStatelessClientRequestService.runConversationCallingEndedConversation();
Assert.assertEquals(-999, count);
- }
-
+ }
+
@Test
public void testStatelessRequestConversationCallingEndedConversationCallback() {
int count = conversationalStatelessClientRequestService.runConversationCallingEndedConversationCallback();
Assert.assertEquals(0, count);
- }
-
+ }
+
@Test
public void testStatelessRequestConversationCallingEndedConversationCheckConversationId() {
- String id = conversationalStatelessClientRequestService.runConversationCallingEndedConversationCheckConversationId();
+ String id =
+ conversationalStatelessClientRequestService.runConversationCallingEndedConversationCheckConversationId();
Assert.assertEquals(null, id);
- }
-
+ }
+
//@Test
public void testStatelessRequestConversationCallingEndedConversationCallbackCheckConversationId() {
- String id = conversationalStatelessClientRequestService.runConversationCallingEndedConversationCallbackCheckConversationId();
+ String id =
+ conversationalStatelessClientRequestService
+ .runConversationCallingEndedConversationCallbackCheckConversationId();
Assert.assertEquals(null, id);
- }
-
+ }
+
// stateful client non conversational callback stateful service tests
// ==================================================================
-
+
@Test
public void testStatefulNonConversationalCallbackStatefulConversationFromInjectedReference() {
- int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationFromInjectedReference();
+ int count =
+ conversationalStatefulClientNonConversationalCallbackStatelessService
+ .runConversationFromInjectedReference();
Assert.assertEquals(2, count);
- }
-
+ }
+
@Test
public void testStatefulNonConversationalCallbackStatefulConversationFromInjectedReference2() {
- int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationFromInjectedReference2();
+ int count =
+ conversationalStatefulClientNonConversationalCallbackStatelessService
+ .runConversationFromInjectedReference2();
Assert.assertEquals(2, count);
- }
-
+ }
+
@Test
public void testStatefulNonConversationalCallbackStatefulConversationFromServiceReference() {
- int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationFromServiceReference();
+ int count =
+ conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationFromServiceReference();
Assert.assertEquals(2, count);
- }
-
+ }
+
@Test
public void testStatefulNonConversationalCallbackStatefulConversationWithUserDefinedConversationId() {
- int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationWithUserDefinedConversationId();
+ int count =
+ conversationalStatefulClientNonConversationalCallbackStatelessService
+ .runConversationWithUserDefinedConversationId();
Assert.assertEquals(2, count);
- }
-
+ }
+
@Test
public void testStatefulNonConversationalCallbackStatefulConversationCheckUserDefinedConversationId() {
- String conversationId = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCheckUserDefinedConversationId();
+ String conversationId =
+ conversationalStatefulClientNonConversationalCallbackStatelessService
+ .runConversationCheckUserDefinedConversationId();
Assert.assertEquals("MyConversation2", conversationId);
- }
-
+ }
+
@Test
public void testStatefulNonConversationalCallbackStatefulConversationCheckingScope() {
resetCallStack();
- conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCheckingScope();
- Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,destroy,",
- ConversationalServiceStatefulNonConversationalCallbackImpl.calls.toString());
- }
+ conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCheckingScope();
+ Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,destroy,",
+ ConversationalServiceStatefulNonConversationalCallbackImpl.calls.toString());
+ }
@Test
public void testStatefulNonConversationalCallbackStatefulConversationWithCallback() {
resetCallStack();
int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationWithCallback();
Assert.assertEquals(0, count);
-
- Assert.assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,",
- ConversationalClientStatefulNonConversationalCallbackImpl.calls.toString());
- }
-
+
+ Assert
+ .assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,",
+ ConversationalClientStatefulNonConversationalCallbackImpl.calls.toString());
+ }
+
//@Test
public void testStatefulNonConversationalCallbackStatefulConversationHavingPassedReference() {
- int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationHavingPassedReference();
+ int count =
+ conversationalStatefulClientNonConversationalCallbackStatelessService
+ .runConversationHavingPassedReference();
Assert.assertEquals(0, count);
- }
-
+ }
+
@Test
public void testStatefulNonConversationalCallbackStatefulConversationCallingEndedConversation() {
- int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCallingEndedConversation();
+ int count =
+ conversationalStatefulClientNonConversationalCallbackStatelessService
+ .runConversationCallingEndedConversation();
Assert.assertEquals(0, count);
- }
-
+ }
+
@Test
public void testStatefulNonConversationalCallbackStatefulConversationCallingEndedConversationCallback() {
- int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCallingEndedConversationCallback();
+ int count =
+ conversationalStatefulClientNonConversationalCallbackStatelessService
+ .runConversationCallingEndedConversationCallback();
Assert.assertEquals(0, count);
- }
-
+ }
+
@Test
public void testStatefulNonConversationalCallbackStatefulConversationCallingEndedConversationCheckConversationId() {
- String id = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCallingEndedConversationCheckConversationId();
+ String id =
+ conversationalStatefulClientNonConversationalCallbackStatelessService
+ .runConversationCallingEndedConversationCheckConversationId();
Assert.assertEquals(null, id);
- }
-
+ }
+
@Test
public void testStatefulNonConversationalCallbackStatefulConversationCallingEndedConversationCallbackCheckConversationId() {
- String id = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCallingEndedConversationCallbackCheckConversationId();
+ String id =
+ conversationalStatefulClientNonConversationalCallbackStatelessService
+ .runConversationCallingEndedConversationCallbackCheckConversationId();
Assert.assertEquals("MyConversation3", id);
- }
+ }
private static final String NEW_A_VALUE = "First Instance - TestCode Set state on A";
private static final String NEW_B_VALUE = "First Instance - TestCode Set state on B";
private static final String SECOND_NEW_A_VALUE = "Second Instance - TestCode Set state on A";
private static final String SECOND_NEW_B_VALUE = "Second Instance - TestCode Set state on B";
-
+
@Test
public void testMultipleConversations() {
//////////
// Tests on first instance
//////////
System.out.println("========= First instance tests =========");
- AService aService = domain.getService(AService.class, "ConversationalAComponent");
-
+ AService aService = node.getService(AService.class, "ConversationalAComponent");
+
// Make sure initial values are correct
Assert.assertEquals(Constants.A_INITIAL_VALUE, aService.getState());
Assert.assertEquals(Constants.B_INITIAL_VALUE, aService.getStateOnB());
@@ -613,28 +667,27 @@ public class ConversationalTestCase { // Set some new values
aService.setState(NEW_A_VALUE);
aService.setStateOnB(NEW_B_VALUE);
-
+
// Verify the set worked
Assert.assertEquals(NEW_A_VALUE, aService.getState());
Assert.assertEquals(NEW_B_VALUE, aService.getStateOnB());
-
//////////
// Tests on second instance
//////////
System.out.println("========= Second instance tests =========");
// Do another look up
- AService aService2 = domain.getService(AService.class, "ConversationalAComponent");
+ AService aService2 = node.getService(AService.class, "ConversationalAComponent");
// Make sure initial values are correct on the second instance
Assert.assertEquals(Constants.A_INITIAL_VALUE, aService2.getState());
Assert.assertEquals(Constants.B_INITIAL_VALUE, aService2.getStateOnB());
-
+
// Set some new values on the second instance
aService2.setState(SECOND_NEW_A_VALUE);
aService2.setStateOnB(SECOND_NEW_B_VALUE);
-
+
// Verify the set worked on the second instance
Assert.assertEquals(SECOND_NEW_A_VALUE, aService2.getState());
Assert.assertEquals(SECOND_NEW_B_VALUE, aService2.getStateOnB());
@@ -642,8 +695,8 @@ public class ConversationalTestCase { // Verify the values have not been changed on the first instance
Assert.assertEquals(NEW_A_VALUE, aService.getState());
Assert.assertEquals(NEW_B_VALUE, aService.getStateOnB());
-
+
System.out.println("========= Done instance tests =========");
}
-
+
}
|