diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-03-10 13:14:17 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-03-10 13:14:17 +0000 |
commit | 9fa916cc7665365fb1daf6607f5c758dd4115e8c (patch) | |
tree | e242ab9a9e6779798259db6344f110a56c589a7a /sca-java-2.x/trunk/testing | |
parent | e92daadeffcc15df28bdb20d97920346807915b6 (diff) |
Extend test to prove that node which fires up ws binding can be stopped/started repeatedly
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1080209 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/testing')
-rw-r--r-- | sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldWSDLMergedTestCase.java | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldWSDLMergedTestCase.java b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldWSDLMergedTestCase.java index b79ee7d254..bc69473abe 100644 --- a/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldWSDLMergedTestCase.java +++ b/sca-java-2.x/trunk/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldWSDLMergedTestCase.java @@ -29,16 +29,22 @@ import org.apache.axiom.om.OMText; import org.apache.tuscany.sca.node.Contribution; import org.apache.tuscany.sca.node.Node; import org.apache.tuscany.sca.node.NodeFactory; +import org.apache.tuscany.sca.node.impl.NodeImpl; +import org.junit.Ignore; public class HelloWorldWSDLMergedTestCase extends TestCase { - private Node node; + private NodeFactory nodeFactory; + private NodeImpl node; private HelloWorldOM helloWorld; @Override protected void setUp() throws Exception { String contribution = "target/classes"; - node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.composite", new Contribution("test", contribution)); + nodeFactory = NodeFactory.newInstance(); + // have to set this to stop the node factory killing itself when we stop and re-start the node + nodeFactory.setAutoDestroy(false); + node = (NodeImpl)nodeFactory.createNode("org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.composite", new Contribution("test", contribution)); node.start(); helloWorld = node.getService(HelloWorldOM.class, "HelloWorldWSDLMergedComponent"); } @@ -52,7 +58,26 @@ public class HelloWorldWSDLMergedTestCase extends TestCase { OMElement responseOM = helloWorld.getGreetings(requestOM); OMElement child = (OMElement)responseOM.getFirstElement(); Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText()); - } + } + + @Ignore + public void testHelloWorldRepeating() throws Exception { + for (int i = 0; i < 2; i++){ + OMFactory fac = OMAbstractFactory.getOMFactory(); + OMElement requestOM = fac.createOMElement("getGreetings", "http://helloworld-om", "helloworld"); + OMElement parmE = fac.createOMElement("name", "http://helloworld-om", "helloworld"); + requestOM.addChild(parmE); + parmE.addChild(fac.createOMText("petra")); + OMElement responseOM = helloWorld.getGreetings(requestOM); + OMElement child = (OMElement)responseOM.getFirstElement(); + Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText()); + + node.stop(); + node.start(); + + helloWorld = node.getService(HelloWorldOM.class, "HelloWorldWSDLMergedComponent"); + } + } @Override protected void tearDown() throws Exception { |