From a40e527938d76ba71f211da7e327adb50384ba69 Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:26:33 +0000 Subject: Moving 1.x tags git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835157 13f79535-47bb-0310-9956-ffa450edef68 --- .../1.2.1/samples/helloworld-ws-service-jms/README | 119 ---------------- .../samples/helloworld-ws-service-jms/build.xml | 72 ---------- .../helloworld-ws-service.png | Bin 6531 -> 0 bytes .../helloworld-ws-service.svg | 150 --------------------- .../samples/helloworld-ws-service-jms/pom.xml | 87 ------------ .../src/main/java/helloworld/HelloWorldImpl.java | 33 ----- .../src/main/java/helloworld/HelloWorldServer.java | 60 --------- .../main/java/helloworld/HelloWorldService.java | 31 ----- .../src/main/resources/definitions.xml | 66 --------- .../src/main/resources/helloworldwsjms.composite | 35 ----- .../main/resources/helloworldwsjmspolicy.composite | 34 ----- .../src/main/resources/wsdl/helloworld.wsdl | 92 ------------- .../HelloWorldJmsPolicyServerTestCase.java | 68 ---------- .../helloworld/HelloWorldJmsServerTestCase.java | 72 ---------- 14 files changed, 919 deletions(-) delete mode 100644 tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/README delete mode 100644 tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/build.xml delete mode 100644 tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/helloworld-ws-service.png delete mode 100644 tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/helloworld-ws-service.svg delete mode 100644 tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/pom.xml delete mode 100644 tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/java/helloworld/HelloWorldImpl.java delete mode 100644 tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/java/helloworld/HelloWorldServer.java delete mode 100644 tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/java/helloworld/HelloWorldService.java delete mode 100644 tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/resources/definitions.xml delete mode 100644 tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/resources/helloworldwsjms.composite delete mode 100644 tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/resources/helloworldwsjmspolicy.composite delete mode 100644 tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/resources/wsdl/helloworld.wsdl delete mode 100644 tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/test/java/helloworld/HelloWorldJmsPolicyServerTestCase.java delete mode 100644 tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/test/java/helloworld/HelloWorldJmsServerTestCase.java (limited to 'tags/java/sca/1.2.1/samples/helloworld-ws-service-jms') diff --git a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/README b/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/README deleted file mode 100644 index fa6ceff63f..0000000000 --- a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/README +++ /dev/null @@ -1,119 +0,0 @@ -Hello World SOAP/JMS Service Sample -=================================== -This sample demonstrates an SCA service that uses a web service binding using -a SOAP/JMS protocol - -The README in the samples directory (the directory above this) provides -general instructions about building and running samples. Take a look there -first. - -If you just want to run it to see what happens open a command prompt, navigate -to this sample directory and do: - -ant run - -OR if you don't have ant, on Windows do - -java -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-helloworld-ws-service-jms.jar helloworld.HelloWorldServer - -and on *nix do - -java -cp ../../lib/tuscany-sca-manifest.jar:target/sample-helloworld-ws-service-jms.jar helloworld.HelloWorldServer - -Now the server is started you can use the helloworld-ws-reference-jms sample to -exercise it. - -Sample Overview ---------------- -The sample provides a single component that is wired to a service with a -web service binding. - -helloworld-ws-service-jms/ - src/ - main/ - java/ - helloworld/ - HelloWorldService.java - interface description for - HelloWorldServiceComponent - HelloWorldImpl.java - component implementation - HelloWorldServer.java - starts the SCA Runtime and - deploys the helloworldwsjms - .composite and then waits for the - service to be called via web services - resources/ - wsdl/ - helloworld.wsdl - the service description that describes - the exposed service - helloworldwsjms.composite - the SCA assembly for this sample - helloworldwsjmspolicy.composite - shows how the protocol can be - selected using policy. Not run - by the sample - test/ - java/ - helloworld/ - HelloWorldJMSServerTestCase.java- JUnit test case - HelloWorldJMSPolicyServerTestCase.java- JUnit test case - helloworld-ws-service.png - a pictorial representation of the - sample .composite file - build.xml - the Ant build file - pom.xml - the Maven build file - -Building And Running The Sample Using Ant ------------------------------------------ -With the binary distribution the sample can be built and run using Ant using the -following commands - -cd helloworld-ws-service-jms -ant compile -ant run - -You should see the following output from the run target. - -run: - [java] log4j:WARN No appenders could be found for logger (org.apache.axiom. -om.util.StAXUtils). - [java] log4j:WARN Please initialize the log4j system properly. - [java] HelloWorld server started (press enter to shutdown) - -As this point the SCA service is exposed as a web service by a web server -started automatically by the SCA runtime. To stop the server just press -enter. - -To exercise the service run up the helloworld-ws-reference-jms sample. Take a look at -the README in that sample and you will see you need the following commands - -cd helloworld-ws-reference-jms -ant run - -Building And Running The Sample Using Maven -------------------------------------------- -With either the binary or source distributions the sample can be built and run -using Maven as follows. When using Maven you don't need to run the helloworld- -ws-reference-jms sample as Maven includes a simple ping test to make sure that the -service is available - -cd helloworld-ws-service-jms -mvn - -You should see the following output from the test phase. - -------------------------------------------------------- - T E S T S -------------------------------------------------------- -Running helloworld.HelloWorldJmsPolicyServerTestCase -08-Jan-2008 10:41:17 org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceProvide -r start -INFO: Axis2 JMS URL=jms:/HelloWorldServiceComponent?java.naming.factory.initial= -org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url= -tcp://localhost:61619&transport.jms.ConnectionFactoryJNDIName=QueueConnectionFac -tory -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.984 sec -Running helloworld.HelloWorldJmsServerTestCase -08-Jan-2008 10:41:22 org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceProvide -r start -INFO: Axis2 JMS URL=jms:/queue.sample?transport.jms.ConnectionFactoryJNDIName=Qu -eueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.Active -MQInitialContextFactory&java.naming.provider.url=tcp://localhost:61619 -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.266 sec - -This shows that the Junit test cases have run successfully. diff --git a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/build.xml b/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/build.xml deleted file mode 100644 index 5a05e9cd28..0000000000 --- a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/build.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/helloworld-ws-service.png b/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/helloworld-ws-service.png deleted file mode 100644 index eab29d0bcd..0000000000 Binary files a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/helloworld-ws-service.png and /dev/null differ diff --git a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/helloworld-ws-service.svg b/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/helloworld-ws-service.svg deleted file mode 100644 index 8d2ae98c82..0000000000 --- a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/helloworld-ws-service.svg +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - helloworldws - - HelloWorldServiceComponent - - HelloWorldWebService - - diff --git a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/pom.xml b/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/pom.xml deleted file mode 100644 index 956b8428a1..0000000000 --- a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/pom.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.2.1-incubating - ../../pom.xml - - sample-helloworld-ws-service-jms - Apache Tuscany SCA HelloWorld Web Service JMS Sample - - - - apache.incubator - http://people.apache.org/repo/m2-incubating-repository - - - - - - org.apache.tuscany.sca - tuscany-host-jetty - 1.2.1-incubating - compile - - - - org.apache.tuscany.sca - tuscany-host-embedded - 1.2.1-incubating - compile - - - - org.apache.activemq - activemq-core - 4.1.1 - compile - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 1.2.1-incubating - runtime - - - - org.apache.tuscany.sca - tuscany-binding-ws-axis2 - 1.2.1-incubating - runtime - - - - junit - junit - 4.2 - test - - - - - - ${artifactId} - - - diff --git a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/java/helloworld/HelloWorldImpl.java b/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/java/helloworld/HelloWorldImpl.java deleted file mode 100644 index 0de3c70303..0000000000 --- a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/java/helloworld/HelloWorldImpl.java +++ /dev/null @@ -1,33 +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 helloworld; - -import org.osoa.sca.annotations.Service; - -/** - * This class implements the HelloWorld service. - */ -@Service(HelloWorldService.class) -public class HelloWorldImpl implements HelloWorldService { - - public String getGreetings(String name) { - return "Hello " + name; - } - -} diff --git a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/java/helloworld/HelloWorldServer.java b/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/java/helloworld/HelloWorldServer.java deleted file mode 100644 index 5baf8ef645..0000000000 --- a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/java/helloworld/HelloWorldServer.java +++ /dev/null @@ -1,60 +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 helloworld; - -import java.io.IOException; - -import org.apache.activemq.broker.BrokerService; -import org.apache.tuscany.sca.host.embedded.SCADomain; - -/** - * This server program shows how to create an SCA runtime, and start it which - * activates the helloworld Web service endpoint. - */ -public class HelloWorldServer { - - protected static BrokerService startBroker() throws Exception { - BrokerService jmsBroker = new BrokerService(); - jmsBroker.setPersistent(false); - jmsBroker.setUseJmx(false); - jmsBroker.addConnector("tcp://localhost:61619"); - jmsBroker.start(); - return jmsBroker; - } - - public static void main(String[] args) throws Exception { - - BrokerService broker = startBroker(); - SCADomain scaDomain = SCADomain.newInstance("helloworldwsjms.composite"); - - try { - System.out.println("HelloWorld server started (press enter to shutdown)"); - System.in.read(); - } catch (IOException e) { - e.printStackTrace(); - } - - scaDomain.close(); - broker.stop(); - System.out.println("HelloWorld server stopped"); - // FIXME: Workaround for http://issues.apache.org/jira/browse/AXIS2-3685 - System.exit(0); - } - -} diff --git a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/java/helloworld/HelloWorldService.java b/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/java/helloworld/HelloWorldService.java deleted file mode 100644 index 7245513b2a..0000000000 --- a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/java/helloworld/HelloWorldService.java +++ /dev/null @@ -1,31 +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 helloworld; - -import org.osoa.sca.annotations.Remotable; - -/** - * This is the business interface of the HelloWorld greetings service. - */ -@Remotable -public interface HelloWorldService { - - public String getGreetings(String name); -} - diff --git a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/resources/definitions.xml b/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/resources/definitions.xml deleted file mode 100644 index 9cf337ac98..0000000000 --- a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/resources/definitions.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - The general intent that a transport is available over which SOAP messages flow - - - - - - A JMS transport is required - - - - - - An HTTP transport is required - - - - - - - An HTTPS transport is required - - - - - - - org.apache.activemq.jndi.ActiveMQInitialContextFactory - tcp://localhost:61619 - QueueConnectionFactory - - - - - \ No newline at end of file diff --git a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/resources/helloworldwsjms.composite b/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/resources/helloworldwsjms.composite deleted file mode 100644 index 67079f738e..0000000000 --- a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/resources/helloworldwsjms.composite +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - diff --git a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/resources/helloworldwsjmspolicy.composite b/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/resources/helloworldwsjmspolicy.composite deleted file mode 100644 index 10faf374f3..0000000000 --- a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/resources/helloworldwsjmspolicy.composite +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - diff --git a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/resources/wsdl/helloworld.wsdl b/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/resources/wsdl/helloworld.wsdl deleted file mode 100644 index 3f9e00689e..0000000000 --- a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/main/resources/wsdl/helloworld.wsdl +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/test/java/helloworld/HelloWorldJmsPolicyServerTestCase.java b/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/test/java/helloworld/HelloWorldJmsPolicyServerTestCase.java deleted file mode 100644 index 755caad824..0000000000 --- a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/test/java/helloworld/HelloWorldJmsPolicyServerTestCase.java +++ /dev/null @@ -1,68 +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 helloworld; - -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertNotNull; - -import java.io.IOException; - -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 that the helloworld server is available - */ -public class HelloWorldJmsPolicyServerTestCase{ - - private SCADomain scaDomain; - private BrokerService jmsBroker; - - @Before - public void startServer() throws Exception { - startBroker(); - scaDomain = SCADomain.newInstance("helloworldwsjmspolicy.composite"); - } - - protected void startBroker() throws Exception { - jmsBroker = new BrokerService(); - jmsBroker.setPersistent(false); - jmsBroker.setUseJmx(false); - jmsBroker.addConnector("tcp://localhost:61619"); - jmsBroker.start(); - } - - @Test - public void testServiceCall() throws IOException { - HelloWorldService helloWorldService = scaDomain.getService(HelloWorldService.class, "HelloWorldServiceComponent/HelloWorldService"); - assertNotNull(helloWorldService); - assertEquals("Hello Smith", helloWorldService.getGreetings("Smith")); - } - - @After - public void stopServer() throws Exception { - scaDomain.close(); - if (jmsBroker != null) { - jmsBroker.stop(); - } - } -} diff --git a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/test/java/helloworld/HelloWorldJmsServerTestCase.java b/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/test/java/helloworld/HelloWorldJmsServerTestCase.java deleted file mode 100644 index cd026b0538..0000000000 --- a/tags/java/sca/1.2.1/samples/helloworld-ws-service-jms/src/test/java/helloworld/HelloWorldJmsServerTestCase.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 helloworld; - -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertNotNull; - -import java.io.IOException; - -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 that the helloworld server is available - */ -public class HelloWorldJmsServerTestCase{ - - private SCADomain scaDomain; - private BrokerService jmsBroker; - - @Before - public void startServer() throws Exception { - startBroker(); - scaDomain = SCADomain.newInstance("helloworldwsjms.composite"); - } - - protected void startBroker() throws Exception { - jmsBroker = new BrokerService(); - jmsBroker.setPersistent(false); - jmsBroker.setUseJmx(false); - jmsBroker.addConnector("tcp://localhost:61619"); - jmsBroker.start(); - } - - @Test - public void testServiceCall() throws IOException { - HelloWorldService helloWorldService = scaDomain.getService(HelloWorldService.class, "HelloWorldServiceComponent/HelloWorldService"); - assertNotNull(helloWorldService); - - assertEquals("Hello Smith", helloWorldService.getGreetings("Smith")); - } - - @After - public void stopServer() throws Exception { - if (scaDomain != null) { - scaDomain.close(); - } - if (jmsBroker != null) { - jmsBroker.stop(); - } - } - -} -- cgit v1.2.3