From 725006d4c47e63986ac042ade23a4d193298b1fe Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:08:29 +0000 Subject: Moving 1.x branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835131 13f79535-47bb-0310-9956-ffa450edef68 --- branches/sca-java-1.4/samples/binding-echo/README | 103 ------------ .../samples/binding-echo/binding-echo.png | Bin 7846 -> 0 bytes .../samples/binding-echo/binding-echo.svg | 174 --------------------- .../sca-java-1.4/samples/binding-echo/build.xml | 75 --------- branches/sca-java-1.4/samples/binding-echo/pom.xml | 71 --------- .../binding-echo/src/main/java/echo/Echo.java | 29 ---- .../src/main/java/echo/EchoBindingClient.java | 51 ------ .../src/main/java/echo/EchoComponentImpl.java | 44 ------ .../src/main/resources/EchoBinding.composite | 40 ----- .../src/test/java/echo/EchoBindingTestCase.java | 57 ------- 10 files changed, 644 deletions(-) delete mode 100644 branches/sca-java-1.4/samples/binding-echo/README delete mode 100644 branches/sca-java-1.4/samples/binding-echo/binding-echo.png delete mode 100644 branches/sca-java-1.4/samples/binding-echo/binding-echo.svg delete mode 100644 branches/sca-java-1.4/samples/binding-echo/build.xml delete mode 100644 branches/sca-java-1.4/samples/binding-echo/pom.xml delete mode 100644 branches/sca-java-1.4/samples/binding-echo/src/main/java/echo/Echo.java delete mode 100644 branches/sca-java-1.4/samples/binding-echo/src/main/java/echo/EchoBindingClient.java delete mode 100644 branches/sca-java-1.4/samples/binding-echo/src/main/java/echo/EchoComponentImpl.java delete mode 100644 branches/sca-java-1.4/samples/binding-echo/src/main/resources/EchoBinding.composite delete mode 100644 branches/sca-java-1.4/samples/binding-echo/src/test/java/echo/EchoBindingTestCase.java (limited to 'branches/sca-java-1.4/samples/binding-echo') diff --git a/branches/sca-java-1.4/samples/binding-echo/README b/branches/sca-java-1.4/samples/binding-echo/README deleted file mode 100644 index 84367ab5f0..0000000000 --- a/branches/sca-java-1.4/samples/binding-echo/README +++ /dev/null @@ -1,103 +0,0 @@ -Binding Echo Sample Application -=============================== -This sample demonstrates how to use the new binding extension -binding-echo-extension. - -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;..\binding-echo-extension\target\sample-binding-echo-extension.jar;target\sample-binding-echo.jar echo.EchoBindingClient - -and on *nix do - -java -cp ../../lib/tuscany-sca-manifest.jar:../binding-echo-extension/target/sample-binding-echo-extension.jar:target/sample-binding-echo.jar echo.EchoBindingClient - -This looks like a long command. The three things we add to the classpath are - -tuscany-sca-manifest.jar - all of the standard Tuscany SCA runtime and - extension classes -sample-binding-echo-extension.jar - the new echo binding extension implementation -sample-binding-echo - the application that uses the echo binding - - -Sample Overview ---------------- -This sample contains an application (client and server code) that uses -an SCA binding that simply echoes back any messages that are sent to it. - -binding-echo/ - src/ - main/ - java/ - echo/ - Echo.java - interface definition for the sample - reference and service - EchoComponentImpl.java - sample component implementation with - echo binding reference - EchoBindingClient.java - sample client - resources/ - EchoBinding.composite - the SCA assembly for this sample - test/ - java/ - echo - EchoBindingTestCase.java - sample JUnit test case for the sample - client - binding-echo.png - 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 as -follows. - -cd binding-echo -ant compile -ant run - -You should see the following output from the run target. - -run: - [java] Passing thro invoker... - [java] Returned message: foo - [java] Echo reference = foo - [java] Passing thro invoker... - [java] Returned message: bar - [java] Echo service = bar - - -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. - -cd binding-echo -mvn - -You should see the following output from the test phase. - -------------------------------------------------------- - T E S T S -------------------------------------------------------- -Running echo.EchoBindingTestCase -Passing thro invoker... -Returned message: foo -Passing thro invoker... -Returned message: bar -Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.811 sec - -Results : - -Tests run: 2, Failures: 0, Errors: 0, Skipped: 0 - -This shows that the Junit test cases have run successfully. diff --git a/branches/sca-java-1.4/samples/binding-echo/binding-echo.png b/branches/sca-java-1.4/samples/binding-echo/binding-echo.png deleted file mode 100644 index a38d985363..0000000000 Binary files a/branches/sca-java-1.4/samples/binding-echo/binding-echo.png and /dev/null differ diff --git a/branches/sca-java-1.4/samples/binding-echo/binding-echo.svg b/branches/sca-java-1.4/samples/binding-echo/binding-echo.svg deleted file mode 100644 index 5b5051bef5..0000000000 --- a/branches/sca-java-1.4/samples/binding-echo/binding-echo.svg +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - EchoBinding - - - EchoComponent - - - - EchoSerivce EchoReference - - - diff --git a/branches/sca-java-1.4/samples/binding-echo/build.xml b/branches/sca-java-1.4/samples/binding-echo/build.xml deleted file mode 100644 index 7689ef3a54..0000000000 --- a/branches/sca-java-1.4/samples/binding-echo/build.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.4/samples/binding-echo/pom.xml b/branches/sca-java-1.4/samples/binding-echo/pom.xml deleted file mode 100644 index b1ef923130..0000000000 --- a/branches/sca-java-1.4/samples/binding-echo/pom.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.4.1-SNAPSHOT - ../../pom.xml - - sample-binding-echo - Apache Tuscany SCA Sample Echo Binding Application - - - - apache.incubator - http://people.apache.org/repo/m2-incubating-repository - - - - - - org.apache.tuscany.sca - tuscany-host-embedded - 1.4.1-SNAPSHOT - - - - org.apache.tuscany.sca - sample-binding-echo-extension - 1.4.1-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 1.4.1-SNAPSHOT - runtime - - - - junit - junit - 4.5 - test - - - - - - ${artifactId} - - - diff --git a/branches/sca-java-1.4/samples/binding-echo/src/main/java/echo/Echo.java b/branches/sca-java-1.4/samples/binding-echo/src/main/java/echo/Echo.java deleted file mode 100644 index 1d5e973f33..0000000000 --- a/branches/sca-java-1.4/samples/binding-echo/src/main/java/echo/Echo.java +++ /dev/null @@ -1,29 +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 echo; - -/** - * Interface of our sample Echo service. - * - * @version $Rev$ $Date$ - */ -public interface Echo { - - String echo(String msg); -} diff --git a/branches/sca-java-1.4/samples/binding-echo/src/main/java/echo/EchoBindingClient.java b/branches/sca-java-1.4/samples/binding-echo/src/main/java/echo/EchoBindingClient.java deleted file mode 100644 index 21bdff4011..0000000000 --- a/branches/sca-java-1.4/samples/binding-echo/src/main/java/echo/EchoBindingClient.java +++ /dev/null @@ -1,51 +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 echo; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -import echo.server.EchoServer; - -/** - * This client program shows how to create an SCA runtime, start it, - * and locate and invoke a SCA component - * @version $Rev$ $Date$ - */ -public class EchoBindingClient { - - public static void main(String[] args) throws Exception { - - SCADomain scaDomain = SCADomain.newInstance("EchoBinding.composite"); - - // Call the echo service component which will, in turn, call a reference - // with an echo binding. The echo binding will echo the given string. - Echo service = scaDomain.getService(Echo.class, "EchoComponent"); - String echoString = service.echo("foo"); - System.out.println("Echo reference = " + echoString ); - - // Call the echo server. This will dispatch the call to a service with an - // echo binding. The echo binding will pass the call to the echo component. - echoString = EchoServer.getServer().sendReceive("http://tempuri.org", "bar"); - System.out.println("Echo service = " + echoString ); - - scaDomain.close(); - - } - -} diff --git a/branches/sca-java-1.4/samples/binding-echo/src/main/java/echo/EchoComponentImpl.java b/branches/sca-java-1.4/samples/binding-echo/src/main/java/echo/EchoComponentImpl.java deleted file mode 100644 index ba68dfe908..0000000000 --- a/branches/sca-java-1.4/samples/binding-echo/src/main/java/echo/EchoComponentImpl.java +++ /dev/null @@ -1,44 +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 echo; - -import org.osoa.sca.annotations.Constructor; -import org.osoa.sca.annotations.Reference; - - -/** - * A simple client component that uses a reference with an Echo binding. - * - * @version $Rev$ $Date$ - */ -public class EchoComponentImpl implements Echo { - - private Echo echoReference; - - @Constructor - public EchoComponentImpl(@Reference(name = "echoReference", required = true) Echo echoReference) { - this.echoReference = echoReference; - } - - public String echo(String msg) { - String result = echoReference.echo(msg); - System.out.println("Returned message: "+ result); - return result; - } -} diff --git a/branches/sca-java-1.4/samples/binding-echo/src/main/resources/EchoBinding.composite b/branches/sca-java-1.4/samples/binding-echo/src/main/resources/EchoBinding.composite deleted file mode 100644 index 94612fb325..0000000000 --- a/branches/sca-java-1.4/samples/binding-echo/src/main/resources/EchoBinding.composite +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.4/samples/binding-echo/src/test/java/echo/EchoBindingTestCase.java b/branches/sca-java-1.4/samples/binding-echo/src/test/java/echo/EchoBindingTestCase.java deleted file mode 100644 index 1a597fc80f..0000000000 --- a/branches/sca-java-1.4/samples/binding-echo/src/test/java/echo/EchoBindingTestCase.java +++ /dev/null @@ -1,57 +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 echo; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -import echo.Echo; -import echo.server.EchoServer; - -public class EchoBindingTestCase extends TestCase { - - private SCADomain scaDomain; - - @Override - protected void setUp() throws Exception { - scaDomain = SCADomain.newInstance("EchoBinding.composite"); - } - - @Override - protected void tearDown() throws Exception { - scaDomain.close(); - } - - public void testReference() throws Exception { - // Call the echo service component which will, in turn, call a reference - // with an echo binding. The echo binding will echo the given string. - Echo service = scaDomain.getService(Echo.class, "EchoComponent"); - String echoString = service.echo("foo"); - assertEquals(echoString, "foo"); - } - - public void testService() throws Exception { - // Call the echo server. This will dispatch the call to a service with an - // echo binding. The echo binding will pass the call to the echo component. - String echoString = EchoServer.getServer().sendReceive("http://tempuri.org", "bar"); - assertEquals(echoString, "bar"); - } -} -- cgit v1.2.3