From 3dd7e2c4da9c80b8182a2d04dc129a67aa7910df Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:06:58 +0000 Subject: Moving 1.x branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835121 13f79535-47bb-0310-9956-ffa450edef68 --- .../samples/implementation-crud/README | 113 ----------------- .../samples/implementation-crud/build.xml | 75 ------------ .../implementation-crud/implementation-crud.png | Bin 4227 -> 0 bytes .../implementation-crud/implementation-crud.svg | 135 --------------------- .../samples/implementation-crud/pom.xml | 64 ---------- .../src/main/java/crud/client/CRUDClient.java | 55 --------- .../src/main/resources/crud.composite | 30 ----- .../src/test/java/crud/client/CRUDTestCase.java | 58 --------- 8 files changed, 530 deletions(-) delete mode 100644 branches/sca-java-0.99/samples/implementation-crud/README delete mode 100644 branches/sca-java-0.99/samples/implementation-crud/build.xml delete mode 100644 branches/sca-java-0.99/samples/implementation-crud/implementation-crud.png delete mode 100644 branches/sca-java-0.99/samples/implementation-crud/implementation-crud.svg delete mode 100644 branches/sca-java-0.99/samples/implementation-crud/pom.xml delete mode 100644 branches/sca-java-0.99/samples/implementation-crud/src/main/java/crud/client/CRUDClient.java delete mode 100644 branches/sca-java-0.99/samples/implementation-crud/src/main/resources/crud.composite delete mode 100644 branches/sca-java-0.99/samples/implementation-crud/src/test/java/crud/client/CRUDTestCase.java (limited to 'branches/sca-java-0.99/samples/implementation-crud') diff --git a/branches/sca-java-0.99/samples/implementation-crud/README b/branches/sca-java-0.99/samples/implementation-crud/README deleted file mode 100644 index 50da631c04..0000000000 --- a/branches/sca-java-0.99/samples/implementation-crud/README +++ /dev/null @@ -1,113 +0,0 @@ -Implementation CRUD Sample Client -================================= -This sample demonstrates how to use the new implementation extension, -implementation-crud-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;..\implementation-crud-extension\target\sample-implementation-crud-extension.jar;target\sample-implementation-crud.jar crud.client.CRUDClient - -and on *nix do - -java -cp ../../lib/tuscany-sca-manifest.jar:../implementation-crud-extension/target/sample-implementation-crud-extension.jar:target/sample-implementation-crud.jar crud.client.CRUDClient - -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-implementation-crud-extension.jar - the new crud implementation - extension -sample-implementation-crud.jar - the application that uses the crud - implementation - -Sample Overview ---------------- -This sample contains a client application for a CRUD implementation type that -shows how to create new implementation types. See the README for the -mplementation-crud-extension sample for details of this implementation type. - -implementation-crud/ - src/ - main/ - java/ - crud/ - client/ - CRUDClient.java - sample client - resources/ - crud.composite - the SCA assembly used by this sample - - test/ - java/ - crud/ - client/ - CRUDTestCase.java - sample JUnit test case for the sample client - - implementation-crud.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 as -follows - -cd implementation-crud -ant compile -ant run - -You should see the following output from the run target. - -run: - [java] Starting CRUDServiceComponent - [java] create(ABC) in tmp - [java] retrieve(0) - [java] Result from create: ABC - [java] update(0) - [java] retrieve(0) - [java] Result from update: EFG - [java] delete(0) - [java] retrieve(0) - [java] Result from delete: null - [java] Stopping CRUDServiceComponent - - -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 implementation-crud -mvn - -You should see the following output from the test phase. - -------------------------------------------------------- - T E S T S -------------------------------------------------------- -Running crud.client.CRUDTestCase -Starting CRUDServiceComponent -create(ABC) in tmp -retrieve(0) -update(0) -retrieve(0) -delete(0) -retrieve(0) -Stopping CRUDServiceComponent -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.641 sec - -Results : - -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 - -This shows that the Junit test cases have run successfully. diff --git a/branches/sca-java-0.99/samples/implementation-crud/build.xml b/branches/sca-java-0.99/samples/implementation-crud/build.xml deleted file mode 100644 index 10b26b5a94..0000000000 --- a/branches/sca-java-0.99/samples/implementation-crud/build.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.99/samples/implementation-crud/implementation-crud.png b/branches/sca-java-0.99/samples/implementation-crud/implementation-crud.png deleted file mode 100644 index a292037e7a..0000000000 Binary files a/branches/sca-java-0.99/samples/implementation-crud/implementation-crud.png and /dev/null differ diff --git a/branches/sca-java-0.99/samples/implementation-crud/implementation-crud.svg b/branches/sca-java-0.99/samples/implementation-crud/implementation-crud.svg deleted file mode 100644 index dbb37be208..0000000000 --- a/branches/sca-java-0.99/samples/implementation-crud/implementation-crud.svg +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - crud - - CRUDServiceComponent - CRUD - diff --git a/branches/sca-java-0.99/samples/implementation-crud/pom.xml b/branches/sca-java-0.99/samples/implementation-crud/pom.xml deleted file mode 100644 index c27996539e..0000000000 --- a/branches/sca-java-0.99/samples/implementation-crud/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 0.99-incubating-SNAPSHOT - ../../pom.xml - - sample-implementation-crud - Apache Tuscany CRUD Implementation Extension Sample Client - - - - apache.incubator - http://people.apache.org/repo/m2-incubating-repository - - - - - - org.apache.tuscany.sca - tuscany-host-embedded - 0.99-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - sample-implementation-crud-extension - 0.99-incubating-SNAPSHOT - - - - junit - junit - 4.2 - test - - - - - - ${artifactId} - - - diff --git a/branches/sca-java-0.99/samples/implementation-crud/src/main/java/crud/client/CRUDClient.java b/branches/sca-java-0.99/samples/implementation-crud/src/main/java/crud/client/CRUDClient.java deleted file mode 100644 index e349f30fb9..0000000000 --- a/branches/sca-java-0.99/samples/implementation-crud/src/main/java/crud/client/CRUDClient.java +++ /dev/null @@ -1,55 +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 crud.client; - - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -import crud.CRUD; - -/** - * @version $Rev$ $Date$ - */ -public class CRUDClient { - - public static void main(String[] args) throws Exception { - - SCADomain scaDomain = SCADomain.newInstance("crud.composite"); - CRUD crudService = scaDomain.getService(CRUD.class, "CRUDServiceComponent"); - - String id = crudService.create("ABC"); - Object result = crudService.retrieve(id); - System.out.println("Result from create: " + result); - crudService.update(id, "EFG"); - result = crudService.retrieve(id); - System.out.println("Result from update: " + result); - crudService.delete(id); - result = crudService.retrieve(id); - if (result == null) { - System.out.println("Result from delete: null"); - } else { - System.out.println("Result from delete: should be null but was " + result); - } - - scaDomain.close(); - - } - -} diff --git a/branches/sca-java-0.99/samples/implementation-crud/src/main/resources/crud.composite b/branches/sca-java-0.99/samples/implementation-crud/src/main/resources/crud.composite deleted file mode 100644 index 18745033bb..0000000000 --- a/branches/sca-java-0.99/samples/implementation-crud/src/main/resources/crud.composite +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - diff --git a/branches/sca-java-0.99/samples/implementation-crud/src/test/java/crud/client/CRUDTestCase.java b/branches/sca-java-0.99/samples/implementation-crud/src/test/java/crud/client/CRUDTestCase.java deleted file mode 100644 index 171ddbaed3..0000000000 --- a/branches/sca-java-0.99/samples/implementation-crud/src/test/java/crud/client/CRUDTestCase.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 crud.client; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -import crud.CRUD; - - -public class CRUDTestCase extends TestCase { - - private SCADomain scaDomain; - - @Override - protected void setUp() throws Exception { - scaDomain = SCADomain.newInstance("crud.composite"); - } - - @Override - protected void tearDown() throws Exception { - scaDomain.close(); - } - - public void test() throws Exception { - CRUD crudService = scaDomain.getService(CRUD.class, "CRUDServiceComponent"); - - String id = crudService.create("ABC"); - Object result = crudService.retrieve(id); - assertEquals(result, "ABC"); - - crudService.update(id, "EFG"); - result = crudService.retrieve(id); - assertEquals(result, "EFG"); - - crudService.delete(id); - result = crudService.retrieve(id); - assertNull(result); - } -} -- cgit v1.2.3