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 --- .../itest/osgi-implementation/build-bundles.xml | 34 + .../itest/osgi-implementation/pom.xml | 734 +++++++++++++++++++++ .../src/main/java/helloworld/Greetings.java | 36 + .../src/main/java/helloworld/HelloWorld.java | 29 + .../java/helloworld/JavaGreetingsComponent.java | 73 ++ .../java/helloworld/JavaHelloWorldComponent.java | 41 ++ .../main/java/helloworld/OSGiGreetingsImpl.java | 109 +++ .../main/java/helloworld/OSGiHelloWorldImpl.java | 81 +++ .../src/main/java/helloworld/ws/HelloWorld.java | 29 + .../main/java/helloworld/ws/HelloWorldService.java | 28 + .../stockquote/OSGiStockQuoteComponentImpl.java | 83 +++ .../java/stockquote/OSGiStockQuoteFactoryImpl.java | 65 ++ .../main/java/stockquote/OSGiStockQuoteImpl.java | 116 ++++ .../src/main/java/stockquote/StockQuote.java | 31 + .../src/main/java/supplychain/OSGiBundleImpl.java | 163 +++++ .../main/java/supplychain/customer/Customer.java | 39 ++ .../customer/JavaCustomerComponentImpl.java | 88 +++ .../customer/OSGiCustomerComponentImpl.java | 104 +++ .../customer/OSGiCustomerFactoryImpl.java | 65 ++ .../supplychain/customer/OSGiCustomerImpl.java | 89 +++ .../OSGiCustomerWithQueryComponentImpl.java | 100 +++ .../customer/OSGiCustomerWithQueryImpl.java | 82 +++ .../customer/OSGiVersionedCustomerImpl.java | 98 +++ .../retailer/JavaRetailerComponentImpl.java | 67 ++ .../retailer/OSGiRetailerComponentImpl.java | 64 ++ .../supplychain/retailer/OSGiRetailerImpl.java | 58 ++ .../retailer/OSGiRetailerServiceImpl.java | 45 ++ .../OSGiRetailerWithQueryComponentImpl.java | 78 +++ .../retailer/OSGiRetailerWithQueryImpl.java | 64 ++ .../retailer/OSGiVersionedRetailerImpl.java | 75 +++ .../retailer/OSGiVersionedRetailerServiceImpl.java | 47 ++ .../main/java/supplychain/retailer/Retailer.java | 28 + .../java/supplychain/retailer/RetailerQuery.java | 28 + .../shipper/JavaShipperComponentImpl.java | 58 ++ .../shipper/OSGiShipperComponentImpl.java | 62 ++ .../shipper/OSGiShipperFactoryImpl.java | 78 +++ .../java/supplychain/shipper/OSGiShipperImpl.java | 57 ++ .../shipper/OSGiShipperServiceImpl.java | 43 ++ .../shipper/OSGiVersionedShipperImpl.java | 76 +++ .../shipper/OSGiVersionedShipperServiceImpl.java | 46 ++ .../src/main/java/supplychain/shipper/Shipper.java | 28 + .../warehouse/JavaWarehouseComponentImpl.java | 48 ++ .../JavaWarehouseWithQueryComponentImpl.java | 52 ++ .../warehouse/OSGiWarehouseComponentImpl.java | 57 ++ .../supplychain/warehouse/OSGiWarehouseImpl.java | 68 ++ .../warehouse/OSGiWarehouseServiceImpl.java | 62 ++ .../main/java/supplychain/warehouse/Warehouse.java | 28 + .../java/supplychain/warehouse/WarehouseQuery.java | 28 + .../src/main/resources/META-INF/LICENSE.txt | 202 ++++++ .../src/main/resources/META-INF/NOTICE | 14 + .../src/main/resources/META-INF/README.txt | 35 + .../main/resources/META-INF/sca-contribution.xml | 24 + .../resources/helloworld/Greetings.componentType | 30 + .../resources/helloworld/HelloWorld.componentType | 31 + .../src/main/resources/osgi/factory/Customer.mf | 11 + .../src/main/resources/osgi/factory/Retailer.mf | 10 + .../src/main/resources/osgi/factory/Shipper.mf | 10 + .../src/main/resources/osgi/factory/ds/Customer.mf | 10 + .../main/resources/osgi/factory/ds/Customer.xml | 41 ++ .../src/main/resources/osgi/factory/ds/Retailer.mf | 11 + .../main/resources/osgi/factory/ds/Retailer1.xml | 32 + .../main/resources/osgi/factory/ds/Retailer2.xml | 32 + .../src/main/resources/osgi/factory/ds/Shipper.mf | 10 + .../main/resources/osgi/factory/ds/Shipper1.xml | 34 + .../main/resources/osgi/factory/ds/Shipper2.xml | 34 + .../main/resources/osgi/factory/ds/Warehouse.mf | 11 + .../main/resources/osgi/factory/ds/Warehouse.xml | 32 + .../src/main/resources/osgi/interfaces/Customer.mf | 11 + .../src/main/resources/osgi/interfaces/Retailer.mf | 10 + .../src/main/resources/osgi/interfaces/Shipper.mf | 10 + .../main/resources/osgi/interfaces/ds/Customer.mf | 10 + .../main/resources/osgi/interfaces/ds/Customer.xml | 43 ++ .../main/resources/osgi/interfaces/ds/Retailer.mf | 11 + .../main/resources/osgi/interfaces/ds/Retailer.xml | 39 ++ .../main/resources/osgi/interfaces/ds/Shipper.mf | 10 + .../main/resources/osgi/interfaces/ds/Shipper.xml | 34 + .../src/main/resources/osgi/passbyref/Greetings.mf | 10 + .../osgi/properties/ManagedStockQuoteFactory.mf | 10 + .../main/resources/osgi/properties/StockQuote.mf | 10 + .../resources/osgi/properties/StockQuoteFactory.mf | 10 + .../resources/osgi/properties/ds/StockQuote.mf | 11 + .../resources/osgi/properties/ds/StockQuote.xml | 27 + .../osgi/properties/ds/StockQuoteFactory.mf | 11 + .../osgi/properties/ds/StockQuoteFactory.xml | 27 + .../src/main/resources/osgi/services/Customer.mf | 11 + .../src/main/resources/osgi/services/Retailer.mf | 10 + .../src/main/resources/osgi/services/Shipper.mf | 10 + .../src/main/resources/osgi/services/Warehouse.mf | 10 + .../main/resources/osgi/services/ds/Customer.mf | 10 + .../main/resources/osgi/services/ds/Customer.xml | 41 ++ .../main/resources/osgi/services/ds/Retailer.mf | 11 + .../main/resources/osgi/services/ds/Retailer1.xml | 32 + .../main/resources/osgi/services/ds/Retailer2.xml | 32 + .../src/main/resources/osgi/services/ds/Shipper.mf | 10 + .../main/resources/osgi/services/ds/Shipper1.xml | 34 + .../main/resources/osgi/services/ds/Shipper2.xml | 34 + .../main/resources/osgi/services/ds/Warehouse.mf | 11 + .../main/resources/osgi/services/ds/Warehouse1.xml | 32 + .../main/resources/osgi/services/ds/Warehouse2.xml | 32 + .../src/main/resources/osgi/version/Customer1.mf | 11 + .../src/main/resources/osgi/version/Customer2.mf | 11 + .../src/main/resources/osgi/version/Retailer1.mf | 10 + .../src/main/resources/osgi/version/Retailer2.mf | 10 + .../src/main/resources/osgi/version/Shipper1.mf | 10 + .../src/main/resources/osgi/version/Shipper2.mf | 10 + .../src/main/resources/osgi/version/Warehouse1.mf | 10 + .../src/main/resources/osgi/version/Warehouse2.mf | 10 + .../main/resources/osgi/version/ds/Customer1.mf | 10 + .../main/resources/osgi/version/ds/Customer2.mf | 10 + .../main/resources/osgi/version/ds/CustomerV1.xml | 41 ++ .../main/resources/osgi/version/ds/CustomerV2.xml | 41 ++ .../main/resources/osgi/version/ds/Retailer1.mf | 11 + .../main/resources/osgi/version/ds/Retailer1V1.xml | 34 + .../main/resources/osgi/version/ds/Retailer1V2.xml | 34 + .../main/resources/osgi/version/ds/Retailer2.mf | 11 + .../main/resources/osgi/version/ds/Retailer2V1.xml | 33 + .../main/resources/osgi/version/ds/Retailer2V2.xml | 33 + .../src/main/resources/osgi/version/ds/Shipper1.mf | 10 + .../main/resources/osgi/version/ds/Shipper1V1.xml | 35 + .../main/resources/osgi/version/ds/Shipper1V2.xml | 35 + .../src/main/resources/osgi/version/ds/Shipper2.mf | 10 + .../main/resources/osgi/version/ds/Shipper2V1.xml | 35 + .../main/resources/osgi/version/ds/Shipper2V2.xml | 35 + .../main/resources/osgi/version/ds/Warehouse1.mf | 11 + .../resources/osgi/version/ds/Warehouse1V1.xml | 32 + .../resources/osgi/version/ds/Warehouse1V2.xml | 32 + .../main/resources/osgi/version/ds/Warehouse2.mf | 11 + .../resources/osgi/version/ds/Warehouse2V1.xml | 32 + .../resources/osgi/version/ds/Warehouse2V2.xml | 32 + .../src/main/resources/osgi/wiring/Customer.mf | 11 + .../src/main/resources/osgi/wiring/Retailer.mf | 10 + .../src/main/resources/osgi/wiring/Shipper.mf | 10 + .../src/main/resources/osgi/wiring/Warehouse.mf | 10 + .../src/main/resources/osgi/wiring/ds/Customer.mf | 10 + .../src/main/resources/osgi/wiring/ds/Customer.xml | 41 ++ .../src/main/resources/osgi/wiring/ds/Retailer.mf | 11 + .../main/resources/osgi/wiring/ds/Retailer1.xml | 33 + .../main/resources/osgi/wiring/ds/Retailer2.xml | 33 + .../src/main/resources/osgi/wiring/ds/Shipper.mf | 10 + .../src/main/resources/osgi/wiring/ds/Shipper1.xml | 35 + .../src/main/resources/osgi/wiring/ds/Shipper2.xml | 34 + .../src/main/resources/osgi/wiring/ds/Warehouse.mf | 11 + .../main/resources/osgi/wiring/ds/Warehouse1.xml | 32 + .../main/resources/osgi/wiring/ds/Warehouse2.xml | 32 + .../src/main/resources/osgi/ws/HelloWorld.mf | 12 + .../main/resources/sca/factory-ds-test.composite | 136 ++++ .../src/main/resources/sca/factory-test.composite | 121 ++++ .../src/main/resources/sca/helloworld.wsdl | 80 +++ .../resources/sca/interfaces-ds-test.composite | 60 ++ .../main/resources/sca/interfaces-test.composite | 60 ++ .../main/resources/sca/passbyref-test.composite | 41 ++ .../resources/sca/properties-ds-test.composite | 41 ++ .../main/resources/sca/properties-test.composite | 41 ++ .../resources/sca/properties2-ds-test.composite | 58 ++ .../main/resources/sca/properties2-test.composite | 52 ++ .../main/resources/sca/services-ds-test.composite | 93 +++ .../src/main/resources/sca/services-test.composite | 92 +++ .../main/resources/sca/version-ds-test.composite | 160 +++++ .../src/main/resources/sca/version-test.composite | 150 +++++ .../main/resources/sca/wiring-ds-test1.composite | 142 ++++ .../main/resources/sca/wiring-ds-test2.composite | 159 +++++ .../src/main/resources/sca/wiring-test1.composite | 132 ++++ .../src/main/resources/sca/wiring-test2.composite | 159 +++++ .../src/main/resources/sca/ws-helloworld.composite | 52 ++ .../resources/stockquote/StockQuote.componentType | 28 + .../resources/supplychain/Customer.componentType | 34 + .../supplychain/CustomerServices.componentType | 34 + .../supplychain/CustomerWithQuery.componentType | 31 + .../resources/supplychain/Retailer.componentType | 29 + .../supplychain/RetailerServices.componentType | 33 + .../supplychain/RetailerWithQuery.componentType | 35 + .../resources/supplychain/Shipper.componentType | 29 + .../supplychain/ShipperServices.componentType | 30 + .../resources/supplychain/Warehouse.componentType | 28 + .../supplychain/WarehouseServices.componentType | 28 + .../supplychain/WarehouseWithQuery.componentType | 31 + .../test/java/helloworld/HelloWorldTestCase.java | 55 ++ .../test/java/helloworld/PassByRefTestCase.java | 135 ++++ .../test/java/supplychain/SupplyChainTestCase.java | 79 +++ .../supplychain/VersionedSupplyChainTestCase.java | 81 +++ .../supplychain/factory/DSFactoryTestCase.java | 32 + .../java/supplychain/factory/FactoryTestCase.java | 52 ++ .../interfaces/DSInterfacesTestCase.java | 32 + .../supplychain/interfaces/InterfacesTestCase.java | 32 + .../properties/DSProperties2TestCase.java | 31 + .../properties/DSPropertiesTestCase.java | 31 + .../properties/Properties2TestCase.java | 83 +++ .../supplychain/properties/PropertiesTestCase.java | 73 ++ .../supplychain/services/DSServicesTestCase.java | 32 + .../supplychain/services/ServicesTestCase.java | 32 + .../supplychain/version/DSVersionTestCase.java | 33 + .../java/supplychain/version/VersionTestCase.java | 33 + .../java/supplychain/wiring/DSWiring1TestCase.java | 33 + .../java/supplychain/wiring/DSWiring2TestCase.java | 33 + .../java/supplychain/wiring/Wiring1TestCase.java | 32 + .../java/supplychain/wiring/Wiring2TestCase.java | 32 + .../src/test/java/util/OSGiTestUtil.java | 71 ++ .../resources/osgi/felix/felix.config.properties | 44 ++ 198 files changed, 9165 insertions(+) create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/build-bundles.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/Greetings.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/HelloWorld.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/JavaGreetingsComponent.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/JavaHelloWorldComponent.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/OSGiGreetingsImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/OSGiHelloWorldImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/ws/HelloWorld.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/ws/HelloWorldService.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/stockquote/OSGiStockQuoteComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/stockquote/OSGiStockQuoteFactoryImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/stockquote/OSGiStockQuoteImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/stockquote/StockQuote.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/OSGiBundleImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/Customer.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerFactoryImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerWithQueryComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerWithQueryImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiVersionedCustomerImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerWithQueryComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerWithQueryImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiVersionedRetailerImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiVersionedRetailerServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/Retailer.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/RetailerQuery.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/JavaShipperComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiShipperComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiShipperFactoryImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiShipperImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiShipperServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiVersionedShipperImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiVersionedShipperServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/Shipper.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/JavaWarehouseWithQueryComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/Warehouse.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/WarehouseQuery.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/META-INF/LICENSE.txt create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/META-INF/NOTICE create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/META-INF/README.txt create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/helloworld/Greetings.componentType create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/helloworld/HelloWorld.componentType create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/Customer.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/Retailer.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/Shipper.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Customer.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Customer.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Retailer.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Retailer1.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Retailer2.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Shipper.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Shipper1.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Shipper2.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Warehouse.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Warehouse.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/Customer.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/Retailer.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/Shipper.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Customer.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Customer.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Retailer.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Retailer.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Shipper.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Shipper.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/passbyref/Greetings.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/ManagedStockQuoteFactory.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/StockQuote.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/StockQuoteFactory.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/ds/StockQuote.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/ds/StockQuote.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/ds/StockQuoteFactory.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/ds/StockQuoteFactory.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/Customer.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/Retailer.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/Shipper.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/Warehouse.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Customer.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Customer.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Retailer.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Retailer1.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Retailer2.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Shipper.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Shipper1.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Shipper2.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Warehouse.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Warehouse1.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Warehouse2.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Customer1.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Customer2.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Retailer1.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Retailer2.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Shipper1.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Shipper2.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Warehouse1.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Warehouse2.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Customer1.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Customer2.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/CustomerV1.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/CustomerV2.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer1.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer1V1.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer1V2.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer2.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer2V1.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer2V2.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper1.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper1V1.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper1V2.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper2.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper2V1.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper2V2.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse1.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse1V1.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse1V2.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse2.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse2V1.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse2V2.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/Customer.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/Retailer.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/Shipper.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/Warehouse.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Customer.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Customer.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Retailer.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Retailer1.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Retailer2.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Shipper.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Shipper1.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Shipper2.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Warehouse.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Warehouse1.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Warehouse2.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/ws/HelloWorld.mf create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/factory-ds-test.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/factory-test.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/helloworld.wsdl create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/interfaces-ds-test.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/interfaces-test.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/passbyref-test.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/properties-ds-test.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/properties-test.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/properties2-ds-test.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/properties2-test.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/services-ds-test.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/services-test.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/version-ds-test.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/version-test.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/wiring-ds-test1.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/wiring-ds-test2.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/wiring-test1.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/wiring-test2.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/ws-helloworld.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/stockquote/StockQuote.componentType create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/Customer.componentType create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/CustomerServices.componentType create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/CustomerWithQuery.componentType create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/Retailer.componentType create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/RetailerServices.componentType create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/RetailerWithQuery.componentType create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/Shipper.componentType create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/ShipperServices.componentType create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/Warehouse.componentType create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/WarehouseServices.componentType create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/WarehouseWithQuery.componentType create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/helloworld/HelloWorldTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/helloworld/PassByRefTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/SupplyChainTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/VersionedSupplyChainTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/factory/DSFactoryTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/factory/FactoryTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/interfaces/DSInterfacesTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/interfaces/InterfacesTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/properties/DSProperties2TestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/properties/DSPropertiesTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/properties/Properties2TestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/properties/PropertiesTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/services/DSServicesTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/services/ServicesTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/version/DSVersionTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/version/VersionTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/wiring/DSWiring1TestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/wiring/DSWiring2TestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/wiring/Wiring1TestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/wiring/Wiring2TestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/util/OSGiTestUtil.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/resources/osgi/felix/felix.config.properties (limited to 'sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation') diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/build-bundles.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/build-bundles.xml new file mode 100644 index 0000000000..450b14a463 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/build-bundles.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/pom.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/pom.xml new file mode 100644 index 0000000000..2cbbedd463 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/pom.xml @@ -0,0 +1,734 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 0.99-incubating-SNAPSHOT + ../../pom.xml + + itest-osgi-implementation + Apache Tuscany OSGi-SCA Integration tests + + + + + org.apache.felix + org.apache.felix.main + 1.0.0 + + + + org.apache.felix + org.osgi.core + 1.0.0 + + + + org.apache.felix + org.apache.felix.configadmin + 0.9.0-SNAPSHOT + + + + org.apache.felix + org.apache.felix.log + 0.9.0-incubator-SNAPSHOT + + + + org.apache.felix + org.apache.felix.scr + 0.9.0-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-host-embedded + 0.99-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 0.99-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-osgi + 0.99-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 0.99-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-http + 0.99-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-http-jetty + 0.99-incubating-SNAPSHOT + test + + + + junit + junit + 4.2 + test + + + + + itest-osgi-implementation + + + org.apache.maven.plugins + maven-antrun-plugin + 1.1 + + + + ant + ant-trax + 1.6.5 + + + + + + create-bundles + generate-test-sources + + run + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/Greetings.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/Greetings.java new file mode 100644 index 0000000000..9285c0a8d5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/Greetings.java @@ -0,0 +1,36 @@ +/* + * 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; + +@Remotable +public interface Greetings { + + + public String[] getGreetingsFromJava(String[] s); + + public String[] getGreetingsFromOSGi(String[] s); + + public String[] getModifiedGreetingsFromJava(String[] s); + + public String[] getModifiedGreetingsFromOSGi(String[] s); + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/HelloWorld.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/HelloWorld.java new file mode 100644 index 0000000000..16d0eae990 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/HelloWorld.java @@ -0,0 +1,29 @@ +/* + * 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; + +@Remotable +public interface HelloWorld { + + public String getGreetings(String s); + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/JavaGreetingsComponent.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/JavaGreetingsComponent.java new file mode 100644 index 0000000000..3d0e045225 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/JavaGreetingsComponent.java @@ -0,0 +1,73 @@ +/* + * 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.AllowsPassByReference; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(Greetings.class) +@Scope("COMPOSITE") +public class JavaGreetingsComponent implements Greetings { + + private Greetings greetingsService; + + @Reference + public void setGreetingsService(Greetings greetingsService) { + this.greetingsService = greetingsService; + } + + + public String[] getGreetingsFromJava(String s[]) { + for (int i = 0; i < s.length; i++) { + s[i] = "Hello " + s[i] + "(From Java)"; + } + + return greetingsService.getGreetingsFromJava(s); + } + + public String[] getGreetingsFromOSGi(String s[]) { + for (int i = 0; i < s.length; i++) { + s[i] = s[i] + "(From Java)"; + } + + return s; + } + + @AllowsPassByReference + public String[] getModifiedGreetingsFromJava(String s[]) { + for (int i = 0; i < s.length; i++) { + s[i] = "Hello " + s[i] + "(From Java)"; + } + + return greetingsService.getModifiedGreetingsFromJava(s); + } + + @AllowsPassByReference + public String[] getModifiedGreetingsFromOSGi(String s[]) { + for (int i = 0; i < s.length; i++) { + s[i] = s[i] + "(From Java)"; + } + + return s; + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/JavaHelloWorldComponent.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/JavaHelloWorldComponent.java new file mode 100644 index 0000000000..c055aee142 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/JavaHelloWorldComponent.java @@ -0,0 +1,41 @@ +/* + * 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.Reference; +import org.osoa.sca.annotations.Scope; + +@Scope("COMPOSITE") +public class JavaHelloWorldComponent implements HelloWorld { + + public helloworld.ws.HelloWorld helloWorldWS; + + @Reference + public void setHelloWorldWS(helloworld.ws.HelloWorld helloWorldWS) { + this.helloWorldWS = helloWorldWS; + } + + public String getGreetings(String s) { + return helloWorldWS.getGreetings(s); + } + + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/OSGiGreetingsImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/OSGiGreetingsImpl.java new file mode 100644 index 0000000000..fb0313a313 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/OSGiGreetingsImpl.java @@ -0,0 +1,109 @@ +/* + * 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.util.Hashtable; + +import org.osgi.framework.BundleContext; +import org.osgi.framework.InvalidSyntaxException; +import org.osgi.framework.ServiceEvent; +import org.osgi.framework.ServiceListener; +import org.osgi.framework.ServiceReference; +import org.osgi.framework.BundleActivator; + + +public class OSGiGreetingsImpl implements Greetings, ServiceListener, BundleActivator { + + private Greetings greetingsService; + + private BundleContext bundleContext; + + public String[] getGreetingsFromOSGi(String s[]) { + for (int i = 0; i < s.length; i++) { + s[i] = "Hello " + s[i] + "(From OSGi)"; + } + + return greetingsService.getGreetingsFromOSGi(s); + } + + public String[] getGreetingsFromJava(String s[]) { + for (int i = 0; i < s.length; i++) { + s[i] = s[i] + "(From OSGi)"; + } + + return s; + } + + public String[] getModifiedGreetingsFromOSGi(String s[]) { + for (int i = 0; i < s.length; i++) { + s[i] = "Hello " + s[i] + "(From OSGi)"; + } + + return greetingsService.getModifiedGreetingsFromOSGi(s); + } + + public String[] getModifiedGreetingsFromJava(String s[]) { + for (int i = 0; i < s.length; i++) { + s[i] = s[i] + "(From OSGi)"; + } + + return s; + } + + public void start(BundleContext bc) { + + System.out.println("Started OsgiGreetingsImpl bundle "); + + this.bundleContext = bc; + + Hashtable serviceProps = new Hashtable(); + serviceProps.put("component.service.name", "OSGiGreetingsComponent/Greetings"); + bundleContext.registerService("helloworld.Greetings", this, serviceProps); + + + ServiceReference ref = bundleContext.getServiceReference("helloworld.Greetings"); + if (ref != null) + greetingsService = (helloworld.Greetings)bundleContext.getService(ref); + else { + try { + String filter = "(objectclass=helloworld.Greetings)"; + this.bundleContext.addServiceListener(this, filter); + + } catch (InvalidSyntaxException e) { + e.printStackTrace(); + } + } + + } + + public void stop(BundleContext bc) { + } + + public void serviceChanged(ServiceEvent event) { + try { + if (event.getType() == ServiceEvent.REGISTERED) { + ServiceReference ref = event.getServiceReference(); + greetingsService = (helloworld.Greetings) bundleContext.getService(ref); + } + } catch (Throwable e) { + e.printStackTrace(); + } + } +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/OSGiHelloWorldImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/OSGiHelloWorldImpl.java new file mode 100644 index 0000000000..0588da9a85 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/OSGiHelloWorldImpl.java @@ -0,0 +1,81 @@ +/* + * 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.util.Hashtable; + +import org.osgi.framework.BundleContext; +import org.osgi.framework.InvalidSyntaxException; +import org.osgi.framework.ServiceEvent; +import org.osgi.framework.ServiceListener; +import org.osgi.framework.ServiceReference; +import org.osgi.framework.BundleActivator; + + +public class OSGiHelloWorldImpl implements HelloWorld, ServiceListener, BundleActivator { + + public helloworld.ws.HelloWorld helloWorldWS; + + private BundleContext bundleContext; + + public String getGreetings(String s) { + return helloWorldWS.getGreetings(s); + } + + + public void start(BundleContext bc) { + + System.out.println("Started OsgiHelloWorldImpl bundle "); + + this.bundleContext = bc; + + Hashtable serviceProps = new Hashtable(); + serviceProps.put("component.name", "HelloWorldComponent"); + bundleContext.registerService("helloworld.HelloWorld", this, serviceProps); + + ServiceReference ref = bundleContext.getServiceReference("helloworld.ws.HelloWorld"); + if (ref != null) + helloWorldWS = (helloworld.ws.HelloWorld)bundleContext.getService(ref); + else { + try { + String filter = "(objectclass=helloworld.ws.HelloWorld)"; + this.bundleContext.addServiceListener(this, filter); + + } catch (InvalidSyntaxException e) { + e.printStackTrace(); + } + } + + } + + public void stop(BundleContext bc) { + } + + public void serviceChanged(ServiceEvent event) { + try { + if (event.getType() == ServiceEvent.REGISTERED) { + ServiceReference ref = event.getServiceReference(); + helloWorldWS = (helloworld.ws.HelloWorld) bundleContext.getService(ref); + } + } catch (Throwable e) { + e.printStackTrace(); + } + } +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/ws/HelloWorld.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/ws/HelloWorld.java new file mode 100644 index 0000000000..039a214856 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/ws/HelloWorld.java @@ -0,0 +1,29 @@ +/* + * 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.ws; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface HelloWorld { + + public String getGreetings(String s); + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/ws/HelloWorldService.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/ws/HelloWorldService.java new file mode 100644 index 0000000000..4a3cd4aed2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/helloworld/ws/HelloWorldService.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 helloworld.ws; + +public class HelloWorldService implements HelloWorld { + + public String getGreetings(String s) { + return "Hello " + s; + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/stockquote/OSGiStockQuoteComponentImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/stockquote/OSGiStockQuoteComponentImpl.java new file mode 100644 index 0000000000..a69f325526 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/stockquote/OSGiStockQuoteComponentImpl.java @@ -0,0 +1,83 @@ +/* + * 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 stockquote; + +import java.util.Dictionary; + +import org.osgi.service.component.ComponentContext; + +/** + * Declarative Stock quote with configurable properties. + */ +public class OSGiStockQuoteComponentImpl implements StockQuote { + + public double exchangeRate; + + private String currency; + + + public double configExchangeRate; + public String configCurrency; + + public void setCurrency(String currency) { + this.currency = currency; + } + + public double getQuote(String ticker) throws Exception { + + if (exchangeRate == 2.0 && !"USD".equals(currency)) { + throw new RuntimeException("Property exchangeRate not set correctly, exchangeRate= " + + exchangeRate + " currency=" + currency); + } + if (exchangeRate == 1.48 && !"EURO".equals(currency)) { + throw new RuntimeException("Property exchangeRate not set correctly, exchangeRate= " + + exchangeRate + " currency=" + currency); + } + + if (configExchangeRate == 2.0 && !"USD".equals(configCurrency)) { + throw new RuntimeException("ConfigAdmin Property exchangeRate not set correctly, exchangeRate= " + + configExchangeRate + " currency=" + configCurrency); + } + if (configExchangeRate == 1.48 && !"EURO".equals(configCurrency)) { + throw new RuntimeException("Property configExchangeRate not set correctly, exchangeRate= " + + configExchangeRate + " currency=" + configCurrency); + } + + return 52.81 * exchangeRate; + + } + + protected void activate(ComponentContext context){ + System.out.println("Activated OSGiStockQuoteComponentImpl bundle "); + Dictionary props = context.getProperties(); + Object prop = props.get("currency"); + if (prop instanceof String[]&& ((String [])prop).length > 0) + configCurrency = ((String [])prop)[0]; + prop = props.get("exchangeRate"); + if (prop instanceof Double[]&& ((Double [])prop).length > 0) + configExchangeRate = (double)((Double [])prop)[0]; + } + + protected void deactivate(ComponentContext context){ + System.out.println("Deactivated OSGiStockQuoteComponentImpl bundle "); + } + + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/stockquote/OSGiStockQuoteFactoryImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/stockquote/OSGiStockQuoteFactoryImpl.java new file mode 100644 index 0000000000..e2d25bf47d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/stockquote/OSGiStockQuoteFactoryImpl.java @@ -0,0 +1,65 @@ +/* + * 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 stockquote; + +import java.util.Hashtable; + +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceFactory; +import org.osgi.framework.ServiceRegistration; + +/** + * + * OSGi service factory where service has configurable properties + * Only property injection is tested. ConfigurationAdmin is not used. + * + */ +public class OSGiStockQuoteFactoryImpl implements BundleActivator, ServiceFactory { + + + private BundleContext bundleContext; + + + public void start(BundleContext bc) throws Exception { + + bundleContext = bc; + + Hashtable props = new Hashtable(); + bc.registerService(StockQuote.class.getName(), this, props); + + } + + public void stop(BundleContext bc) throws Exception { + } + + + public Object getService(Bundle bundle, ServiceRegistration registration) { + return new OSGiStockQuoteImpl(bundleContext); + } + + + public void ungetService(Bundle bundle, ServiceRegistration registration, Object service) { + + } + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/stockquote/OSGiStockQuoteImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/stockquote/OSGiStockQuoteImpl.java new file mode 100644 index 0000000000..3f91f1e922 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/stockquote/OSGiStockQuoteImpl.java @@ -0,0 +1,116 @@ +/* + * 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 stockquote; + +import java.util.Dictionary; +import java.util.Hashtable; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; +import org.osgi.service.cm.Configuration; +import org.osgi.service.cm.ConfigurationAdmin; + +/** + * + * Stock quote with configurable properties. + * + */ +public class OSGiStockQuoteImpl implements StockQuote, BundleActivator { + + public String pid; + + public double exchangeRate; + + private String currency; + + private BundleContext bundleContext; + + public OSGiStockQuoteImpl() { + this.pid = "stockQuote"; + } + + protected OSGiStockQuoteImpl(BundleContext bc) { + this.bundleContext = bc; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + + private void checkProperties() throws Exception { + + if (exchangeRate == 2.0 && !"USD".equals(currency)) { + throw new RuntimeException("Property exchangeRate not set correctly, exchangeRate= " + + exchangeRate + " currency=" + currency); + } + + if (exchangeRate == 1.48 && !"EURO".equals(currency)) { + throw new RuntimeException("Property exchangeRate not set correctly, exchangeRate= " + + exchangeRate + " currency=" + currency); + } + + ServiceReference configAdminReference = bundleContext.getServiceReference("org.osgi.service.cm.ConfigurationAdmin"); + if (configAdminReference != null && pid != null ) { + + ConfigurationAdmin cm = (ConfigurationAdmin)bundleContext.getService(configAdminReference); + + Configuration config = cm.getConfiguration("stockQuote", null); + + Dictionary props = config.getProperties(); + + if (exchangeRate != (double)(Double)props.get("exchangeRate")) { + throw new Exception("Config Property exchangeRate not set correctly, expected " + + props.get("exchangeRate") + " got " + exchangeRate); + } + + if (!currency.equals(props.get("currency"))) { + throw new Exception("Config Property currency not set correctly, expected " + + props.get("currency") + " got " + currency); + } + } + + } + + public double getQuote(String ticker) throws Exception { + + checkProperties(); + + return 52.81 * exchangeRate; + + } + + public void start(BundleContext bc) throws Exception { + + bundleContext = bc; + + Hashtable props = new Hashtable(); + props.put("service.pid", "stockQuote"); + + bc.registerService(StockQuote.class.getName(), this, props); + + } + + public void stop(BundleContext bc) throws Exception { + } + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/stockquote/StockQuote.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/stockquote/StockQuote.java new file mode 100644 index 0000000000..a47f68c579 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/stockquote/StockQuote.java @@ -0,0 +1,31 @@ +/* + * 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 stockquote; + +/** + * + * Stock Quote interface + * + */ +public interface StockQuote { + + public double getQuote(String ticker) throws Exception ; + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/OSGiBundleImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/OSGiBundleImpl.java new file mode 100644 index 0000000000..25d7bcf2ff --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/OSGiBundleImpl.java @@ -0,0 +1,163 @@ +/* + * 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; + + + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Hashtable; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceEvent; +import org.osgi.framework.ServiceListener; +import org.osgi.framework.ServiceReference; + + +/** + * This class implements the Customer service component. + */ +public class OSGiBundleImpl implements ServiceListener, BundleActivator { + + + String name; + + String[] references; + Class[] referenceClasses; + Field[] referenceFields; + String[] referenceFilters; + + Class myClass; + ArrayList serviceNames = new ArrayList(); + ArrayList serviceObjs = new ArrayList(); + ArrayList> serviceProperties = new ArrayList>(); + + + private BundleContext bundleContext; + + public OSGiBundleImpl() {} + + public OSGiBundleImpl(String[] references, String[] filters) { + + myClass = this.getClass(); + this.name = this.getClass().getSimpleName(); + this.references = references == null?new String[0] : references; + + + try { + referenceClasses = new Class[references.length]; + referenceFields = new Field[references.length]; + referenceFilters = new String[references.length]; + for (int i = 0; i < references.length; i++) { + referenceFields[i] = this.getClass().getDeclaredField(references[i]); + referenceFields[i].setAccessible(true); + referenceClasses[i] = referenceFields[i].getType(); + + if (filters != null && filters.length > i) + referenceFilters[i] = filters[i]; + } + + } catch (Exception e) { + throw new RuntimeException(e); + } + + } + + public void start(BundleContext bc) { + + System.out.println("Started bundle " + name); + + this.bundleContext = bc; + + boolean useSingleRegisterService = serviceNames.size() > 1; + for (int i = 1; i < serviceNames.size(); i++) { + if (serviceObjs.get(i) != serviceObjs.get(0) || + serviceProperties.get(i) != serviceProperties.get(0)) { + useSingleRegisterService = false; + break; + } + } + if (useSingleRegisterService) { + bundleContext.registerService(serviceNames.toArray(new String[serviceNames.size()]), + serviceObjs.get(0), serviceProperties.get(0)); + } + else { + for (int i = 0; i < serviceNames.size(); i++) { + bundleContext.registerService(serviceNames.get(i), serviceObjs.get(i), serviceProperties.get(i)); + } + } + + started(bc); + + for (int i = 0; i < references.length; i++) { + + try { + if (referenceFields[i].get(this) != null) + continue; + + ServiceReference[] refs = bundleContext.getServiceReferences(referenceClasses[i].getName(), referenceFilters[i]); + if (refs != null && refs.length > 0) { + Object obj = bundleContext.getService(refs[0]); + referenceFields[i].set(this, referenceClasses[i].cast(obj)); + } else { + String filter = "(objectclass=" + referenceClasses[i].getName() + ")"; + this.bundleContext.addServiceListener(this, filter); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + public void stop(BundleContext bc) { + System.out.println("Stop bundle " + name); + + } + + protected void started(BundleContext bc) { + + } + + public void serviceChanged(ServiceEvent event) { + try { + if (event.getType() == ServiceEvent.REGISTERED) { + + ServiceReference ref = event.getServiceReference(); + Object obj = bundleContext.getService(ref); + for (int i = 0; i < references.length; i++) { + if (referenceClasses[i].isAssignableFrom(obj.getClass())) { + referenceFields[i].set(this, referenceClasses[i].cast(obj)); + } + } + } + } catch (Throwable e) { + e.printStackTrace(); + } + } + + + public void registerService(Object serviceObject, String serviceName, Hashtable props) { + serviceObjs.add(serviceObject); + serviceNames.add(serviceName); + serviceProperties.add(props == null? new Hashtable() : props); + } +} + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/Customer.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/Customer.java new file mode 100644 index 0000000000..2762bc62be --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/Customer.java @@ -0,0 +1,39 @@ +/* + * 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; + +/** + * This is the business interface of the Customer service component. + */ +public interface Customer { + + public void purchaseBooks(); + + public void purchaseGames(); + + public void purchaseGoods(); + + @OneWay + public void notifyShipment(String order); + + public boolean hasOutstandingOrders(); + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java new file mode 100644 index 0000000000..80346311b1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java @@ -0,0 +1,88 @@ +/* + * 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 java.util.ArrayList; + +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. + */ +@Service(Customer.class) +@Scope("COMPOSITE") +public class JavaCustomerComponentImpl implements Customer { + + private Retailer retailer1; + + private Retailer retailer2; + + private Retailer retailer3; + + private static ArrayList outstandingOrders = new ArrayList(); + + @Reference + public void setRetailer1(Retailer retailer1) { + this.retailer1 = retailer1; + } + + @Reference + public void setRetailer2(Retailer retailer2) { + this.retailer2 = retailer2; + } + + @Reference + public void setRetailer3(Retailer retailer3) { + this.retailer3 = retailer3; + } + + public void purchaseBooks() { + System.out.println("JavaCustomerComponentImpl.purchaseBooks"); + outstandingOrders.add("Order, submitted (amazon.com), fulfilled, shipped (ParcelForce)"); + retailer1.submitOrder("Order"); + } + + public void purchaseGames() { + System.out.println("JavaCustomerComponentImpl.purchaseGames"); + outstandingOrders.add("Order, submitted (play.com), fulfilled, shipped (ParcelForce)"); + + retailer2.submitOrder("Order"); + } + + public void purchaseGoods() { + retailer3.submitOrder("Order"); + } + + public void notifyShipment(String order) { + outstandingOrders.remove(order); + System.out.print("Work thread " + Thread.currentThread() + " - "); + System.out.println(order); + } + + public boolean hasOutstandingOrders() { + return outstandingOrders.size() != 0; + } + + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerComponentImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerComponentImpl.java new file mode 100644 index 0000000000..9717025a4f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerComponentImpl.java @@ -0,0 +1,104 @@ +/* + * 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 java.util.ArrayList; + +import org.osgi.service.component.ComponentContext; + + +import supplychain.retailer.Retailer; + +/** + * This class implements the Customer service component. + */ +public class OSGiCustomerComponentImpl implements Customer { + + + private Retailer retailer1; + private Retailer retailer2; + private Retailer retailer3; + + private ArrayList outstandingOrders = new ArrayList(); + + public OSGiCustomerComponentImpl() { + System.out.println("Created OSGiCustomerComponentImpl " + this); + } + + protected void setRetailer1(Retailer retailer1) { + this.retailer1 = retailer1; + } + + protected void unsetRetailer1(Retailer retailer1) { + this.retailer1 = null; + } + + + protected void setRetailer2(Retailer retailer2) { + this.retailer2 = retailer2; + } + + protected void unsetRetailer2(Retailer retailer2) { + this.retailer2 = null; + } + + protected void setRetailer3(Retailer retailer2) { + this.retailer3 = retailer2; + } + + protected void unsetRetailer3(Retailer retailer2) { + this.retailer3 = null; + } + + public void purchaseBooks() { + System.out.println("OSGiCustomerComponentImpl.purchaseBooks"); + outstandingOrders.add("Order, submitted (amazon.com), fulfilled, shipped (ParcelForce)"); + retailer1.submitOrder("Order"); + } + + public void purchaseGames() { + System.out.println("OSGiCustomerComponentImpl.purchaseGames"); + outstandingOrders.add("Order, submitted (play.com), fulfilled, shipped (ParcelForce)"); + + retailer2.submitOrder("Order"); + } + + public void purchaseGoods() { + retailer3.submitOrder("Order"); + } + + public void notifyShipment(String order) { + outstandingOrders.remove(order); + System.out.print("Work thread " + Thread.currentThread() + " - "); + System.out.println(order); + } + + protected void activate(ComponentContext context){ + System.out.println("Activated OSGiCustomerComponentImpl bundle "); + } + + protected void deactivate(ComponentContext context){ + System.out.println("Deactivated OSGiCustomerComponentImpl bundle "); + } + + public boolean hasOutstandingOrders() { + return outstandingOrders.size() != 0; + } +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerFactoryImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerFactoryImpl.java new file mode 100644 index 0000000000..c8cb522cf4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerFactoryImpl.java @@ -0,0 +1,65 @@ +/* + * 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.osgi.framework.Bundle; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceFactory; +import org.osgi.framework.ServiceRegistration; + +/** + * This class implements the Customer service component. + */ +public class OSGiCustomerFactoryImpl implements BundleActivator, ServiceFactory { + + private BundleContext bundleContext; + + public OSGiCustomerFactoryImpl() { + } + + + public void start(BundleContext bc) { + + this.bundleContext = bc; + bc.registerService(Customer.class.getName(), this, null); + } + + + + + public void stop(BundleContext context) throws Exception { + + } + + + public Object getService(Bundle bundle, ServiceRegistration registration) { + + OSGiCustomerImpl customer = new OSGiCustomerImpl(false); + customer.start(bundleContext); + return customer; + + } + + public void ungetService(Bundle bundle, ServiceRegistration registration, Object obj) { + } + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerImpl.java new file mode 100644 index 0000000000..37077bad8b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerImpl.java @@ -0,0 +1,89 @@ +/* + * 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 java.util.ArrayList; + +import supplychain.OSGiBundleImpl; +import supplychain.retailer.Retailer; + +/** + * This class implements the Customer service component. + */ +public class OSGiCustomerImpl extends OSGiBundleImpl implements Customer { + + private ArrayList outstandingOrders = new ArrayList(); + + private Retailer retailer1; + private Retailer retailer2; + private Retailer retailer3; + + public OSGiCustomerImpl() { + super( new String[]{"retailer1", "retailer2", "retailer3"}, + new String[]{"(retailerName=amazon.com)", + "(retailerName=play.com)", + "(retailerName=ebay.com)" + }); + registerService(this, "supplychain.customer.Customer", null); + + } + + public OSGiCustomerImpl(boolean ignore) { // Used only to test service factories + super( new String[]{"retailer1", "retailer2", "retailer3"}, + new String[]{"(retailerName=amazon.com)", + "(retailerName=play.com)", + "(retailerName=ebay.com)" + }); + + } + + public void purchaseBooks() { + System.out.println("OSGiCustomerImpl.purchaseBooks, retailer is " + retailer1); + outstandingOrders.add("Order, submitted (amazon.com), fulfilled, shipped (ParcelForce)"); + + retailer1.submitOrder("Order"); + + } + + public void purchaseGames() { + System.out.println("OSGiCustomerImpl.purchaseGames, retailer is " + retailer2); + outstandingOrders.add("Order, submitted (play.com), fulfilled, shipped (ParcelForce)"); + + retailer2.submitOrder("Order"); + + } + + public void purchaseGoods() { + retailer3.submitOrder("Order"); + } + + public void notifyShipment(String order) { + + outstandingOrders.remove(order); + + System.out.print("Work thread " + Thread.currentThread() + " - "); + System.out.println(order); + } + + public boolean hasOutstandingOrders() { + return outstandingOrders.size() != 0; + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerWithQueryComponentImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerWithQueryComponentImpl.java new file mode 100644 index 0000000000..02862bc5f6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerWithQueryComponentImpl.java @@ -0,0 +1,100 @@ +/* + * 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 java.util.ArrayList; + +import org.osgi.service.component.ComponentContext; + + +import supplychain.retailer.Retailer; +import supplychain.retailer.RetailerQuery; + +/** + * This class implements the Customer service component. + */ +public class OSGiCustomerWithQueryComponentImpl implements Customer { + + + private Retailer retailer; + private RetailerQuery retailerQuery; + + private static ArrayList outstandingOrders = new ArrayList(); + + public OSGiCustomerWithQueryComponentImpl() { + System.out.println("Created OSGiCustomerWithQueryComponentImpl " + this); + } + + protected void setRetailer(Retailer retailer) { + this.retailer = retailer; + } + + protected void unsetRetailer(Retailer retailer) { + this.retailer = null; + } + + + protected void setRetailerQuery(RetailerQuery retailerQuery) { + this.retailerQuery = retailerQuery; + } + + protected void unsetRetailerQuery(RetailerQuery retailerQuery) { + this.retailerQuery = null; + } + + public void purchaseBooks() { + System.out.println("OSGiCustomerWithQueryComponentImpl.purchaseBooks"); + outstandingOrders.add("Order, submitted (amazon.com), fulfilled, shipped (RoyalMail)"); + + if (retailerQuery.isAvailable("Order")) + retailer.submitOrder("Order"); + } + + public void purchaseGames() { + System.out.println("OSGiCustomerWithQueryComponentImpl.purchaseGames"); + outstandingOrders.add("Order, submitted (amazon.com), fulfilled, shipped (RoyalMail)"); + + if (retailerQuery.isAvailable("Order")) + retailer.submitOrder("Order"); + } + + public void purchaseGoods() { + if (retailerQuery.isAvailable("Order")) + retailer.submitOrder("Order"); + } + + public void notifyShipment(String order) { + outstandingOrders.remove(order); + System.out.print("Work thread " + Thread.currentThread() + " - "); + System.out.println(order); + } + + protected void activate(ComponentContext context){ + System.out.println("Activated OSGiCustomerWithQueryComponentImpl bundle "); + } + + protected void deactivate(ComponentContext context){ + System.out.println("Deactivated OSGiCustomerWithQueryComponentImpl bundle "); + } + + public boolean hasOutstandingOrders() { + return outstandingOrders.size() != 0; + } +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerWithQueryImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerWithQueryImpl.java new file mode 100644 index 0000000000..981e3c7520 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerWithQueryImpl.java @@ -0,0 +1,82 @@ +/* + * 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 java.util.ArrayList; + +import supplychain.OSGiBundleImpl; +import supplychain.retailer.Retailer; +import supplychain.retailer.RetailerQuery; + +/** + * This class implements the Customer service component. + */ +public class OSGiCustomerWithQueryImpl extends OSGiBundleImpl implements Customer { + + private static ArrayList outstandingOrders = new ArrayList(); + + private Retailer retailer; + private RetailerQuery retailerQuery; + + public OSGiCustomerWithQueryImpl() { + super( new String[]{"retailer", "retailerQuery"}, + new String[]{"(retailerName=amazon.com)", + "(retailerName=amazon.com)" + }); + registerService(this, "supplychain.customer.Customer", null); + + } + + public void purchaseBooks() { + System.out.println("OSGiCustomerWithQueryImpl.purchaseBooks"); + outstandingOrders.add("Order, submitted (amazon.com), fulfilled, shipped (RoyalMail)"); + + if (retailerQuery.isAvailable("Order")) + retailer.submitOrder("Order"); + + } + + public void purchaseGames() { + System.out.println("OSGiCustomerWithQueryImpl.purchaseGames"); + outstandingOrders.add("Order, submitted (amazon.com), fulfilled, shipped (RoyalMail)"); + + if (retailerQuery.isAvailable("Order")) + retailer.submitOrder("Order"); + + } + + public void purchaseGoods() { + if (retailerQuery.isAvailable("Order")) + retailer.submitOrder("Order"); + } + + public void notifyShipment(String order) { + + outstandingOrders.remove(order); + + System.out.print("Work thread " + Thread.currentThread() + " - "); + System.out.println(order); + } + + public boolean hasOutstandingOrders() { + return outstandingOrders.size() != 0; + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiVersionedCustomerImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiVersionedCustomerImpl.java new file mode 100644 index 0000000000..599ab51a50 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiVersionedCustomerImpl.java @@ -0,0 +1,98 @@ +/* + * 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 java.util.ArrayList; +import java.util.Hashtable; + +import org.osgi.framework.BundleContext; + +import supplychain.OSGiBundleImpl; +import supplychain.retailer.Retailer; + +/** + * This class implements the Customer service component. + */ +public class OSGiVersionedCustomerImpl extends OSGiBundleImpl implements Customer { + + private static ArrayList outstandingOrders = new ArrayList(); + + private Retailer retailer1; + private Retailer retailer2; + private Retailer retailer3; + private int version; + + public OSGiVersionedCustomerImpl() { + super( new String[]{"retailer1", "retailer2", "retailer3"}, + new String[]{"(retailerName=amazon.com)", + "(retailerName=play.com)", + "(retailerName=ebay.com)" + }); + + } + + protected void started(BundleContext bc) { + + String jarFile = bc.getBundle().getLocation(); + if (jarFile.endsWith("1.jar")) version = 1; + else if (jarFile.endsWith("2.jar")) version = 2; + else version = 3; + + Hashtable props1 = new Hashtable(); + props1.put("component.name", "CustomerComponent" + version); + bc.registerService("supplychain.customer.Customer", this, props1); + + } + + public void purchaseBooks() { + System.out.println("OSGiVersionedCustomerImpl.purchaseBooks , retailer is " + retailer1); + outstandingOrders.add("Order, submitted (amazon.com v" + version + + "), fulfilled, shipped (ParcelForce)"); + + retailer1.submitOrder("Order"); + + } + + public void purchaseGames() { + System.out.println("OSGiCustomerImpl.purchaseGames"); + outstandingOrders.add("Order, submitted (play.com v" + version + + "), fulfilled, shipped (ParcelForce)"); + + retailer2.submitOrder("Order"); + + } + + public void purchaseGoods() { + retailer3.submitOrder("Order"); + } + + public void notifyShipment(String order) { + + outstandingOrders.remove(order); + + System.out.print("Work thread " + Thread.currentThread() + " - "); + System.out.println(order); + } + + public boolean hasOutstandingOrders() { + return outstandingOrders.size() != 0; + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java new file mode 100644 index 0000000000..df52c6c760 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java @@ -0,0 +1,67 @@ +/* + * 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.Property; +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 Customer service component. + */ +@Service(Retailer.class) +@Scope("COMPOSITE") +public class JavaRetailerComponentImpl implements Retailer { + + private Warehouse warehouse; + + private String retailerName; + + public JavaRetailerComponentImpl() { + System.out.println("Created RetailerComponentImpl"); + } + + @Reference + public void setWarehouse(Warehouse warehouse) { + System.out.println("retailer setWarehouse " + warehouse); + + this.warehouse = warehouse; + } + + @Property + public void setRetailerName(String retailerName) { + this.retailerName = retailerName; + } + + + public void submitOrder(String order) { + + System.out.println("JavaRetailerComponentImpl.submitOrder " + warehouse); + warehouse.fulfillOrder(order + ", submitted (" + retailerName + ")"); + + } + + + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerComponentImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerComponentImpl.java new file mode 100644 index 0000000000..d4374e4315 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerComponentImpl.java @@ -0,0 +1,64 @@ +/* + * 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.osgi.service.component.ComponentContext; + +import supplychain.warehouse.Warehouse; + +/** + * This class implements the Customer service component. + */ +public class OSGiRetailerComponentImpl implements Retailer { + + private Warehouse warehouse; + private String retailerName; + + + protected void setWarehouse(Warehouse warehouse) { + this.warehouse = warehouse; + } + + protected void unsetWarehouse(Warehouse warehouse) { + this.warehouse = null; + } + + public void submitOrder(String order) { + + System.out.println("OSGiRetailerComponentImpl.submitOrder , warehouse is " + warehouse); + warehouse.fulfillOrder(order + ", submitted (" + retailerName + ")"); + + } + + protected void activate(ComponentContext context){ + System.out.println("Activated OSGiRetailerComponentImpl bundle "); + + Object prop = context.getProperties().get("retailerName"); + if (prop instanceof String[]) + retailerName = ((String [])prop)[0]; + + + } + + protected void deactivate(ComponentContext context){ + System.out.println("Deactivated OSGiRetailerComponentImpl bundle "); + } + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerImpl.java new file mode 100644 index 0000000000..e71c624f49 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerImpl.java @@ -0,0 +1,58 @@ +/* + * 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 java.util.Hashtable; + +import supplychain.OSGiBundleImpl; +import supplychain.warehouse.Warehouse; + +/** + * This class implements the Retailer service component. + */ +public class OSGiRetailerImpl extends OSGiBundleImpl { + + protected Warehouse warehouse; + + public OSGiRetailerImpl() { + + super(new String[]{"warehouse"}, + new String[]{"(component.service.name=WarehouseComponent1/Warehouse)"}); + + Hashtable props1 = new Hashtable(); + props1.put("retailerName", "amazon.com"); + registerService(new OSGiRetailerServiceImpl(this, "amazon.com"), + "supplychain.retailer.Retailer", props1); + + Hashtable props2 = new Hashtable(); + props2.put("retailerName", "play.com"); + registerService( + new OSGiRetailerServiceImpl(this, "play.com"), + "supplychain.retailer.Retailer", props2); + + Hashtable props3 = new Hashtable(); + props3.put("retailerName", "ebay.com"); + registerService( + new OSGiRetailerServiceImpl(this, "ebay.com"), + "supplychain.retailer.Retailer", props3); + } + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerServiceImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerServiceImpl.java new file mode 100644 index 0000000000..a036ecfc76 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerServiceImpl.java @@ -0,0 +1,45 @@ +/* + * 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 class implements the Retailer service. + */ +public class OSGiRetailerServiceImpl implements Retailer { + + private OSGiRetailerImpl retailerImpl; + + private String retailerName; + + OSGiRetailerServiceImpl(OSGiRetailerImpl retailerImpl, String retailerName) { + this.retailerImpl = retailerImpl; + this.retailerName = retailerName; + + } + + public void submitOrder(String order) { + + System.out.println("Retailer.submitOrder, warehouse is " + retailerImpl.warehouse); + retailerImpl.warehouse.fulfillOrder(order + ", submitted (" + + retailerName + ")"); + + } + +} \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerWithQueryComponentImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerWithQueryComponentImpl.java new file mode 100644 index 0000000000..278a439540 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerWithQueryComponentImpl.java @@ -0,0 +1,78 @@ +/* + * 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.osgi.service.component.ComponentContext; + +import supplychain.warehouse.Warehouse; +import supplychain.warehouse.WarehouseQuery; + +/** + * This class implements the Customer service component. + */ +public class OSGiRetailerWithQueryComponentImpl implements Retailer, RetailerQuery { + + private Warehouse warehouse; + private WarehouseQuery warehouseQuery; + private String retailerName; + + + protected void setWarehouse(Warehouse warehouse) { + this.warehouse = warehouse; + } + + protected void unsetWarehouse(Warehouse warehouse) { + this.warehouse = null; + } + + protected void setWarehouseQuery(WarehouseQuery warehouseQuery) { + this.warehouseQuery = warehouseQuery; + } + + protected void unsetWarehouseQuery(WarehouseQuery warehouse) { + this.warehouseQuery = null; + } + + public void submitOrder(String order) { + + System.out.println("OSGiRetailerComponentImpl.submitOrder , warehouse is " + warehouse); + warehouse.fulfillOrder(order + ", submitted (" + retailerName + ")"); + + } + + public boolean isAvailable(String order) { + return warehouseQuery.isAvailable(order); + } + + protected void activate(ComponentContext context){ + System.out.println("Activated OSGiRetailerComponentImpl bundle "); + + Object prop = context.getProperties().get("retailerName"); + if (prop instanceof String[]) + retailerName = ((String [])prop)[0]; + + + } + + protected void deactivate(ComponentContext context){ + System.out.println("Deactivated OSGiRetailerComponentImpl bundle "); + } + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerWithQueryImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerWithQueryImpl.java new file mode 100644 index 0000000000..ee1f575e70 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerWithQueryImpl.java @@ -0,0 +1,64 @@ +/* + * 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 java.util.Hashtable; + +import supplychain.OSGiBundleImpl; +import supplychain.warehouse.Warehouse; +import supplychain.warehouse.WarehouseQuery; + +/** + * This class implements the Retailer service component with query. + */ +public class OSGiRetailerWithQueryImpl extends OSGiBundleImpl implements Retailer, RetailerQuery { + + private Warehouse warehouse; + private WarehouseQuery warehouseQuery; + + public OSGiRetailerWithQueryImpl() { + + super(new String[]{"warehouse", "warehouseQuery"}, null); + + Hashtable props1 = new Hashtable(); + props1.put("retailerName", "amazon.com"); + registerService(this, + "supplychain.retailer.Retailer", props1); + + registerService(this, + "supplychain.retailer.RetailerQuery", props1); + + } + + public void submitOrder(String order) { + + System.out.println("Retailer.submitOrder, warehouse is " + warehouse); + warehouse.fulfillOrder(order + ", submitted (" + + "amazon.com" + ")"); + + } + + public boolean isAvailable(String order) { + return warehouseQuery.isAvailable(order); + } + + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiVersionedRetailerImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiVersionedRetailerImpl.java new file mode 100644 index 0000000000..09e60ca626 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiVersionedRetailerImpl.java @@ -0,0 +1,75 @@ +/* + * 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 java.util.Hashtable; + +import org.osgi.framework.BundleContext; +import org.osgi.framework.InvalidSyntaxException; +import org.osgi.framework.ServiceReference; + +import supplychain.OSGiBundleImpl; +import supplychain.warehouse.Warehouse; + +/** + * This class implements the Retailer service component. + */ +public class OSGiVersionedRetailerImpl extends OSGiBundleImpl { + + protected Warehouse warehouse; + + private int version; + + public OSGiVersionedRetailerImpl() { + + super(new String[]{"warehouse"}, null); + + + } + + protected void started(BundleContext bc) { + String jarFile = bc.getBundle().getLocation(); + if (jarFile.endsWith("1.jar")) version = 1; + else if (jarFile.endsWith("2.jar")) version = 2; + else version = 3; + + Hashtable props1 = new Hashtable(); + props1.put("retailerName", "amazon.com"); + bc.registerService("supplychain.retailer.Retailer", + new OSGiVersionedRetailerServiceImpl(this, "amazon.com", version), + props1); + + Hashtable props2 = new Hashtable(); + props2.put("retailerName", "play.com"); + bc.registerService( + "supplychain.retailer.Retailer", + new OSGiVersionedRetailerServiceImpl(this, "play.com", version), + props2); + + try { + ServiceReference[] refs = bc.getServiceReferences(Warehouse.class.getName(), + "(component.service.name=WarehouseComponent" + version + "/Warehouse)"); + if (refs != null && refs.length > 0) { + warehouse = (Warehouse) bc.getService(refs[0]); + } + } catch (InvalidSyntaxException e) { + } + } +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiVersionedRetailerServiceImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiVersionedRetailerServiceImpl.java new file mode 100644 index 0000000000..7dd70889c7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiVersionedRetailerServiceImpl.java @@ -0,0 +1,47 @@ +/* + * 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 class implements the Retailer service. + */ +public class OSGiVersionedRetailerServiceImpl implements Retailer { + + private OSGiVersionedRetailerImpl retailerImpl; + + private String retailerName; + + private int version; + + OSGiVersionedRetailerServiceImpl(OSGiVersionedRetailerImpl retailerImpl, String retailerName, int version) { + this.retailerImpl = retailerImpl; + this.retailerName = retailerName; + this.version = version; + } + + public void submitOrder(String order) { + + System.out.println("Retailer.submitOrder, warehouse is " + retailerImpl.warehouse); + retailerImpl.warehouse.fulfillOrder(order + ", submitted (" + + retailerName + " v" + version + ")"); + + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/Retailer.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/Retailer.java new file mode 100644 index 0000000000..1e87d59af1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/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/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/RetailerQuery.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/RetailerQuery.java new file mode 100644 index 0000000000..354f40a064 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/retailer/RetailerQuery.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 RetailerQuery service. + */ +public interface RetailerQuery { + + public boolean isAvailable(String order); + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/JavaShipperComponentImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/JavaShipperComponentImpl.java new file mode 100644 index 0000000000..d0cf43a960 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/JavaShipperComponentImpl.java @@ -0,0 +1,58 @@ +/* + * 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.Property; +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. + */ +@Service(Shipper.class) +@Scope("COMPOSITE") +public class JavaShipperComponentImpl implements Shipper { + + private Customer customer; + + private String shipperName; + + @Reference + public void setCustomer(Customer customer) { + this.customer = customer; + } + + @Property + public void setShipperName(String shipperName) { + this.shipperName = shipperName; + } + + + + public void processShipment(String order) { + System.out.println("JavaShipperComponentImpl.processShipment"); + customer.notifyShipment(order + ", shipped (" + shipperName + ")"); + } + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiShipperComponentImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiShipperComponentImpl.java new file mode 100644 index 0000000000..f3a98be77b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiShipperComponentImpl.java @@ -0,0 +1,62 @@ +/* + * 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.osgi.service.component.ComponentContext; + +import supplychain.customer.Customer; + +/** + * This class implements the Shipper service component. + */ +public class OSGiShipperComponentImpl implements Shipper { + + private Customer customer; + private String shipperName; + + protected void setCustomer(Customer customer) { + this.customer = customer; + } + + protected void unsetCustomer(Customer customer) { + this.customer = null; + } + + public void processShipment(String order) { + System.out.println("OSGiShipperComponentImpl.processShipment, customer is " + customer); + customer.notifyShipment(order + ", shipped (" + shipperName + ")"); + } + + + protected void activate(ComponentContext context){ + System.out.println("Activated OSGiShipperComponentImpl bundle "); + + Object prop = context.getProperties().get("shipperName"); + if (prop instanceof String[]) + shipperName = ((String [])prop)[0]; + + } + + protected void deactivate(ComponentContext context){ + System.out.println("Deactivated OSGiShipperComponentImpl bundle "); + } + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiShipperFactoryImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiShipperFactoryImpl.java new file mode 100644 index 0000000000..e2f649e4f4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiShipperFactoryImpl.java @@ -0,0 +1,78 @@ +/* + * 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 java.util.Hashtable; + +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceFactory; +import org.osgi.framework.ServiceRegistration; + + +/** + * This class implements the Shipper service component. + */ +public class OSGiShipperFactoryImpl implements BundleActivator, ServiceFactory { + + private BundleContext bundleContext; + + public OSGiShipperFactoryImpl() { + + } + + + public void start(BundleContext bc) { + + this.bundleContext = bc; + + Hashtable props1 = new Hashtable(); + props1.put("shipperName", "RoyalMail"); + bc.registerService(Shipper.class.getName(), this, props1); + + Hashtable props2 = new Hashtable(); + props2.put("shipperName", "ParcelForce"); + bc.registerService(Shipper.class.getName(), this, props2); + } + + + + + public void stop(BundleContext context) throws Exception { + + } + + + public Object getService(Bundle bundle, ServiceRegistration reg) { + OSGiShipperImpl shipper = new OSGiShipperImpl(false); + shipper.start(bundleContext); + OSGiShipperServiceImpl shipperService = new OSGiShipperServiceImpl(shipper, + (String)reg.getReference().getProperty("shipperName")); + return shipperService; + } + + public void ungetService(Bundle arg0, ServiceRegistration arg1, Object arg2) { + + } + + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiShipperImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiShipperImpl.java new file mode 100644 index 0000000000..effae8c246 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiShipperImpl.java @@ -0,0 +1,57 @@ +/* + * 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 java.util.Hashtable; + +import supplychain.OSGiBundleImpl; +import supplychain.customer.Customer; + +/** + * This class implements the Shipper service component. + */ +public class OSGiShipperImpl extends OSGiBundleImpl { + + protected Customer customer; + + + public OSGiShipperImpl() { + + super(new String[]{"customer"}, null); + + Hashtable props1 = new Hashtable(); + props1.put("shipperName", "RoyalMail"); + registerService(new OSGiShipperServiceImpl(this, "RoyalMail"), + "supplychain.shipper.Shipper", props1); + + Hashtable props2 = new Hashtable(); + props2.put("shipperName", "ParcelForce"); + registerService( + new OSGiShipperServiceImpl(this, "ParcelForce"), + "supplychain.shipper.Shipper", props2); + } + + // Used only by service factories + public OSGiShipperImpl(boolean ignore) { + + super(new String[]{"customer"}, null); + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiShipperServiceImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiShipperServiceImpl.java new file mode 100644 index 0000000000..4effadf208 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiShipperServiceImpl.java @@ -0,0 +1,43 @@ +/* + * 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 class implements the Shipper service. + */ +public class OSGiShipperServiceImpl implements Shipper { + + private OSGiShipperImpl shipperImpl; + + private String shipperName; + + OSGiShipperServiceImpl(OSGiShipperImpl shipperImpl, String shipperName) { + this.shipperImpl = shipperImpl; + this.shipperName = shipperName; + } + + public void processShipment(String order) { + + System.out.println("Shipper.submitOrder, warehouse is " + shipperImpl.customer); + shipperImpl.customer.notifyShipment(order + ", shipped (" + shipperName + ")"); + + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiVersionedShipperImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiVersionedShipperImpl.java new file mode 100644 index 0000000000..3b87f6b087 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiVersionedShipperImpl.java @@ -0,0 +1,76 @@ +/* + * 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 java.util.Hashtable; + +import org.osgi.framework.BundleContext; +import org.osgi.framework.InvalidSyntaxException; +import org.osgi.framework.ServiceReference; + +import supplychain.OSGiBundleImpl; +import supplychain.customer.Customer; + +/** + * This class implements the Shipper service component. + */ +public class OSGiVersionedShipperImpl extends OSGiBundleImpl { + + protected Customer customer; + + private int version; + + + public OSGiVersionedShipperImpl() { + + super(new String[]{"customer"}, null); + } + + protected void started(BundleContext bc) { + + String jarFile = bc.getBundle().getLocation(); + if (jarFile.endsWith("1.jar")) version = 1; + else if (jarFile.endsWith("2.jar")) version = 2; + + + Hashtable props1 = new Hashtable(); + props1.put("shipperName", "RoyalMail"); + bc.registerService("supplychain.shipper.Shipper", + new OSGiVersionedShipperServiceImpl(this, "RoyalMail", version), + props1); + + Hashtable props2 = new Hashtable(); + props2.put("shipperName", "ParcelForce"); + bc.registerService("supplychain.shipper.Shipper", + new OSGiVersionedShipperServiceImpl(this, "ParcelForce", version), + props2); + + try { + ServiceReference[] refs = bc.getServiceReferences(Customer.class.getName(), + "(component.service.name=CustomerComponent" + version + ".CustomerService)"); + if (refs != null && refs.length > 0) { + customer = (Customer) bc.getService(refs[0]); + } + } catch (InvalidSyntaxException e) { + } + } + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiVersionedShipperServiceImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiVersionedShipperServiceImpl.java new file mode 100644 index 0000000000..b66961b1c2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiVersionedShipperServiceImpl.java @@ -0,0 +1,46 @@ +/* + * 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 class implements the Shipper service. + */ +public class OSGiVersionedShipperServiceImpl implements Shipper { + + private OSGiVersionedShipperImpl shipperImpl; + + private String shipperName; + + private int version; + + OSGiVersionedShipperServiceImpl(OSGiVersionedShipperImpl shipperImpl, String shipperName, int version) { + this.shipperImpl = shipperImpl; + this.shipperName = shipperName; + this.version = version; + } + + public void processShipment(String order) { + + System.out.println("Shipper.processShipment, version " + version + " customer is " + shipperImpl.customer); + shipperImpl.customer.notifyShipment(order + ", shipped (" + shipperName + ")"); + + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/Shipper.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/shipper/Shipper.java new file mode 100644 index 0000000000..2514928c10 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/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/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java new file mode 100644 index 0000000000..9edf3567e5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java @@ -0,0 +1,48 @@ +/* + * 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. + */ +@Service(Warehouse.class) +@Scope("STATELESS") +public class JavaWarehouseComponentImpl implements Warehouse { + + private Shipper shipper; + + @Reference + public void setShipper(Shipper shipper) { + this.shipper = shipper; + } + + public void fulfillOrder(String order) { + System.out.println("JavaWarehouseComponentImpl.fulfillOrder : shipper is " + shipper); + + shipper.processShipment(order + ", fulfilled"); + } + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/JavaWarehouseWithQueryComponentImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/JavaWarehouseWithQueryComponentImpl.java new file mode 100644 index 0000000000..659f16be7f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/JavaWarehouseWithQueryComponentImpl.java @@ -0,0 +1,52 @@ +/* + * 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. + */ +@Service(interfaces={Warehouse.class, WarehouseQuery.class}) +@Scope("COMPOSITE") +public class JavaWarehouseWithQueryComponentImpl implements Warehouse, WarehouseQuery { + + private Shipper shipper; + + @Reference + public void setShipper(Shipper shipper) { + this.shipper = shipper; + } + + public void fulfillOrder(String order) { + System.out.println("JavaWarehouseComponentImpl.fulfillOrder : shipper is " + shipper); + + shipper.processShipment(order + ", fulfilled"); + } + + public boolean isAvailable(String order) { + return true; + } + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseComponentImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseComponentImpl.java new file mode 100644 index 0000000000..dd283bf779 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseComponentImpl.java @@ -0,0 +1,57 @@ +/* + * 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.osgi.service.component.ComponentContext; + +import supplychain.shipper.Shipper; + +/** + * This class implements the Warehouse service component. + */ + +public class OSGiWarehouseComponentImpl implements Warehouse { + + private Shipper shipper; + + protected void setShipper(Shipper shipper) { + this.shipper = shipper; + } + + protected void unsetShipper(Shipper shipper) { + this.shipper = null; + } + + public void fulfillOrder(String order) { + System.out.println("OSGiWarehouseComponentImpl.fulfillOrder : shipper is " + shipper); + + shipper.processShipment(order + ", fulfilled"); + + } + + protected void activate(ComponentContext context){ + System.out.println("Activated OSGiWarehouseComponentImpl "); + } + + protected void deactivate(ComponentContext context){ + System.out.println("Deactivated OSGiWarehouseComponentImpl "); + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseImpl.java new file mode 100644 index 0000000000..bb04ff42e0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseImpl.java @@ -0,0 +1,68 @@ +/* + * 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 java.util.Hashtable; + +import org.osgi.framework.BundleContext; + +import supplychain.OSGiBundleImpl; +import supplychain.shipper.Shipper; + +/** + * This class implements the Warehouse service component. + */ + +public class OSGiWarehouseImpl extends OSGiBundleImpl implements Warehouse { + + protected Shipper shipper; + private OSGiWarehouseServiceImpl warehouseService1; + private OSGiWarehouseServiceImpl warehouseService2; + + public OSGiWarehouseImpl() { + super(new String[]{"shipper"}, null); + + Hashtable props1 = new Hashtable(); + props1.put("component.name", "WarehouseComponent1"); + warehouseService1 = new OSGiWarehouseServiceImpl(this, 2); + registerService(warehouseService1, + "supplychain.warehouse.Warehouse", props1); + + Hashtable props2 = new Hashtable(); + props2.put("component.name", "WarehouseComponent2"); + warehouseService2 = new OSGiWarehouseServiceImpl(this, 1); + registerService(warehouseService2, + "supplychain.warehouse.Warehouse", props2); + } + + protected void started(BundleContext bc) { + warehouseService1.started(bc); + warehouseService2.started(bc); + } + + public void fulfillOrder(String order) { + System.out.println("OSGiWarehouseImpl.fulfillOrder : shipper is " + shipper); + + shipper.processShipment(order + ", fulfilled"); + + } + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseServiceImpl.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseServiceImpl.java new file mode 100644 index 0000000000..3317816557 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseServiceImpl.java @@ -0,0 +1,62 @@ +/* + * 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.osgi.framework.BundleContext; +import org.osgi.framework.InvalidSyntaxException; +import org.osgi.framework.ServiceReference; + +import supplychain.shipper.Shipper; + + +/** + * This class implements the Warehouse service. + */ +public class OSGiWarehouseServiceImpl implements Warehouse { + + private OSGiWarehouseImpl warehouseImpl; + private Shipper shipper; + private int shipperNum; + + + OSGiWarehouseServiceImpl(OSGiWarehouseImpl warehouseImpl, int shipperNum) { + this.warehouseImpl = warehouseImpl; + this.shipperNum = shipperNum; + } + + + protected void started(BundleContext bc) { + try { + ServiceReference[] refs = bc.getServiceReferences(Shipper.class.getName(), + "(component.service.name=ShipperComponent" + shipperNum + "/Shipper)"); + if (refs != null && refs.length > 0) { + shipper = (Shipper) bc.getService(refs[0]); + } + } catch (InvalidSyntaxException e) { + } + } + + public void fulfillOrder(String order) { + System.out.println("OSGiWarehouseImpl.fulfillOrder : shipper is " + warehouseImpl.shipper); + + shipper.processShipment(order + ", fulfilled"); + + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/Warehouse.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/Warehouse.java new file mode 100644 index 0000000000..6f1f6b8730 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/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/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/WarehouseQuery.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/WarehouseQuery.java new file mode 100644 index 0000000000..6d1ad76796 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/java/supplychain/warehouse/WarehouseQuery.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 RetailerQuery service. + */ +public interface WarehouseQuery { + + public boolean isAvailable(String order); + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/META-INF/LICENSE.txt b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/META-INF/LICENSE.txt new file mode 100644 index 0000000000..0084319535 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/META-INF/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, serviceDefinition marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed 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. diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/META-INF/NOTICE b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/META-INF/NOTICE new file mode 100644 index 0000000000..d83ebbe236 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/META-INF/NOTICE @@ -0,0 +1,14 @@ +${pom.name} +Copyright (c) 2005 - 2006 The Apache Software Foundation + +Apache Tuscany is an effort undergoing incubation at The Apache Software +Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is +required of all newly accepted projects until a further review indicates that +the infrastructure, communications, and decision making process have stabilized +in a manner consistent with other successful ASF projects. While incubation +status is not necessarily a reflection of the completeness or stability of the +code, it does indicate that the project has yet to be fully endorsed by the ASF. + +This product includes software developed by +The Apache Software Foundation (http://www.apache.org/). + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/META-INF/README.txt b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/META-INF/README.txt new file mode 100644 index 0000000000..9b26d1690a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/META-INF/README.txt @@ -0,0 +1,35 @@ +Apache Tuscany M1 build (May, 2006) +=================================== + +http://incubator.apache.org/tuscany/ + +Tuscany is an effort undergoing incubation at the Apache Software Foundation +(ASF), sponsored by the Web Services PMC. + +Incubation is required of all newly accepted projects until a further review +indicates that the infrastructure, communications, and decision making process +have stabilized in a manner consistent with other successful ASF projects. + +While incubation status is not necessarily a reflection of the completeness or +stability of the code, it does indicate that the project has yet to be fully +endorsed by the ASF. + + +Support +------- + +Any problem with this release can be reported to the Tuscany mailing list +or in the JIRA issue tracker. + +Mailing list subscription: + tuscany-dev-subscribe@ws.apache.org + +Jira: + http://issues.apache.org/jira/browse/Tuscany + + +Thank you for using Tuscany! + + +The Tuscany Team. + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..2d345390b7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/helloworld/Greetings.componentType b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/helloworld/Greetings.componentType new file mode 100644 index 0000000000..127349eacf --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/helloworld/Greetings.componentType @@ -0,0 +1,30 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/helloworld/HelloWorld.componentType b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/helloworld/HelloWorld.componentType new file mode 100644 index 0000000000..7e3810c458 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/helloworld/HelloWorld.componentType @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/Customer.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/Customer.mf new file mode 100644 index 0000000000..26f32fe617 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/Customer.mf @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Customer +Bundle-SymbolicName: factory.supplychain.customer.Customer +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.retailer +Export-Package: supplychain.customer +Bundle-Activator: supplychain.customer.OSGiCustomerFactoryImpl + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/Retailer.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/Retailer.mf new file mode 100644 index 0000000000..1b9e0e847e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/Retailer.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Retailer +Bundle-SymbolicName: factory.supplychain.retailer.Retailer +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.warehouse +Export-Package: supplychain.retailer +Bundle-Activator: supplychain.retailer.OSGiRetailerImpl diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/Shipper.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/Shipper.mf new file mode 100644 index 0000000000..6066a38f29 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/Shipper.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Shipper +Bundle-SymbolicName: factory.supplychain.shipper.Shipper +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.customer +Export-Package: supplychain.shipper +Bundle-Activator: supplychain.shipper.OSGiShipperFactoryImpl diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Customer.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Customer.mf new file mode 100644 index 0000000000..777edd3f7d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Customer.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Customer +Bundle-SymbolicName: ds.factory.supplychain.customer.Customer +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, supplychain.retailer +Export-Package: supplychain.customer +Service-Component: osgi/factory/ds/Customer.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Customer.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Customer.xml new file mode 100644 index 0000000000..d8adaa2ba3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Customer.xml @@ -0,0 +1,41 @@ + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Retailer.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Retailer.mf new file mode 100644 index 0000000000..e0bd9d8c10 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Retailer.mf @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Retailer +Bundle-SymbolicName: ds.factory.supplychain.retailer.Retailer +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, + supplychain.warehouse +Export-Package: supplychain.retailer +Service-Component: osgi/factory/ds/Retailer1.xml, osgi/factory/ds/Retailer2.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Retailer1.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Retailer1.xml new file mode 100644 index 0000000000..6005ae785c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Retailer1.xml @@ -0,0 +1,32 @@ + + + + + + + + + amazon.com + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Retailer2.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Retailer2.xml new file mode 100644 index 0000000000..6f0b79ebc2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Retailer2.xml @@ -0,0 +1,32 @@ + + + + + + + + + play.com + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Shipper.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Shipper.mf new file mode 100644 index 0000000000..d4b461460e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Shipper.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Shipper +Bundle-SymbolicName: ds.factory.supplychain.shipper.Shipper +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, supplychain.customer +Export-Package: supplychain.shipper +Service-Component: osgi/factory/ds/Shipper1.xml, osgi/factory/ds/Shipper2.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Shipper1.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Shipper1.xml new file mode 100644 index 0000000000..bb15e6e3aa --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Shipper1.xml @@ -0,0 +1,34 @@ + + + + + + + + + RoyalMail + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Shipper2.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Shipper2.xml new file mode 100644 index 0000000000..7591201b8c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Shipper2.xml @@ -0,0 +1,34 @@ + + + + + + + + + ParcelForce + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Warehouse.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Warehouse.mf new file mode 100644 index 0000000000..0e844fab99 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Warehouse.mf @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Warehouse +Bundle-SymbolicName: ds.factory.supplychain.warehouse.Warehouse +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, + supplychain.shipper +Export-Package: supplychain.warehouse +Service-Component: osgi/factory/ds/Warehouse.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Warehouse.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Warehouse.xml new file mode 100644 index 0000000000..fc86a76784 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Warehouse.xml @@ -0,0 +1,32 @@ + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/Customer.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/Customer.mf new file mode 100644 index 0000000000..a8a87c5c8c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/Customer.mf @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Customer +Bundle-SymbolicName: interfaces.supplychain.customer.Customer +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.retailer +Export-Package: supplychain.customer +Bundle-Activator: supplychain.customer.OSGiCustomerWithQueryImpl + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/Retailer.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/Retailer.mf new file mode 100644 index 0000000000..05bbf4db88 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/Retailer.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Retailer +Bundle-SymbolicName: interfaces.supplychain.retailer.Retailer +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.warehouse +Export-Package: supplychain.retailer +Bundle-Activator: supplychain.retailer.OSGiRetailerWithQueryImpl diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/Shipper.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/Shipper.mf new file mode 100644 index 0000000000..a12d1a21ea --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/Shipper.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Shipper +Bundle-SymbolicName: interfaces.supplychain.shipper.Shipper +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.customer +Export-Package: supplychain.shipper +Bundle-Activator: supplychain.shipper.OSGiShipperImpl diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Customer.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Customer.mf new file mode 100644 index 0000000000..2214db11a6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Customer.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Customer +Bundle-SymbolicName: ds.interfaces.supplychain.customer.Customer +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, supplychain.retailer +Export-Package: supplychain.customer +Service-Component: osgi/interfaces/ds/Customer.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Customer.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Customer.xml new file mode 100644 index 0000000000..236ff3f84f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Customer.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Retailer.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Retailer.mf new file mode 100644 index 0000000000..60c0fb3fd3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Retailer.mf @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Retailer +Bundle-SymbolicName: ds.interfaces.supplychain.retailer.Retailer +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, + supplychain.warehouse +Export-Package: supplychain.retailer +Service-Component: osgi/interfaces/ds/Retailer.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Retailer.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Retailer.xml new file mode 100644 index 0000000000..ca1392d2b8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Retailer.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + amazon.com + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Shipper.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Shipper.mf new file mode 100644 index 0000000000..7c9f67c36d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Shipper.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Shipper +Bundle-SymbolicName: ds.interfaces.supplychain.shipper.Shipper +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, supplychain.customer +Export-Package: supplychain.shipper +Service-Component: osgi/interfaces/ds/Shipper.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Shipper.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Shipper.xml new file mode 100644 index 0000000000..760c761666 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Shipper.xml @@ -0,0 +1,34 @@ + + + + + + + + + RoyalMail + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/passbyref/Greetings.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/passbyref/Greetings.mf new file mode 100644 index 0000000000..ebca01749a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/passbyref/Greetings.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Greetings +Bundle-SymbolicName: helloworld.Greetings +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework +Export-Package: helloworld +Bundle-Activator: helloworld.OSGiGreetingsImpl + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/ManagedStockQuoteFactory.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/ManagedStockQuoteFactory.mf new file mode 100644 index 0000000000..c7ff94d216 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/ManagedStockQuoteFactory.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: StockQuote +Bundle-SymbolicName: stockquote.StockQuote +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, org.osgi.service.cm +Export-Package: stockquote +Bundle-Activator: stockquote.OSGiManagedStockQuoteFactoryImpl + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/StockQuote.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/StockQuote.mf new file mode 100644 index 0000000000..66f98011cb --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/StockQuote.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: StockQuote +Bundle-SymbolicName: stockquote.StockQuote +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, org.osgi.service.cm +Export-Package: stockquote +Bundle-Activator: stockquote.OSGiStockQuoteImpl + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/StockQuoteFactory.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/StockQuoteFactory.mf new file mode 100644 index 0000000000..02fefbce42 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/StockQuoteFactory.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: StockQuote +Bundle-SymbolicName: stockquote.StockQuote +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, org.osgi.service.cm +Export-Package: stockquote +Bundle-Activator: stockquote.OSGiStockQuoteFactoryImpl + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/ds/StockQuote.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/ds/StockQuote.mf new file mode 100644 index 0000000000..8b2e1717fa --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/ds/StockQuote.mf @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: StockQuote +Bundle-SymbolicName: stockquote.StockQuote +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, org.osgi.service.component, org.osgi.service.cm +Export-Package: stockquote +Service-Component: osgi/properties/ds/StockQuote.xml + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/ds/StockQuote.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/ds/StockQuote.xml new file mode 100644 index 0000000000..c7f13a50a7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/ds/StockQuote.xml @@ -0,0 +1,27 @@ + + + + + + + + GBP + 1.0 + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/ds/StockQuoteFactory.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/ds/StockQuoteFactory.mf new file mode 100644 index 0000000000..01c125ae38 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/ds/StockQuoteFactory.mf @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: StockQuote +Bundle-SymbolicName: stockquote.StockQuote +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, org.osgi.service.component, org.osgi.service.cm +Export-Package: stockquote +Service-Component: osgi/properties/ds/StockQuoteFactory.xml + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/ds/StockQuoteFactory.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/ds/StockQuoteFactory.xml new file mode 100644 index 0000000000..cbebf7eec2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/properties/ds/StockQuoteFactory.xml @@ -0,0 +1,27 @@ + + + + + + + + GBP + 1.0 + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/Customer.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/Customer.mf new file mode 100644 index 0000000000..fc762df8d5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/Customer.mf @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Customer +Bundle-SymbolicName: services.supplychain.customer.Customer +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.retailer +Export-Package: supplychain.customer +Bundle-Activator: supplychain.customer.OSGiCustomerImpl + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/Retailer.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/Retailer.mf new file mode 100644 index 0000000000..02e42bc010 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/Retailer.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Retailer +Bundle-SymbolicName: services.supplychain.retailer.Retailer +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.warehouse +Export-Package: supplychain.retailer +Bundle-Activator: supplychain.retailer.OSGiRetailerImpl diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/Shipper.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/Shipper.mf new file mode 100644 index 0000000000..390367b99b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/Shipper.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Shipper +Bundle-SymbolicName: services.supplychain.shipper.Shipper +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.customer +Export-Package: supplychain.shipper +Bundle-Activator: supplychain.shipper.OSGiShipperImpl diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/Warehouse.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/Warehouse.mf new file mode 100644 index 0000000000..4715cbd976 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/Warehouse.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Warehouse +Bundle-SymbolicName: services.supplychain.warehouse.Warehouse +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.shipper +Export-Package: supplychain.warehouse +Bundle-Activator: supplychain.warehouse.OSGiWarehouseImpl diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Customer.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Customer.mf new file mode 100644 index 0000000000..932fb8a483 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Customer.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Customer +Bundle-SymbolicName: ds.services.supplychain.customer.Customer +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, supplychain.retailer +Export-Package: supplychain.customer +Service-Component: osgi/services/ds/Customer.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Customer.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Customer.xml new file mode 100644 index 0000000000..b10d0416dc --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Customer.xml @@ -0,0 +1,41 @@ + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Retailer.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Retailer.mf new file mode 100644 index 0000000000..c799f31606 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Retailer.mf @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Retailer +Bundle-SymbolicName: ds.services.supplychain.retailer.Retailer +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, + supplychain.warehouse +Export-Package: supplychain.retailer +Service-Component: osgi/services/ds/Retailer1.xml, osgi/services/ds/Retailer2.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Retailer1.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Retailer1.xml new file mode 100644 index 0000000000..db68d7e333 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Retailer1.xml @@ -0,0 +1,32 @@ + + + + + + + + + amazon.com + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Retailer2.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Retailer2.xml new file mode 100644 index 0000000000..1aea3cf669 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Retailer2.xml @@ -0,0 +1,32 @@ + + + + + + + + + play.com + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Shipper.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Shipper.mf new file mode 100644 index 0000000000..106bd1b6aa --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Shipper.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Shipper +Bundle-SymbolicName: ds.services.supplychain.shipper.Shipper +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, supplychain.customer +Export-Package: supplychain.shipper +Service-Component: osgi/services/ds/Shipper1.xml, osgi/services/ds/Shipper2.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Shipper1.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Shipper1.xml new file mode 100644 index 0000000000..1e3c915a59 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Shipper1.xml @@ -0,0 +1,34 @@ + + + + + + + + + RoyalMail + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Shipper2.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Shipper2.xml new file mode 100644 index 0000000000..d7d0b41f5e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Shipper2.xml @@ -0,0 +1,34 @@ + + + + + + + + + ParcelForce + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Warehouse.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Warehouse.mf new file mode 100644 index 0000000000..81c51e6804 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Warehouse.mf @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Warehouse +Bundle-SymbolicName: ds.services.supplychain.warehouse.Warehouse +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, + supplychain.shipper +Export-Package: supplychain.warehouse +Service-Component: osgi/services/ds/Warehouse1.xml, osgi/services/ds/Warehouse2.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Warehouse1.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Warehouse1.xml new file mode 100644 index 0000000000..ca50b554df --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Warehouse1.xml @@ -0,0 +1,32 @@ + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Warehouse2.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Warehouse2.xml new file mode 100644 index 0000000000..14658127f8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/services/ds/Warehouse2.xml @@ -0,0 +1,32 @@ + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Customer1.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Customer1.mf new file mode 100644 index 0000000000..335bc419c1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Customer1.mf @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Customer +Bundle-SymbolicName: version.supplychain.customer.Customer +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.retailer;version="[1.0.0,2.0.0)" +Export-Package: supplychain.customer;version="1.0.0" +Bundle-Activator: supplychain.customer.OSGiVersionedCustomerImpl + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Customer2.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Customer2.mf new file mode 100644 index 0000000000..a68b9d6dbb --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Customer2.mf @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Customer +Bundle-SymbolicName: version.supplychain.customer.Customer +Bundle-Version: 2.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.retailer;version="[2.0.0,3.0.0)" +Export-Package: supplychain.customer;version="2.0.0" +Bundle-Activator: supplychain.customer.OSGiVersionedCustomerImpl + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Retailer1.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Retailer1.mf new file mode 100644 index 0000000000..02f79c15f3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Retailer1.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Retailer +Bundle-SymbolicName: version.supplychain.retailer.Retailer +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.warehouse +Export-Package: supplychain.retailer;version="1.0.0" +Bundle-Activator: supplychain.retailer.OSGiVersionedRetailerImpl diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Retailer2.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Retailer2.mf new file mode 100644 index 0000000000..8428b08d96 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Retailer2.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Retailer +Bundle-SymbolicName: version.supplychain.retailer.Retailer +Bundle-Version: 2.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.warehouse +Export-Package: supplychain.retailer;version="2.0.0" +Bundle-Activator: supplychain.retailer.OSGiVersionedRetailerImpl diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Shipper1.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Shipper1.mf new file mode 100644 index 0000000000..01d0320f5b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Shipper1.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Shipper +Bundle-SymbolicName: version.supplychain.shipper.Shipper +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.customer +Export-Package: supplychain.shipper;version="1.0.0" +Bundle-Activator: supplychain.shipper.OSGiVersionedShipperImpl diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Shipper2.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Shipper2.mf new file mode 100644 index 0000000000..8f311807b5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Shipper2.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Shipper +Bundle-SymbolicName: version.supplychain.shipper.Shipper +Bundle-Version: 2.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.customer +Export-Package: supplychain.shipper;version="2.0.0" +Bundle-Activator: supplychain.shipper.OSGiVersionedShipperImpl diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Warehouse1.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Warehouse1.mf new file mode 100644 index 0000000000..fccaad9e05 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Warehouse1.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Warehouse +Bundle-SymbolicName: version.supplychain.warehouse.Warehouse +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.shipper +Export-Package: supplychain.warehouse;version="1.0.0" +Bundle-Activator: supplychain.warehouse.OSGiWarehouseImpl diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Warehouse2.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Warehouse2.mf new file mode 100644 index 0000000000..7ebbfbe185 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/Warehouse2.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Warehouse +Bundle-SymbolicName: version.supplychain.warehouse.Warehouse +Bundle-Version: 2.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.shipper +Export-Package: supplychain.warehouse;version="2.0.0" +Bundle-Activator: supplychain.warehouse.OSGiWarehouseImpl diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Customer1.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Customer1.mf new file mode 100644 index 0000000000..6674cdd7f2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Customer1.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Customer +Bundle-SymbolicName: ds.version.supplychain.customer.Customer +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, supplychain.retailer;version="[1.0.0,2.0.0)" +Export-Package: supplychain.customer;version="1.0.0" +Service-Component: osgi/version/ds/CustomerV1.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Customer2.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Customer2.mf new file mode 100644 index 0000000000..72df35ef41 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Customer2.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Customer +Bundle-SymbolicName: ds.version.supplychain.customer.Customer +Bundle-Version: 2.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, supplychain.retailer;version="[2.0.0,3.0.0)" +Export-Package: supplychain.customer;version="2.0.0" +Service-Component: osgi/version/ds/CustomerV2.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/CustomerV1.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/CustomerV1.xml new file mode 100644 index 0000000000..724c8132df --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/CustomerV1.xml @@ -0,0 +1,41 @@ + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/CustomerV2.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/CustomerV2.xml new file mode 100644 index 0000000000..1e5035d949 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/CustomerV2.xml @@ -0,0 +1,41 @@ + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer1.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer1.mf new file mode 100644 index 0000000000..85bfd86422 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer1.mf @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Retailer +Bundle-SymbolicName: ds.version.supplychain.retailer.Retailer +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, + supplychain.warehouse +Export-Package: supplychain.retailer;version="1.0.0" +Service-Component: osgi/version/ds/Retailer1V1.xml, osgi/version/ds/Retailer2V1.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer1V1.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer1V1.xml new file mode 100644 index 0000000000..6e51b3d6f2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer1V1.xml @@ -0,0 +1,34 @@ + + + + + + + + + amazon.com + 1 + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer1V2.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer1V2.xml new file mode 100644 index 0000000000..9a87758ec2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer1V2.xml @@ -0,0 +1,34 @@ + + + + + + + + + amazon.com + 2 + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer2.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer2.mf new file mode 100644 index 0000000000..e134bd1061 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer2.mf @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Retailer +Bundle-SymbolicName: ds.version.supplychain.retailer.Retailer +Bundle-Version: 2.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, + supplychain.warehouse +Export-Package: supplychain.retailer;version="2.0.0" +Service-Component: osgi/version/ds/Retailer1V2.xml, osgi/version/ds/Retailer2V2.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer2V1.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer2V1.xml new file mode 100644 index 0000000000..c19895bab1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer2V1.xml @@ -0,0 +1,33 @@ + + + + + + + + + play.com + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer2V2.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer2V2.xml new file mode 100644 index 0000000000..707609d2c4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer2V2.xml @@ -0,0 +1,33 @@ + + + + + + + + + play.com + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper1.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper1.mf new file mode 100644 index 0000000000..e084e5831a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper1.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Shipper +Bundle-SymbolicName: ds.version.supplychain.shipper.Shipper +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, supplychain.customer;version="[1.0.0,2.0.0)" +Export-Package: supplychain.shipper;version="1.0.0" +Service-Component: osgi/version/ds/Shipper1V1.xml, osgi/version/ds/Shipper2V1.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper1V1.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper1V1.xml new file mode 100644 index 0000000000..d96f6481fb --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper1V1.xml @@ -0,0 +1,35 @@ + + + + + + + + + RoyalMail + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper1V2.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper1V2.xml new file mode 100644 index 0000000000..10ef690c9b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper1V2.xml @@ -0,0 +1,35 @@ + + + + + + + + + RoyalMail + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper2.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper2.mf new file mode 100644 index 0000000000..003f9dca5a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper2.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Shipper +Bundle-SymbolicName: ds.version.supplychain.shipper.Shipper +Bundle-Version: 2.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, supplychain.customer;version="[2.0.0,3.0.0)" +Export-Package: supplychain.shipper;version="2.0.0" +Service-Component: osgi/version/ds/Shipper1V2.xml, osgi/version/ds/Shipper2V2.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper2V1.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper2V1.xml new file mode 100644 index 0000000000..fefdea106d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper2V1.xml @@ -0,0 +1,35 @@ + + + + + + + + + ParcelForce + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper2V2.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper2V2.xml new file mode 100644 index 0000000000..f6b847ed59 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper2V2.xml @@ -0,0 +1,35 @@ + + + + + + + + + ParcelForce + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse1.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse1.mf new file mode 100644 index 0000000000..5cff2f573e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse1.mf @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Warehouse +Bundle-SymbolicName: ds.version.supplychain.warehouse.Warehouse +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, + supplychain.shipper;version="[1.0.0,2.0.0)" +Export-Package: supplychain.warehouse;version="1.0.0" +Service-Component: osgi/version/ds/Warehouse1V1.xml, osgi/version/ds/Warehouse2V2.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse1V1.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse1V1.xml new file mode 100644 index 0000000000..ca50b554df --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse1V1.xml @@ -0,0 +1,32 @@ + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse1V2.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse1V2.xml new file mode 100644 index 0000000000..14658127f8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse1V2.xml @@ -0,0 +1,32 @@ + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse2.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse2.mf new file mode 100644 index 0000000000..0fec68a725 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse2.mf @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Warehouse +Bundle-SymbolicName: ds.version.supplychain.warehouse.Warehouse +Bundle-Version: 2.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, + supplychain.shipper;version="[2.0.0,3.0.0)" +Export-Package: supplychain.warehouse;version="2.0.0" +Service-Component: osgi/version/ds/Warehouse1V1.xml, osgi/version/ds/Warehouse2V2.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse2V1.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse2V1.xml new file mode 100644 index 0000000000..ca50b554df --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse2V1.xml @@ -0,0 +1,32 @@ + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse2V2.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse2V2.xml new file mode 100644 index 0000000000..14658127f8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse2V2.xml @@ -0,0 +1,32 @@ + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/Customer.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/Customer.mf new file mode 100644 index 0000000000..678014d48d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/Customer.mf @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Customer +Bundle-SymbolicName: wiring.supplychain.customer.Customer +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.retailer +Export-Package: supplychain.customer +Bundle-Activator: supplychain.customer.OSGiCustomerImpl + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/Retailer.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/Retailer.mf new file mode 100644 index 0000000000..f0090fb52b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/Retailer.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Retailer +Bundle-SymbolicName: wiring.supplychain.retailer.Retailer +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.warehouse +Export-Package: supplychain.retailer +Bundle-Activator: supplychain.retailer.OSGiRetailerImpl diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/Shipper.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/Shipper.mf new file mode 100644 index 0000000000..0b50923a05 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/Shipper.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Shipper +Bundle-SymbolicName: wiring.supplychain.shipper.Shipper +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.customer +Export-Package: supplychain.shipper +Bundle-Activator: supplychain.shipper.OSGiShipperImpl diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/Warehouse.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/Warehouse.mf new file mode 100644 index 0000000000..1000a5f974 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/Warehouse.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Warehouse +Bundle-SymbolicName: wiring.supplychain.warehouse.Warehouse +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + supplychain.shipper +Export-Package: supplychain.warehouse +Bundle-Activator: supplychain.warehouse.OSGiWarehouseImpl diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Customer.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Customer.mf new file mode 100644 index 0000000000..4e392a9ff1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Customer.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Customer +Bundle-SymbolicName: ds.wiring.supplychain.customer.Customer +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, supplychain.retailer +Export-Package: supplychain.customer +Service-Component: osgi/wiring/ds/Customer.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Customer.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Customer.xml new file mode 100644 index 0000000000..b10d0416dc --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Customer.xml @@ -0,0 +1,41 @@ + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Retailer.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Retailer.mf new file mode 100644 index 0000000000..788ec4f19a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Retailer.mf @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Retailer +Bundle-SymbolicName: ds.wiring.supplychain.retailer.Retailer +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, + supplychain.warehouse +Export-Package: supplychain.retailer +Service-Component: osgi/wiring/ds/Retailer1.xml, osgi/wiring/ds/Retailer2.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Retailer1.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Retailer1.xml new file mode 100644 index 0000000000..1ba16d0693 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Retailer1.xml @@ -0,0 +1,33 @@ + + + + + + + + + amazon.com + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Retailer2.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Retailer2.xml new file mode 100644 index 0000000000..a55ebd02a8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Retailer2.xml @@ -0,0 +1,33 @@ + + + + + + + + + play.com + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Shipper.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Shipper.mf new file mode 100644 index 0000000000..e7459360e6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Shipper.mf @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Shipper +Bundle-SymbolicName: ds.wiring.supplychain.shipper.Shipper +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, supplychain.customer +Export-Package: supplychain.shipper +Service-Component: osgi/wiring/ds/Shipper1.xml, osgi/wiring/ds/Shipper2.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Shipper1.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Shipper1.xml new file mode 100644 index 0000000000..d518ecab62 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Shipper1.xml @@ -0,0 +1,35 @@ + + + + + + + + + RoyalMail + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Shipper2.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Shipper2.xml new file mode 100644 index 0000000000..d7d0b41f5e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Shipper2.xml @@ -0,0 +1,34 @@ + + + + + + + + + ParcelForce + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Warehouse.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Warehouse.mf new file mode 100644 index 0000000000..880304187b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Warehouse.mf @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Warehouse +Bundle-SymbolicName: ds.wiring.supplychain.warehouse.Warehouse +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component, + supplychain.shipper +Export-Package: supplychain.warehouse +Service-Component: osgi/wiring/ds/Warehouse1.xml, osgi/wiring/ds/Warehouse2.xml diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Warehouse1.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Warehouse1.xml new file mode 100644 index 0000000000..ca50b554df --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Warehouse1.xml @@ -0,0 +1,32 @@ + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Warehouse2.xml b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Warehouse2.xml new file mode 100644 index 0000000000..14658127f8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Warehouse2.xml @@ -0,0 +1,32 @@ + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/ws/HelloWorld.mf b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/ws/HelloWorld.mf new file mode 100644 index 0000000000..d8e4c1cb7e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/osgi/ws/HelloWorld.mf @@ -0,0 +1,12 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: HelloWorld +Bundle-SymbolicName: helloworld.HelloWorld +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Import-Package: org.osgi.framework, + org.osgi.service.component , + helloworld.ws +Export-Package: helloworld +Bundle-Activator: helloworld.OSGiHelloWorldImpl + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/factory-ds-test.composite b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/factory-ds-test.composite new file mode 100644 index 0000000000..ed5b7593dc --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/factory-ds-test.composite @@ -0,0 +1,136 @@ + + + + + + + + + amazon.com + + + play.com + + + ebay.com + + + + + + + + + + + + + + amazon.com + + + + + + amazon.com + + + + + + play.com + + + + + play.com + + + + + + ebay.com + + + + + ebay.com + + + + + + + + + + + + + + + + + + + + + RoyalMail + + + + + RoyalMail + + + + + + + ParcelForce + + + + + ParcelForce + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/factory-test.composite b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/factory-test.composite new file mode 100644 index 0000000000..53abe030b7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/factory-test.composite @@ -0,0 +1,121 @@ + + + + + + + + + amazon.com + + + play.com + + + ebay.com + + + + + + + + + + + + + + amazon.com + + + + + + amazon.com + + + + + + play.com + + + + + play.com + + + + + + ebay.com + + + + + ebay.com + + + + + + + + + + + + + + + + + + + + + ParcelForce + + + + + ParcelForce + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/helloworld.wsdl b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/helloworld.wsdl new file mode 100644 index 0000000000..68174d1ecd --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/helloworld.wsdl @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/interfaces-ds-test.composite b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/interfaces-ds-test.composite new file mode 100644 index 0000000000..c3ad9e1588 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/interfaces-ds-test.composite @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/interfaces-test.composite b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/interfaces-test.composite new file mode 100644 index 0000000000..56b04f348d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/interfaces-test.composite @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/passbyref-test.composite b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/passbyref-test.composite new file mode 100644 index 0000000000..84e2c5b1cf --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/passbyref-test.composite @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/properties-ds-test.composite b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/properties-ds-test.composite new file mode 100644 index 0000000000..e6f51208a7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/properties-ds-test.composite @@ -0,0 +1,41 @@ + + + + + + + + + stockQuote + + + + USD + 2.0 + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/properties-test.composite b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/properties-test.composite new file mode 100644 index 0000000000..2794007254 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/properties-test.composite @@ -0,0 +1,41 @@ + + + + + + + + + stockQuote + + + + USD + 2.0 + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/properties2-ds-test.composite b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/properties2-ds-test.composite new file mode 100644 index 0000000000..c341446691 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/properties2-ds-test.composite @@ -0,0 +1,58 @@ + + + + + + + + + stockQuote + + + + USD + 2.0 + + + + + + + + stockQuote + + + + EURO + 1.48 + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/properties2-test.composite b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/properties2-test.composite new file mode 100644 index 0000000000..67b5c294ae --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/properties2-test.composite @@ -0,0 +1,52 @@ + + + + + + + + + + USD + 2.0 + + + + + + + + + EURO + 1.48 + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/services-ds-test.composite b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/services-ds-test.composite new file mode 100644 index 0000000000..db743296a0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/services-ds-test.composite @@ -0,0 +1,93 @@ + + + + + + + + + amazon.com + + + play.com + + + ebay.com + + + + + + + + + + + + + + + + amazon.com + + + play.com + + + ebay.com + + + + + + + + + + + + + + + + + + RoyalMail + + + ParcelForce + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/services-test.composite b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/services-test.composite new file mode 100644 index 0000000000..35bb9834d6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/services-test.composite @@ -0,0 +1,92 @@ + + + + + + + + + amazon.com + + + play.com + + + ebay.com + + + + + + + + + + + + + + + amazon.com + + + play.com + + + ebay.com + + + + + + + + + + + + + + + + + + RoyalMail + + + ParcelForce + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/version-ds-test.composite b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/version-ds-test.composite new file mode 100644 index 0000000000..66d3a6474d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/version-ds-test.composite @@ -0,0 +1,160 @@ + + + + + + + + + CustomerComponent1 + + + + + + + + + + + + + + + + + + CustomerComponent2 + + + + + + + + + + + + + + + amazon.com + + + play.com + + + ebay.com + + + WarehouseComponent1/Warehouse + + + + + + + + + + amazon.com + + + play.com + + + ebay.com + + + WarehouseComponent2/Warehouse + + + + + + + + + + + + + + + + + + + + + + + + RoyalMail + + + ParcelForce + + + CustomerComponent1 + + + + + + + + + + + RoyalMail + + + ParcelForce + + + CustomerComponent2 + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/version-test.composite b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/version-test.composite new file mode 100644 index 0000000000..d3d1551c73 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/version-test.composite @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + amazon.com + + + play.com + + + ebay.com + + + + + + + + + + + amazon.com + + + play.com + + + ebay.com + + + WarehouseComponent2/Warehouse + + + + + + + + + + + + + + + + + + + + + + + + RoyalMail + + + ParcelForce + + + CustomerComponent1/CustomerService + + + + + + + + + + + RoyalMail + + + ParcelForce + + + CustomerComponent2/CustomerService + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/wiring-ds-test1.composite b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/wiring-ds-test1.composite new file mode 100644 index 0000000000..24f8c8f6fc --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/wiring-ds-test1.composite @@ -0,0 +1,142 @@ + + + + + + + + + amazon.com + + + play.com + + + ebay.com + + + + + + + + + + + + + + amazon.com + + + WarehouseComponent1 + + + + + + amazon.com + + + + + + play.com + + + WarehouseComponent1 + + + + + play.com + + + + + + + ebay.com + + + WarehouseComponent2 + + + + + play.com + + + + + + + + + + + + + + + + + + + + ShipperComponent1 + RoyalMail + + + + RoyalMail + + + + + + + ShipperComponent2 + ParcelForce + + + + ParcelForce + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/wiring-ds-test2.composite b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/wiring-ds-test2.composite new file mode 100644 index 0000000000..95be8374cd --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/wiring-ds-test2.composite @@ -0,0 +1,159 @@ + + + + + + + + + amazon.com + + + play.com + + + ebay.com + + + + + + + + + + + + + + amazon.com + + + WarehouseComponent1 + + + + + + amazon.com + + + + + + + play.com + + + + WarehouseComponent1 + + + + play.com + + + + + + + ebay.com + + + WarehouseComponent1 + + + + ebay.com + + + + + + + + ParcelForce + + + + + + + + + + + + + RoyalMail + + + + + + + + + + + + RoyalMail + + + + + RoyalMail + + + + + + + ParcelForce + + + + + ParcelForce + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/wiring-test1.composite b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/wiring-test1.composite new file mode 100644 index 0000000000..67066049e7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/wiring-test1.composite @@ -0,0 +1,132 @@ + + + + + + + + + amazon.com + + + play.com + + + ebay.com + + + + + + + + + + + + + + amazon.com + + + + + amazon.com + + + + + + + play.com + + + + play.com + + + + + + + ebay.com + + + + ebay.com + + + + + + + + + + + + + + + + + + + + + RoyalMail + + + + + RoyalMail + + + + + + + ParcelForce + + + + + ParcelForce + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/wiring-test2.composite b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/wiring-test2.composite new file mode 100644 index 0000000000..a5a634208d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/wiring-test2.composite @@ -0,0 +1,159 @@ + + + + + + + + + amazon.com + + + play.com + + + ebay.com + + + + + + + + + + + + + + amazon.com + + + WarehouseComponent1 + + + + + + amazon.com + + + + + + + play.com + + + + WarehouseComponent1 + + + + play.com + + + + + + + ebay.com + + + WarehouseComponent1 + + + + ebay.com + + + + + + + + ParcelForce + + + + + + + + + + + + + RoyalMail + + + + + + + + + + + + RoyalMail + + + + + RoyalMail + + + + + + + ParcelForce + + + + + ParcelForce + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/ws-helloworld.composite b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/ws-helloworld.composite new file mode 100644 index 0000000000..30fd337134 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/sca/ws-helloworld.composite @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/stockquote/StockQuote.componentType b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/stockquote/StockQuote.componentType new file mode 100644 index 0000000000..0b0aa0912b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/stockquote/StockQuote.componentType @@ -0,0 +1,28 @@ + + + + + + + + GBP + 1.0 + + diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/Customer.componentType b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/Customer.componentType new file mode 100644 index 0000000000..64986c7dcc --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/Customer.componentType @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/CustomerServices.componentType b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/CustomerServices.componentType new file mode 100644 index 0000000000..0cf5563258 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/CustomerServices.componentType @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/CustomerWithQuery.componentType b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/CustomerWithQuery.componentType new file mode 100644 index 0000000000..9906af1463 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/CustomerWithQuery.componentType @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/Retailer.componentType b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/Retailer.componentType new file mode 100644 index 0000000000..7323b2d9be --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/Retailer.componentType @@ -0,0 +1,29 @@ + + + + + + + + + + default + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/RetailerServices.componentType b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/RetailerServices.componentType new file mode 100644 index 0000000000..f7ead7eb85 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/RetailerServices.componentType @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/RetailerWithQuery.componentType b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/RetailerWithQuery.componentType new file mode 100644 index 0000000000..f6ac2393dc --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/RetailerWithQuery.componentType @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + default + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/Shipper.componentType b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/Shipper.componentType new file mode 100644 index 0000000000..7996f0f429 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/Shipper.componentType @@ -0,0 +1,29 @@ + + + + + + + + + + default + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/ShipperServices.componentType b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/ShipperServices.componentType new file mode 100644 index 0000000000..2906e0d2ed --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/ShipperServices.componentType @@ -0,0 +1,30 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/Warehouse.componentType b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/Warehouse.componentType new file mode 100644 index 0000000000..c5ae9b76f3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/Warehouse.componentType @@ -0,0 +1,28 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/WarehouseServices.componentType b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/WarehouseServices.componentType new file mode 100644 index 0000000000..c5ae9b76f3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/WarehouseServices.componentType @@ -0,0 +1,28 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/WarehouseWithQuery.componentType b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/WarehouseWithQuery.componentType new file mode 100644 index 0000000000..24edf697d5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/main/resources/supplychain/WarehouseWithQuery.componentType @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/helloworld/HelloWorldTestCase.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/helloworld/HelloWorldTestCase.java new file mode 100644 index 0000000000..ab08fd1982 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/helloworld/HelloWorldTestCase.java @@ -0,0 +1,55 @@ +/* + * 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 helloworld.HelloWorld; +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +import util.OSGiTestUtil; + + +public class HelloWorldTestCase extends TestCase { + + private SCADomain scaDomain; + private HelloWorld helloWorld; + + protected void setUp() throws Exception { + OSGiTestUtil.setUpOSGiTestRutime(); + + scaDomain = SCADomain.newInstance("sca/ws-helloworld.composite"); + helloWorld = scaDomain.getService(HelloWorld.class, "HelloWorldComponent"); + } + + protected void tearDown() throws Exception { + scaDomain.close(); + OSGiTestUtil.shutdownOSGiRuntime(); + } + + + public void testHelloWorld() throws Exception { + String greetings = helloWorld.getGreetings("petra"); + System.out.println(greetings); + assertEquals("Hello petra", greetings); + } + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/helloworld/PassByRefTestCase.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/helloworld/PassByRefTestCase.java new file mode 100644 index 0000000000..454fc6a7f8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/helloworld/PassByRefTestCase.java @@ -0,0 +1,135 @@ +/* + * 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 junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +import util.OSGiTestUtil; + + +public class PassByRefTestCase extends TestCase { + + private SCADomain scaDomain; + private Greetings greetingsJava; + private Greetings greetingsOSGi; + private String[] origNames = {"world"}; + private String[] names; + + protected void setUp() throws Exception { + OSGiTestUtil.setUpOSGiTestRutime(); + + scaDomain = SCADomain.newInstance("sca/passbyref-test.composite"); + greetingsJava = scaDomain.getService(Greetings.class, "JavaGreetingsComponent"); + greetingsOSGi = scaDomain.getService(Greetings.class, "OSGiGreetingsComponent"); + + names = new String[origNames.length]; + System.arraycopy(origNames, 0, names, 0, names.length); + } + + protected void tearDown() throws Exception { + scaDomain.close(); + OSGiTestUtil.shutdownOSGiRuntime(); + } + + public void test() throws Exception { + + javaOSGiPassByValue(); + osgiJavaPassByValue(); + javaOSGiPassByRef(); + osgiJavaPassByRef(); + + } + + + public void javaOSGiPassByValue() throws Exception { + + String[] greetings = greetingsJava.getGreetingsFromJava(names); + for (int i = 0; i < origNames.length; i++) { + assertEquals(origNames[i], names[i]); + } + for (int i = 0; i < origNames.length; i++) { + + System.out.println(greetings[i]); + + assertEquals(greetings[i], + "Hello " + origNames[i] + "(From Java)(From OSGi)"); + } + + } + + public void osgiJavaPassByValue() throws Exception { + String[] names = { + "world" + }; + String[] greetings = greetingsOSGi.getGreetingsFromOSGi(names); + + for (int i = 0; i < origNames.length; i++) { + assertEquals(origNames[i], names[i]); + } + for (int i = 0; i < origNames.length; i++) { + + System.out.println(greetings[i]); + + assertEquals(greetings[i], + "Hello " + origNames[i] + "(From OSGi)(From Java)"); + } + + + + } + + public void javaOSGiPassByRef() throws Exception { + String[] names = { + "world" + }; + String[] greetings = greetingsJava.getModifiedGreetingsFromJava(names); + for (int i = 0; i < origNames.length; i++) { + assertEquals("Hello " + origNames[i] + "(From Java)(From OSGi)", names[i]); + } + for (int i = 0; i < origNames.length; i++) { + + System.out.println(greetings[i]); + + assertEquals(greetings[i], + "Hello " + origNames[i] + "(From Java)(From OSGi)"); + } + } + + public void osgiJavaPassByRef() throws Exception { + String[] names = { + "world" + }; + String[] greetings = greetingsOSGi.getModifiedGreetingsFromOSGi(names); + for (int i = 0; i < origNames.length; i++) { + assertEquals("Hello " + origNames[i] + "(From OSGi)(From Java)", names[i]); + } + for (int i = 0; i < origNames.length; i++) { + + System.out.println(greetings[i]); + + assertEquals(greetings[i], + "Hello " + origNames[i] + "(From OSGi)(From Java)"); + } + } + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/SupplyChainTestCase.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/SupplyChainTestCase.java new file mode 100644 index 0000000000..b41c00bd0b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/SupplyChainTestCase.java @@ -0,0 +1,79 @@ +/* + * 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; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + + +import supplychain.customer.Customer; +import util.OSGiTestUtil; + +/** + * Test case for supplychain - it is invoked with different composite files to test + * various scenarios. + */ +public abstract class SupplyChainTestCase extends TestCase { + + private String compositeName; + private SCADomain scaDomain; + public Customer customer; + + public SupplyChainTestCase(String compositeName) { + super(); + this.compositeName = compositeName; + } + + protected void setUp() throws Exception { + + OSGiTestUtil.setUpOSGiTestRutime(); + + scaDomain = SCADomain.newInstance(compositeName); + customer = scaDomain.getService(Customer.class, "CustomerComponent"); + } + + protected void tearDown() throws Exception { + scaDomain.close(); + + OSGiTestUtil.shutdownOSGiRuntime(); + } + + + public void test() throws Exception { + + System.out.println("Main thread " + Thread.currentThread()); + customer.purchaseBooks(); + customer.purchaseGames(); + long timeout = 5000L; + while (timeout > 0) { + if (customer.hasOutstandingOrders()) { + Thread.sleep(100); + timeout -= 100; + } else + break; + } + assertFalse(customer.hasOutstandingOrders()); + + System.out.println("Test complete"); + + } + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/VersionedSupplyChainTestCase.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/VersionedSupplyChainTestCase.java new file mode 100644 index 0000000000..d569cd7189 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/VersionedSupplyChainTestCase.java @@ -0,0 +1,81 @@ +/* + * 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; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +import supplychain.customer.Customer; +import util.OSGiTestUtil; + +/** + * OSGi test program - common code for versioned bundles + */ +public abstract class VersionedSupplyChainTestCase extends TestCase { + + private String compositeName; + private SCADomain scaDomain; + private Customer customer1; + private Customer customer2; + + + public VersionedSupplyChainTestCase(String compositeName) { + super(); + this.compositeName = compositeName; + } + + protected void setUp() throws Exception { + + OSGiTestUtil.setUpOSGiTestRutime(); + + scaDomain = SCADomain.newInstance(compositeName); + customer1 = scaDomain.getService(Customer.class, "CustomerComponent1"); + customer2 = scaDomain.getService(Customer.class, "CustomerComponent2"); + } + + protected void tearDown() throws Exception { + scaDomain.close(); + + OSGiTestUtil.shutdownOSGiRuntime(); + } + + public void test() throws Exception { + + System.out.println("Main thread " + Thread.currentThread()); + customer1.purchaseBooks(); + customer2.purchaseGames(); + long timeout = 5000L; + while (timeout > 0) { + if (customer1.hasOutstandingOrders()) { + Thread.sleep(100); + timeout -= 100; + } else if (customer2.hasOutstandingOrders()) { + Thread.sleep(100); + timeout -= 100; + } else + break; + } + assertFalse(customer1.hasOutstandingOrders()); + assertFalse(customer2.hasOutstandingOrders()); + + System.out.println("Test complete"); + + } +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/factory/DSFactoryTestCase.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/factory/DSFactoryTestCase.java new file mode 100644 index 0000000000..eba07d7d93 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/factory/DSFactoryTestCase.java @@ -0,0 +1,32 @@ +/* + * 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.factory; + + +/** + * OSGi test program - declarative with scopes other than composites which use OSGi service factories + */ +public class DSFactoryTestCase extends FactoryTestCase { + + public DSFactoryTestCase() { + super("sca/factory-ds-test.composite"); + } + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/factory/FactoryTestCase.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/factory/FactoryTestCase.java new file mode 100644 index 0000000000..2f367a2f64 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/factory/FactoryTestCase.java @@ -0,0 +1,52 @@ +/* + * 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.factory; + +import supplychain.SupplyChainTestCase; + +/** + * OSGi test program - declarative with scopes other than composites which use OSGi service factories + */ +public class FactoryTestCase extends SupplyChainTestCase { + + public FactoryTestCase() { + super("sca/factory-test.composite"); + } + + protected FactoryTestCase(String compositeName) { + super(compositeName); + } + + + @Override + public void test() throws Exception { + + System.out.println("Main thread " + Thread.currentThread()); + customer.purchaseBooks(); + assertFalse(customer.hasOutstandingOrders()); + + customer.purchaseGames(); + assertFalse(customer.hasOutstandingOrders()); + + Thread.sleep(1000); + System.out.println("Test complete"); + + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/interfaces/DSInterfacesTestCase.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/interfaces/DSInterfacesTestCase.java new file mode 100644 index 0000000000..64610bfff8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/interfaces/DSInterfacesTestCase.java @@ -0,0 +1,32 @@ +/* + * 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.interfaces; + +import supplychain.SupplyChainTestCase; + +/** + * OSGi test program - declarative with components exposing multiple services with multiple interfaces + */ +public class DSInterfacesTestCase extends SupplyChainTestCase { + + public DSInterfacesTestCase() { + super("sca/interfaces-ds-test.composite"); + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/interfaces/InterfacesTestCase.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/interfaces/InterfacesTestCase.java new file mode 100644 index 0000000000..7b7d4f1e04 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/interfaces/InterfacesTestCase.java @@ -0,0 +1,32 @@ +/* + * 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.interfaces; + +import supplychain.SupplyChainTestCase; + +/** + * OSGi test program - procedural with components exposing multiple services with multiple interfaces + */ +public class InterfacesTestCase extends SupplyChainTestCase { + + public InterfacesTestCase() { + super("sca/interfaces-test.composite"); + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/properties/DSProperties2TestCase.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/properties/DSProperties2TestCase.java new file mode 100644 index 0000000000..20dab1ec66 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/properties/DSProperties2TestCase.java @@ -0,0 +1,31 @@ +/* + * 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.properties; + + +/** + * OSGi test program - declarative with business properties + */ +public class DSProperties2TestCase extends Properties2TestCase { + + public DSProperties2TestCase() { + super("sca/properties2-ds-test.composite"); + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/properties/DSPropertiesTestCase.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/properties/DSPropertiesTestCase.java new file mode 100644 index 0000000000..5de9035ace --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/properties/DSPropertiesTestCase.java @@ -0,0 +1,31 @@ +/* + * 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.properties; + + +/** + * OSGi test program - declarative with business properties + */ +public class DSPropertiesTestCase extends PropertiesTestCase { + + public DSPropertiesTestCase() { + super("sca/properties-ds-test.composite"); + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/properties/Properties2TestCase.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/properties/Properties2TestCase.java new file mode 100644 index 0000000000..51d37a4519 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/properties/Properties2TestCase.java @@ -0,0 +1,83 @@ +/* + * 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.properties; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +import stockquote.StockQuote; +import util.OSGiTestUtil; + +/** + * OSGi test program - procedural with business properties + */ +public class Properties2TestCase extends TestCase { + + + private SCADomain scaDomain; + private StockQuote stockQuoteServiceUSD; + private StockQuote stockQuoteServiceEURO; + private String compositeName; + + public Properties2TestCase() { + super(); + compositeName = "sca/properties2-test.composite"; + } + + protected Properties2TestCase(String compositeName) { + super(); + this.compositeName = compositeName; + } + + protected void setUp() throws Exception { + + OSGiTestUtil.setUpOSGiTestRutime(); + + scaDomain = SCADomain.newInstance(compositeName); + stockQuoteServiceUSD = scaDomain.getService(StockQuote.class, "USDStockQuoteComponent"); + stockQuoteServiceEURO = scaDomain.getService(StockQuote.class, "EUROStockQuoteComponent"); + } + + protected void tearDown() throws Exception { + scaDomain.close(); + OSGiTestUtil.shutdownOSGiRuntime(); + } + + public void test() throws Exception { + + double stockQuote = stockQuoteServiceUSD.getQuote("IBM"); + + double expectedValue = 52.81 * 2.0; + + System.out.println("IBM: $" + stockQuote); + + assertTrue(stockQuote > expectedValue - 0.1 && stockQuote < expectedValue + 0.1); + + double stockQuote2 = stockQuoteServiceEURO.getQuote("IBM"); + + double expectedValue2 = 52.81 * 1.48; + + System.out.println("IBM: Euro " + stockQuote2); + + assertTrue(stockQuote2 > expectedValue2 - 0.1 && stockQuote2 < expectedValue2 + 0.1); + + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/properties/PropertiesTestCase.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/properties/PropertiesTestCase.java new file mode 100644 index 0000000000..23e1624be1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/properties/PropertiesTestCase.java @@ -0,0 +1,73 @@ +/* + * 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.properties; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +import stockquote.StockQuote; +import util.OSGiTestUtil; + +/** + * OSGi test program - procedural with business properties + */ +public class PropertiesTestCase extends TestCase { + + + private SCADomain scaDomain; + private StockQuote stockQuoteService; + private String compositeName; + + public PropertiesTestCase() { + super(); + compositeName = "sca/properties-test.composite"; + } + + protected PropertiesTestCase(String compositeName) { + super(); + this.compositeName = compositeName; + } + + protected void setUp() throws Exception { + + OSGiTestUtil.setUpOSGiTestRutime(); + + scaDomain = SCADomain.newInstance(compositeName); + stockQuoteService = scaDomain.getService(StockQuote.class, "StockQuoteComponent"); + } + + protected void tearDown() throws Exception { + scaDomain.close(); + OSGiTestUtil.shutdownOSGiRuntime(); + } + + public void test() throws Exception { + + double stockQuote = stockQuoteService.getQuote("IBM"); + + double expectedValue = 52.81 * 2.0; + + System.out.println("IBM: " + stockQuote); + + assertTrue(stockQuote > expectedValue - 0.1 && stockQuote < expectedValue + 0.1); + + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/services/DSServicesTestCase.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/services/DSServicesTestCase.java new file mode 100644 index 0000000000..069a5e538d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/services/DSServicesTestCase.java @@ -0,0 +1,32 @@ +/* + * 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.services; + +import supplychain.SupplyChainTestCase; + +/** + * OSGi test program - declarative with components exposing multiple services + */ +public class DSServicesTestCase extends SupplyChainTestCase { + + public DSServicesTestCase() { + super("sca/services-ds-test.composite"); + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/services/ServicesTestCase.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/services/ServicesTestCase.java new file mode 100644 index 0000000000..5ec9f51c71 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/services/ServicesTestCase.java @@ -0,0 +1,32 @@ +/* + * 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.services; + +import supplychain.SupplyChainTestCase; + +/** + * OSGi test program - procedural with components exposing multiple services + */ +public class ServicesTestCase extends SupplyChainTestCase { + + public ServicesTestCase() { + super("sca/services-test.composite"); + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/version/DSVersionTestCase.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/version/DSVersionTestCase.java new file mode 100644 index 0000000000..3226362335 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/version/DSVersionTestCase.java @@ -0,0 +1,33 @@ +/* + * 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.version; + +import supplychain.VersionedSupplyChainTestCase; + +/** + * OSGi test program - declarative with versioning + */ +public class DSVersionTestCase extends VersionedSupplyChainTestCase { + + public DSVersionTestCase() { + super("sca/version-ds-test.composite"); + } + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/version/VersionTestCase.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/version/VersionTestCase.java new file mode 100644 index 0000000000..3153399820 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/version/VersionTestCase.java @@ -0,0 +1,33 @@ +/* + * 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.version; + +import supplychain.VersionedSupplyChainTestCase; + +/** + * OSGi test program - procedural with versioning + */ +public class VersionTestCase extends VersionedSupplyChainTestCase { + + public VersionTestCase() { + super("sca/version-test.composite"); + } + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/wiring/DSWiring1TestCase.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/wiring/DSWiring1TestCase.java new file mode 100644 index 0000000000..8c50bf89aa --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/wiring/DSWiring1TestCase.java @@ -0,0 +1,33 @@ +/* + * 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.wiring; + +import supplychain.SupplyChainTestCase; + +/** + * OSGi test program - declarative with SCA wiring + */ +public class DSWiring1TestCase extends SupplyChainTestCase { + + public DSWiring1TestCase() { + super("sca/wiring-ds-test1.composite"); + } + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/wiring/DSWiring2TestCase.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/wiring/DSWiring2TestCase.java new file mode 100644 index 0000000000..46d41710c6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/wiring/DSWiring2TestCase.java @@ -0,0 +1,33 @@ +/* + * 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.wiring; + +import supplychain.SupplyChainTestCase; + +/** + * OSGi test program - declarative with SCA wiring + */ +public class DSWiring2TestCase extends SupplyChainTestCase { + + public DSWiring2TestCase() { + super("sca/wiring-ds-test2.composite"); + } + + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/wiring/Wiring1TestCase.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/wiring/Wiring1TestCase.java new file mode 100644 index 0000000000..00c6d69678 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/wiring/Wiring1TestCase.java @@ -0,0 +1,32 @@ +/* + * 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.wiring; + +import supplychain.SupplyChainTestCase; + +/** + * OSGi test program - procedural with SCA wiring + */ +public class Wiring1TestCase extends SupplyChainTestCase { + + public Wiring1TestCase() { + super("sca/wiring-test1.composite"); + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/wiring/Wiring2TestCase.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/wiring/Wiring2TestCase.java new file mode 100644 index 0000000000..b7f0ad79d8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/supplychain/wiring/Wiring2TestCase.java @@ -0,0 +1,32 @@ +/* + * 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.wiring; + +import supplychain.SupplyChainTestCase; + +/** + * OSGi test program - procedural with SCA wiring + */ +public class Wiring2TestCase extends SupplyChainTestCase { + + public Wiring2TestCase() { + super("sca/wiring-test2.composite"); + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/util/OSGiTestUtil.java b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/util/OSGiTestUtil.java new file mode 100644 index 0000000000..ad13e72866 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/java/util/OSGiTestUtil.java @@ -0,0 +1,71 @@ +/* + * 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 util; + +import org.apache.tuscany.sca.implementation.osgi.runtime.OSGiRuntime; + + +/** + * OSGi Test Utils + */ +public class OSGiTestUtil { + + public static void setUpOSGiTestRutime() throws Exception { + + setUpFelixTestRutime(); + } + + + private static void setUpFelixTestRutime() throws Exception { + + String felixConfigFileName = "file:target/test-classes/osgi/felix/felix.config.properties"; + + System.setProperty("felix.config.properties", felixConfigFileName); + + try { + + ClassLoader cl = OSGiTestUtil.class.getClassLoader(); + + Class felixMainClass = cl.loadClass("org.apache.felix.main.Main"); + if (felixMainClass != null) { + String felixDir = felixMainClass.getProtectionDomain().getCodeSource().getLocation().getPath(); + int index = 0; + if ((index = felixDir.indexOf("/org.apache.felix.main")) >= 0) { + felixDir = felixDir.substring(0, index); + System.setProperty("FELIX_DIR", felixDir); + } + } + + } catch (Exception e) { + // Ignore + } + + + } + + public static void shutdownOSGiRuntime() { + try { + OSGiRuntime.getRuntime().shutdown(); + + } catch (Exception e) { + // Ignore + } + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/resources/osgi/felix/felix.config.properties b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/resources/osgi/felix/felix.config.properties new file mode 100644 index 0000000000..72fd6fd843 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/itest/osgi-implementation/src/test/resources/osgi/felix/felix.config.properties @@ -0,0 +1,44 @@ +# +# 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. +# +# +# Framework config properties. +# +org.osgi.framework.system.packages=org.osgi.framework; version=1.3.0, \ + org.osgi.service.packageadmin; version=1.2.0, \ + org.osgi.service.startlevel; version=1.0.0, \ + org.osgi.service.url; version=1.0.0 + + +felix.auto.start.1= \ + "file://${FELIX_DIR}/org.apache.felix.shell/1.0.0/org.apache.felix.shell-1.0.0.jar" \ + "file://${FELIX_DIR}/org.apache.felix.shell.tui/1.0.0/org.apache.felix.shell.tui-1.0.0.jar" \ + "file://${FELIX_DIR}/org.apache.felix.bundlerepository/1.0.0/org.apache.felix.bundlerepository-1.0.0.jar" \ + "file://${FELIX_DIR}/org.apache.felix.scr/0.9.0-SNAPSHOT/org.apache.felix.scr-0.9.0-SNAPSHOT.jar" \ + "file://${FELIX_DIR}/org.apache.felix.log/0.9.0-incubator-SNAPSHOT/org.apache.felix.log-0.9.0-incubator-SNAPSHOT.jar" \ + "file://${FELIX_DIR}/org.apache.felix.configadmin/0.9.0-SNAPSHOT/org.apache.felix.configadmin-0.9.0-SNAPSHOT.jar" + + +felix.startlevel.framework=1 +felix.startlevel.bundle=1 + +# +# Bundle config properties. +# +org.osgi.service.http.port=8080 +obr.shell.telnet=on -- cgit v1.2.3