diff options
author | dims <dims@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-17 00:23:01 +0000 |
---|---|---|
committer | dims <dims@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-17 00:23:01 +0000 |
commit | bdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a (patch) | |
tree | 38a92061c0793434c4be189f1d70c3458b6bc41d /branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles |
Move Tuscany from Incubator to top level.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles')
17 files changed, 905 insertions, 0 deletions
diff --git a/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/build-bundles.xml b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/build-bundles.xml new file mode 100644 index 0000000000..b4251a2fd3 --- /dev/null +++ b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/build-bundles.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * 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. +--> +<project name="OSGiBundleCreator"> + + <target name="create-bundles"> + + <jar jarfile="${jar.dir}/${jar.file.name}" manifest="${files.dir}/${manifest.file.name}" > + <fileset dir="${files.dir}" includes="${files.list}"> + </fileset> + </jar> + </target> + + +</project> diff --git a/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/pom.xml b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/pom.xml new file mode 100644 index 0000000000..9da6008984 --- /dev/null +++ b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/pom.xml @@ -0,0 +1,124 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * 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. +--> +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-itest</artifactId> + <version>1.2.1-incubating-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent> + <artifactId>itest-osgi-tuscany-test-bundles</artifactId> + <name>Apache Tuscany OSGi-Based Tuscany Runtime Test Bundles</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-sca-api</artifactId> + <version>1.2.1-incubating-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-embedded</artifactId> + <version>1.2.1-incubating-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.felix</groupId> + <artifactId>org.apache.felix.main</artifactId> + <version>1.1.0-SNAPSHOT</version> + </dependency> + + + </dependencies> + + <build> + <finalName>itest-osgi-tuscany-test-bundles</finalName> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.1</version> + + <dependencies> + <dependency> + <groupId>ant</groupId> + <artifactId>ant-trax</artifactId> + <version>1.6.5</version> + </dependency> + </dependencies> + + <executions> + <execution> + <id>create-bundles</id> + <phase>generate-test-sources</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <tasks> + <ant antfile="./build-bundles.xml" target="create-bundles"> + <property name="jar.dir" value="target" /> + <property name="files.dir" value="target/classes" /> + <property name="jar.file.name" value="SupplyChain.jar" /> + <property name="manifest.file.name" value="META-INF/SupplyChain.mf" /> + <property name="files.list" + value="supplychain/customer/* \ + supplychain/retailer/* \ + supplychain/warehouse/* \ + supplychain/shipper/* \ + supplychain/supplychain.composite \ + META-INF/sca-contribution.xml" /> + + </ant> + <ant antfile="./build-bundles.xml" target="create-bundles"> + <property name="jar.dir" value="target" /> + <property name="files.dir" value="target/classes" /> + <property name="jar.file.name" value="SupplyChainClient.jar" /> + <property name="manifest.file.name" value="META-INF/SupplyChainClient.mf" /> + <property name="files.list" + value="supplychain/client/*" /> + </ant> + <ant antfile="./build-bundles.xml" target="create-bundles"> + <property name="jar.dir" value="target" /> + <property name="files.dir" value="target/classes" /> + <property name="jar.file.name" value="SupplyChainWS.jar" /> + <property name="manifest.file.name" value="META-INF/SupplyChain.mf" /> + <property name="files.list" + value="supplychain/customer/* \ + supplychain/retailer/* \ + supplychain/warehouse/* \ + supplychain/shipper/* \ + supplychain/ws/supplychain.composite \ + supplychain/ws/Customer.wsdl \ + META-INF/sca-contribution.xml" /> + + </ant> + + </tasks> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project> diff --git a/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/client/SupplyChainClient.java b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/client/SupplyChainClient.java new file mode 100644 index 0000000000..006cccda58 --- /dev/null +++ b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/client/SupplyChainClient.java @@ -0,0 +1,115 @@ +/* + * 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 supplychain.client; + + +import java.io.File; +import java.net.URL; +import java.util.Hashtable; + + +import org.apache.tuscany.sca.assembly.Composite; +import org.apache.tuscany.sca.contribution.Contribution; +import org.apache.tuscany.sca.contribution.service.ContributionService; +import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + + + +import supplychain.customer.Customer; + +/** + * SupplyChain test client + */ +public class SupplyChainClient implements BundleActivator { + + private EmbeddedSCADomain scaDomain; + private Customer customer; + + + + public void start(BundleContext context) throws Exception { + + context.registerService(SupplyChainClient.class.getName(), this, new Hashtable()); + + } + + public void stop(BundleContext context) throws Exception { + + } + + protected void setUp(String contributionJarName) throws Exception { + + scaDomain = new EmbeddedSCADomain(EmbeddedSCADomain.class.getClassLoader(), "http://localhost"); + scaDomain.start(); + ContributionService contributionService = scaDomain.getContributionService(); + String folderName = "../test-bundles/target/"; + String supplychainJarName = contributionJarName; + URL supplyChainURL = new File(folderName + supplychainJarName).toURI().toURL(); + + Contribution contribution = contributionService.contribute("SupplyChain", supplyChainURL, false); + for (Composite deployable : contribution.getDeployables() ) { + scaDomain.getDomainComposite().getIncludes().add(deployable); + scaDomain.buildComposite(deployable); + } + + for (Composite deployable : contribution.getDeployables() ) { + scaDomain.getCompositeActivator().activate(deployable); + scaDomain.getCompositeActivator().start(deployable); + } + customer = scaDomain.getService(Customer.class, "CustomerComponent"); + } + + protected void tearDown() throws Exception { + if (scaDomain != null) { + scaDomain.close(); + scaDomain = null; + } + } + + + public void runTest(String contributionJarName) throws Exception { + + try { + setUp(contributionJarName); + customer.purchaseGoods(); + int retries = 10; + int outstandingCount = 1; + while (retries-- > 0) { + + outstandingCount = customer.outstandingOrderCount(); + if (outstandingCount == 0) + break; + else + Thread.sleep(100); + } + if (outstandingCount != 0) + throw new RuntimeException("Orders not processed on time"); + + } finally { + + tearDown(); + } + + + } + + +} diff --git a/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/customer/Customer.java b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/customer/Customer.java new file mode 100644 index 0000000000..35190c7ca4 --- /dev/null +++ b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/customer/Customer.java @@ -0,0 +1,37 @@ +/* + * 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 supplychain.customer; + +import org.osoa.sca.annotations.OneWay; +import org.osoa.sca.annotations.Remotable; + +/** + * This is the business interface of the Customer service component. + */ +@Remotable +public interface Customer { + + public void purchaseGoods(); + + @OneWay + public void notifyShipment(String order); + + public int outstandingOrderCount(); + +} diff --git a/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java new file mode 100644 index 0000000000..d6f164c5aa --- /dev/null +++ b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java @@ -0,0 +1,61 @@ +/* + * 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 supplychain.customer; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import supplychain.retailer.Retailer; + +/** + * This class implements the Customer service component (POJO implementation). + */ +@Service(Customer.class) +@Scope("COMPOSITE") +public class JavaCustomerComponentImpl implements Customer { + + private static int outstandingOrderCount; + + private Retailer retailer; + + public JavaCustomerComponentImpl() { + } + + @Reference + public void setRetailer(Retailer retailer) { + this.retailer = retailer; + } + + public void purchaseGoods() { + outstandingOrderCount++; + retailer.submitOrder("Order"); + } + + public void notifyShipment(String order) { + outstandingOrderCount--; + System.out.print("Work thread " + Thread.currentThread() + " - "); + System.out.println(order); + } + + public int outstandingOrderCount() { + return outstandingOrderCount; + } + +} diff --git a/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java new file mode 100644 index 0000000000..d7b52ee07b --- /dev/null +++ b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java @@ -0,0 +1,59 @@ +/* + * 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 supplychain.retailer; + + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import supplychain.warehouse.Warehouse; + +/** + * This class implements the Retailer service component (POJO implementation). + */ +@Service(Retailer.class) +@Scope("STATELESS") +public class JavaRetailerComponentImpl implements Retailer { + + private Warehouse warehouse; + + public JavaRetailerComponentImpl() { + } + + @Reference + public void setWarehouse(Warehouse warehouse) { + this.warehouse = warehouse; + } + + + public Warehouse getWarehouse() { + return warehouse; + } + + public void submitOrder(String order) { + + warehouse.fulfillOrder(order + ", submitted"); + + } + + + + +} diff --git a/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/retailer/Retailer.java b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/retailer/Retailer.java new file mode 100644 index 0000000000..1e87d59af1 --- /dev/null +++ b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/retailer/Retailer.java @@ -0,0 +1,28 @@ +/* + * 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 supplychain.retailer; + +/** + * This is the business interface of the Retailer service component. + */ +public interface Retailer { + + public void submitOrder(String order); + +} diff --git a/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/shipper/JavaShipperComponentImpl.java b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/shipper/JavaShipperComponentImpl.java new file mode 100644 index 0000000000..28de2cf1c2 --- /dev/null +++ b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/shipper/JavaShipperComponentImpl.java @@ -0,0 +1,50 @@ +/* + * 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 supplychain.shipper; + + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import supplychain.customer.Customer; + +/** + * This class implements the Shipper service component (POJO implementation). + */ +@Service(Shipper.class) +@Scope("COMPOSITE") +public class JavaShipperComponentImpl implements Shipper { + + private Customer customer; + + public JavaShipperComponentImpl() { + } + + @Reference + public void setCustomer(Customer customer) { + this.customer = customer; + } + + public void processShipment(String order) { + customer.notifyShipment(order + ", shipped"); + } + + +} diff --git a/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/shipper/Shipper.java b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/shipper/Shipper.java new file mode 100644 index 0000000000..2514928c10 --- /dev/null +++ b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/shipper/Shipper.java @@ -0,0 +1,28 @@ +/* + * 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 supplychain.shipper; + +/** + * This is the business interface of the Shipper service component. + */ +public interface Shipper { + + public void processShipment(String order); + +} diff --git a/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java new file mode 100644 index 0000000000..37de2d70c0 --- /dev/null +++ b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java @@ -0,0 +1,49 @@ +/* + * 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 supplychain.warehouse; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import supplychain.shipper.Shipper; + +/** + * This class implements the Warehouse service component (POJO implementation). + */ +@Service(Warehouse.class) +@Scope("STATELESS") +public class JavaWarehouseComponentImpl implements Warehouse { + + private Shipper shipper; + + public JavaWarehouseComponentImpl() { + } + + @Reference + public void setShipper(Shipper shipper) { + this.shipper = shipper; + } + + public void fulfillOrder(String order) { + shipper.processShipment(order + ", fulfilled"); + } + + +} diff --git a/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/warehouse/Warehouse.java b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/warehouse/Warehouse.java new file mode 100644 index 0000000000..6f1f6b8730 --- /dev/null +++ b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/warehouse/Warehouse.java @@ -0,0 +1,28 @@ +/* + * 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 supplychain.warehouse; + +/** + * This is the business interface of the Warehouse service component. + */ +public interface Warehouse { + + public void fulfillOrder(String order); + +} diff --git a/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/META-INF/SupplyChain.mf b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/META-INF/SupplyChain.mf new file mode 100644 index 0000000000..be36629b3c --- /dev/null +++ b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/META-INF/SupplyChain.mf @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: SupplyChain +Bundle-SymbolicName: supplychain.SupplyChain +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osoa.sca, + org.osoa.sca.annotations +Export-Package: supplychain.customer, supplychain + diff --git a/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/META-INF/SupplyChainClient.mf b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/META-INF/SupplyChainClient.mf new file mode 100644 index 0000000000..d4055a8fc3 --- /dev/null +++ b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/META-INF/SupplyChainClient.mf @@ -0,0 +1,20 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: SupplyChainClient +Bundle-SymbolicName: supplychain.SupplyChainClient +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.customer, supplychain, + org.apache.tuscany.sca.host.embedded, + org.apache.tuscany.sca.host.embedded.impl, + org.apache.tuscany.sca.assembly, + org.apache.tuscany.sca.contribution, + org.apache.tuscany.sca.contribution.service, + org.apache.tuscany.sca.core.assembly, + org.apache.tuscany.sca.assembly.builder, + org.osoa.sca, + org.osoa.sca.annotations +Export-Package: supplychain.client +Bundle-Activator: supplychain.client.SupplyChainClient + diff --git a/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/META-INF/sca-contribution.xml b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..714d1826e1 --- /dev/null +++ b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * 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. +--> +<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0" + targetNamespace="http://supplychain" + xmlns:supplychain="http://supplychain"> + + <deployable composite="supplychain:supplychain"/> + +</contribution> diff --git a/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/supplychain/supplychain.composite b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/supplychain/supplychain.composite new file mode 100644 index 0000000000..5be79b741a --- /dev/null +++ b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/supplychain/supplychain.composite @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ targetNamespace="http://supplychain"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:sp="http://supplychain"
+ name="supplychain">
+
+ <component name="CustomerComponent">
+ <implementation.java class="supplychain.customer.JavaCustomerComponentImpl" />
+ <reference name="retailer" target="RetailerComponent" />
+ </component>
+
+ <component name="RetailerComponent">
+ <implementation.java class="supplychain.retailer.JavaRetailerComponentImpl" />
+ <reference name="warehouse" target="WarehouseComponent"/>
+ </component>
+
+ <component name="WarehouseComponent">
+ <implementation.java class="supplychain.warehouse.JavaWarehouseComponentImpl" />
+ <reference name="shipper" target="ShipperComponent" />
+ </component>
+
+ <component name="ShipperComponent">
+ <implementation.java class="supplychain.shipper.JavaShipperComponentImpl" />
+ <reference name="customer" target="CustomerComponent" />
+ </component>
+
+
+</composite>
diff --git a/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/supplychain/ws/Customer.wsdl b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/supplychain/ws/Customer.wsdl new file mode 100644 index 0000000000..466bc38fc2 --- /dev/null +++ b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/supplychain/ws/Customer.wsdl @@ -0,0 +1,135 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * 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. + --> +<wsdl:definitions targetNamespace="http://supplychain" + xmlns:axis2ns1="http://supplychain" + xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" + xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" + xmlns:ns1="http://supplychain" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <wsdl:types xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <xs:schema attributeFormDefault="unqualified" + elementFormDefault="qualified" + targetNamespace="http://supplychain" + xmlns:ns="http://supplychain" xmlns:xs="http://www.w3.org/2001/XMLSchema"> + <xs:element name="outstandingOrderCount"> + <xs:complexType> + <xs:sequence/> + </xs:complexType> + </xs:element> + <xs:element name="outstandingOrderCountResponse"> + <xs:complexType> + <xs:sequence> + <xs:element name="return" type="xs:int"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="notifyShipment"> + <xs:complexType> + <xs:sequence> + <xs:element name="param0" type="xs:string"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="notifyShipmentResponse"> + <xs:complexType> + <xs:sequence/> + </xs:complexType> + </xs:element> + <xs:element name="purchaseGoods"> + <xs:complexType> + <xs:sequence/> + </xs:complexType> + </xs:element> + <xs:element name="purchaseGoodsResponse"> + <xs:complexType> + <xs:sequence/> + </xs:complexType> + </xs:element> + </xs:schema> + </wsdl:types> + <wsdl:message name="outstandingOrderCountRequest" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <wsdl:part element="ns1:outstandingOrderCount" name="part1" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/> + </wsdl:message> + <wsdl:message name="outstandingOrderCountResponseMessage" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <wsdl:part element="ns1:outstandingOrderCountResponse" name="part1" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/> + </wsdl:message> + <wsdl:message name="notifyShipmentRequest" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <wsdl:part element="ns1:notifyShipment" name="part1" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/> + </wsdl:message> + <wsdl:message name="notifyShipmentResponseMessage" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <wsdl:part element="ns1:notifyShipmentResponse" name="part1" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/> + </wsdl:message> + <wsdl:message name="purchaseGoodsRequest" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <wsdl:part element="ns1:purchaseGoods" name="part1" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/> + </wsdl:message> + <wsdl:message name="purchaseGoodsResponseMessage" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <wsdl:part element="ns1:purchaseGoodsResponse" name="part1" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/> + </wsdl:message> + <wsdl:portType name="Customer" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <wsdl:operation name="outstandingOrderCount" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <wsdl:input message="axis2ns1:outstandingOrderCountRequest" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/> + <wsdl:output + message="axis2ns1:outstandingOrderCountResponseMessage" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/> + </wsdl:operation> + <wsdl:operation name="notifyShipment" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <wsdl:input message="axis2ns1:notifyShipmentRequest" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/> + </wsdl:operation> + <wsdl:operation name="purchaseGoods" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <wsdl:input message="axis2ns1:purchaseGoodsRequest" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/> + <wsdl:output message="axis2ns1:purchaseGoodsResponseMessage" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="CustomerBinding" type="axis2ns1:Customer" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> + <wsdl:operation name="outstandingOrderCount" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <soap:operation soapAction="urn:outstandingOrderCount" + style="document" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> + <wsdl:input xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <soap:body namespace="http://supplychain" use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> + </wsdl:input> + <wsdl:output xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <soap:body namespace="http://supplychain" use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="notifyShipment" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <soap:operation soapAction="urn:notifyShipment" style="document" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> + <wsdl:input xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <soap:body namespace="http://supplychain" use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> + </wsdl:input> + </wsdl:operation> + <wsdl:operation name="purchaseGoods" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <soap:operation soapAction="urn:purchaseGoods" style="document" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> + <wsdl:input xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <soap:body namespace="http://supplychain" use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> + </wsdl:input> + </wsdl:operation> + </wsdl:binding> + + <wsdl:service name="CustomerWebService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <wsdl:port binding="axis2ns1:CustomerBinding" + name="CustomerPort" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <soap:address + location="http://localhost:8085/services/Customer" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> + </wsdl:port> + </wsdl:service>
+ +</wsdl:definitions> diff --git a/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/supplychain/ws/supplychain.composite b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/supplychain/ws/supplychain.composite new file mode 100644 index 0000000000..88d1e72efc --- /dev/null +++ b/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/supplychain/ws/supplychain.composite @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ targetNamespace="http://supplychain"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:sp="http://supplychain"
+ name="supplychain">
+
+ <component name="CustomerComponent">
+ <implementation.java class="supplychain.customer.JavaCustomerComponentImpl" />
+ <reference name="retailer" target="RetailerComponent" />
+ <service name="Customer">
+ <interface.wsdl interface="http://supplychain#wsdl.interface(Customer)" />
+ <binding.ws wsdlElement="http://supplychain#wsdl.port(CustomerWebService/CustomerPort)"/>
+ </service>
+ </component>
+
+ <component name="RetailerComponent">
+ <implementation.java class="supplychain.retailer.JavaRetailerComponentImpl" />
+ <reference name="warehouse" target="WarehouseComponent"/>
+ </component>
+
+ <component name="WarehouseComponent">
+ <implementation.java class="supplychain.warehouse.JavaWarehouseComponentImpl" />
+ <reference name="shipper" target="ShipperComponent" />
+ </component>
+
+ <component name="ShipperComponent">
+ <implementation.java class="supplychain.shipper.JavaShipperComponentImpl" />
+ <reference name="customer">
+ <interface.wsdl interface="http://supplychain#wsdl.interface(Customer)" />
+ <binding.ws wsdlElement="http://supplychain#wsdl.port(CustomerWebService/CustomerPort)"/>
+ </reference>
+ </component>
+
+
+</composite>
|