diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-01-31 08:59:12 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-01-31 08:59:12 +0000 |
commit | c7b50e47dd1dd51a4c1c83f92cd28845853bef90 (patch) | |
tree | a5fe80ad04647285f70eeb6944f1c144e32d46c7 /java/sca/itest/jms/src/test | |
parent | 3a5130c837a8483e99ec27875eb78dbde85815f3 (diff) |
Moving iTests that are not part of the main build to contrib
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@739528 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/itest/jms/src/test')
11 files changed, 0 insertions, 804 deletions
diff --git a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/DefaultsTestCase.java b/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/DefaultsTestCase.java deleted file mode 100644 index dca9386637..0000000000 --- a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/DefaultsTestCase.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.jms; - -import static org.junit.Assert.assertEquals; - -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * This shows how to test the JMS binding using a simple HelloWorld application. - */ -public class DefaultsTestCase { - - private static SCADomain scaDomain; - - @Before - public void init() { - scaDomain = - SCADomain.newInstance("http://localhost", "/", "defaults/client.composite", "defaults/service.composite"); - // scaDomain = SCADomain.newInstance("http://localhost", "/", "simple/client.composite"); - } - - @Test - public void testHelloWorldCreate() throws Exception { - HelloWorldService helloWorldService = scaDomain.getService(HelloWorldService.class, "HelloWorldClient"); - assertEquals("jmsHello Petra", helloWorldService.sayHello("Petra")); - } - - @After - public void end() { - if (scaDomain != null) { - scaDomain.close(); - } - } -} diff --git a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/DynamicReplyQTestCase.java b/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/DynamicReplyQTestCase.java deleted file mode 100644 index f4750e5453..0000000000 --- a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/DynamicReplyQTestCase.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.jms; - -import static org.junit.Assert.assertEquals; - -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * This shows how to test the JMS binding using a simple HelloWorld application. - */ -public class DynamicReplyQTestCase { - - private static SCADomain scaDomain; - - @Before - public void init() { - scaDomain = - SCADomain.newInstance("http://localhost", "/", "dynamic/client.composite", "simple/service.composite"); - } - - @Test - public void testHelloWorldCreate() throws Exception { - HelloWorldService helloWorldService = scaDomain.getService(HelloWorldService.class, "HelloWorldClient"); - assertEquals("jmsHello Beate", helloWorldService.sayHello("Beate")); - } - - @After - public void end() { - if (scaDomain != null) { - scaDomain.close(); - } - } -} diff --git a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java b/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java deleted file mode 100644 index ba3e697e13..0000000000 --- a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.jms; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.junit.After; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; - -/** - * This shows how to test the JMS binding using a simple HelloWorld application. - */ -public class ExceptionsTestCase { - - private static SCADomain scaDomain; - - @Before - public void init() { - scaDomain = - SCADomain.newInstance("http://localhost", "/", "exceptions/client.composite", "exceptions/service.composite"); - } - - @Test - @Ignore // TUSCANY-2593, currently fails for some jaxws reason? - public void testChecked() { - ExceptionService service = scaDomain.getService(ExceptionService.class, "ExceptionServiceClient"); - try { - service.throwChecked(); - fail(); - } catch (CheckedExcpetion e) { - assertEquals("foo", e.getMessage()); - } - } - - @Test - public void testUnChecked() { - ExceptionService service = scaDomain.getService(ExceptionService.class, "ExceptionServiceClient"); - try { - service.throwUnChecked(); - fail(); - } catch (Exception e) { - assertEquals("bla", e.getCause().getCause().getMessage()); - } - } - - @After - public void end() { - if (scaDomain != null) { - scaDomain.close(); - } - } -} diff --git a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExternalBrokerTestCase.java b/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExternalBrokerTestCase.java deleted file mode 100644 index c34ad07901..0000000000 --- a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExternalBrokerTestCase.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.jms; - -import static org.junit.Assert.assertEquals; - -import org.apache.activemq.broker.BrokerService; -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * Tests using the JMS binding with an external JMS broker - */ -public class ExternalBrokerTestCase { - - private static SCADomain scaDomain; - private BrokerService broker; - - @Before - public void init() throws Exception { - startBroker(); - scaDomain = SCADomain.newInstance("http://localhost", "/", "external/client.composite", "external/service.composite"); - } - - @Test - public void testHelloWorldCreate() throws Exception { - HelloWorldService helloWorldService = scaDomain.getService(HelloWorldService.class, "HelloWorldClient"); - assertEquals("jmsHello Petra", helloWorldService.sayHello("Petra")); - } - - @After - public void end() throws Exception { - if (scaDomain != null) { - scaDomain.close(); - } - stopBroker(); - } - - protected void startBroker() throws Exception { - broker = new BrokerService(); - broker.setPersistent(false); - broker.setUseJmx(false); - broker.addConnector("tcp://localhost:61616"); - broker.start(); - } - protected void stopBroker() throws Exception { - if (broker != null) { - broker.stop(); - } - } - -} diff --git a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/MessageProcessorTestCase.java b/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/MessageProcessorTestCase.java deleted file mode 100644 index 9ec77ca440..0000000000 --- a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/MessageProcessorTestCase.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.jms; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * This shows how to test the JMS binding using a simple HelloWorld application. - */ -public class MessageProcessorTestCase { - - private static SCADomain scaDomain; - - @Before - public void init() { - scaDomain = - SCADomain.newInstance("http://localhost", "/", "simple/mpclient.composite", "simple/service.composite"); - // scaDomain = SCADomain.newInstance("http://localhost", "/", "simple/client.composite"); - } - - @Test - public void testHelloWorldCreate() throws Exception { - HelloWorldService helloWorldService = scaDomain.getService(HelloWorldService.class, "HelloWorldClient"); - assertEquals("jmsHello Petra", helloWorldService.sayHello("Petra")); - assertTrue(TestMessageProcessor.extractPayloadFromJMSMessageCalled); - assertTrue(TestMessageProcessor.insertPayloadIntoJMSMessageCalled); - assertTrue(TestMessageProcessor.setOperationNameCalled); - } - - @After - public void end() { - if (scaDomain != null) { - scaDomain.close(); - } - } -} diff --git a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/NonSCAClientTestCase.java b/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/NonSCAClientTestCase.java deleted file mode 100644 index fc47211f46..0000000000 --- a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/NonSCAClientTestCase.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.jms; - -import static org.junit.Assert.assertEquals; - -import java.io.Serializable; -import java.util.HashSet; -import java.util.Set; - -import javax.jms.JMSException; -import javax.jms.MessageProducer; -import javax.jms.Session; -import javax.naming.NamingException; - -import org.apache.activemq.broker.BrokerService; -import org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory; -import org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactoryImpl; -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * This shows how to test the JMS binding using a simple HelloWorld application. - */ -public class NonSCAClientTestCase { - - private static SCADomain scaDomain; - - @Before - public void init() throws Exception { - startBroker(); - scaDomain = SCADomain.newInstance("http://localhost", "/", "nonSCAclient/service.composite"); - OneWayServiceImpl.name = null; - } - - @Test - public void testXMLText() throws Exception { - - synchronized (OneWayServiceImpl.mutex) { - - sendTextMessage("dynamicQueues/OneWayService", "<ns2:sayHello xmlns:ns2=\"http://jms.binding.sca.tuscany.apache.org/\"><arg0>Petra</arg0></ns2:sayHello>"); - - // wait up to 10 seconds but it will likely be a lot less - // as the service invocation will wake this up earlier - if (OneWayServiceImpl.name == null) { - OneWayServiceImpl.mutex.wait(10000); - } - } - assertEquals("Petra", OneWayServiceImpl.name); - } - - @Test - public void testText() throws Exception { - - synchronized (OneWayServiceImpl.mutex) { - - sendTextMessage("dynamicQueues/TextDest", "Petra"); - - // wait up to 10 seconds but it will likely be a lot less - // as the service invocation will wake this up earlier - OneWayServiceImpl.mutex.wait(10000); - } - assertEquals("Petra", OneWayServiceImpl.name); - } - - @Test - public void testObject() throws Exception { - - Set<Integer> arg = new HashSet<Integer>(); - arg.add(new Integer(3)); - - synchronized (OneWayObjectServiceImpl.mutex) { - - sendObjectMessage("dynamicQueues/ObjectDest", arg); - - // wait up to 10 seconds but it will likely be a lot less - // as the service invocation will wake this up earlier - OneWayObjectServiceImpl.mutex.wait(10000); - } - assertEquals(arg, OneWayObjectServiceImpl.name); - } - - @After - public void end() throws Exception { - if (scaDomain != null) { - scaDomain.close(); - } - stopBroker(); - } - - private BrokerService broker; - protected void startBroker() throws Exception { - broker = new BrokerService(); - broker.setPersistent(false); - broker.setUseJmx(false); - broker.addConnector("tcp://localhost:61618"); - broker.start(); - } - protected void stopBroker() throws Exception { - if (broker != null) { - broker.stop(); - } - } - - protected static void sendTextMessage(String destName, String payload) throws JMSException, NamingException { - JMSResourceFactory rf = new JMSResourceFactoryImpl(null, null, "tcp://localhost:61618"); - Session session = rf.getConnection().createSession(false, Session.AUTO_ACKNOWLEDGE); - MessageProducer p = session.createProducer(rf.lookupDestination(destName)); - rf.getConnection().start(); - session.run(); - p.send(session.createTextMessage(payload)); - rf.closeConnection(); - } - - protected static void sendObjectMessage(String destName, Object payload) throws JMSException, NamingException { - JMSResourceFactory rf = new JMSResourceFactoryImpl(null, null, "tcp://localhost:61618"); - Session session = rf.getConnection().createSession(false, Session.AUTO_ACKNOWLEDGE); - MessageProducer p = session.createProducer(rf.lookupDestination(destName)); - rf.getConnection().start(); - session.run(); - p.send(session.createObjectMessage((Serializable)payload)); - rf.closeConnection(); - } -} diff --git a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/OneWayTestCase.java b/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/OneWayTestCase.java deleted file mode 100644 index 26dda13cf9..0000000000 --- a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/OneWayTestCase.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.jms; - -import static org.junit.Assert.assertEquals; - -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * This shows how to test the JMS binding using a simple HelloWorld application. - */ -public class OneWayTestCase { - - private static SCADomain scaDomain; - - @Before - public void init() { - scaDomain = SCADomain.newInstance("http://localhost", "/", "oneway/OneWayClient.composite", "oneway/OneWayService.composite"); - } - - @Test - public void testOneWayInvoked() throws Exception { - OneWayService oneWayService = scaDomain.getService(OneWayService.class, "OneWayClient"); - oneWayService.sayHello("Petra"); - synchronized (OneWayServiceImpl.mutex) { - // wait up to 10 seconds but it will likely be a lot less - // as the service invocation will wake this up earlier - OneWayServiceImpl.mutex.wait(10000); - } - assertEquals("Petra", OneWayServiceImpl.name); - } - - @After - public void end() { - if (scaDomain != null) { - scaDomain.close(); - } - } -} diff --git a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/PolicyHeadersTestCase.java b/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/PolicyHeadersTestCase.java deleted file mode 100644 index c0c90cea95..0000000000 --- a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/PolicyHeadersTestCase.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.jms; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import javax.jms.DeliveryMode; - -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.junit.After; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; - -/** - */ -public class PolicyHeadersTestCase { - - private static SCADomain scaDomain; - - @Before - public void init() { - scaDomain = SCADomain.newInstance("http://localhost", "/", "policyHeaders/policyHeaders.composite"); - } - - @Test - public void testProps1() throws Exception { - JMSClient client = scaDomain.getService(JMSClient.class, "ClientComponent"); - - client.aClientMethod(); - - // wait for up to 5 seconds but should wake up as soon as done - synchronized(MsgServiceImpl.lock) { - if (MsgServiceImpl.msg == null) { - MsgServiceImpl.lock.wait(5000); - } - } - assertNotNull(MsgServiceImpl.msg); - - - assertEquals(4, MsgServiceImpl.msg.getJMSPriority()); // Doesn't seem to work with ActiveMQ - /* - assertEquals("myType", MsgServiceImpl.msg.getJMSType()); - assertEquals("xyz", MsgServiceImpl.msg.getJMSCorrelationID()); - assertEquals(DeliveryMode.PERSISTENT, MsgServiceImpl.msg.getJMSDeliveryMode()); - assertEquals("myHeadP1", MsgServiceImpl.msg.getStringProperty("headP1")); - */ - } - - @Test - @Ignore - public void testOp2() throws Exception { - MsgClient client = scaDomain.getService(MsgClient.class, "ClientComponent"); - - client.op2(); - - // wait for up to 5 seconds but should wake up as soon as done - synchronized(MsgServiceImpl.lock) { - if (MsgServiceImpl.msg == null) { - MsgServiceImpl.lock.wait(5000); - } - } - assertNotNull(MsgServiceImpl.msg); - - assertEquals("op2Type", MsgServiceImpl.msg.getJMSType()); - assertEquals("op2CID", MsgServiceImpl.msg.getJMSCorrelationID()); - // assertEquals(DeliveryMode.NON_PERSISTENT, MsgServiceImpl.msg.getJMSDeliveryMode()); // Doesn't seem to work with ActiveMQ - // assertEquals(3, MsgServiceImpl.msg.getJMSPriority()); // Doesn't seem to work with ActiveMQ - assertEquals("myHeadP1", MsgServiceImpl.msg.getStringProperty("headP1")); - assertEquals("foo", MsgServiceImpl.msg.getStringProperty("op2P2")); - assertEquals("nativeOp2", MsgServiceImpl.msg.getStringProperty("scaOperationName")); - } - - @After - public void end() { - if (scaDomain != null) { - scaDomain.close(); - } - } -} diff --git a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/PropertiesTestCase.java b/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/PropertiesTestCase.java deleted file mode 100644 index 4cc229422e..0000000000 --- a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/PropertiesTestCase.java +++ /dev/null @@ -1,92 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.jms;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import javax.jms.DeliveryMode;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- */
-public class PropertiesTestCase {
-
- private static SCADomain scaDomain;
-
- @Before
- public void init() {
- scaDomain = SCADomain.newInstance("http://localhost", "/", "properties/properties.composite");
- }
-
- @Test
- public void testProps1() throws Exception {
- JMSClient client = scaDomain.getService(JMSClient.class, "ClientComponent");
-
- client.aClientMethod();
-
- // wait for up to 5 seconds but should wake up as soon as done
- synchronized(MsgServiceImpl.lock) {
- if (MsgServiceImpl.msg == null) {
- MsgServiceImpl.lock.wait(5000);
- }
- }
- assertNotNull(MsgServiceImpl.msg);
-
- assertEquals("myType", MsgServiceImpl.msg.getJMSType());
- assertEquals("xyz", MsgServiceImpl.msg.getJMSCorrelationID());
- assertEquals(DeliveryMode.PERSISTENT, MsgServiceImpl.msg.getJMSDeliveryMode());
- // assertEquals(3, MsgServiceImpl.msg.getJMSPriority()); // Doesn't seem to work with ActiveMQ
- assertEquals("myHeadP1", MsgServiceImpl.msg.getStringProperty("headP1"));
- }
-
- @Test
- public void testOp2() throws Exception {
- MsgClient client = scaDomain.getService(MsgClient.class, "ClientComponent");
-
- client.op2();
-
- // wait for up to 5 seconds but should wake up as soon as done
- synchronized(MsgServiceImpl.lock) {
- if (MsgServiceImpl.msg == null) {
- MsgServiceImpl.lock.wait(5000);
- }
- }
- assertNotNull(MsgServiceImpl.msg);
-
- assertEquals("op2Type", MsgServiceImpl.msg.getJMSType());
- assertEquals("op2CID", MsgServiceImpl.msg.getJMSCorrelationID());
- // assertEquals(DeliveryMode.NON_PERSISTENT, MsgServiceImpl.msg.getJMSDeliveryMode()); // Doesn't seem to work with ActiveMQ
- // assertEquals(3, MsgServiceImpl.msg.getJMSPriority()); // Doesn't seem to work with ActiveMQ
- assertEquals("myHeadP1", MsgServiceImpl.msg.getStringProperty("headP1"));
- assertEquals("foo", MsgServiceImpl.msg.getStringProperty("op2P2"));
- assertEquals("nativeOp2", MsgServiceImpl.msg.getStringProperty("scaOperationName"));
- }
-
- @After
- public void end() {
- if (scaDomain != null) {
- scaDomain.close();
- }
- }
-}
diff --git a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/RPCTestCase.java b/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/RPCTestCase.java deleted file mode 100644 index c1882a1e26..0000000000 --- a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/RPCTestCase.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.jms; - -import static org.junit.Assert.assertEquals; - -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * This shows how to test the JMS binding using a simple HelloWorld application. - */ -public class RPCTestCase { - - private static SCADomain scaDomain; - - @Before - public void init() { - scaDomain = - SCADomain.newInstance("http://localhost", "/", "simple/client.composite", "simple/service.composite"); - // scaDomain = SCADomain.newInstance("http://localhost", "/", "simple/client.composite"); - } - - @Test - public void testHelloWorldCreate() throws Exception { - HelloWorldService helloWorldService = scaDomain.getService(HelloWorldService.class, "HelloWorldClient"); - assertEquals("jmsHello Petra", helloWorldService.sayHello("Petra")); - } - - @After - public void end() { - if (scaDomain != null) { - scaDomain.close(); - } - } -} diff --git a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/URIRPCTestCase.java b/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/URIRPCTestCase.java deleted file mode 100644 index bed5515d7f..0000000000 --- a/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/URIRPCTestCase.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.jms; - -import static org.junit.Assert.assertEquals; - -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * This shows how to test the JMS binding using a simple HelloWorld application. - */ -public class URIRPCTestCase { - - private static SCADomain scaDomain; - - @Before - public void init() { - scaDomain = - SCADomain.newInstance("http://localhost", "/", "simple/uriclient.composite", "simple/service.composite"); - // scaDomain = SCADomain.newInstance("http://localhost", "/", "simple/client.composite"); - } - - @Test - public void testHelloWorldCreate() throws Exception { - HelloWorldService helloWorldService = scaDomain.getService(HelloWorldService.class, "HelloWorldClient"); - assertEquals("jmsHello Petra", helloWorldService.sayHello("Petra")); - } - - @After - public void end() { - if (scaDomain != null) { - scaDomain.close(); - } - } -} |