From 6a3ca6736c808c1647854e405ef379b609f276db Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:07:45 +0000 Subject: Moving 1.x branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835126 13f79535-47bb-0310-9956-ffa450edef68 --- .../branches/sca-java-1.2.1/itest/admin/README | 28 + .../branches/sca-java-1.2.1/itest/admin/pom.xml | 60 ++ .../tuscany/sca/itest/admin/MyListService.java | 27 + .../sca/itest/admin/MyListServiceByYear.java | 26 + .../tuscany/sca/itest/admin/MyListServiceImpl.java | 87 ++ .../apache/tuscany/sca/itest/admin/MyLogger.java | 35 + .../apache/tuscany/sca/itest/admin/MyService.java | 27 + .../tuscany/sca/itest/admin/MyServiceByDate.java | 28 + .../tuscany/sca/itest/admin/MyServiceImpl.java | 125 +++ .../tuscany/sca/itest/admin/MyTotalService.java | 24 + .../sca/itest/admin/MyTotalServiceImpl.java | 92 ++ .../sca/itest/admin/SCAComponentService.java | 25 + .../admin/MySimpleServiceInRecursiveTestCase.java | 79 ++ .../sca/itest/admin/MySimpleServiceTestCase.java | 75 ++ .../sca/itest/admin/MyTotalServiceTestCase.java | 66 ++ .../test/resources/Iteration1Composite.composite | 43 + .../test/resources/Iteration3Composite.composite | 68 ++ .../src/test/resources/MySimpleService.composite | 59 ++ .../itest/bpel/helloworld-reference/pom.xml | 210 ++++ .../src/test/java/greetings/GreetingsService.java | 31 + .../test/java/greetings/GreetingsServiceImpl.java | 33 + .../src/test/java/greetings/GreetingsTestCase.java | 63 ++ .../test/java/greetings/GreetingsTestServer.java | 55 + .../test/java/helloworld/HelloWorldService.java | 29 + .../java/helloworld/HelloWorldServiceImpl.java | 47 + .../test/java/helloworld/HelloWorldTestCase.java | 63 ++ .../test/resources/greetings/greetings.composite | 33 + .../src/test/resources/greetings/greetings.wsdl | 87 ++ .../src/test/resources/helloworld/deploy.xml | 34 + .../src/test/resources/helloworld/helloworld.bpel | 84 ++ .../resources/helloworld/helloworld.componentType | 36 + .../test/resources/helloworld/helloworld.composite | 50 + .../src/test/resources/helloworld/helloworld.wsdl | 82 ++ .../src/test/resources/log4j.properties | 35 + .../sca-java-1.2.1/itest/bpel/helloworld/pom.xml | 162 +++ .../src/test/java/helloworld/HelloWorld.java | 45 + .../test/java/helloworld/HelloWorldTestCase.java | 63 ++ .../src/test/resources/helloworld/deploy.xml | 30 + .../src/test/resources/helloworld/helloworld.bpel | 66 ++ .../resources/helloworld/helloworld.componentType | 30 + .../test/resources/helloworld/helloworld.composite | 36 + .../src/test/resources/helloworld/helloworld.wsdl | 82 ++ .../helloworld/src/test/resources/log4j.properties | 33 + .../sca-java-1.2.1/itest/bpel/ping-pong/pom.xml | 195 ++++ .../test/java/pingpong/BPELPingPongTestCase.java | 60 ++ .../test/java/pingpong/BPELPingTestCase.java | 63 ++ .../test/java/pingpong/BPELPongTestCase.java | 62 ++ .../bpel/ping-pong/test/resources/log4j.properties | 33 + .../resources/ping-pong/ping-pong.componentType | 36 + .../test/resources/ping-pong/ping-pong.composite | 36 + .../bpel/ping-pong/test/resources/ping/deploy.xml | 35 + .../bpel/ping-pong/test/resources/ping/ping.bpel | 124 +++ .../test/resources/ping/ping.componentType | 36 + .../ping-pong/test/resources/ping/ping.composite | 29 + .../bpel/ping-pong/test/resources/ping/ping.wsdl | 84 ++ .../bpel/ping-pong/test/resources/ping/pong.wsdl | 84 ++ .../bpel/ping-pong/test/resources/pong/deploy.xml | 31 + .../bpel/ping-pong/test/resources/pong/pong.bpel | 84 ++ .../test/resources/pong/pong.componentType | 29 + .../ping-pong/test/resources/pong/pong.composite | 30 + .../bpel/ping-pong/test/resources/pong/pong.wsdl | 93 ++ .../branches/sca-java-1.2.1/itest/bpel/pom.xml | 35 + .../sca-java-1.2.1/itest/build-was-integration.xml | 68 ++ .../itest/callablereferences-ws/pom.xml | 59 ++ .../src/main/java/com/example/ExampleClient.java | 26 + .../main/java/com/example/ExampleClientImpl.java | 59 ++ .../src/main/java/com/example/ExampleService.java | 30 + .../main/java/com/example/ExampleServiceImpl.java | 33 + .../sca/itest/callablerefwsreturn/Alpha.java | 26 + .../sca/itest/callablerefwsreturn/AlphaImpl.java | 96 ++ .../sca/itest/callablerefwsreturn/Beta.java | 27 + .../sca/itest/callablerefwsreturn/BetaImpl.java | 46 + .../sca/itest/callablerefwsreturn/Gamma.java | 34 + .../sca/itest/callablerefwsreturn/GammaImpl.java | 49 + .../CallableReferenceWsReturnTest.composite | 54 + .../src/main/resources/example.composite | 40 + .../src/test/java/com/example/ExampleTestCase.java | 44 + .../CallableReferenceReturnTestCase.java | 49 + .../itest/callablereferences/pom.xml | 81 ++ .../tuscany/sca/itest/callableref/AComponent.java | 39 + .../sca/itest/callableref/AComponentImpl.java | 116 ++ .../tuscany/sca/itest/callableref/BComponent.java | 30 + .../sca/itest/callableref/BComponentImpl.java | 38 + .../tuscany/sca/itest/callableref/CComponent.java | 27 + .../sca/itest/callableref/CComponentImpl.java | 30 + .../tuscany/sca/itest/callableref/DComponent.java | 35 + .../sca/itest/callableref/DComponentImpl.java | 67 ++ .../tuscany/sca/itest/callablerefreturn/Alpha.java | 27 + .../sca/itest/callablerefreturn/AlphaImpl.java | 86 ++ .../tuscany/sca/itest/callablerefreturn/Beta.java | 28 + .../sca/itest/callablerefreturn/BetaImpl.java | 44 + .../tuscany/sca/itest/callablerefreturn/Gamma.java | 35 + .../sca/itest/callablerefreturn/GammaImpl.java | 47 + .../CallableReferenceReturnTest.composite | 39 + .../main/resources/CallableReferenceTest.composite | 45 + .../src/main/resources/nodeA/CompositeA.composite | 47 + .../resources/nodeA/META-INF/sca-contribution.xml | 22 + .../src/main/resources/nodeB/CompositeB.composite | 34 + .../resources/nodeB/META-INF/sca-contribution.xml | 22 + .../CallableReferenceRemoteTestCase.java | 142 +++ .../CallableReferenceReturnTestCase.java | 48 + .../callableref/CallableReferenceTestCase.java | 83 ++ .../sca-java-1.2.1/itest/callback-api/pom.xml | 50 + .../tuscany/sca/test/CallBackApiCallBack.java | 38 + .../apache/tuscany/sca/test/CallBackApiClient.java | 30 + .../tuscany/sca/test/CallBackApiClientImpl.java | 206 ++++ .../tuscany/sca/test/CallBackApiService.java | 50 + .../tuscany/sca/test/CallBackApiServiceImpl.java | 123 +++ .../src/main/resources/CallBackApiTest.composite | 33 + .../main/resources/META-INF/sca-contribution.xml | 23 + .../tuscany/sca/test/CallBackApiTestCase.java | 62 ++ .../sca-java-1.2.1/itest/callback-basic/pom.xml | 50 + .../tuscany/sca/test/CallBackBasicCallBack.java | 33 + .../tuscany/sca/test/CallBackBasicClient.java | 28 + .../tuscany/sca/test/CallBackBasicClientImpl.java | 135 +++ .../tuscany/sca/test/CallBackBasicService.java | 37 + .../tuscany/sca/test/CallBackBasicServiceImpl.java | 59 ++ .../src/main/resources/CallBackBasicTest.composite | 33 + .../main/resources/META-INF/sca-contribution.xml | 23 + .../tuscany/sca/test/CallBackBasicTestCase.java | 50 + .../itest/callback-complex-type/pom.xml | 45 + .../tuscany/sca/test/CallBackCTypeCallBack.java | 33 + .../tuscany/sca/test/CallBackCTypeClient.java | 28 + .../tuscany/sca/test/CallBackCTypeClientImpl.java | 142 +++ .../tuscany/sca/test/CallBackCTypeService.java | 36 + .../tuscany/sca/test/CallBackCTypeServiceImpl.java | 62 ++ .../main/resources/CallBackCTypeClient.composite | 33 + .../test/CallBackCTypeServiceImpl.componentType | 28 + .../sca/test/CallBackCTypeTestCaseFIXME.java | 48 + .../sca-java-1.2.1/itest/callback-id/pom.xml | 45 + .../tuscany/sca/test/CallBackIdCallBack.java | 31 + .../apache/tuscany/sca/test/CallBackIdClient.java | 28 + .../tuscany/sca/test/CallBackIdClientImpl.java | 147 +++ .../apache/tuscany/sca/test/CallBackIdService.java | 33 + .../tuscany/sca/test/CallBackIdServiceImpl.java | 48 + .../src/main/resources/CallBackIdClient.composite | 33 + .../tuscany/sca/test/CallBackIdTestCase.java | 45 + .../itest/callback-multiple-wires/pom.xml | 45 + .../apache/tuscany/sca/test/callback/MyClient.java | 27 + .../tuscany/sca/test/callback/MyClientImpl1.java | 49 + .../tuscany/sca/test/callback/MyClientImpl2.java | 49 + .../tuscany/sca/test/callback/MyService.java | 32 + .../sca/test/callback/MyServiceCallback.java | 27 + .../tuscany/sca/test/callback/MyServiceImpl.java | 45 + .../main/resources/CallbackMultiWireTest.composite | 38 + .../test/callback/CallbackMultiWireTestCase.java | 55 + .../itest/callback-separatethread/pom.xml | 45 + .../sca/itest/CallBackSeparateThreadClient.java | 34 + .../itest/CallBackSeparateThreadClientImpl.java | 172 +++ .../tuscany/sca/itest/EventProcessorCallBack.java | 38 + .../tuscany/sca/itest/EventProcessorService.java | 48 + .../sca/itest/EventProcessorServiceImpl.java | 197 ++++ .../resources/CallBackSeparateThreadTest.composite | 31 + .../sca/itest/CallBackSeparateThreadTestCase.java | 64 ++ .../itest/callback-set-callback/pom.xml | 45 + .../sca/test/CallBackSetCalbackService.java | 34 + .../sca/test/CallBackSetCallbackBadCallback.java | 38 + .../sca/test/CallBackSetCallbackCallback.java | 31 + .../sca/test/CallBackSetCallbackCallbackImpl.java | 66 ++ .../sca/test/CallBackSetCallbackClient.java | 28 + .../sca/test/CallBackSetCallbackClientImpl.java | 190 ++++ .../test/CallBackSetCallbackObjectCallback.java | 44 + .../sca/test/CallBackSetCallbackServiceImpl.java | 75 ++ .../resources/CallBackSetCallbackTest.composite | 37 + .../sca/test/CallBackSetCallbackTestCase.java | 49 + .../itest/callback-set-conversation/pom.xml | 45 + .../test/CallBackSetCallbackConvBadCallback.java | 38 + .../sca/test/CallBackSetCallbackConvCallback.java | 34 + .../sca/test/CallBackSetCallbackConvClient.java | 28 + .../test/CallBackSetCallbackConvClientImpl.java | 174 +++ .../CallBackSetCallbackConvNonSerCallback.java | 58 + .../CallBackSetCallbackConvObjectCallback.java | 54 + .../sca/test/CallBackSetCallbackConvService.java | 36 + .../test/CallBackSetCallbackConvServiceImpl.java | 98 ++ .../CallBackSetCallbackConvTest.composite | 33 + .../sca/test/CallBackSetCallbackConvTestCase.java | 48 + .../sca-java-1.2.1/itest/component-type/pom.xml | 47 + .../src/main/java/calculator/AddService.java | 28 + .../src/main/java/calculator/AddServiceImpl.java | 30 + .../src/main/java/calculator/CalculatorClient.java | 45 + .../main/java/calculator/CalculatorService.java | 35 + .../java/calculator/CalculatorServiceImpl.java | 67 ++ .../src/main/java/calculator/DivideService.java | 28 + .../main/java/calculator/DivideServiceImpl.java | 30 + .../src/main/java/calculator/MultiplyService.java | 28 + .../main/java/calculator/MultiplyServiceImpl.java | 30 + .../src/main/java/calculator/SubtractService.java | 28 + .../main/java/calculator/SubtractServiceImpl.java | 30 + .../src/main/resources/Calculator.composite | 49 + .../calculator/AddServiceImpl.componentType | 27 + .../calculator/CalculatorServiceImpl.componentType | 43 + .../calculator/DivideServiceImpl.componentType | 27 + .../calculator/MultiplyServiceImpl.componentType | 27 + .../calculator/SubtractServiceImpl.componentType | 27 + .../test/java/calculator/CalculatorTestCase.java | 52 + .../contribution-classes/build-jar.xml | 39 + .../contribution-classes/pom.xml | 203 ++++ .../main/java/supplychain/customer/Customer.java | 35 + .../customer/JavaCustomerComponentImpl.java | 63 ++ .../illegal/JavaCustomerComponentImpl.java | 74 ++ .../retailer/JavaRetailerComponentImpl.java | 61 ++ .../main/java/supplychain/retailer/Retailer.java | 28 + .../shipper/JavaShipperComponentImpl.java | 52 + .../src/main/java/supplychain/shipper/Shipper.java | 28 + .../warehouse/JavaWarehouseComponentImpl.java | 47 + .../main/java/supplychain/warehouse/Warehouse.java | 28 + .../complete-supplychain-sca-contribution.xml | 26 + .../META-INF/customer-impl-sca-contribution.xml | 26 + .../customer-interface-sca-contribution.xml | 26 + .../META-INF/customer-sca-contribution.xml | 25 + .../META-INF/illegal-customer-sca-contribution.xml | 26 + .../illegal1-supplychain-sca-contribution.xml | 24 + .../illegal2-supplychain-sca-contribution.xml | 31 + .../META-INF/retailer-sca-contribution.xml | 25 + .../META-INF/shipper-sca-contribution.xml | 25 + .../META-INF/supplychain-sca-contribution.xml | 30 + .../META-INF/warehouse-sca-contribution.xml | 25 + .../supplychain/illegalsupplychain.composite | 48 + .../resources/supplychain/supplychain.composite | 48 + .../JavaWarehouseComponentImpl.componentType | 28 + .../contribution-test/pom.xml | 53 + .../test/contribution/ContributionTestCase.java | 371 +++++++ .../tuscany/sca/test/contribution/SupplyChain.java | 231 ++++ .../TuscanyClassloadingTestCaseFIXME.java | 381 +++++++ .../itest/contribution-classloader/pom.xml | 51 + .../export-composite/pom.xml | 67 ++ .../src/main/java/hello/Hello.java | 30 + .../src/main/java/hello/HelloImpl.java | 33 + .../main/resources/META-INF/sca-contribution.xml | 25 + .../src/main/resources/hello.composite | 31 + .../sca/test/contribution/HelloTestCase.java | 91 ++ .../contribution-import-export/export-java/pom.xml | 67 ++ .../main/java/helloworld/HelloWorldService.java | 30 + .../main/resources/META-INF/sca-contribution.xml | 24 + .../helloworld/HelloWorldImpl.componentType | 30 + .../export-resource/pom.xml | 31 + .../main/resources/META-INF/sca-contribution.xml | 24 + .../src/main/resources/ufservices/store.html | 27 + .../contribution-import-export/export-wsdl/pom.xml | 31 + .../main/resources/META-INF/sca-contribution.xml | 24 + .../export-wsdl/src/main/resources/helloworld.wsdl | 76 ++ .../export-wsdl/src/main/resources/helloworld.xsd | 35 + .../import-composite/pom.xml | 73 ++ .../src/main/java/helloworld/HelloWorldImpl.java | 38 + .../src/main/java/helloworld/HelloWorldServer.java | 46 + .../main/java/helloworld/HelloWorldService.java | 30 + .../main/resources/META-INF/sca-contribution.xml | 27 + .../src/main/resources/helloworld.wsdl | 76 ++ .../src/main/resources/helloworld.xsd | 35 + .../src/main/resources/helloworldws.composite | 39 + .../contribution/HelloWorldServerTestCase.java | 126 +++ .../contribution-import-export/import-java/pom.xml | 73 ++ .../src/main/java/helloworld/HelloWorldImpl.java | 33 + .../main/resources/META-INF/sca-contribution.xml | 25 + .../src/main/resources/helloworldws.composite | 29 + .../contribution/HelloWorldServerTestCase.java | 127 +++ .../import-resource/pom.xml | 95 ++ .../main/resources/META-INF/sca-contribution.xml | 25 + .../src/main/resources/store.composite | 33 + .../sca/test/contribution/StoreTestCase.java | 129 +++ .../contribution-import-export/import-wsdl/pom.xml | 73 ++ .../src/main/java/helloworld/HelloWorldImpl.java | 33 + .../src/main/java/helloworld/HelloWorldServer.java | 46 + .../main/java/helloworld/HelloWorldService.java | 30 + .../main/resources/META-INF/sca-contribution.xml | 25 + .../src/main/resources/helloworldws.composite | 33 + .../contribution/HelloWorldServerTestCase.java | 137 +++ .../itest/contribution-import-export/pom.xml | 56 + .../itest/contribution-multiple/pom.xml | 51 + .../src/test/java/hello/Hello.java | 29 + .../src/test/java/hello/HelloImpl.java | 33 + .../src/test/java/helloworld/HelloWorldImpl.java | 38 + .../test/java/helloworld/HelloWorldService.java | 29 + .../java/test/ContributionCycleTestCaseFIXME.java | 121 +++ .../src/test/java/test/ContributionTestCase.java | 116 ++ .../META-INF/sca-contribution.xml | 26 + .../contribution-cycle-export/hello.composite | 31 + .../META-INF/sca-contribution.xml | 26 + .../helloworld_one.composite | 35 + .../META-INF/sca-contribution.xml | 25 + .../resources/contribution-export/hello.composite | 31 + .../META-INF/sca-contribution.xml | 26 + .../helloworld_one.composite | 35 + .../sca-java-1.2.1/itest/contribution/pom.xml | 45 + .../src/main/java/calculator/AddService.java | 32 + .../src/main/java/calculator/AddServiceImpl.java | 30 + .../src/main/java/calculator/CalculatorClient.java | 46 + .../main/java/calculator/CalculatorService.java | 35 + .../java/calculator/CalculatorServiceImpl.java | 70 ++ .../src/main/java/calculator/DivideService.java | 32 + .../main/java/calculator/DivideServiceImpl.java | 30 + .../src/main/java/calculator/MultiplyService.java | 33 + .../main/java/calculator/MultiplyServiceImpl.java | 30 + .../src/main/java/calculator/SubtractService.java | 33 + .../main/java/calculator/SubtractServiceImpl.java | 30 + .../src/main/resources/ContributionTest.composite | 24 + .../main/resources/calculator/Calculator.composite | 51 + .../main/resources/calculator/sca-contribution.xml | 24 + .../contribution/ContributionServiceTestCase.java | 201 ++++ .../resources/deployables/sample-calculator.jar | Bin 0 -> 26901 bytes .../resources/repository/sample-calculator.jar | Bin 0 -> 26901 bytes .../sca-java-1.2.1/itest/conversations-ws/pom.xml | 64 ++ .../itest/conversational/BusinessException.java | 41 + .../conversational/ConversationIdService.java | 29 + .../conversational/ConversationalCallback.java | 50 + .../itest/conversational/ConversationalClient.java | 51 + .../ConversationalReferenceClient.java | 36 + .../conversational/ConversationalService.java | 58 + ...ersationalServiceNonConversationalCallback.java | 59 ++ .../conversational/NonConversationalCallback.java | 44 + .../impl/ConversationAgeComponentImpl.java | 76 ++ .../impl/ConversationIdComponentImpl.java | 48 + .../impl/ConversationMaxIdleComponentImpl.java | 76 ++ .../impl/ConversationalClientStatefulImpl.java | 322 ++++++ ...lientStatefulNonConversationalCallbackImpl.java | 311 ++++++ .../impl/ConversationalClientStatelessImpl.java | 318 ++++++ .../impl/ConversationalReferenceClientImpl.java | 43 + .../impl/ConversationalServiceRequestImpl.java | 124 +++ .../impl/ConversationalServiceStatefulImpl.java | 119 +++ ...rviceStatefulNonConversationalCallbackImpl.java | 118 +++ .../impl/ConversationalServiceStatelessImpl.java | 123 +++ .../ConversationalServiceStatelessScopeImpl.java | 94 ++ .../Conversational/META-INF/sca-contribution.xml | 22 + .../Conversational/conversational.composite | 169 +++ .../ConversationalServiceStateful.wsdl | 383 +++++++ .../META-INF/sca-contribution.xml | 22 + .../conversationalWSDL.composite | 48 + .../conversational/ConversationWSDLTestCase.java | 75 ++ .../conversational/ConversationalTestCaseOff.java | 610 +++++++++++ .../NonConversationalCallbackTestCase.java | 202 ++++ .../itest/conversational/RequestScopeTestCase.java | 211 ++++ .../conversational/StatefulStatefulTestCase.java | 197 ++++ .../conversational/StatefulStatelessTestCase.java | 196 ++++ .../conversational/StatelessStatefulTestCase.java | 209 ++++ .../conversational/StatelessStatelessTestCase.java | 196 ++++ .../sca-java-1.2.1/itest/conversations/pom.xml | 45 + .../tuscany/sca/itest/conversational/AService.java | 56 + .../tuscany/sca/itest/conversational/BService.java | 42 + .../tuscany/sca/itest/conversational/CService.java | 42 + .../sca/itest/conversational/Constants.java | 25 + .../conversational/ConversationIdService.java | 29 + .../conversational/ConversationalCallback.java | 50 + .../itest/conversational/ConversationalClient.java | 51 + .../ConversationalReferenceClient.java | 36 + .../conversational/ConversationalService.java | 62 ++ ...ersationalServiceNonConversationalCallback.java | 62 ++ .../tuscany/sca/itest/conversational/DService.java | 46 + .../conversational/NonConversationalCallback.java | 48 + .../itest/conversational/impl/AServiceImpl.java | 111 ++ .../itest/conversational/impl/BServiceImpl.java | 73 ++ .../itest/conversational/impl/CServiceImpl.java | 85 ++ .../impl/ConversationAgeComponentImpl.java | 75 ++ .../impl/ConversationIdComponentImpl.java | 48 + .../impl/ConversationMaxIdleComponentImpl.java | 75 ++ .../impl/ConversationalClientStatefulImpl.java | 321 ++++++ ...lientStatefulNonConversationalCallbackImpl.java | 310 ++++++ .../impl/ConversationalClientStatelessImpl.java | 317 ++++++ .../impl/ConversationalReferenceClientImpl.java | 43 + .../impl/ConversationalServiceRequestImpl.java | 123 +++ .../impl/ConversationalServiceStatefulImpl.java | 117 +++ ...rviceStatefulNonConversationalCallbackImpl.java | 117 +++ .../impl/ConversationalServiceStatelessImpl.java | 123 +++ .../ConversationalServiceStatelessScopeImpl.java | 93 ++ .../itest/conversational/impl/DServiceImpl.java | 71 ++ .../src/main/resources/ConversationAge.composite | 31 + .../src/main/resources/conversationId.composite | 27 + .../main/resources/conversationLifetime.composite | 33 + .../src/main/resources/conversational.composite | 99 ++ .../conversational/ConversationIdTestCase.java | 54 + .../ConversationLifetimeTestCase.java | 204 ++++ .../conversational/ConversationalAgeTestCase.java | 103 ++ .../conversational/ConversationalJ2SETestCase.java | 84 ++ .../conversational/ConversationalTestCase.java | 651 ++++++++++++ .../itest/databindings/common/pom.xml | 126 +++ .../tuscany/sca/itest/generate/Generate.java | 181 ++++ .../resources/generate/DatabindingTestCase.java.vm | 112 ++ .../src/main/resources/generate/Greeter.wsdl.vm | 103 ++ .../main/resources/generate/GreeterService.java.vm | 53 + .../generate/GreeterServiceClient.java.vm | 42 + .../generate/GreeterServiceClientImpl.java.vm | 65 ++ .../resources/generate/GreeterServiceImpl.java.vm | 55 + .../src/main/resources/generate/generate.xsd | 61 ++ .../common/src/main/resources/wsdl/Dummy.txt | 4 + .../common/src/main/resources/xsd/Annotation.xml | 24 + .../common/src/main/resources/xsd/Annotation.xsd | 38 + .../common/src/main/resources/xsd/Attribute.xml | 24 + .../common/src/main/resources/xsd/Attribute.xsd | 39 + .../src/main/resources/xsd/AttributeReference.xml | 24 + .../src/main/resources/xsd/AttributeReference.xsd | 40 + .../resources/xsd/AttributeWithDefaultValue.xml | 24 + .../resources/xsd/AttributeWithDefaultValue.xsd | 38 + .../main/resources/xsd/AttributeWithFixedValue.xml | 24 + .../main/resources/xsd/AttributeWithFixedValue.xsd | 38 + .../resources/xsd/AttributeWithSDOAliasName.xml | 24 + .../resources/xsd/AttributeWithSDOAliasName.xsd | 38 + .../resources/xsd/AttributeWithSDODataType.xml | 24 + .../resources/xsd/AttributeWithSDODataType.xsd | 38 + .../main/resources/xsd/AttributeWithSDOName.xml | 24 + .../main/resources/xsd/AttributeWithSDOName.xsd | 38 + ...ibuteWithSDOPropertySDOOppositePropertyType.xml | 24 + ...ibuteWithSDOPropertySDOOppositePropertyType.xsd | 38 + .../resources/xsd/AttributeWithSDOPropertyType.xml | 24 + .../resources/xsd/AttributeWithSDOPropertyType.xsd | 38 + .../main/resources/xsd/AttributeWithSDOString.xml | 24 + .../main/resources/xsd/AttributeWithSDOString.xsd | 38 + .../main/resources/xsd/BuiltInAnySimpleType.xml | 24 + .../main/resources/xsd/BuiltInAnySimpleType.xsd | 31 + .../src/main/resources/xsd/BuiltInAnyType.xml | 24 + .../src/main/resources/xsd/BuiltInAnyType.xsd | 31 + .../src/main/resources/xsd/BuiltInAnyURI.xml | 24 + .../src/main/resources/xsd/BuiltInAnyURI.xsd | 31 + .../src/main/resources/xsd/BuiltInBase64Binary.xml | 24 + .../src/main/resources/xsd/BuiltInBase64Binary.xsd | 31 + .../src/main/resources/xsd/BuiltInBoolean.xml | 27 + .../src/main/resources/xsd/BuiltInBoolean.xsd | 31 + .../common/src/main/resources/xsd/BuiltInByte.xml | 25 + .../common/src/main/resources/xsd/BuiltInByte.xsd | 31 + .../common/src/main/resources/xsd/BuiltInDate.xml | 24 + .../common/src/main/resources/xsd/BuiltInDate.xsd | 31 + .../src/main/resources/xsd/BuiltInDateTime.xml | 24 + .../src/main/resources/xsd/BuiltInDateTime.xsd | 31 + .../src/main/resources/xsd/BuiltInDecimal.xml | 23 + .../src/main/resources/xsd/BuiltInDecimal.xsd | 31 + .../src/main/resources/xsd/BuiltInDouble.xml | 25 + .../src/main/resources/xsd/BuiltInDouble.xsd | 31 + .../src/main/resources/xsd/BuiltInDuration.xml | 24 + .../src/main/resources/xsd/BuiltInDuration.xsd | 31 + .../common/src/main/resources/xsd/BuiltInFloat.xml | 24 + .../common/src/main/resources/xsd/BuiltInFloat.xsd | 31 + .../common/src/main/resources/xsd/BuiltInGDay.xml | 24 + .../common/src/main/resources/xsd/BuiltInGDay.xsd | 31 + .../src/main/resources/xsd/BuiltInGMonth.xml | 24 + .../src/main/resources/xsd/BuiltInGMonth.xsd | 31 + .../src/main/resources/xsd/BuiltInGMonthDay.xml | 24 + .../src/main/resources/xsd/BuiltInGMonthDay.xsd | 31 + .../common/src/main/resources/xsd/BuiltInGYear.xml | 24 + .../common/src/main/resources/xsd/BuiltInGYear.xsd | 31 + .../src/main/resources/xsd/BuiltInGYearMonth.xml | 24 + .../src/main/resources/xsd/BuiltInGYearMonth.xsd | 31 + .../src/main/resources/xsd/BuiltInHexBinary.xml | 24 + .../src/main/resources/xsd/BuiltInHexBinary.xsd | 31 + .../common/src/main/resources/xsd/BuiltInID.xml | 24 + .../common/src/main/resources/xsd/BuiltInID.xsd | 31 + .../common/src/main/resources/xsd/BuiltInIDREF.xml | 24 + .../common/src/main/resources/xsd/BuiltInIDREF.xsd | 31 + .../src/main/resources/xsd/BuiltInIDREFS.xml | 24 + .../src/main/resources/xsd/BuiltInIDREFS.xsd | 31 + .../common/src/main/resources/xsd/BuiltInInt.xml | 25 + .../common/src/main/resources/xsd/BuiltInInt.xsd | 31 + .../src/main/resources/xsd/BuiltInInteger.xml | 25 + .../src/main/resources/xsd/BuiltInInteger.xsd | 31 + .../src/main/resources/xsd/BuiltInLanguage.xml | 24 + .../src/main/resources/xsd/BuiltInLanguage.xsd | 31 + .../common/src/main/resources/xsd/BuiltInLong.xml | 25 + .../common/src/main/resources/xsd/BuiltInLong.xsd | 33 + .../src/main/resources/xsd/BuiltInNCName.xml | 24 + .../src/main/resources/xsd/BuiltInNCName.xsd | 31 + .../src/main/resources/xsd/BuiltInNMTOKEN.xml | 24 + .../src/main/resources/xsd/BuiltInNMTOKEN.xsd | 31 + .../src/main/resources/xsd/BuiltInNMTOKENS.xml | 24 + .../src/main/resources/xsd/BuiltInNMTOKENS.xsd | 31 + .../src/main/resources/xsd/BuiltInNOTATION.xml | 24 + .../src/main/resources/xsd/BuiltInNOTATION.xsd | 39 + .../common/src/main/resources/xsd/BuiltInName.xml | 24 + .../common/src/main/resources/xsd/BuiltInName.xsd | 31 + .../main/resources/xsd/BuiltInNegativeInteger.xml | 24 + .../main/resources/xsd/BuiltInNegativeInteger.xsd | 31 + .../resources/xsd/BuiltInNonNegativeInteger.xml | 24 + .../resources/xsd/BuiltInNonNegativeInteger.xsd | 31 + .../resources/xsd/BuiltInNonPositiveInteger.xml | 24 + .../resources/xsd/BuiltInNonPositiveInteger.xsd | 31 + .../main/resources/xsd/BuiltInNormalizedString.xml | 24 + .../main/resources/xsd/BuiltInNormalizedString.xsd | 31 + .../main/resources/xsd/BuiltInPositiveInteger.xml | 24 + .../main/resources/xsd/BuiltInPositiveInteger.xsd | 31 + .../common/src/main/resources/xsd/BuiltInQName.xml | 24 + .../common/src/main/resources/xsd/BuiltInQName.xsd | 31 + .../common/src/main/resources/xsd/BuiltInShort.xml | 25 + .../common/src/main/resources/xsd/BuiltInShort.xsd | 31 + .../src/main/resources/xsd/BuiltInString.xml | 24 + .../src/main/resources/xsd/BuiltInString.xsd | 31 + .../common/src/main/resources/xsd/BuiltInTime.xml | 24 + .../common/src/main/resources/xsd/BuiltInTime.xsd | 31 + .../common/src/main/resources/xsd/BuiltInToken.xml | 24 + .../common/src/main/resources/xsd/BuiltInToken.xsd | 31 + .../src/main/resources/xsd/BuiltInUnsignedByte.xml | 25 + .../src/main/resources/xsd/BuiltInUnsignedByte.xsd | 31 + .../src/main/resources/xsd/BuiltInUnsignedInt.xml | 25 + .../src/main/resources/xsd/BuiltInUnsignedInt.xsd | 31 + .../src/main/resources/xsd/BuiltInUnsignedLong.xml | 25 + .../src/main/resources/xsd/BuiltInUnsignedLong.xsd | 31 + .../main/resources/xsd/BuiltInUnsignedShort.xml | 25 + .../main/resources/xsd/BuiltInUnsignedShort.xsd | 31 + ...lexTypeComplexContentRestrictingComplexType.xml | 26 + ...lexTypeComplexContentRestrictingComplexType.xsd | 44 + .../xsd/ComplexTypeExtendingComplexType.xml | 27 + .../xsd/ComplexTypeExtendingComplexType.xsd | 43 + .../xsd/ComplexTypeExtendingSimpleType.xml | 24 + .../xsd/ComplexTypeExtendingSimpleType.xsd | 41 + ...plexTypeSimpleContentRestrictingComplexType.xml | 24 + ...plexTypeSimpleContentRestrictingComplexType.xsd | 41 + .../main/resources/xsd/ComplexTypeWithAbstract.xml | 27 + .../main/resources/xsd/ComplexTypeWithAbstract.xsd | 47 + .../main/resources/xsd/ComplexTypeWithCDATA.xml | 30 + .../main/resources/xsd/ComplexTypeWithCDATA.xsd | 39 + .../main/resources/xsd/ComplexTypeWithContent.xml | 26 + .../main/resources/xsd/ComplexTypeWithContent.xsd | 37 + .../main/resources/xsd/ComplexTypeWithMixed.xml | 29 + .../main/resources/xsd/ComplexTypeWithMixed.xsd | 39 + .../xsd/ComplexTypeWithOpenAttributes.xml | 24 + .../xsd/ComplexTypeWithOpenAttributes.xsd | 42 + .../resources/xsd/ComplexTypeWithOpenContent.xml | 31 + .../resources/xsd/ComplexTypeWithOpenContent.xsd | 39 + .../xsd/ComplexTypeWithOppositeProperty.xml | 30 + .../xsd/ComplexTypeWithOppositeProperty.xsd | 59 ++ .../resources/xsd/ComplexTypeWithSDOAliasName.xml | 26 + .../resources/xsd/ComplexTypeWithSDOAliasName.xsd | 38 + .../main/resources/xsd/ComplexTypeWithSDOName.xml | 26 + .../main/resources/xsd/ComplexTypeWithSDOName.xsd | 38 + .../resources/xsd/ComplexTypeWithSDOSequence.xml | 26 + .../resources/xsd/ComplexTypeWithSDOSequence.xsd | 40 + .../resources/xsd/ComplexTypeWithoutContent.xml | 24 + .../resources/xsd/ComplexTypeWithoutContent.xsd | 33 + .../main/resources/xsd/ComplexTypeWithoutName.xml | 26 + .../main/resources/xsd/ComplexTypeWithoutName.xsd | 39 + .../src/main/resources/xsd/DefaultNamespace.xml | 23 + .../src/main/resources/xsd/DefaultNamespace.xsd | 32 + .../common/src/main/resources/xsd/ElementInAll.xml | 27 + .../common/src/main/resources/xsd/ElementInAll.xsd | 40 + .../src/main/resources/xsd/ElementInChoice.xml | 25 + .../src/main/resources/xsd/ElementInChoice.xsd | 48 + .../xsd/ElementOfSDOChangeSummaryType.xml | 29 + .../xsd/ElementOfSDOChangeSummaryType.xsd | 34 + .../xsd/ElementOfSimpleTypeWithDefault.xml | 24 + .../xsd/ElementOfSimpleTypeWithDefault.xsd | 31 + .../resources/xsd/ElementOfSimpleTypeWithFixed.xml | 24 + .../resources/xsd/ElementOfSimpleTypeWithFixed.xsd | 31 + .../xsd/ElementOfSimpleTypeWithSDODataType.xml | 24 + .../xsd/ElementOfSimpleTypeWithSDODataType.xsd | 33 + ...mentOfSimpleTypeWithSDOOppositePropertyType.xml | 24 + ...mentOfSimpleTypeWithSDOOppositePropertyType.xsd | 33 + .../xsd/ElementOfSimpleTypeWithSDOPropertyType.xml | 24 + .../xsd/ElementOfSimpleTypeWithSDOPropertyType.xsd | 32 + .../xsd/ElementOfSimpleTypeWithSDOString.xml | 24 + .../xsd/ElementOfSimpleTypeWithSDOString.xsd | 32 + .../resources/xsd/ElementSubstitutionGroupBase.xml | 40 + .../resources/xsd/ElementSubstitutionGroupBase.xsd | 52 + .../main/resources/xsd/ElementWithMaxOccurs.xml | 25 + .../main/resources/xsd/ElementWithMaxOccurs.xsd | 31 + .../src/main/resources/xsd/ElementWithNillable.xml | 24 + .../src/main/resources/xsd/ElementWithNillable.xsd | 31 + .../main/resources/xsd/ElementWithSDOAliasName.xml | 24 + .../main/resources/xsd/ElementWithSDOAliasName.xsd | 32 + .../src/main/resources/xsd/ElementWithSDOName.xml | 24 + .../src/main/resources/xsd/ElementWithSDOName.xsd | 32 + .../resources/xsd/GlobalElementComplexType.xml | 24 + .../resources/xsd/GlobalElementComplexType.xsd | 31 + .../main/resources/xsd/GlobalElementSimpleType.xml | 24 + .../main/resources/xsd/GlobalElementSimpleType.xsd | 26 + .../common/src/main/resources/xsd/Import.xml | 30 + .../common/src/main/resources/xsd/Import.xsd | 40 + .../src/main/resources/xsd/ImportedSchema.xsd | 33 + .../common/src/main/resources/xsd/Include.xml | 24 + .../common/src/main/resources/xsd/Include.xsd | 36 + .../common/src/main/resources/xsd/Interop.xsd | 138 +++ .../common/src/main/resources/xsd/Notation.xml | 24 + .../common/src/main/resources/xsd/Notation.xsd | 35 + .../common/src/main/resources/xsd/Person.xsd | 30 + .../src/main/resources/xsd/SDOJavaPackage.xml | 25 + .../src/main/resources/xsd/SDOJavaPackage.xsd | 39 + .../main/resources/xsd/SimpleTypeWithAbstract.xml | 24 + .../main/resources/xsd/SimpleTypeWithAbstract.xsd | 40 + .../xsd/SimpleTypeWithExtendedInstanceClass.xml | 24 + .../xsd/SimpleTypeWithExtendedInstanceClass.xsd | 36 + .../resources/xsd/SimpleTypeWithInstanceClass.xml | 24 + .../resources/xsd/SimpleTypeWithInstanceClass.xsd | 37 + .../src/main/resources/xsd/SimpleTypeWithList.xml | 24 + .../src/main/resources/xsd/SimpleTypeWithList.xsd | 37 + .../src/main/resources/xsd/SimpleTypeWithName.xml | 24 + .../src/main/resources/xsd/SimpleTypeWithName.xsd | 36 + .../main/resources/xsd/SimpleTypeWithSDOName.xml | 24 + .../main/resources/xsd/SimpleTypeWithSDOName.xsd | 37 + .../src/main/resources/xsd/SimpleTypeWithUnion.xml | 25 + .../src/main/resources/xsd/SimpleTypeWithUnion.xsd | 46 + .../main/resources/xsd/SimpleTypeWithoutName.xml | 26 + .../main/resources/xsd/SimpleTypeWithoutName.xsd | 38 + .../src/main/resources/xsd/TargetNamespace.xml | 24 + .../src/main/resources/xsd/TargetNamespace.xsd | 34 + .../common/src/main/resources/xsd/datagraph.xsd | 88 ++ .../common/src/main/resources/xsd/sdoJava.xsd | 88 ++ .../common/src/main/resources/xsd/sdoModel.xsd | 221 ++++ .../sca/itest/generate/GenerateTestCase.java | 49 + .../sca-java-1.2.1/itest/databindings/config.png | Bin 0 -> 31222 bytes .../sca-java-1.2.1/itest/databindings/config.svg | 117 +++ .../itest/databindings/databinding.png | Bin 0 -> 14106 bytes .../itest/databindings/databinding.svg | 242 +++++ .../sca-java-1.2.1/itest/databindings/interop.png | Bin 0 -> 23179 bytes .../sca-java-1.2.1/itest/databindings/interop.svg | 352 +++++++ .../itest/databindings/interop/pom.xml | 230 ++++ .../generate/InteropDatabindingTestCase.java.vm | 113 ++ .../main/resources/generate/JAXBGreeter.wsdl.vm | 103 ++ .../src/main/resources/generate/SDOGreeter.wsdl.vm | 103 ++ .../src/main/resources/generate/generate.xml | 159 +++ .../resources/generate/interopgreeter.composite.vm | 78 ++ .../itest/databindings/jaxbgen/pom.xml | 256 +++++ .../src/main/resources/generate/generate.xml | 172 +++ .../jaxbgen/src/main/resources/greeter.composite | 49 + .../sca-java-1.2.1/itest/databindings/pom.xml | 45 + .../sca-java-1.2.1/itest/databindings/readme.html | 157 +++ .../itest/databindings/sdogen/pom.xml | 238 +++++ .../src/main/resources/generate/generate.xml | 170 +++ .../main/resources/generate/greeter.composite.vm | 56 + .../branches/sca-java-1.2.1/itest/domain/pom.xml | 81 ++ .../src/main/java/calculator/AddService.java | 31 + .../src/main/java/calculator/AddServiceImpl.java | 31 + .../main/java/calculator/AddServiceUpdateImpl.java | 31 + .../main/java/calculator/CalculatorService.java | 38 + .../java/calculator/CalculatorServiceImpl.java | 74 ++ .../src/main/java/calculator/DivideService.java | 28 + .../main/java/calculator/DivideServiceImpl.java | 30 + .../src/main/java/calculator/MultiplyService.java | 28 + .../main/java/calculator/MultiplyServiceImpl.java | 30 + .../src/main/java/calculator/SubtractService.java | 31 + .../main/java/calculator/SubtractServiceImpl.java | 31 + .../resources/contributionA/Calculator.composite | 44 + .../contributionA/META-INF/sca-contribution.xml | 24 + .../META-INF/sca-deployables/Calculator.composite | 45 + .../META-INF/sca-deployables/Calculator.composite | 45 + .../META-INF/sca-deployables/Calculator.composite | 32 + .../META-INF/sca-deployables/Calculator.composite | 49 + .../contributionDependent/Calculator.composite | 33 + .../META-INF/sca-contribution.xml | 24 + .../contributionPrimary/Calculator.composite | 47 + .../META-INF/sca-contribution.xml | 25 + .../sca/itest/domain/DomainAPITestCase.java | 233 ++++ .../itest/exceptions-cross-binding-ws/pom.xml | 243 +++++ .../test/exceptions/impl/StockExchangeJaxB.java | 71 ++ .../sca/test/exceptions/impl/StockTraderSDO.java | 39 + .../test/exceptions/impl/StockTraderSDOImpl.java | 136 +++ .../sdohandgen/InvalidSymbolSDOException.java | 84 ++ .../sdohandgen/MarketClosedSDOException.java | 76 ++ .../exceptions/sdohandgen/StockExceptionTest.java | 45 + .../src/main/resources/ExceptionTest.composite | 23 + .../src/main/resources/intracomposite.composite | 42 + .../main/resources/wsdl/StockExceptionTest.wsdl | 148 +++ .../src/main/resources/xsd/StockExceptionTest.xsd | 65 ++ .../test/exceptions/IntraCompositeTestCase.java | 102 ++ .../itest/exceptions-cross-binding/pom.xml | 234 +++++ .../exceptions/impl/StockExceptionTestJAXB.java | 31 + .../test/exceptions/impl/StockExchangeJaxB.java | 76 ++ .../sca/test/exceptions/impl/StockTraderSDO.java | 37 + .../test/exceptions/impl/StockTraderSDOImpl.java | 119 +++ .../sdohandgen/InvalidSymbolSDOException.java | 84 ++ .../sdohandgen/MarketClosedSDOException.java | 75 ++ .../exceptions/sdohandgen/StockExceptionTest.java | 45 + .../src/main/resources/ExceptionTest.composite | 25 + .../src/main/resources/intracomposite.composite | 35 + .../resources/wsdl.sdo/StockExceptionTest.wsdl | 141 +++ .../main/resources/wsdl/StockExceptionTest.wsdl | 148 +++ .../src/main/resources/xsd/StockExceptionTest.xsd | 65 ++ .../test/exceptions/IntraCompositeTestCase.java | 93 ++ .../itest/exceptions-simple-ws/pom.xml | 59 ++ .../main/java/com/example/BusinessException.java | 43 + .../src/main/java/com/example/ExampleClient.java | 23 + .../main/java/com/example/ExampleClientImpl.java | 44 + .../src/main/java/com/example/ExampleService.java | 27 + .../main/java/com/example/ExampleServiceImpl.java | 26 + .../src/main/resources/example.composite | 40 + .../src/main/resources/wsdl/ExampleService.wsdl | 129 +++ .../src/test/java/com/example/ExampleTestCase.java | 44 + .../sca-java-1.2.1/itest/exceptions/pom.xml | 45 + .../tuscany/sca/test/exceptions/Checked.java | 58 + .../sca/test/exceptions/ExceptionHandler.java | 32 + .../test/exceptions/ExceptionRemoteThrower.java | 30 + .../sca/test/exceptions/ExceptionThrower.java | 38 + .../tuscany/sca/test/exceptions/UnChecked.java | 57 + .../test/exceptions/impl/ExceptionHandlerImpl.java | 115 ++ .../impl/ExceptionRemoteThrowerImpl.java | 44 + .../test/exceptions/impl/ExceptionThrowerImpl.java | 45 + .../impl/RemoteExceptionHandlerImpl.java | 116 ++ .../src/main/resources/ExceptionTest.composite | 41 + .../sca/test/exceptions/ExceptionsTestCase.java | 71 ++ .../sca-java-1.2.1/itest/extended-api/pom.xml | 51 + .../tuscany/sca/test/extended/BasicService.java | 26 + .../tuscany/sca/test/extended/MathService.java | 25 + .../sca/test/extended/impl/BasicServiceImpl.java | 45 + .../sca/test/extended/impl/MathServiceImpl.java | 31 + .../src/main/resources/BasicService.composite | 29 + .../src/main/resources/MathService.composite | 29 + .../sca/test/extended/ServiceLocateTestCase.java | 73 ++ .../sca-java-1.2.1/itest/interfaces/pom.xml | 46 + .../itest/interfaces/LocalCallbackInterface.java | 31 + .../sca/itest/interfaces/LocalClientComponent.java | 47 + .../itest/interfaces/LocalClientComponentImpl.java | 83 ++ .../itest/interfaces/LocalServiceComponent.java | 39 + .../interfaces/LocalServiceComponentImpl.java | 49 + .../sca/itest/interfaces/ParameterObject.java | 47 + .../itest/interfaces/RemoteCallbackInterface.java | 33 + .../itest/interfaces/RemoteClientComponent.java | 63 ++ .../interfaces/RemoteClientComponentImpl.java | 81 ++ .../itest/interfaces/RemoteServiceComponent.java | 38 + .../interfaces/RemoteServiceComponentImpl.java | 54 + .../src/main/resources/InterfacesTest.composite | 40 + .../sca/itest/interfaces/InterfacesTestCase.java | 126 +++ .../branches/sca-java-1.2.1/itest/jms/pom.xml | 85 ++ .../tuscany/sca/binding/jms/CheckedExcpetion.java | 28 + .../tuscany/sca/binding/jms/ExceptionService.java | 30 + .../sca/binding/jms/ExceptionServiceClient.java | 45 + .../sca/binding/jms/ExceptionServiceImpl.java | 32 + .../sca/binding/jms/HelloWorldClientImpl.java | 41 + .../tuscany/sca/binding/jms/HelloWorldService.java | 26 + .../sca/binding/jms/HelloWorldServiceImpl.java | 30 + .../tuscany/sca/binding/jms/OneWayClientImpl.java | 41 + .../tuscany/sca/binding/jms/OneWayService.java | 29 + .../tuscany/sca/binding/jms/OneWayServiceImpl.java | 34 + .../sca/binding/jms/TestMessageProcessor.java | 57 + .../src/main/resources/defaults/client.composite | 33 + .../src/main/resources/defaults/service.composite | 30 + .../src/main/resources/dynamic/client.composite | 36 + .../src/main/resources/exceptions/client.composite | 33 + .../main/resources/exceptions/service.composite | 30 + .../src/main/resources/external/client.composite | 38 + .../src/main/resources/external/service.composite | 35 + .../itest/jms/src/main/resources/jndi.properties | 39 + .../main/resources/oneway/OneWayClient.composite | 35 + .../main/resources/oneway/OneWayService.composite | 32 + .../jms/src/main/resources/simple/client.composite | 38 + .../src/main/resources/simple/mpclient.composite | 38 + .../src/main/resources/simple/service.composite | 35 + .../src/main/resources/simple/uriclient.composite | 33 + .../tuscany/sca/binding/jms/DefaultsTestCase.java | 54 + .../sca/binding/jms/DynamicReplyQTestCase.java | 53 + .../sca/binding/jms/ExceptionsTestCase.java | 70 ++ .../sca/binding/jms/ExternalBrokerTestCase.java | 70 ++ .../sca/binding/jms/MessageProcessorTestCase.java | 58 + .../tuscany/sca/binding/jms/OneWayTestCase.java | 58 + .../tuscany/sca/binding/jms/RPCTestCase.java | 54 + .../tuscany/sca/binding/jms/URIRPCTestCase.java | 54 + .../sca-java-1.2.1/itest/large-sdo-ws/pom.xml | 141 +++ .../tuscany/sca/itest/trninq/TrnInqClient.java | 43 + .../tuscany/sca/itest/trninq/TrnInqService.java | 112 ++ .../tuscany/sca/itest/trninq/TrninqInterface.java | 38 + .../main/resources/META-INF/sca-contribution.xml | 23 + .../src/main/resources/trnInq.composite | 39 + .../src/main/resources/wsdl/IFX170_XSD.xsd | 146 +++ .../src/main/resources/wsdl/trninq.wsdl | 57 + .../test/java/trninq/TrnInqServiceTestCase.java | 87 ++ .../branches/sca-java-1.2.1/itest/oneway/build.xml | 127 +++ .../branches/sca-java-1.2.1/itest/oneway/pom.xml | 64 ++ .../tuscany/sca/itest/oneway/OneWayClient.java | 32 + .../tuscany/sca/itest/oneway/OneWayService.java | 37 + .../sca/itest/oneway/impl/OneWayClientImpl.java | 53 + .../sca/itest/oneway/impl/OneWayServer.java | 46 + .../sca/itest/oneway/impl/OneWayServiceImpl.java | 45 + .../META-INF/sca-deployables/oneWay.composite | 39 + .../sca/itest/oneway/OneWayTestCaseFIXME.java | 82 ++ .../itest/operation-overloading/pom.xml | 45 + .../sca/test/opoverload/OverloadASourceTarget.java | 61 ++ .../sca/test/opoverload/impl/OverloadASource.java | 113 ++ .../sca/test/opoverload/impl/OverloadATarget.java | 99 ++ .../src/main/resources/OperationOverload.composite | 34 + .../test/opoverload/impl/OverloadATestCase.java | 84 ++ .../contribution-classes-v2/build-bundles.xml | 39 + .../contribution-classes-v2/pom.xml | 211 ++++ .../src/main/java/supplychain/OSGiBundleImpl.java | 121 +++ .../main/java/supplychain/customer/Customer.java | 33 + .../customer/JavaCustomerComponentImpl.java | 55 + .../customer/OSGiCustomerComponentImpl.java | 51 + .../supplychain/customer/OSGiCustomerImpl.java | 47 + .../retailer/JavaRetailerComponentImpl.java | 57 + .../retailer/OSGiRetailerComponentImpl.java | 46 + .../supplychain/retailer/OSGiRetailerImpl.java | 44 + .../main/java/supplychain/retailer/Retailer.java | 28 + .../shipper/JavaShipperComponentImpl.java | 52 + .../shipper/OSGiShipperComponentImpl.java | 45 + .../java/supplychain/shipper/OSGiShipperImpl.java | 42 + .../src/main/java/supplychain/shipper/Shipper.java | 28 + .../warehouse/JavaWarehouseComponentImpl.java | 51 + .../warehouse/OSGiWarehouseComponentImpl.java | 47 + .../supplychain/warehouse/OSGiWarehouseImpl.java | 44 + .../main/java/supplychain/warehouse/Warehouse.java | 28 + .../src/main/resources/Customer2V2.componentType | 28 + .../src/main/resources/CustomerV2.componentType | 28 + .../META-INF/customer-sca-contribution.xml | 32 + .../META-INF/retailer-sca-contribution.xml | 29 + .../META-INF/shipper-sca-contribution.xml | 27 + .../META-INF/supplychain-sca-contribution.xml | 24 + .../META-INF/warehouse-sca-contribution.xml | 28 + .../src/main/resources/RetailerV2.componentType | 28 + .../src/main/resources/ShipperV2.componentType | 28 + .../src/main/resources/WarehouseV2.componentType | 28 + .../src/main/resources/osgi/Customer.mf | 13 + .../src/main/resources/osgi/Customer2.mf | 13 + .../src/main/resources/osgi/Retailer.mf | 10 + .../src/main/resources/osgi/RetailerJar.mf | 1 + .../src/main/resources/osgi/Shipper.mf | 10 + .../src/main/resources/osgi/SupplyChain.mf | 13 + .../src/main/resources/osgi/Warehouse.mf | 10 + .../src/main/resources/supplychain.composite | 67 ++ .../contribution-classes/build-bundles.xml | 39 + .../osgi-contribution/contribution-classes/pom.xml | 212 ++++ .../src/main/java/supplychain/OSGiBundleImpl.java | 121 +++ .../main/java/supplychain/customer/Customer.java | 33 + .../customer/JavaCustomerComponentImpl.java | 55 + .../customer/OSGiCustomerComponentImpl.java | 51 + .../supplychain/customer/OSGiCustomerImpl.java | 47 + .../retailer/JavaRetailerComponentImpl.java | 57 + .../retailer/OSGiRetailerComponentImpl.java | 46 + .../supplychain/retailer/OSGiRetailerImpl.java | 44 + .../main/java/supplychain/retailer/Retailer.java | 28 + .../shipper/JavaShipperComponentImpl.java | 52 + .../shipper/OSGiShipperComponentImpl.java | 45 + .../java/supplychain/shipper/OSGiShipperImpl.java | 42 + .../src/main/java/supplychain/shipper/Shipper.java | 28 + .../warehouse/JavaWarehouseComponentImpl.java | 51 + .../warehouse/OSGiWarehouseComponentImpl.java | 47 + .../supplychain/warehouse/OSGiWarehouseImpl.java | 44 + .../main/java/supplychain/warehouse/Warehouse.java | 28 + .../src/main/resources/Customer2V1.componentType | 28 + .../src/main/resources/CustomerV1.componentType | 28 + .../META-INF/customer-sca-contribution.xml | 30 + .../META-INF/retailer-sca-contribution.xml | 26 + .../META-INF/shipper-sca-contribution.xml | 26 + .../META-INF/supplychain-sca-contribution.xml | 24 + .../META-INF/warehouse-sca-contribution.xml | 26 + .../src/main/resources/RetailerV1.componentType | 28 + .../src/main/resources/ShipperV1.componentType | 28 + .../src/main/resources/WarehouseV1.componentType | 28 + .../src/main/resources/osgi/Customer.mf | 13 + .../src/main/resources/osgi/Customer2.mf | 13 + .../src/main/resources/osgi/Retailer.mf | 10 + .../src/main/resources/osgi/RetailerJar.mf | 1 + .../src/main/resources/osgi/Shipper.mf | 10 + .../src/main/resources/osgi/SupplyChain.mf | 13 + .../src/main/resources/osgi/Warehouse.mf | 10 + .../src/main/resources/supplychain.composite | 66 ++ .../osgi-contribution/contribution-test/pom.xml | 98 ++ .../sca/contribution/osgi/OSGiTestUtil.java | 73 ++ .../osgi/test/MixedContributionTestCase.java | 43 + .../osgi/test/NestedBundleTestCase.java | 182 ++++ .../osgi/test/OSGiResolverTestCase.java | 257 +++++ .../osgi/test/SCAResolverTestCase.java | 240 +++++ .../resources/osgi/felix/felix.config.properties | 45 + .../sca-java-1.2.1/itest/osgi-contribution/pom.xml | 52 + .../itest/osgi-implementation/build-bundles.xml | 34 + .../itest/osgi-implementation/pom.xml | 1109 ++++++++++++++++++++ .../java/callback/client/CallbackCallback.java | 33 + .../main/java/callback/client/CallbackClient.java | 31 + .../callback/client/JavaCallbackClientImpl.java | 141 +++ .../callback/client/OSGiCallbackClientImpl.java | 181 ++++ .../java/callback/service/CallbackService.java | 39 + .../callback/service/JavaCallbackServiceImpl.java | 68 ++ .../callback/service/OSGiCallbackServiceImpl.java | 95 ++ .../client/ConversationalCallback.java | 50 + .../conversation/client/ConversationalClient.java | 51 + .../client/ConversationalClientActivator.java | 105 ++ .../client/ConversationalClientServiceFactory.java | 135 +++ .../client/ConversationalClientStatefulImpl.java | 254 +++++ .../client/ConversationalClientStatelessImpl.java | 253 +++++ .../ConversationalReferenceClient.java | 38 + .../ConversationalReferenceClientActivator.java | 66 ++ .../ConversationalReferenceClientImpl.java | 45 + .../service/ConversationalService.java | 65 ++ .../service/ConversationalServiceActivator.java | 76 ++ .../service/ConversationalServiceFactory.java | 52 + .../service/ConversationalServiceStatefulImpl.java | 121 +++ .../ConversationalServiceStatelessImpl.java | 127 +++ .../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 | 112 ++ .../main/java/helloworld/OSGiHelloWorldImpl.java | 81 ++ .../src/main/java/helloworld/ws/HelloWorld.java | 29 + .../main/java/helloworld/ws/HelloWorldService.java | 28 + .../stockquote/OSGiStockQuoteComponentImpl.java | 86 ++ .../java/stockquote/OSGiStockQuoteFactoryImpl.java | 65 ++ .../main/java/stockquote/OSGiStockQuoteImpl.java | 119 +++ .../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 | 106 ++ .../customer/OSGiCustomerFactoryImpl.java | 65 ++ .../supplychain/customer/OSGiCustomerImpl.java | 92 ++ .../OSGiCustomerWithQueryComponentImpl.java | 100 ++ .../customer/OSGiCustomerWithQueryImpl.java | 82 ++ .../OSGiStatelessCustomerComponentImpl.java | 30 + .../customer/OSGiStatelessCustomerImpl.java | 35 + .../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/OSGiStatelessShipperComponentImpl.java | 30 + .../shipper/OSGiStatelessShipperServiceImpl.java | 35 + .../shipper/OSGiVersionedShipperImpl.java | 78 ++ .../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 + .../main/resources/META-INF/sca-contribution.xml | 24 + .../callback/CallbackClient.componentType | 31 + .../callback/CallbackService.componentType | 27 + .../resources/callback/callback-test1.composite | 39 + .../resources/callback/callback-test2.composite | 41 + .../resources/callback/callback-test3.composite | 38 + .../ConversationalClient.componentType | 37 + .../ConversationalReferenceClient.componentType | 28 + .../ConversationalService.componentType | 29 + .../conversation/conversation-test.composite | 162 +++ .../main/resources/factory/Customer.componentType | 34 + .../main/resources/factory/Retailer.componentType | 29 + .../main/resources/factory/Shipper.componentType | 29 + .../main/resources/factory/Warehouse.componentType | 28 + .../resources/factory/ds/Customer.componentType | 34 + .../resources/factory/ds/Retailer.componentType | 29 + .../resources/factory/ds/Shipper.componentType | 29 + .../resources/factory/ds/Warehouse.componentType | 28 + .../resources/factory/ds/factory-ds-test.composite | 130 +++ .../main/resources/factory/factory-test.composite | 116 ++ .../resources/helloworld/Greetings.componentType | 30 + .../resources/helloworld/HelloWorld.componentType | 31 + .../resources/interfaces/Customer.componentType | 31 + .../resources/interfaces/Retailer.componentType | 35 + .../resources/interfaces/Shipper.componentType | 29 + .../resources/interfaces/Warehouse.componentType | 31 + .../resources/interfaces/ds/Customer.componentType | 31 + .../resources/interfaces/ds/Retailer.componentType | 35 + .../resources/interfaces/ds/Shipper.componentType | 29 + .../interfaces/ds/Warehouse.componentType | 31 + .../interfaces/ds/interfaces-ds-test.composite | 57 + .../resources/interfaces/interfaces-test.composite | 57 + .../main/resources/osgi/callback/CallbackClient.mf | 10 + .../resources/osgi/callback/CallbackService.mf | 10 + .../osgi/conversation/ConversationalClient.mf | 11 + .../conversation/ConversationalReferenceClient.mf | 11 + .../osgi/conversation/ConversationalService.mf | 11 + .../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 | 11 + .../osgi/properties/ManagedStockQuoteFactory.mf | 11 + .../main/resources/osgi/properties/StockQuote.mf | 10 + .../resources/osgi/properties/StockQuoteFactory.mf | 11 + .../resources/osgi/properties/ds/StockQuote.mf | 12 + .../resources/osgi/properties/ds/StockQuote.xml | 27 + .../osgi/properties/ds/StockQuoteFactory.mf | 12 + .../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 | 33 + .../main/resources/osgi/wiring/ds/Warehouse2.xml | 33 + .../src/main/resources/osgi/ws/HelloWorld.mf | 12 + .../resources/passbyref/Greetings.componentType | 30 + .../resources/passbyref/passbyref-test.composite | 39 + .../resources/properties/StockQuote.componentType | 28 + .../properties/StockQuoteFactory.componentType | 28 + .../properties/ds/StockQuote.componentType | 28 + .../properties/ds/StockQuoteFactory.componentType | 28 + .../properties/ds/properties-ds-test.composite | 39 + .../properties/ds/properties2-ds-test.composite | 54 + .../resources/properties/properties-test.composite | 39 + .../properties/properties2-test.composite | 50 + .../main/resources/services/Customer.componentType | 34 + .../main/resources/services/Retailer.componentType | 33 + .../main/resources/services/Shipper.componentType | 30 + .../resources/services/Warehouse.componentType | 28 + .../resources/services/ds/Customer.componentType | 34 + .../resources/services/ds/Retailer.componentType | 33 + .../resources/services/ds/Shipper.componentType | 30 + .../resources/services/ds/Warehouse.componentType | 28 + .../services/ds/services-ds-test.composite | 90 ++ .../resources/services/services-test.composite | 89 ++ .../resources/stockquote/StockQuote.componentType | 28 + .../main/resources/version/Customer1.componentType | 34 + .../main/resources/version/Customer2.componentType | 34 + .../main/resources/version/Retailer1.componentType | 33 + .../main/resources/version/Retailer2.componentType | 33 + .../main/resources/version/Shipper1.componentType | 30 + .../main/resources/version/Shipper2.componentType | 30 + .../resources/version/Warehouse1.componentType | 28 + .../resources/version/Warehouse2.componentType | 28 + .../resources/version/ds/Customer1.componentType | 34 + .../resources/version/ds/Customer2.componentType | 34 + .../resources/version/ds/Retailer1.componentType | 33 + .../resources/version/ds/Retailer2.componentType | 33 + .../resources/version/ds/Shipper1.componentType | 30 + .../resources/version/ds/Shipper2.componentType | 30 + .../resources/version/ds/Warehouse1.componentType | 28 + .../resources/version/ds/Warehouse2.componentType | 28 + .../resources/version/ds/version-ds-test.composite | 184 ++++ .../main/resources/version/version-test.composite | 170 +++ .../main/resources/wiring/Customer.componentType | 34 + .../main/resources/wiring/Retailer.componentType | 29 + .../main/resources/wiring/Shipper.componentType | 29 + .../main/resources/wiring/Warehouse.componentType | 28 + .../resources/wiring/ds/Customer.componentType | 34 + .../resources/wiring/ds/Retailer.componentType | 29 + .../main/resources/wiring/ds/Shipper.componentType | 29 + .../resources/wiring/ds/Warehouse.componentType | 28 + .../resources/wiring/ds/wiring-ds-test1.composite | 136 +++ .../resources/wiring/ds/wiring-ds-test2.composite | 151 +++ .../main/resources/wiring/wiring-test1.composite | 127 +++ .../main/resources/wiring/wiring-test2.composite | 151 +++ .../src/main/resources/ws/HelloWorld.componentType | 31 + .../src/main/resources/ws/helloworld.wsdl | 80 ++ .../src/main/resources/ws/ws-helloworld.composite | 51 + .../src/test/java/callback/Callback1TestCase.java | 30 + .../src/test/java/callback/Callback2TestCase.java | 29 + .../src/test/java/callback/Callback3TestCase.java | 29 + .../src/test/java/callback/CallbackTestCase.java | 50 + .../java/conversation/ConversationTestCase.java | 325 ++++++ .../helloworld/passbyref/PassByRefTestCase.java | 130 +++ .../java/helloworld/ws/HelloWorldTestCase.java | 55 + .../test/java/supplychain/SupplyChainTestCase.java | 63 ++ .../supplychain/VersionedSupplyChainTestCase.java | 71 ++ .../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 | 69 ++ .../supplychain/properties/PropertiesTestCase.java | 58 + .../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/test/OSGiTestCase.java | 67 ++ .../src/test/java/util/OSGiTestUtil.java | 71 ++ .../resources/osgi/felix/felix.config.properties | 45 + .../itest/osgi-tuscany/osgi-tuscany-test/pom.xml | 85 ++ .../test/osgi/runtime/impl/FelixTestRuntime.java | 185 ++++ .../test/osgi/runtime/impl/OSGiTestRuntime.java | 109 ++ .../tuscany/sca/test/util/OSGiRuntimeLoader.java | 86 ++ .../tuscany/sca/test/util/TuscanyLoader.java | 105 ++ .../test/osgi/harness/OSGiTuscanyTestHarness.java | 304 ++++++ .../sca/test/osgi/harness/TestBundleActivator.java | 38 + .../CalculatorImplementationPoliciesTestCase.java | 61 ++ .../test/osgi/tuscany/CalculatorRmiTestCase.java | 62 ++ .../osgi/tuscany/CalculatorScriptTestCase.java | 61 ++ .../osgi/tuscany/CallbackWsClientTestCase.java | 61 ++ .../osgi/tuscany/CallbackWsServiceTestCase.java | 61 ++ .../tuscany/HelloworldWsServiceJmsTestCase.java | 61 ++ .../tuscany/HelloworldWsServiceSecureTestCase.java | 61 ++ .../osgi/tuscany/HelloworldWsServiceTestCase.java | 61 ++ .../test/osgi/tuscany/OSGiSupplyChainTestCase.java | 61 ++ .../osgi/tuscany/OSGiTuscanyRuntimeTestCase.java | 115 ++ .../tuscany/TuscanySampleExtensionsTestCase.java | 93 ++ .../TuscanySamplesUsingOldDomainTestCase.java | 80 ++ .../src/test/resources/META-INF/MANIFEST.MF | 17 + .../test/resources/felix/felix.config.properties | 45 + .../sca-java-1.2.1/itest/osgi-tuscany/pom.xml | 42 + .../itest/osgi-tuscany/sca-api/pom.xml | 60 ++ .../osgi-tuscany/test-bundles/build-bundles.xml | 31 + .../itest/osgi-tuscany/test-bundles/pom.xml | 124 +++ .../java/supplychain/client/SupplyChainClient.java | 115 ++ .../main/java/supplychain/customer/Customer.java | 37 + .../customer/JavaCustomerComponentImpl.java | 61 ++ .../retailer/JavaRetailerComponentImpl.java | 59 ++ .../main/java/supplychain/retailer/Retailer.java | 28 + .../shipper/JavaShipperComponentImpl.java | 50 + .../src/main/java/supplychain/shipper/Shipper.java | 28 + .../warehouse/JavaWarehouseComponentImpl.java | 49 + .../main/java/supplychain/warehouse/Warehouse.java | 28 + .../src/main/resources/META-INF/SupplyChain.mf | 11 + .../main/resources/META-INF/SupplyChainClient.mf | 20 + .../main/resources/META-INF/sca-contribution.xml | 26 + .../resources/supplychain/supplychain.composite | 48 + .../main/resources/supplychain/ws/Customer.wsdl | 135 +++ .../resources/supplychain/ws/supplychain.composite | 55 + .../itest/osgi-tuscany/tuscany-3rdparty/pom.xml | 332 ++++++ .../itest/osgi-tuscany/tuscany-extensions/pom.xml | 336 ++++++ .../itest/osgi-tuscany/tuscany-runtime/pom.xml | 197 ++++ .../itest/osgi-tuscany/tuscany-spi/pom.xml | 125 +++ .../branches/sca-java-1.2.1/itest/policy/pom.xml | 68 ++ .../src/main/java/calculator/AddService.java | 35 + .../src/main/java/calculator/AddServiceImpl.java | 35 + .../src/main/java/calculator/CalculatorClient.java | 69 ++ .../main/java/calculator/CalculatorService.java | 39 + .../java/calculator/CalculatorServiceImpl.java | 76 ++ .../src/main/java/calculator/DivideService.java | 33 + .../main/java/calculator/DivideServiceImpl.java | 35 + .../src/main/java/calculator/MultiplyService.java | 28 + .../main/java/calculator/MultiplyServiceImpl.java | 35 + .../src/main/java/calculator/PolicyQNames.java | 43 + .../src/main/java/calculator/SubtractService.java | 28 + .../main/java/calculator/SubtractServiceImpl.java | 35 + .../calculator/policy/TestImplPolicyHandler.java | 84 ++ .../calculator/policy/TestRefPolicyHandler.java | 62 ++ .../calculator/policy/TestSvcPolicyHandler.java | 62 ++ .../policy/src/main/resources/Calculator.composite | 66 ++ ...rg.apache.tuscany.sca.policy.util.PolicyHandler | 28 + .../policy/src/main/resources/definitions.xml | 147 +++ .../sca/itest/PoliciedCalculatorTestCase.java | 55 + sca-java-1.x/branches/sca-java-1.2.1/itest/pom.xml | 701 +++++++++++++ .../sca-java-1.2.1/itest/properties/pom.xml | 84 ++ .../java/mysca/test/myservice/impl/MyService.java | 34 + .../mysca/test/myservice/impl/MyServiceImpl.java | 88 ++ .../test/myservice/impl/MyTotalServiceImpl.java | 46 + .../apache/tuscany/sca/itest/ABCDComponent.java | 50 + .../tuscany/sca/itest/ABCDComponentImpl.java | 73 ++ .../org/apache/tuscany/sca/itest/ABComponent.java | 75 ++ .../apache/tuscany/sca/itest/ABComponentImpl.java | 131 +++ .../org/apache/tuscany/sca/itest/CDComponent.java | 71 ++ .../apache/tuscany/sca/itest/CDComponentImpl.java | 143 +++ .../tuscany/sca/itest/ComplexPropertyBean.java | 151 +++ .../apache/tuscany/sca/itest/OverrideService.java | 27 + .../tuscany/sca/itest/OverrideServiceImpl.java | 28 + .../tuscany/sca/itest/PropertyComponent.java | 120 +++ .../tuscany/sca/itest/PropertyComponentImpl.java | 172 +++ .../apache/tuscany/sca/itest/PropertyService.java | 27 + .../java/org/apache/tuscany/sca/itest/cdi/Bar.java | 23 + .../org/apache/tuscany/sca/itest/cdi/Foo1.java | 39 + .../org/apache/tuscany/sca/itest/cdi/Foo2.java | 39 + .../org/apache/tuscany/sca/itest/cdi/Foo3.java | 44 + .../ConstructorPropertyInjection.composite | 41 + .../properties/src/main/resources/Outer.composite | 43 + .../src/main/resources/OuterPropertyTest.composite | 42 + .../src/main/resources/PropertyTest.composite | 247 +++++ .../properties/src/main/resources/customer.xsd | 30 + .../properties/src/main/resources/fileProperty.txt | 21 + .../src/main/resources/manyValuesFileProperty.txt | 23 + .../src/main/resources/mySimpleService.composite | 40 + .../tuscany/sca/itest/MyTotalServiceTestCase.java | 99 ++ .../tuscany/sca/itest/OuterPropertyTestCase.java | 164 +++ .../apache/tuscany/sca/itest/PropertyTestCase.java | 446 ++++++++ .../cdi/ConstructorPropertyInjectionTestCase.java | 44 + .../sca-java-1.2.1/itest/recursive/pom.xml | 45 + .../src/main/java/composite/CompositeClient.java | 42 + .../recursive/src/main/java/composite/Source.java | 24 + .../src/main/java/composite/SourceCallback.java | 24 + .../src/main/java/composite/SourceImpl.java | 55 + .../recursive/src/main/java/composite/Target.java | 30 + .../src/main/java/composite/TargetImpl.java | 41 + .../itest/recursive/src/main/java/foo/A.java | 28 + .../itest/recursive/src/main/java/foo/B.java | 36 + .../itest/recursive/src/main/java/foo/I.java | 23 + .../src/main/java/sample/ComponentAImpl.java | 41 + .../src/main/java/sample/ComponentCImpl.java | 41 + .../src/main/java/sample/ComponentEImpl.java | 38 + .../src/main/java/sample/ComponentFImpl.java | 45 + .../recursive/src/main/java/sample/Service1.java | 27 + .../recursive/src/main/java/test/Aggregator.java | 27 + .../src/main/java/test/AggregatorImpl.java | 55 + .../src/main/java/test/InnerSourceImpl.java | 34 + .../src/main/java/test/OuterSourceImpl.java | 34 + .../itest/recursive/src/main/java/test/Source.java | 30 + .../src/main/java/test1/composite/Target.java | 23 + .../src/main/java/test1/composite/TargetOne.java | 29 + .../src/main/java/test1/composite/TargetTwo.java | 29 + .../src/main/resources/AComposite.composite | 30 + .../src/main/resources/BComposite.composite | 45 + .../src/main/resources/CComposite.composite | 44 + .../src/main/resources/Composite1.composite | 42 + .../src/main/resources/Composite2.composite | 43 + .../src/main/resources/Composite3.composite | 48 + .../recursive/src/main/resources/Inner.composite | 45 + .../src/main/resources/InnerComposite.composite | 41 + .../src/main/resources/InnerComposite2.composite | 33 + .../main/resources/META-INF/sca-contribution.xml | 24 + .../recursive/src/main/resources/Outer.composite | 39 + .../src/main/resources/OuterComposite.composite | 39 + .../itest/recursive/src/main/resources/foo/foo.png | Bin 0 -> 571816 bytes .../recursive/src/main/resources/foo/o1.composite | 31 + .../recursive/src/main/resources/foo/o2.composite | 31 + .../recursive/src/main/resources/foo/o3.composite | 35 + .../recursive/src/main/resources/foo/o4.composite | 37 + .../main/resources/test1/InnerComposite.composite | 39 + .../main/resources/test1/OuterComposite.composite | 27 + .../src/test/java/composite/CompositeTestCase.java | 51 + .../LocateServiceEmbeddedSCADomainTestCase.java | 113 ++ .../composite/LocateServiceSCADomainTestCase.java | 73 ++ .../recursive/src/test/java/foo/O2TestCase.java | 32 + .../recursive/src/test/java/foo/O4TestCase.java | 39 + .../itest/recursive/src/test/java/sample/C.java | 32 + .../recursive/src/test/java/sample/CImpl.java | 80 ++ .../src/test/java/sample/NestedTestCase.java | 96 ++ .../sample/RecursiveCompositeTestCaseFIXME.java | 53 + .../itest/recursive/src/test/java/sample/X.java | 32 + .../recursive/src/test/java/sample/XImpl.java | 37 + .../itest/recursive/src/test/java/sample/Y.java | 32 + .../recursive/src/test/java/sample/YImpl.java | 38 + .../src/test/java/test/InnerTestCase.java | 51 + .../src/test/java/test/OuterTestCase.java | 51 + .../test1/composite/CompositeClientTestCase.java | 62 ++ .../sca-java-1.2.1/itest/references/pom.xml | 46 + .../tuscany/sca/itest/references/AComponent.java | 40 + .../sca/itest/references/AComponentImpl.java | 126 +++ .../tuscany/sca/itest/references/BComponent.java | 26 + .../sca/itest/references/BComponentImpl.java | 39 + .../tuscany/sca/itest/references/CComponent.java | 24 + .../sca/itest/references/CComponentImpl.java | 27 + .../tuscany/sca/itest/references/DComponent.java | 25 + .../sca/itest/references/DComponentImpl.java | 35 + .../resources/AutoWiredReferencesTest.composite | 56 + .../main/resources/InnerReferencesTest.composite | 54 + .../references/AutoWiredReferenceTestCase.java | 91 ++ .../itest/references/InnerReferenceTestCase.java | 94 ++ .../branches/sca-java-1.2.1/itest/scopes/pom.xml | 47 + .../scopes/CompositeScopeStateVerifierImpl.java | 44 + .../scopes/RequestScopeStateVerifierImpl.java | 37 + .../tuscany/sca/itest/scopes/StateVerifier.java | 25 + .../scopes/src/main/resources/scopes.composite | 33 + .../org/apache/tuscany/sca/test/ScopeTestCase.java | 93 ++ .../branches/sca-java-1.2.1/itest/services/pom.xml | 46 + .../tuscany/sca/itest/services/AComponent.java | 27 + .../tuscany/sca/itest/services/AComponentImpl.java | 28 + .../tuscany/sca/itest/services/BComponent.java | 25 + .../tuscany/sca/itest/services/BComponentImpl.java | 31 + .../tuscany/sca/itest/services/CComponent.java | 27 + .../tuscany/sca/itest/services/CComponentImpl.java | 28 + .../tuscany/sca/itest/services/D1Component.java | 25 + .../tuscany/sca/itest/services/DComponent.java | 25 + .../tuscany/sca/itest/services/DComponentImpl.java | 34 + .../main/resources/META-INF/sca-contribution.xml | 22 + .../src/main/resources/ServicesTest.composite | 70 ++ .../sca/itest/services/ServicesTestCase.java | 105 ++ .../branches/sca-java-1.2.1/itest/spring/pom.xml | 80 ++ .../sca/SpringDelegationHelloWorld-context.xml | 37 + .../META-INF/sca/SpringHelloWorld-context.xml | 31 + .../spring/SpringDelegationHelloWorld.composite | 32 + .../sca/itest/spring/SpringHelloWorld.composite | 32 + .../itest/spring/AbstractHelloWorldTestCase.java | 40 + .../sca/itest/spring/AbstractSCATestCase.java | 51 + .../tuscany/sca/itest/spring/HelloWorld.java | 34 + .../tuscany/sca/itest/spring/HelloWorldProxy.java | 41 + .../spring/SpringDelegationHelloWorldTestCase.java | 31 + .../sca/itest/spring/SpringHelloWorldTestCase.java | 32 + .../sca/itest/spring/TestHelloWorldBean.java | 36 + .../itest/spring/TestHelloWorldDelegatorBean.java | 40 + .../sca-java-1.2.1/itest/transaction/pom.xml | 91 ++ .../transaction/AccountNotFoundException.java | 36 + .../sca/itest/transaction/AccountService.java | 31 + .../sca/itest/transaction/AccountServiceImpl.java | 70 ++ .../transaction/CheckingAccountServiceImpl.java | 143 +++ .../sca/itest/transaction/OverDraftException.java | 36 + .../transaction/SavingsAccountServiceImpl.java | 133 +++ .../sca/itest/transaction/TransferService.java | 31 + .../sca/itest/transaction/TransferServiceImpl.java | 64 ++ .../src/main/resources/accounts.composite | 43 + .../transaction/src/main/resources/definitions.xml | 99 ++ .../src/main/resources/log4j.properties | 29 + .../transaction/ConcurrentXAResourceTestCase.java | 119 +++ .../sca/itest/transaction/TransactionTestCase.java | 53 + .../branches/sca-java-1.2.1/itest/wasAdmin.py | 91 ++ .../branches/sca-java-1.2.1/itest/wires/pom.xml | 45 + .../org/apache/tuscany/sca/itest/WireClient.java | 34 + .../apache/tuscany/sca/itest/WireClientImpl.java | 52 + .../org/apache/tuscany/sca/itest/WireService.java | 36 + .../apache/tuscany/sca/itest/WireServiceImpl.java | 39 + .../wires/src/main/resources/WireTest.composite | 39 + .../org/apache/tuscany/sca/itest/WireTestCase.java | 69 ++ .../itest/ws-void-args-return/pom.xml | 61 ++ .../src/main/java/voidtest/Bean.java | 39 + .../src/main/java/voidtest/HelloWorldImpl.java | 64 ++ .../src/main/java/voidtest/HelloWorldService.java | 47 + .../src/main/java/voidtest/TestClient.java | 23 + .../src/main/java/voidtest/TestClientImpl.java | 53 + .../src/main/resources/voidtest.composite | 41 + .../test/java/voidtest/VoidArgsReturnTestCase.java | 53 + .../sca-java-1.2.1/itest/wsdl-multiple/pom.xml | 135 +++ .../main/java/helloworld/HelloWorldCallback.java | 30 + .../main/java/helloworld/HelloWorldClientImpl.java | 42 + .../main/java/helloworld/HelloWorldService.java | 32 + .../java/helloworld/HelloWorldServiceImpl.java | 37 + .../src/main/resources/auto-wsdl.composite | 44 + .../src/main/resources/manual-wsdl.composite | 46 + .../wsdl/helloworld.HelloWorldCallback.wsdl | 98 ++ .../wsdl/helloworld.HelloWorldService.wsdl | 95 ++ .../apache/tuscany/sca/itest/AutoWSDLTestCase.java | 65 ++ .../tuscany/sca/itest/ManualWSDLTestCase.java | 65 ++ .../branches/sca-java-1.2.1/itest/wsdl/pom.xml | 135 +++ .../services/accountdata/AccountDataService.java | 92 ++ .../accountdata/AccountDataServiceImpl.java | 93 ++ .../accountdata/AccountServiceClientImpl.java | 79 ++ .../services/accountdata/Component2aImpl.java | 79 ++ .../services/accountdata/Component2bImpl.java | 79 ++ .../services/accountdata/Component3aImpl.java | 79 ++ .../services/accountdata/Component3bImpl.java | 79 ++ .../services/accountdata/CustomerIdService.java | 98 ++ .../src/main/java/helloworld/HelloWorldImpl.java | 33 + .../main/java/helloworld/HelloWorldService.java | 30 + .../helloworld/HelloWorldServiceComponent.java | 43 + .../apache/tuscany/sca/itest/Component2aImpl.java | 38 + .../apache/tuscany/sca/itest/Component2bImpl.java | 39 + .../apache/tuscany/sca/itest/Component3aImpl.java | 39 + .../apache/tuscany/sca/itest/Component3bImpl.java | 39 + .../wsdl/src/main/resources/SDOWSDLTest.composite | 344 ++++++ .../wsdl/src/main/resources/WSDLTest.composite | 371 +++++++ .../src/main/resources/wsdl/AccountService.wsdl | 453 ++++++++ .../wsdl/src/main/resources/wsdl/helloworld.wsdl | 80 ++ .../apache/tuscany/sca/itest/SDOWSDLTestCase.java | 169 +++ .../org/apache/tuscany/sca/itest/WSDLTestCase.java | 146 +++ .../sca-java-1.2.1/itest/wsdl2java/pom.xml | 188 ++++ .../src/test/resources/AccountService.wsdl | 479 +++++++++ .../wsdl2java/src/test/resources/EchoService.wsdl | 64 ++ .../wsdl2java/src/test/resources/EchoService.xsd | 40 + .../src/test/resources/StockExceptionTest.wsdl | 167 +++ .../branches/sca-java-1.2.1/itest/wsdlless/pom.xml | 135 +++ .../services/accountdata/AccountDataService.java | 91 ++ .../accountdata/AccountDataServiceImpl.java | 91 ++ .../accountdata/AccountServiceClientImpl.java | 77 ++ .../services/accountdata/Component2aImpl.java | 77 ++ .../services/accountdata/Component2bImpl.java | 77 ++ .../services/accountdata/Component3aImpl.java | 77 ++ .../services/accountdata/Component3bImpl.java | 77 ++ .../services/accountdata/CustomerIdService.java | 98 ++ .../src/main/java/helloworld/HelloWorldImpl.java | 44 + .../main/java/helloworld/HelloWorldService.java | 31 + .../helloworld/HelloWorldServiceComponent.java | 47 + .../apache/tuscany/sca/itest/Component2aImpl.java | 43 + .../apache/tuscany/sca/itest/Component2bImpl.java | 42 + .../apache/tuscany/sca/itest/Component3aImpl.java | 42 + .../apache/tuscany/sca/itest/Component3bImpl.java | 43 + .../src/main/resources/SDOWSDLTest.composite | 321 ++++++ .../wsdlless/src/main/resources/WSDLTest.composite | 350 ++++++ .../src/main/resources/wsdl/AccountService.wsdl | 453 ++++++++ .../src/main/resources/wsdl/helloworld.wsdl | 131 +++ .../apache/tuscany/sca/itest/SDOWSDLTestCase.java | 169 +++ .../org/apache/tuscany/sca/itest/WSDLTestCase.java | 150 +++ 1417 files changed, 82690 insertions(+) create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/admin/README create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/admin/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListServiceByYear.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyLogger.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyServiceByDate.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyTotalService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyTotalServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/SCAComponentService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MySimpleServiceInRecursiveTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MySimpleServiceTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MyTotalServiceTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/test/resources/Iteration1Composite.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/test/resources/Iteration3Composite.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/test/resources/MySimpleService.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsTestServer.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/greetings/greetings.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/greetings/greetings.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/helloworld/deploy.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.bpel create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/log4j.properties create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/java/helloworld/HelloWorld.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/java/helloworld/HelloWorldTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/helloworld/deploy.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.bpel create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/log4j.properties create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/java/pingpong/BPELPingPongTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/java/pingpong/BPELPingTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/java/pingpong/BPELPongTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/log4j.properties create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping-pong/ping-pong.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping-pong/ping-pong.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/deploy.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/ping.bpel create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/ping.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/ping.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/ping.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/pong.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/pong/deploy.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/pong/pong.bpel create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/pong/pong.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/pong/pong.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/pong/pong.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/build-was-integration.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/com/example/ExampleClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/com/example/ExampleClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/com/example/ExampleService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/com/example/ExampleServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/Alpha.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/AlphaImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/Beta.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/BetaImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/Gamma.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/GammaImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/resources/CallableReferenceWsReturnTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/resources/example.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/test/java/com/example/ExampleTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/test/java/org/apache/tuscany/sca/itest/callablerefws/CallableReferenceReturnTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/Alpha.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/AlphaImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/Beta.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/BetaImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/Gamma.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/GammaImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/CallableReferenceReturnTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/CallableReferenceTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/nodeA/CompositeA.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/nodeA/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/nodeB/CompositeB.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/nodeB/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceRemoteTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceReturnTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/resources/CallBackApiTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/resources/CallBackBasicTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeCallBack.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/resources/CallBackCTypeClient.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/resources/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeTestCaseFIXME.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdCallBack.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/resources/CallBackIdClient.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/test/java/org/apache/tuscany/sca/test/CallBackIdTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl1.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl2.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceCallback.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/test/java/org/apache/tuscany/sca/test/callback/CallbackMultiWireTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorCallBack.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/test/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCalbackService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackBadCallback.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallback.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallbackImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackObjectCallback.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/resources/CallBackSetCallbackTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/resources/CallBackSetCallbackConvTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/AddService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/AddServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/CalculatorClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/CalculatorService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/CalculatorServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/DivideService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/DivideServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/MultiplyService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/MultiplyServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/SubtractService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/SubtractServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/Calculator.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/calculator/AddServiceImpl.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/calculator/CalculatorServiceImpl.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/calculator/DivideServiceImpl.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/calculator/MultiplyServiceImpl.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/calculator/SubtractServiceImpl.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/test/java/calculator/CalculatorTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/build-jar.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/customer/Customer.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/illegal/JavaCustomerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/retailer/Retailer.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/shipper/JavaShipperComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/shipper/Shipper.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/warehouse/Warehouse.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/complete-supplychain-sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/customer-impl-sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/customer-interface-sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/customer-sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/illegal-customer-sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/illegal1-supplychain-sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/illegal2-supplychain-sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/retailer-sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/shipper-sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/supplychain-sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/warehouse-sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/supplychain/illegalsupplychain.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/supplychain/supplychain.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/supplychain/warehouse/JavaWarehouseComponentImpl.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-test/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-test/src/test/java/org/apache/tuscany/sca/test/contribution/ContributionTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-test/src/test/java/org/apache/tuscany/sca/test/contribution/SupplyChain.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-test/src/test/java/org/apache/tuscany/sca/test/contribution/TuscanyClassloadingTestCaseFIXME.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/src/main/java/hello/Hello.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/src/main/java/hello/HelloImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/src/main/resources/hello.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/src/test/java/org/apache/tuscany/sca/test/contribution/HelloTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-java/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-java/src/main/java/helloworld/HelloWorldService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-java/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-java/src/main/resources/helloworld/HelloWorldImpl.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-resource/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-resource/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-resource/src/main/resources/ufservices/store.html create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-wsdl/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-wsdl/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldServer.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/resources/helloworld.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/resources/helloworld.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/resources/helloworldws.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/test/java/org/apache/tuscany/test/contribution/HelloWorldServerTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-java/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-java/src/main/java/helloworld/HelloWorldImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-java/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-java/src/main/resources/helloworldws.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-java/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-resource/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-resource/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-resource/src/main/resources/store.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-resource/src/test/java/org/apache/tuscany/sca/test/contribution/StoreTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldServer.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/main/resources/helloworldws.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/hello/Hello.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/hello/HelloImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/helloworld/HelloWorldImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/helloworld/HelloWorldService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/test/ContributionCycleTestCaseFIXME.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/test/ContributionTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-cycle-export/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-cycle-export/hello.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-cycle-import/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-cycle-import/helloworld_one.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-export/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-export/hello.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-import-one/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-import-one/helloworld_one.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/AddService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/AddServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/CalculatorClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/CalculatorService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/CalculatorServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/DivideService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/DivideServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/MultiplyService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/MultiplyServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/SubtractService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/SubtractServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/resources/ContributionTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/resources/calculator/Calculator.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/resources/calculator/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/test/java/org/apache/tuscany/sca/test/contribution/ContributionServiceTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/test/resources/deployables/sample-calculator.jar create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/test/resources/repository/sample-calculator.jar create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/BusinessException.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationIdService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalCallback.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalReferenceClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalServiceNonConversationalCallback.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallback.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationAgeComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationIdComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationMaxIdleComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulNonConversationalCallbackImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatelessImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalReferenceClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceRequestImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulNonConversationalCallbackImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessScopeImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/resources/Conversational/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/resources/Conversational/conversational.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/resources/ConversationalWSDL/ConversationalServiceStateful.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/resources/ConversationalWSDL/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/resources/ConversationalWSDL/conversationalWSDL.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationWSDLTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalTestCaseOff.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallbackTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/RequestScopeTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/StatefulStatefulTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/StatefulStatelessTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/StatelessStatefulTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/StatelessStatelessTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/AService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/BService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/CService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Constants.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationIdService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalCallback.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalReferenceClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalServiceNonConversationalCallback.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/DService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallback.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/CServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationAgeComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationIdComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationMaxIdleComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulNonConversationalCallbackImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatelessImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalReferenceClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceRequestImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulNonConversationalCallbackImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessScopeImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/DServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/resources/ConversationAge.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/resources/conversationId.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/resources/conversationLifetime.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/resources/conversational.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationIdTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationLifetimeTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalAgeTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalJ2SETestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/java/org/apache/tuscany/sca/itest/generate/Generate.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/DatabindingTestCase.java.vm create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/Greeter.wsdl.vm create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/GreeterService.java.vm create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/GreeterServiceClient.java.vm create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/GreeterServiceClientImpl.java.vm create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/GreeterServiceImpl.java.vm create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/generate.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/wsdl/Dummy.txt create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Annotation.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Annotation.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Attribute.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Attribute.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeReference.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeReference.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithDefaultValue.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithDefaultValue.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithFixedValue.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithFixedValue.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOAliasName.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOAliasName.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDODataType.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDODataType.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOName.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOName.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOPropertySDOOppositePropertyType.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOPropertySDOOppositePropertyType.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOPropertyType.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOPropertyType.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOString.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOString.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnySimpleType.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnySimpleType.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnyType.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnyType.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnyURI.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnyURI.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInBase64Binary.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInBase64Binary.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInBoolean.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInBoolean.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInByte.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInByte.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDate.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDate.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDateTime.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDateTime.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDecimal.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDecimal.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDouble.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDouble.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDuration.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDuration.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInFloat.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInFloat.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGDay.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGDay.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGMonth.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGMonth.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGMonthDay.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGMonthDay.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGYear.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGYear.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGYearMonth.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGYearMonth.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInHexBinary.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInHexBinary.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInID.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInID.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInIDREF.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInIDREF.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInIDREFS.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInIDREFS.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInInt.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInInt.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInInteger.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInInteger.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInLanguage.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInLanguage.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInLong.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInLong.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNCName.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNCName.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNMTOKEN.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNMTOKEN.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNMTOKENS.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNMTOKENS.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNOTATION.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNOTATION.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInName.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInName.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNegativeInteger.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNegativeInteger.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNonNegativeInteger.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNonNegativeInteger.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNonPositiveInteger.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNonPositiveInteger.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNormalizedString.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNormalizedString.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInPositiveInteger.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInPositiveInteger.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInQName.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInQName.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInShort.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInShort.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInString.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInString.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInTime.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInTime.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInToken.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInToken.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedByte.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedByte.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedInt.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedInt.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedLong.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedLong.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedShort.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedShort.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeComplexContentRestrictingComplexType.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeComplexContentRestrictingComplexType.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeExtendingComplexType.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeExtendingComplexType.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeExtendingSimpleType.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeExtendingSimpleType.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeSimpleContentRestrictingComplexType.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeSimpleContentRestrictingComplexType.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithAbstract.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithAbstract.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithCDATA.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithCDATA.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithContent.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithContent.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithMixed.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithMixed.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOpenAttributes.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOpenAttributes.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOpenContent.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOpenContent.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOppositeProperty.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOppositeProperty.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOAliasName.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOAliasName.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOName.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOName.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOSequence.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOSequence.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithoutContent.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithoutContent.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithoutName.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithoutName.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/DefaultNamespace.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/DefaultNamespace.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementInAll.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementInAll.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementInChoice.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementInChoice.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSDOChangeSummaryType.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSDOChangeSummaryType.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithDefault.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithDefault.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithFixed.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithFixed.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDODataType.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDODataType.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOOppositePropertyType.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOOppositePropertyType.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOPropertyType.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOPropertyType.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOString.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOString.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementSubstitutionGroupBase.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementSubstitutionGroupBase.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithMaxOccurs.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithMaxOccurs.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithNillable.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithNillable.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithSDOAliasName.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithSDOAliasName.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithSDOName.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithSDOName.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/GlobalElementComplexType.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/GlobalElementComplexType.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/GlobalElementSimpleType.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/GlobalElementSimpleType.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Import.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Import.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ImportedSchema.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Include.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Include.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Interop.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Notation.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Notation.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Person.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SDOJavaPackage.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SDOJavaPackage.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithAbstract.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithAbstract.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithExtendedInstanceClass.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithExtendedInstanceClass.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithInstanceClass.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithInstanceClass.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithList.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithList.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithName.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithName.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithSDOName.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithSDOName.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithUnion.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithUnion.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithoutName.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithoutName.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/TargetNamespace.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/TargetNamespace.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/datagraph.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/sdoJava.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/sdoModel.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/test/java/org/apache/tuscany/sca/itest/generate/GenerateTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/config.png create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/config.svg create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/databinding.png create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/databinding.svg create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop.png create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop.svg create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/src/main/resources/generate/InteropDatabindingTestCase.java.vm create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/src/main/resources/generate/JAXBGreeter.wsdl.vm create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/src/main/resources/generate/SDOGreeter.wsdl.vm create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/src/main/resources/generate/generate.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/src/main/resources/generate/interopgreeter.composite.vm create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/jaxbgen/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/jaxbgen/src/main/resources/generate/generate.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/jaxbgen/src/main/resources/greeter.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/readme.html create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/sdogen/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/sdogen/src/main/resources/generate/generate.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/sdogen/src/main/resources/generate/greeter.composite.vm create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/main/java/calculator/AddService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/main/java/calculator/AddServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/main/java/calculator/AddServiceUpdateImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/main/java/calculator/CalculatorService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/main/java/calculator/CalculatorServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/main/java/calculator/DivideService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/main/java/calculator/DivideServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/main/java/calculator/MultiplyService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/main/java/calculator/MultiplyServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/main/java/calculator/SubtractService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/main/java/calculator/SubtractServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/main/resources/contributionA/Calculator.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/main/resources/contributionA/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/main/resources/contributionB/META-INF/sca-deployables/Calculator.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/main/resources/contributionBupdate/META-INF/sca-deployables/Calculator.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/main/resources/contributionC/META-INF/sca-deployables/Calculator.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/main/resources/contributionD/META-INF/sca-deployables/Calculator.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/main/resources/contributionDependent/Calculator.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/main/resources/contributionDependent/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/main/resources/contributionPrimary/Calculator.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/main/resources/contributionPrimary/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/domain/src/test/java/org/apache/tuscany/sca/itest/domain/DomainAPITestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding-ws/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding-ws/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockExchangeJaxB.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding-ws/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockTraderSDO.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding-ws/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockTraderSDOImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding-ws/src/main/java/org/apache/tuscany/sca/test/exceptions/sdohandgen/InvalidSymbolSDOException.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding-ws/src/main/java/org/apache/tuscany/sca/test/exceptions/sdohandgen/MarketClosedSDOException.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding-ws/src/main/java/org/apache/tuscany/sca/test/exceptions/sdohandgen/StockExceptionTest.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding-ws/src/main/resources/ExceptionTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding-ws/src/main/resources/intracomposite.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding-ws/src/main/resources/wsdl/StockExceptionTest.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding-ws/src/main/resources/xsd/StockExceptionTest.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding-ws/src/test/java/org/apache/tuscany/sca/test/exceptions/IntraCompositeTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockExceptionTestJAXB.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockExchangeJaxB.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockTraderSDO.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockTraderSDOImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding/src/main/java/org/apache/tuscany/sca/test/exceptions/sdohandgen/InvalidSymbolSDOException.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding/src/main/java/org/apache/tuscany/sca/test/exceptions/sdohandgen/MarketClosedSDOException.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding/src/main/java/org/apache/tuscany/sca/test/exceptions/sdohandgen/StockExceptionTest.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding/src/main/resources/ExceptionTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding/src/main/resources/intracomposite.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding/src/main/resources/wsdl.sdo/StockExceptionTest.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding/src/main/resources/wsdl/StockExceptionTest.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding/src/main/resources/xsd/StockExceptionTest.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-cross-binding/src/test/java/org/apache/tuscany/sca/test/exceptions/IntraCompositeTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-simple-ws/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-simple-ws/src/main/java/com/example/BusinessException.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-simple-ws/src/main/java/com/example/ExampleClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-simple-ws/src/main/java/com/example/ExampleClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-simple-ws/src/main/java/com/example/ExampleService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-simple-ws/src/main/java/com/example/ExampleServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-simple-ws/src/main/resources/example.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-simple-ws/src/main/resources/wsdl/ExampleService.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions-simple-ws/src/test/java/com/example/ExampleTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/Checked.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionHandler.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionRemoteThrower.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionThrower.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/UnChecked.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionHandlerImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionRemoteThrowerImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionThrowerImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions/src/main/resources/ExceptionTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/exceptions/src/test/java/org/apache/tuscany/sca/test/exceptions/ExceptionsTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/extended-api/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/extended-api/src/main/java/org/apache/tuscany/sca/test/extended/BasicService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/extended-api/src/main/java/org/apache/tuscany/sca/test/extended/MathService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/extended-api/src/main/java/org/apache/tuscany/sca/test/extended/impl/BasicServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/extended-api/src/main/java/org/apache/tuscany/sca/test/extended/impl/MathServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/extended-api/src/main/resources/BasicService.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/extended-api/src/main/resources/MathService.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/extended-api/src/test/java/org/apache/tuscany/sca/test/extended/ServiceLocateTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/interfaces/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalCallbackInterface.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteCallbackInterface.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/interfaces/src/main/resources/InterfacesTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InterfacesTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/java/org/apache/tuscany/sca/binding/jms/TestMessageProcessor.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/resources/defaults/client.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/resources/defaults/service.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/resources/dynamic/client.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/resources/exceptions/client.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/resources/exceptions/service.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/resources/external/client.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/resources/external/service.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/resources/jndi.properties create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/resources/oneway/OneWayClient.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/resources/oneway/OneWayService.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/resources/simple/client.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/resources/simple/mpclient.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/resources/simple/service.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/main/resources/simple/uriclient.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/DefaultsTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/DynamicReplyQTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExternalBrokerTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/MessageProcessorTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/OneWayTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/RPCTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/URIRPCTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/large-sdo-ws/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/large-sdo-ws/src/main/java/org/apache/tuscany/sca/itest/trninq/TrnInqClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/large-sdo-ws/src/main/java/org/apache/tuscany/sca/itest/trninq/TrnInqService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/large-sdo-ws/src/main/java/org/apache/tuscany/sca/itest/trninq/TrninqInterface.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/large-sdo-ws/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/large-sdo-ws/src/main/resources/trnInq.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/large-sdo-ws/src/main/resources/wsdl/IFX170_XSD.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/large-sdo-ws/src/main/resources/wsdl/trninq.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/large-sdo-ws/src/test/java/trninq/TrnInqServiceTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/oneway/build.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/oneway/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/OneWayClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/OneWayService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayServer.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/oneway/src/main/resources/OneWayContribution/META-INF/sca-deployables/oneWay.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/oneway/src/test/java/org/apache/tuscany/sca/itest/oneway/OneWayTestCaseFIXME.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/operation-overloading/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/OverloadASourceTarget.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadASource.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATarget.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/operation-overloading/src/main/resources/OperationOverload.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/operation-overloading/src/test/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/build-bundles.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/java/supplychain/OSGiBundleImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/java/supplychain/customer/Customer.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/java/supplychain/customer/OSGiCustomerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/java/supplychain/customer/OSGiCustomerImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/java/supplychain/retailer/OSGiRetailerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/java/supplychain/retailer/OSGiRetailerImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/java/supplychain/retailer/Retailer.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/java/supplychain/shipper/JavaShipperComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/java/supplychain/shipper/OSGiShipperComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/java/supplychain/shipper/OSGiShipperImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/java/supplychain/shipper/Shipper.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/java/supplychain/warehouse/OSGiWarehouseComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/java/supplychain/warehouse/OSGiWarehouseImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/java/supplychain/warehouse/Warehouse.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/resources/Customer2V2.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/resources/CustomerV2.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/resources/META-INF/customer-sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/resources/META-INF/retailer-sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/resources/META-INF/shipper-sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/resources/META-INF/supplychain-sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/resources/META-INF/warehouse-sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/resources/RetailerV2.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/resources/ShipperV2.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/resources/WarehouseV2.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/resources/osgi/Customer.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/resources/osgi/Customer2.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/resources/osgi/Retailer.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/resources/osgi/RetailerJar.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/resources/osgi/Shipper.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/resources/osgi/SupplyChain.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/resources/osgi/Warehouse.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes-v2/src/main/resources/supplychain.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/build-bundles.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/java/supplychain/OSGiBundleImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/java/supplychain/customer/Customer.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/java/supplychain/customer/OSGiCustomerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/java/supplychain/customer/OSGiCustomerImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/java/supplychain/retailer/OSGiRetailerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/java/supplychain/retailer/OSGiRetailerImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/java/supplychain/retailer/Retailer.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/java/supplychain/shipper/JavaShipperComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/java/supplychain/shipper/OSGiShipperComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/java/supplychain/shipper/OSGiShipperImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/java/supplychain/shipper/Shipper.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/java/supplychain/warehouse/OSGiWarehouseComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/java/supplychain/warehouse/OSGiWarehouseImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/java/supplychain/warehouse/Warehouse.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/resources/Customer2V1.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/resources/CustomerV1.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/resources/META-INF/customer-sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/resources/META-INF/retailer-sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/resources/META-INF/shipper-sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/resources/META-INF/supplychain-sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/resources/META-INF/warehouse-sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/resources/RetailerV1.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/resources/ShipperV1.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/resources/WarehouseV1.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/resources/osgi/Customer.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/resources/osgi/Customer2.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/resources/osgi/Retailer.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/resources/osgi/RetailerJar.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/resources/osgi/Shipper.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/resources/osgi/SupplyChain.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/resources/osgi/Warehouse.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-classes/src/main/resources/supplychain.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-test/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-test/src/main/java/org/apache/tuscany/sca/contribution/osgi/OSGiTestUtil.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-test/src/test/java/org/apache/tuscany/sca/contribution/osgi/test/MixedContributionTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-test/src/test/java/org/apache/tuscany/sca/contribution/osgi/test/NestedBundleTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-test/src/test/java/org/apache/tuscany/sca/contribution/osgi/test/OSGiResolverTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-test/src/test/java/org/apache/tuscany/sca/contribution/osgi/test/SCAResolverTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/contribution-test/src/test/resources/osgi/felix/felix.config.properties create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-contribution/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/build-bundles.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/callback/client/CallbackCallback.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/callback/client/CallbackClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/callback/client/JavaCallbackClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/callback/client/OSGiCallbackClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/callback/service/CallbackService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/callback/service/JavaCallbackServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/callback/service/OSGiCallbackServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/conversation/client/ConversationalCallback.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/conversation/client/ConversationalClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/conversation/client/ConversationalClientActivator.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/conversation/client/ConversationalClientServiceFactory.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/conversation/client/ConversationalClientStatefulImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/conversation/client/ConversationalClientStatelessImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/conversation/referenceclient/ConversationalReferenceClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/conversation/referenceclient/ConversationalReferenceClientActivator.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/conversation/referenceclient/ConversationalReferenceClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/conversation/service/ConversationalService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/conversation/service/ConversationalServiceActivator.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/conversation/service/ConversationalServiceFactory.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/conversation/service/ConversationalServiceStatefulImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/conversation/service/ConversationalServiceStatelessImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/helloworld/Greetings.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/helloworld/HelloWorld.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/helloworld/JavaGreetingsComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/helloworld/JavaHelloWorldComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/helloworld/OSGiGreetingsImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/helloworld/OSGiHelloWorldImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/helloworld/ws/HelloWorld.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/helloworld/ws/HelloWorldService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/stockquote/OSGiStockQuoteComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/stockquote/OSGiStockQuoteFactoryImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/stockquote/OSGiStockQuoteImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/stockquote/StockQuote.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/OSGiBundleImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/customer/Customer.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerFactoryImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerWithQueryComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerWithQueryImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiStatelessCustomerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiStatelessCustomerImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiVersionedCustomerImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerWithQueryComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiRetailerWithQueryImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiVersionedRetailerImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/retailer/OSGiVersionedRetailerServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/retailer/Retailer.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/retailer/RetailerQuery.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/shipper/JavaShipperComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiShipperComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiShipperFactoryImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiShipperImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiShipperServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiStatelessShipperComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiStatelessShipperServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiVersionedShipperImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/shipper/OSGiVersionedShipperServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/shipper/Shipper.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/JavaWarehouseWithQueryComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/Warehouse.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/WarehouseQuery.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/callback/CallbackClient.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/callback/CallbackService.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/callback/callback-test1.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/callback/callback-test2.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/callback/callback-test3.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/conversation/ConversationalClient.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/conversation/ConversationalReferenceClient.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/conversation/ConversationalService.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/conversation/conversation-test.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/factory/Customer.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/factory/Retailer.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/factory/Shipper.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/factory/Warehouse.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/factory/ds/Customer.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/factory/ds/Retailer.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/factory/ds/Shipper.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/factory/ds/Warehouse.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/factory/ds/factory-ds-test.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/factory/factory-test.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/helloworld/Greetings.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/helloworld/HelloWorld.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/interfaces/Customer.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/interfaces/Retailer.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/interfaces/Shipper.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/interfaces/Warehouse.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/interfaces/ds/Customer.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/interfaces/ds/Retailer.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/interfaces/ds/Shipper.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/interfaces/ds/Warehouse.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/interfaces/ds/interfaces-ds-test.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/interfaces/interfaces-test.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/callback/CallbackClient.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/callback/CallbackService.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/conversation/ConversationalClient.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/conversation/ConversationalReferenceClient.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/conversation/ConversationalService.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/factory/Customer.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/factory/Retailer.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/factory/Shipper.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Customer.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Customer.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Retailer.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Retailer1.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Retailer2.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Shipper.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Shipper1.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Shipper2.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Warehouse.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/factory/ds/Warehouse.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/interfaces/Customer.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/interfaces/Retailer.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/interfaces/Shipper.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Customer.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Customer.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Retailer.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Retailer.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Shipper.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/interfaces/ds/Shipper.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/passbyref/Greetings.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/properties/ManagedStockQuoteFactory.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/properties/StockQuote.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/properties/StockQuoteFactory.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/properties/ds/StockQuote.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/properties/ds/StockQuote.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/properties/ds/StockQuoteFactory.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/properties/ds/StockQuoteFactory.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/services/Customer.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/services/Retailer.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/services/Shipper.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/services/Warehouse.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/services/ds/Customer.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/services/ds/Customer.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/services/ds/Retailer.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/services/ds/Retailer1.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/services/ds/Retailer2.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/services/ds/Shipper.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/services/ds/Shipper1.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/services/ds/Shipper2.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/services/ds/Warehouse.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/services/ds/Warehouse1.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/services/ds/Warehouse2.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/Customer1.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/Customer2.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/Retailer1.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/Retailer2.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/Shipper1.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/Shipper2.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/Warehouse1.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/Warehouse2.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/Customer1.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/Customer2.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/CustomerV1.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/CustomerV2.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer1.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer1V1.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer1V2.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer2.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer2V1.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/Retailer2V2.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper1.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper1V1.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper1V2.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper2.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper2V1.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/Shipper2V2.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse1.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse1V1.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse1V2.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse2.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse2V1.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/version/ds/Warehouse2V2.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/wiring/Customer.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/wiring/Retailer.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/wiring/Shipper.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/wiring/Warehouse.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Customer.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Customer.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Retailer.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Retailer1.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Retailer2.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Shipper.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Shipper1.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Shipper2.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Warehouse.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Warehouse1.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/wiring/ds/Warehouse2.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/osgi/ws/HelloWorld.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/passbyref/Greetings.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/passbyref/passbyref-test.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/properties/StockQuote.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/properties/StockQuoteFactory.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/properties/ds/StockQuote.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/properties/ds/StockQuoteFactory.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/properties/ds/properties-ds-test.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/properties/ds/properties2-ds-test.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/properties/properties-test.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/properties/properties2-test.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/services/Customer.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/services/Retailer.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/services/Shipper.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/services/Warehouse.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/services/ds/Customer.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/services/ds/Retailer.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/services/ds/Shipper.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/services/ds/Warehouse.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/services/ds/services-ds-test.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/services/services-test.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/stockquote/StockQuote.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/version/Customer1.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/version/Customer2.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/version/Retailer1.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/version/Retailer2.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/version/Shipper1.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/version/Shipper2.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/version/Warehouse1.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/version/Warehouse2.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/version/ds/Customer1.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/version/ds/Customer2.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/version/ds/Retailer1.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/version/ds/Retailer2.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/version/ds/Shipper1.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/version/ds/Shipper2.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/version/ds/Warehouse1.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/version/ds/Warehouse2.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/version/ds/version-ds-test.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/version/version-test.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/wiring/Customer.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/wiring/Retailer.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/wiring/Shipper.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/wiring/Warehouse.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/wiring/ds/Customer.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/wiring/ds/Retailer.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/wiring/ds/Shipper.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/wiring/ds/Warehouse.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/wiring/ds/wiring-ds-test1.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/wiring/ds/wiring-ds-test2.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/wiring/wiring-test1.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/wiring/wiring-test2.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/ws/HelloWorld.componentType create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/ws/helloworld.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/main/resources/ws/ws-helloworld.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/callback/Callback1TestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/callback/Callback2TestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/callback/Callback3TestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/callback/CallbackTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/conversation/ConversationTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/helloworld/passbyref/PassByRefTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/helloworld/ws/HelloWorldTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/supplychain/SupplyChainTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/supplychain/VersionedSupplyChainTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/supplychain/factory/DSFactoryTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/supplychain/factory/FactoryTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/supplychain/interfaces/DSInterfacesTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/supplychain/interfaces/InterfacesTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/supplychain/properties/DSProperties2TestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/supplychain/properties/DSPropertiesTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/supplychain/properties/Properties2TestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/supplychain/properties/PropertiesTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/supplychain/services/DSServicesTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/supplychain/services/ServicesTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/supplychain/version/DSVersionTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/supplychain/version/VersionTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/supplychain/wiring/DSWiring1TestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/supplychain/wiring/DSWiring2TestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/supplychain/wiring/Wiring1TestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/supplychain/wiring/Wiring2TestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/test/OSGiTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/java/util/OSGiTestUtil.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-implementation/src/test/resources/osgi/felix/felix.config.properties create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/osgi-tuscany-test/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/osgi-tuscany-test/src/main/java/org/apache/tuscany/sca/test/osgi/runtime/impl/FelixTestRuntime.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/osgi-tuscany-test/src/main/java/org/apache/tuscany/sca/test/osgi/runtime/impl/OSGiTestRuntime.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/osgi-tuscany-test/src/main/java/org/apache/tuscany/sca/test/util/OSGiRuntimeLoader.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/osgi-tuscany-test/src/main/java/org/apache/tuscany/sca/test/util/TuscanyLoader.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/osgi-tuscany-test/src/test/java/org/apache/tuscany/sca/test/osgi/harness/OSGiTuscanyTestHarness.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/osgi-tuscany-test/src/test/java/org/apache/tuscany/sca/test/osgi/harness/TestBundleActivator.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/osgi-tuscany-test/src/test/java/org/apache/tuscany/sca/test/osgi/tuscany/CalculatorImplementationPoliciesTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/osgi-tuscany-test/src/test/java/org/apache/tuscany/sca/test/osgi/tuscany/CalculatorRmiTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/osgi-tuscany-test/src/test/java/org/apache/tuscany/sca/test/osgi/tuscany/CalculatorScriptTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/osgi-tuscany-test/src/test/java/org/apache/tuscany/sca/test/osgi/tuscany/CallbackWsClientTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/osgi-tuscany-test/src/test/java/org/apache/tuscany/sca/test/osgi/tuscany/CallbackWsServiceTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/osgi-tuscany-test/src/test/java/org/apache/tuscany/sca/test/osgi/tuscany/HelloworldWsServiceJmsTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/osgi-tuscany-test/src/test/java/org/apache/tuscany/sca/test/osgi/tuscany/HelloworldWsServiceSecureTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/osgi-tuscany-test/src/test/java/org/apache/tuscany/sca/test/osgi/tuscany/HelloworldWsServiceTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/osgi-tuscany-test/src/test/java/org/apache/tuscany/sca/test/osgi/tuscany/OSGiSupplyChainTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/osgi-tuscany-test/src/test/java/org/apache/tuscany/sca/test/osgi/tuscany/OSGiTuscanyRuntimeTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/osgi-tuscany-test/src/test/java/org/apache/tuscany/sca/test/osgi/tuscany/TuscanySampleExtensionsTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/osgi-tuscany-test/src/test/java/org/apache/tuscany/sca/test/osgi/tuscany/TuscanySamplesUsingOldDomainTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/osgi-tuscany-test/src/test/resources/META-INF/MANIFEST.MF create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/osgi-tuscany-test/src/test/resources/felix/felix.config.properties create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/sca-api/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/build-bundles.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/client/SupplyChainClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/customer/Customer.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/retailer/Retailer.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/shipper/JavaShipperComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/shipper/Shipper.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/java/supplychain/warehouse/Warehouse.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/META-INF/SupplyChain.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/META-INF/SupplyChainClient.mf create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/supplychain/supplychain.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/supplychain/ws/Customer.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/test-bundles/src/main/resources/supplychain/ws/supplychain.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/tuscany-3rdparty/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/tuscany-extensions/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/tuscany-runtime/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/osgi-tuscany/tuscany-spi/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/policy/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/policy/src/main/java/calculator/AddService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/policy/src/main/java/calculator/AddServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/policy/src/main/java/calculator/CalculatorClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/policy/src/main/java/calculator/CalculatorService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/policy/src/main/java/calculator/CalculatorServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/policy/src/main/java/calculator/DivideService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/policy/src/main/java/calculator/DivideServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/policy/src/main/java/calculator/MultiplyService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/policy/src/main/java/calculator/MultiplyServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/policy/src/main/java/calculator/PolicyQNames.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/policy/src/main/java/calculator/SubtractService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/policy/src/main/java/calculator/SubtractServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/policy/src/main/java/calculator/policy/TestImplPolicyHandler.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/policy/src/main/java/calculator/policy/TestRefPolicyHandler.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/policy/src/main/java/calculator/policy/TestSvcPolicyHandler.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/policy/src/main/resources/Calculator.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/policy/src/main/resources/definitions.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/policy/src/test/java/org/apache/tuscany/sca/itest/PoliciedCalculatorTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/java/mysca/test/myservice/impl/MyService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/java/mysca/test/myservice/impl/MyServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/java/mysca/test/myservice/impl/MyTotalServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Bar.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo1.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo2.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo3.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/resources/ConstructorPropertyInjection.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/resources/Outer.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/resources/OuterPropertyTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/resources/PropertyTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/resources/customer.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/resources/fileProperty.txt create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/resources/manyValuesFileProperty.txt create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/main/resources/mySimpleService.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/test/java/org/apache/tuscany/sca/itest/MyTotalServiceTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/test/java/org/apache/tuscany/sca/itest/OuterPropertyTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/properties/src/test/java/org/apache/tuscany/sca/itest/cdi/ConstructorPropertyInjectionTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/composite/CompositeClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/composite/Source.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/composite/SourceCallback.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/composite/SourceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/composite/Target.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/composite/TargetImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/foo/A.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/foo/B.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/foo/I.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/sample/ComponentAImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/sample/ComponentCImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/sample/ComponentEImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/sample/ComponentFImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/sample/Service1.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/test/Aggregator.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/test/AggregatorImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/test/InnerSourceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/test/OuterSourceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/test/Source.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/test1/composite/Target.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/test1/composite/TargetOne.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/java/test1/composite/TargetTwo.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/resources/AComposite.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/resources/BComposite.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/resources/CComposite.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/resources/Composite1.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/resources/Composite2.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/resources/Composite3.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/resources/Inner.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/resources/InnerComposite.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/resources/InnerComposite2.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/resources/Outer.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/resources/OuterComposite.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/resources/foo/foo.png create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/resources/foo/o1.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/resources/foo/o2.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/resources/foo/o3.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/resources/foo/o4.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/resources/test1/InnerComposite.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/main/resources/test1/OuterComposite.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/test/java/composite/CompositeTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/test/java/composite/LocateServiceEmbeddedSCADomainTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/test/java/composite/LocateServiceSCADomainTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/test/java/foo/O2TestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/test/java/foo/O4TestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/test/java/sample/C.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/test/java/sample/CImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/test/java/sample/NestedTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/test/java/sample/RecursiveCompositeTestCaseFIXME.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/test/java/sample/X.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/test/java/sample/XImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/test/java/sample/Y.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/test/java/sample/YImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/test/java/test/InnerTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/test/java/test/OuterTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/recursive/src/test/java/test1/composite/CompositeClientTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/references/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/references/src/main/resources/AutoWiredReferencesTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/references/src/main/resources/InnerReferencesTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/AutoWiredReferenceTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/InnerReferenceTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/scopes/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/CompositeScopeStateVerifierImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/RequestScopeStateVerifierImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/StateVerifier.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/scopes/src/main/resources/scopes.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/scopes/src/test/java/org/apache/tuscany/sca/test/ScopeTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/services/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/D1Component.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/services/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/services/src/main/resources/ServicesTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/services/src/test/java/org/apache/tuscany/sca/itest/services/ServicesTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/spring/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/spring/src/main/resources/META-INF/sca/SpringDelegationHelloWorld-context.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/spring/src/main/resources/META-INF/sca/SpringHelloWorld-context.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorld.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringHelloWorld.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractHelloWorldTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorld.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorldProxy.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorldTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringHelloWorldTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldBean.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldDelegatorBean.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/transaction/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/transaction/src/main/java/org/apache/tuscany/sca/itest/transaction/AccountNotFoundException.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/transaction/src/main/java/org/apache/tuscany/sca/itest/transaction/AccountService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/transaction/src/main/java/org/apache/tuscany/sca/itest/transaction/AccountServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/transaction/src/main/java/org/apache/tuscany/sca/itest/transaction/CheckingAccountServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/transaction/src/main/java/org/apache/tuscany/sca/itest/transaction/OverDraftException.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/transaction/src/main/java/org/apache/tuscany/sca/itest/transaction/SavingsAccountServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/transaction/src/main/java/org/apache/tuscany/sca/itest/transaction/TransferService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/transaction/src/main/java/org/apache/tuscany/sca/itest/transaction/TransferServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/transaction/src/main/resources/accounts.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/transaction/src/main/resources/definitions.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/transaction/src/main/resources/log4j.properties create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/transaction/src/test/java/org/apache/tuscany/sca/itest/transaction/ConcurrentXAResourceTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/transaction/src/test/java/org/apache/tuscany/sca/itest/transaction/TransactionTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wasAdmin.py create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wires/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wires/src/main/resources/WireTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wires/src/test/java/org/apache/tuscany/sca/itest/WireTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/ws-void-args-return/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/ws-void-args-return/src/main/java/voidtest/Bean.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/ws-void-args-return/src/main/java/voidtest/HelloWorldImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/ws-void-args-return/src/main/java/voidtest/HelloWorldService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/ws-void-args-return/src/main/java/voidtest/TestClient.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/ws-void-args-return/src/main/java/voidtest/TestClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/ws-void-args-return/src/main/resources/voidtest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/ws-void-args-return/src/test/java/voidtest/VoidArgsReturnTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl-multiple/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl-multiple/src/main/java/helloworld/HelloWorldCallback.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl-multiple/src/main/java/helloworld/HelloWorldClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl-multiple/src/main/java/helloworld/HelloWorldService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl-multiple/src/main/java/helloworld/HelloWorldServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl-multiple/src/main/resources/auto-wsdl.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl-multiple/src/main/resources/manual-wsdl.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl-multiple/src/main/resources/wsdl/helloworld.HelloWorldCallback.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl-multiple/src/main/resources/wsdl/helloworld.HelloWorldService.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl-multiple/src/test/java/org/apache/tuscany/sca/itest/AutoWSDLTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl-multiple/src/test/java/org/apache/tuscany/sca/itest/ManualWSDLTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/src/main/java/bigbank/account/services/accountdata/AccountDataService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/src/main/java/bigbank/account/services/accountdata/AccountDataServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/src/main/java/bigbank/account/services/accountdata/AccountServiceClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/src/main/java/bigbank/account/services/accountdata/Component2aImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/src/main/java/bigbank/account/services/accountdata/Component2bImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/src/main/java/bigbank/account/services/accountdata/Component3aImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/src/main/java/bigbank/account/services/accountdata/Component3bImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/src/main/java/bigbank/account/services/accountdata/CustomerIdService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/src/main/java/helloworld/HelloWorldImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/src/main/java/helloworld/HelloWorldService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/src/main/java/helloworld/HelloWorldServiceComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/src/main/java/org/apache/tuscany/sca/itest/Component2aImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/src/main/java/org/apache/tuscany/sca/itest/Component2bImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/src/main/java/org/apache/tuscany/sca/itest/Component3aImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/src/main/java/org/apache/tuscany/sca/itest/Component3bImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/src/main/resources/SDOWSDLTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/src/main/resources/WSDLTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/src/main/resources/wsdl/AccountService.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/src/main/resources/wsdl/helloworld.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/src/test/java/org/apache/tuscany/sca/itest/SDOWSDLTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl/src/test/java/org/apache/tuscany/sca/itest/WSDLTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl2java/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl2java/src/test/resources/AccountService.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl2java/src/test/resources/EchoService.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl2java/src/test/resources/EchoService.xsd create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdl2java/src/test/resources/StockExceptionTest.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/src/main/java/bigbank/account/services/accountdata/AccountDataService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/src/main/java/bigbank/account/services/accountdata/AccountDataServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/src/main/java/bigbank/account/services/accountdata/AccountServiceClientImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/src/main/java/bigbank/account/services/accountdata/Component2aImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/src/main/java/bigbank/account/services/accountdata/Component2bImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/src/main/java/bigbank/account/services/accountdata/Component3aImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/src/main/java/bigbank/account/services/accountdata/Component3bImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/src/main/java/bigbank/account/services/accountdata/CustomerIdService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/src/main/java/helloworld/HelloWorldImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/src/main/java/helloworld/HelloWorldService.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/src/main/java/helloworld/HelloWorldServiceComponent.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/src/main/java/org/apache/tuscany/sca/itest/Component2aImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/src/main/java/org/apache/tuscany/sca/itest/Component2bImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/src/main/java/org/apache/tuscany/sca/itest/Component3aImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/src/main/java/org/apache/tuscany/sca/itest/Component3bImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/src/main/resources/SDOWSDLTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/src/main/resources/WSDLTest.composite create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/src/main/resources/wsdl/AccountService.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/src/main/resources/wsdl/helloworld.wsdl create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/src/test/java/org/apache/tuscany/sca/itest/SDOWSDLTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-1.2.1/itest/wsdlless/src/test/java/org/apache/tuscany/sca/itest/WSDLTestCase.java (limited to 'sca-java-1.x/branches/sca-java-1.2.1/itest') diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/admin/README b/sca-java-1.x/branches/sca-java-1.2.1/itest/admin/README new file mode 100644 index 0000000000..b89796f6e1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/admin/README @@ -0,0 +1,28 @@ +This is a simple test compiled to test simple features of SCA + +There are interfaces to different services that have been included + +1. MyListService +2. MyListServiceByYear +3. MyService +4. MyServiceByDate +5. MyTotalservice + +The service that has been used in the tests primarily is MyService/MyTotalService. +in the test cases. + +There are three test cases and three composites (MySimppleService,Iteration1,Iteration3). + +1. MySimpleServiceTestCase - Checks if the components in MySimpleService.composite are initialized properly. + It tries to call simple functions implemented in MySimpleServiceImpl. + +2. MyTotalServiceTestCase - Initializes the components in the Iteration3Composite.composite file. + tries to call simple functions implemented in MyTotalServiceImpl. + +3. MySimpleServiceInRecursiveTestCase - Initializes the components in the Iteration1Composite.composite file. + It initializes its components using implementation:composite tag in the + composite file which points to MySimpleService.composite. + The test case recursively calls functions initialized in MySimpleService.composite. + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/admin/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/admin/pom.xml new file mode 100644 index 0000000000..10588e3595 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/admin/pom.xml @@ -0,0 +1,60 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-admin + Apache Tuscany Admin Tests + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-core-databinding + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-databinding-sdo + 1.2.1-incubating-SNAPSHOT + compile + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListService.java new file mode 100644 index 0000000000..d307e0f9a2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListService.java @@ -0,0 +1,27 @@ +/* + * 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 org.apache.tuscany.sca.itest.admin; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface MyListService { + String[] getHolidays(); + String getYear(); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListServiceByYear.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListServiceByYear.java new file mode 100644 index 0000000000..143f860644 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListServiceByYear.java @@ -0,0 +1,26 @@ +/* + * 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 org.apache.tuscany.sca.itest.admin; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface MyListServiceByYear { + String[] getHolidays(int year); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListServiceImpl.java new file mode 100644 index 0000000000..80f319f7c1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListServiceImpl.java @@ -0,0 +1,87 @@ +/* + * 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 org.apache.tuscany.sca.itest.admin; + + +import java.util.List; + +import org.osoa.sca.annotations.Property; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import org.apache.tuscany.sca.itest.admin.MyListService; +import org.apache.tuscany.sca.itest.admin.MyListServiceByYear; + +@Service(interfaces={MyListService.class,MyListServiceByYear.class}) + +public class MyListServiceImpl implements MyListService,MyListServiceByYear +{ + + // This is multiplicity=1:n + @Reference(name="myListServiceList",required=true) + public List myListServicesList; + + // This is multiplicity=0:n + @Reference(name="myListServiceArray",required=false) + public MyListService[] myListServicesArray; + + @Property(name="serviceYear") + protected String year = "2006"; + + public String[] getHolidays() + { + return getHolidays(new Integer(year).intValue()); + } + + public String[] getHolidays(int year) + { + MyListService myService; + if (myListServicesList!=null) + { + for (int i=0; i=0 && index + + + + Raleigh + 2008 + + Durham + 2009 + + + + + + + + Durham + 2009 + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/test/resources/Iteration3Composite.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/test/resources/Iteration3Composite.composite new file mode 100644 index 0000000000..dd06d030d6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/test/resources/Iteration3Composite.composite @@ -0,0 +1,68 @@ + + + + + Raleigh + 2008 + + + + + + + + CARY + 2007 + + + + + + + + + + + + + + + + + + + + + Durham + 2009 + + + + + + + + Durham + 2009 + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/test/resources/MySimpleService.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/test/resources/MySimpleService.composite new file mode 100644 index 0000000000..a1f8abb8da --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/admin/src/test/resources/MySimpleService.composite @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + Raleigh + 2008 + + + + + + + + CARY + 2007 + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/pom.xml new file mode 100644 index 0000000000..bf08786988 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/pom.xml @@ -0,0 +1,210 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + itest-bpel + 1.2.1-incubating-SNAPSHOT + ../../pom.xml + + itest-bpel-helloworld-reference + Apache Tuscany SCA HelloWorld Reference BPEL iTest + + + + apache.incubator + http://people.apache.org/repo/m2-incubating-repository + + + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-tomcat + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-bpel + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.ode + ode-dao-jpa-ojpa-derby + 1.1 + zip + + + + org.apache.tuscany.sdo + tuscany-sdo-impl + 1.0-incubating-SNAPSHOT + + + + xerces + xercesImpl + 2.8.0 + + + + junit + junit + 4.2 + test + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-surefire-plugin + + 2.3.1 + + false + false + true + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + generate-sources + + unpack + + + + + org.apache.ode + ode-dao-jpa-ojpa-derby + 1.1 + zip + true + ${project.build.directory}/test-classes/ + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsService.java new file mode 100644 index 0000000000..532b84bd22 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsService.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 greetings; + +import org.osoa.sca.annotations.Remotable; + +/** + * This is the business interface of the HelloWorld greetings service. + */ +@Remotable +public interface GreetingsService { + + public String getGreetings(String name); +} + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsServiceImpl.java new file mode 100644 index 0000000000..86d7f245e8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsServiceImpl.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 greetings; + +import org.osoa.sca.annotations.Service; + +/** + * This class implements the HelloWorld service. + */ +@Service(GreetingsService.class) +public class GreetingsServiceImpl implements GreetingsService { + + public String getGreetings(String name) { + return "Hello " + name; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsTestCase.java new file mode 100644 index 0000000000..182d7c2c55 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsTestCase.java @@ -0,0 +1,63 @@ +/* + * 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 greetings; + +import java.io.IOException; +import java.net.Socket; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +/** + * Tests the Greetings service + * + * @version $Rev$ $Date$ + */ +public class GreetingsTestCase extends TestCase { + + private SCADomain scaDomain; + GreetingsService greetingsService = null; + + /** + * @throws java.lang.Exception + */ + @Override + protected void setUp() throws Exception { + scaDomain = SCADomain.newInstance("greetings/greetings.composite"); + greetingsService = scaDomain.getService(GreetingsService.class, "GreetingsServiceComponent"); + } + + /** + * @throws java.lang.Exception + */ + @Override + protected void tearDown() throws Exception { + scaDomain.close(); + } + + public void testPing() throws IOException { + new Socket("127.0.0.1", 8085); + } + public void testInvoke() { + String response = greetingsService.getGreetings("Luciano"); + assertEquals("Hello Luciano", response); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsTestServer.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsTestServer.java new file mode 100644 index 0000000000..86e97361df --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsTestServer.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 greetings; + +import java.io.IOException; +import java.net.Socket; + +import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Starts up the SCA runtime which starts listening for service requests + */ +public class GreetingsTestServer { + + private SCADomain scaDomain; + + @Before + public void startServer() throws Exception { + try { + scaDomain = SCADomain.newInstance("greetings/greetings.composite"); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Test + public void testPing() throws IOException { + new Socket("127.0.0.1", 8085); + } + + @After + public void stopServer() throws Exception { + scaDomain.close(); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldService.java new file mode 100644 index 0000000000..672dbdc0b5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldService.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; + +/** + * The interface for the helloworld service + */ +@Remotable +public interface HelloWorldService { + public String hello(String name); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldServiceImpl.java new file mode 100644 index 0000000000..d7ebd5cbb8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldServiceImpl.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 helloworld; + +import greetings.GreetingsService; + +import org.osoa.sca.annotations.Reference; + +/** + * The HelloWorld service implementation + */ +public class HelloWorldServiceImpl implements HelloWorldService { + + protected GreetingsService greetingsService; + + public GreetingsService getGreetingsService() { + System.out.println("Got Injected greetingsService"); + return greetingsService; + } + + @Reference + public void setGreetingsService(GreetingsService greetingsService) { + System.out.println("Injected greetingsService"); + this.greetingsService = greetingsService; + } + + public String hello(String name) { + System.out.println("Calling greeting services getGreetings"); + return greetingsService.getGreetings(name); + } +} \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldTestCase.java new file mode 100644 index 0000000000..900f59ca9c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldTestCase.java @@ -0,0 +1,63 @@ +/* + * 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 greetings.GreetingsTestServer; +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.apache.tuscany.sca.host.embedded.SCATestCaseRunner; + +/** + * Tests the BPEL Helloworld Service + * + * @version $Rev$ $Date$ + */ +public class HelloWorldTestCase extends TestCase { + private SCADomain scaDomain; + + //private SCATestCaseRunner server; + + /** + * @throws java.lang.Exception + */ + @Override + protected void setUp() throws Exception { + scaDomain = SCADomain.newInstance("helloworld/helloworld.composite"); + + //server = new SCATestCaseRunner(GreetingsTestServer.class); + //server.before(); + } + + /** + * @throws java.lang.Exception + */ + @Override + protected void tearDown() throws Exception { + //server.after(); + scaDomain.close(); + } + + public void testServiceInvocation() { + HelloWorldService bpelService = scaDomain.getService(HelloWorldService.class, "HelloWorldService"); + String response = bpelService.hello("Luciano"); + assertEquals("Hello Luciano", response); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/greetings/greetings.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/greetings/greetings.composite new file mode 100644 index 0000000000..fde89667cd --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/greetings/greetings.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/greetings/greetings.wsdl b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/greetings/greetings.wsdl new file mode 100644 index 0000000000..e768707ccd --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/greetings/greetings.wsdl @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/helloworld/deploy.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/helloworld/deploy.xml new file mode 100644 index 0000000000..f6f9bbfc2e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/helloworld/deploy.xml @@ -0,0 +1,34 @@ + + + + + + true + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.bpel b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.bpel new file mode 100644 index 0000000000..d9b91ed8ba --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.bpel @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + $helloMessage.TestPart + $greetingsRequest.parameters + + + + + + + + $greetingsResponse.parameters + $helloResponse.TestPart + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.componentType b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.componentType new file mode 100644 index 0000000000..de765c986f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.componentType @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.composite new file mode 100644 index 0000000000..7207398eba --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.composite @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.wsdl b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.wsdl new file mode 100644 index 0000000000..0f51b96b27 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.wsdl @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/log4j.properties b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/log4j.properties new file mode 100644 index 0000000000..6c7c7e7ab1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld-reference/src/test/resources/log4j.properties @@ -0,0 +1,35 @@ +# +# 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. +# + +# Set root logger level to WARN and its only appender to CONSOLE +log4j.rootLogger=OFF, CONSOLE + +# log4j properties to work with commandline tools. +log4j.category.org.mortbay=OFF +log4j.category.org.hibernate.type=OFF +log4j.category.org.objectweb=OFF +log4j.category.org.apache.ode.axis2=OFF +log4j.category.org.apache.ode.bpel.engine=OFF +log4j.category.org.apache.ode.daohib.bpel.CorrelatorDaoImpl=OFF +log4j.category.org.apache.ode.bpel.epr=OFF +log4j.category.org.apache.tuscany.sca.implementation.bpel=DEBUG +log4j.category.org.apache.tuscany.sca.implementation.bpel.ode=DEBUG + +# Console appender +log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender +log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout +log4j.appender.CONSOLE.layout.ConversionPattern=%p - %C{1}.%M(%L) | %m%n diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/pom.xml new file mode 100644 index 0000000000..7ca5b77575 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/pom.xml @@ -0,0 +1,162 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + itest-bpel + 1.2.1-incubating-SNAPSHOT + ../../pom.xml + + itest-bpel-helloworld + Apache Tuscany SCA HelloWorld BPEL iTest + + + + apache.incubator + http://people.apache.org/repo/m2-incubating-repository + + + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-bpel + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sdo + tuscany-sdo-impl + 1.0-incubating + + + + xerces + xercesImpl + 2.8.0 + + + + junit + junit + 4.2 + test + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-surefire-plugin + + 2.3.1 + + false + false + true + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + test-compile + + unpack + + + + + org.apache.ode + ode-dao-jpa-ojpa-derby + 1.1 + zip + true + ${project.build.directory}/test-classes/ + + + + + + + + org.apache.tuscany.sdo + tuscany-sdo-plugin + 1.0-incubating + + + generate-bpel-helloworld + generate-sources + + ${basedir}/src/test/resources/helloworld/helloworld.wsdl + ${basedir}/target/wsdl2java-source + HelloWorld + true + true + true + + + generate + + + + + + org.apache.tuscany.sca + tuscany-maven-wsdl2java + 1.2.1-incubating-SNAPSHOT + + + + + + ${basedir}/src/test/resources/helloworld/helloworld.wsdl + + + + + generate + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/java/helloworld/HelloWorld.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/java/helloworld/HelloWorld.java new file mode 100644 index 0000000000..ffdbc50a22 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/java/helloworld/HelloWorld.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 helloworld; + +import org.apache.tuscany.implementation.bpel.example.helloworld.HelloPortType; +import org.osoa.sca.annotations.Reference; + +/** + * @version $Rev$ $Date$ + */ +public class HelloWorld { + private HelloPortType helloService; + + public HelloWorld() { + super(); + } + + @Reference + public void setHelloService(HelloPortType helloService){ + this.helloService = helloService; + } + + public String hello(String hello) throws java.rmi.RemoteException { + System.out.println(">>> Invoking helloService.hello with : " + hello); + return this.helloService.hello(hello); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/java/helloworld/HelloWorldTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/java/helloworld/HelloWorldTestCase.java new file mode 100644 index 0000000000..76fcd35c2d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/java/helloworld/HelloWorldTestCase.java @@ -0,0 +1,63 @@ +/* + * 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.implementation.bpel.example.helloworld.HelloPortType; +import org.apache.tuscany.sca.host.embedded.SCADomain; + +/** + * Tests the BPEL Helloworld Service + * + * @version $Rev$ $Date$ + */ +public class HelloWorldTestCase extends TestCase { + + private SCADomain scaDomain; + + /** + * @throws java.lang.Exception + */ + @Override + protected void setUp() throws Exception { + scaDomain = SCADomain.newInstance("helloworld/helloworld.composite"); + } + + /** + * @throws java.lang.Exception + */ + @Override + protected void tearDown() throws Exception { + scaDomain.close(); + } + + public void testServiceInvocation() throws Exception { + HelloPortType bpelService = scaDomain.getService(HelloPortType.class, "BPELHelloWorldService"); + String response = bpelService.hello("Hello"); + assertEquals("Hello World", response); + } + + public void testReferenceInvocation() throws Exception { + HelloWorld bpelService = scaDomain.getService(HelloWorld.class, "BPELHelloWorld"); + String response = bpelService.hello("Hello"); + assertEquals("Hello World", response); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/helloworld/deploy.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/helloworld/deploy.xml new file mode 100644 index 0000000000..571aa37d58 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/helloworld/deploy.xml @@ -0,0 +1,30 @@ + + + + + + true + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.bpel b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.bpel new file mode 100644 index 0000000000..8cf91adc2c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.bpel @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + concat($tmpVar,' World') + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.componentType b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.componentType new file mode 100644 index 0000000000..121064a475 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.componentType @@ -0,0 +1,30 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.composite new file mode 100644 index 0000000000..f6b12fb14b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.wsdl b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.wsdl new file mode 100644 index 0000000000..610bda3cc4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.wsdl @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/log4j.properties b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/log4j.properties new file mode 100644 index 0000000000..d0b3c3aa5a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/helloworld/src/test/resources/log4j.properties @@ -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. +# + +# Set root logger level to WARN and its only appender to CONSOLE +log4j.rootLogger=OFF, CONSOLE + +# log4j properties to work with commandline tools. +log4j.category.org.mortbay=OFF +log4j.category.org.hibernate.type=OFF +log4j.category.org.objectweb=OFF +log4j.category.org.apache.ode.axis2=OFF +log4j.category.org.apache.ode.bpel.engine=OFF +log4j.category.org.apache.ode.daohib.bpel.CorrelatorDaoImpl=OFF +log4j.category.org.apache.ode.bpel.epr=OFF + +# Console appender +log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender +log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout +log4j.appender.CONSOLE.layout.ConversionPattern=%p - %C{1}.%M(%L) | %m%n diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/pom.xml new file mode 100644 index 0000000000..94322a3638 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/pom.xml @@ -0,0 +1,195 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + itest-bpel + 1.2.1-incubating-SNAPSHOT + ../../pom.xml + + itest-bpel-ping-pong + Apache Tuscany SCA HelloWorld Reference BPEL iTest + + + + apache.incubator + http://people.apache.org/repo/m2-incubating-repository + + + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-tomcat + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-bpel + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sdo + tuscany-sdo-impl + 1.0-incubating-SNAPSHOT + + + + xerces + xercesImpl + 2.8.0 + + + + junit + junit + 4.2 + test + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-surefire-plugin + + 2.3.1 + + false + false + true + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + test-compile + + unpack + + + + + org.apache.ode + ode-dao-jpa-ojpa-derby + 1.1 + zip + true + ${project.build.directory}/test-classes/ + + + + + + + + org.apache.tuscany.sdo + tuscany-sdo-plugin + 1.0-incubating-SNAPSHOT + + + generate-bpel-ping + generate-sources + + ${basedir}/src/test/resources/ping/ping.wsdl + ${basedir}/target/wsdl2java-source + Ping + true + true + true + + + generate + + + + + generate-bpel-pong + generate-sources + + ${basedir}/src/test/resources/pong/pong.wsdl + ${basedir}/target/wsdl2java-source + Pong + true + true + true + + + generate + + + + + + + org.apache.tuscany.sca + tuscany-maven-wsdl2java + 1.2.1-incubating-SNAPSHOT + + + + + + ${basedir}/src/test/resources/ping/ping.wsdl + + + ${basedir}/src/test/resources/pong/pong.wsdl + + + + + generate + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/java/pingpong/BPELPingPongTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/java/pingpong/BPELPingPongTestCase.java new file mode 100644 index 0000000000..1ab2ba3d5d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/java/pingpong/BPELPingPongTestCase.java @@ -0,0 +1,60 @@ +/* + * 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 org.apache.tuscany.sca.implementation.bpel; + +import junit.framework.TestCase; + +import org.apache.tuscany.implementation.bpel.example.ping.PingPortType; +import org.apache.tuscany.sca.host.embedded.SCADomain; + +/** + * Tests the BPEL service + * + * @version $Rev$ $Date$ + */ +public class BPELPingPongTestCase extends TestCase { + + private SCADomain scaDomain; + PingPortType bpelPing = null; + + /** + * @throws java.lang.Exception + */ + @Override + protected void setUp() throws Exception { + //scaDomain = SCADomain.newInstance("ping-pong/ping-pong.composite"); + //bpelPing = scaDomain.getService(PingPortType.class, "BPELPingPong-PingComponent/PingService"); + } + + /** + * @throws java.lang.Exception + */ + @Override + protected void tearDown() throws Exception { + //scaDomain.close(); + } + + public void testPing() { + //String response = bpelPing.Ping("Ping"); + //System.out.println("response:" + response); + //assertNotNull(response); + // assertEquals("Hello World", response); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/java/pingpong/BPELPingTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/java/pingpong/BPELPingTestCase.java new file mode 100644 index 0000000000..34f82318a3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/java/pingpong/BPELPingTestCase.java @@ -0,0 +1,63 @@ +/* + * 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 org.apache.tuscany.sca.implementation.bpel; + +import junit.framework.TestCase; + +import org.apache.tuscany.implementation.bpel.example.ping.PingPortType; +import org.apache.tuscany.sca.host.embedded.SCADomain; + +/** + * Tests the BPEL service + * + * @version $Rev$ $Date$ + */ +public class BPELPingTestCase extends TestCase { + + private SCADomain scaDomain; + PingPortType bpelService = null; + + /** + * @throws java.lang.Exception + */ + @Override + protected void setUp() throws Exception { + //scaDomain = SCADomain.newInstance("ping/ping.composite"); + //bpelService = scaDomain.getService(PingPortType.class, "BPELPingComponent"); + + } + + /** + * @throws java.lang.Exception + */ + @Override + protected void tearDown() throws Exception { + //scaDomain.close(); + } + + public void testInvoke() { + /* + String response = bpelService.Ping("Ping"); + System.out.println("response:" + response); + assertNotNull(response); + */ + // assertEquals("Hello World", response); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/java/pingpong/BPELPongTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/java/pingpong/BPELPongTestCase.java new file mode 100644 index 0000000000..313bd66850 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/java/pingpong/BPELPongTestCase.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 org.apache.tuscany.sca.implementation.bpel; + +import junit.framework.TestCase; + +import org.apache.tuscany.implementation.bpel.example.pong.PongPortType; +import org.apache.tuscany.sca.host.embedded.SCADomain; + +/** + * Tests the BPEL service + * + * @version $Rev$ $Date$ + */ +public class BPELPongTestCase extends TestCase { + + private SCADomain scaDomain; + PongPortType bpelService = null; + + /** + * @throws java.lang.Exception + */ + @Override + protected void setUp() throws Exception { + scaDomain = SCADomain.newInstance("pong/pong.composite"); + bpelService = scaDomain.getService(PongPortType.class, "BPELPongComponent"); + + } + + /** + * @throws java.lang.Exception + */ + @Override + protected void tearDown() throws Exception { + scaDomain.close(); + } + + public void testInvoke() { + String response = bpelService.Pong("Pong"); + System.out.println("response:" + response); + assertNotNull(response); + + // assertEquals("Hello World", response); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/log4j.properties b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/log4j.properties new file mode 100644 index 0000000000..d0b3c3aa5a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/log4j.properties @@ -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. +# + +# Set root logger level to WARN and its only appender to CONSOLE +log4j.rootLogger=OFF, CONSOLE + +# log4j properties to work with commandline tools. +log4j.category.org.mortbay=OFF +log4j.category.org.hibernate.type=OFF +log4j.category.org.objectweb=OFF +log4j.category.org.apache.ode.axis2=OFF +log4j.category.org.apache.ode.bpel.engine=OFF +log4j.category.org.apache.ode.daohib.bpel.CorrelatorDaoImpl=OFF +log4j.category.org.apache.ode.bpel.epr=OFF + +# Console appender +log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender +log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout +log4j.appender.CONSOLE.layout.ConversionPattern=%p - %C{1}.%M(%L) | %m%n diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping-pong/ping-pong.componentType b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping-pong/ping-pong.componentType new file mode 100644 index 0000000000..e4cbdfe89c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping-pong/ping-pong.componentType @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping-pong/ping-pong.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping-pong/ping-pong.composite new file mode 100644 index 0000000000..a0eb4d0b5b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping-pong/ping-pong.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/deploy.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/deploy.xml new file mode 100644 index 0000000000..613ed9c491 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/deploy.xml @@ -0,0 +1,35 @@ + + + + + + true + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/ping.bpel b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/ping.bpel new file mode 100644 index 0000000000..abda9e58d2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/ping.bpel @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + concat($pingRequest.body/ping:text, ' ping') + + + + + + + + + + + + $pongRequest.body + + + + $text + $pongRequest.body/pong:text + + + + + + + + $pongResponse.body/pong:text + $text + + + + + + + + + + + $pingResponse.body + + + + $text + $pingResponse.body/ping:text + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/ping.componentType b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/ping.componentType new file mode 100644 index 0000000000..7598a99d16 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/ping.componentType @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/ping.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/ping.composite new file mode 100644 index 0000000000..75eed03022 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/ping.composite @@ -0,0 +1,29 @@ + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/ping.wsdl b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/ping.wsdl new file mode 100644 index 0000000000..03e54c4de8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/ping.wsdl @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/pong.wsdl b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/pong.wsdl new file mode 100644 index 0000000000..1f4c4a9aaa --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/ping/pong.wsdl @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/pong/deploy.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/pong/deploy.xml new file mode 100644 index 0000000000..1315ef47f0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/pong/deploy.xml @@ -0,0 +1,31 @@ + + + + + + true + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/pong/pong.bpel b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/pong/pong.bpel new file mode 100644 index 0000000000..b5d84898c7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/pong/pong.bpel @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + concat($pongRequest.body/pong:text, ' pong') + $text + + + + + + + + + + + $pongResponse.body + + + + $text + $pongResponse.body/pong:text + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/pong/pong.componentType b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/pong/pong.componentType new file mode 100644 index 0000000000..2f8fd5d3de --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/pong/pong.componentType @@ -0,0 +1,29 @@ + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/pong/pong.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/pong/pong.composite new file mode 100644 index 0000000000..e40ce7ee45 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/pong/pong.composite @@ -0,0 +1,30 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/pong/pong.wsdl b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/pong/pong.wsdl new file mode 100644 index 0000000000..21ee8b82f6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/ping-pong/test/resources/pong/pong.wsdl @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/pom.xml new file mode 100644 index 0000000000..69ff9f8e26 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/bpel/pom.xml @@ -0,0 +1,35 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-bpel + pom + Apache Tuscany SCA BPEL Integration Tests + + + helloworld + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/build-was-integration.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/build-was-integration.xml new file mode 100644 index 0000000000..03de4c050f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/build-was-integration.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + Installing war ${application.war} on ${application.server} using name ${application.name} and context root ${application.contextRoot} + + + + + Starting application ${application.name} on ${application.server} + + + + + + + Uninstalling ${application.name} + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/pom.xml new file mode 100644 index 0000000000..1595d3d393 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/pom.xml @@ -0,0 +1,59 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-callablereferences-ws + Apache Tuscany Test for Callable References over Web Services + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-tomcat + 1.2.1-incubating-SNAPSHOT + runtime + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/com/example/ExampleClient.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/com/example/ExampleClient.java new file mode 100644 index 0000000000..e64ccd7cdf --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/com/example/ExampleClient.java @@ -0,0 +1,26 @@ +/* + * 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 com.example; + +public interface ExampleClient { + + void runTest(); + + void sayHello(String name); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/com/example/ExampleClientImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/com/example/ExampleClientImpl.java new file mode 100644 index 0000000000..d3e19c413d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/com/example/ExampleClientImpl.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package com.example; + +import org.osoa.sca.CallableReference; +import org.osoa.sca.ComponentContext; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(ExampleClient.class) +@Scope("COMPOSITE") +public class ExampleClientImpl implements ExampleClient { + + private ExampleService myService; + + @Context + protected ComponentContext context; + + @Reference + public void setMyService(ExampleService myService) { + this.myService = myService; + } + + public void runTest() { + ServiceReference ref = context.createSelfReference(ExampleClient.class); + ref.getService().sayHello("Jack"); + CallableReference result = myService.hello("Jill", ref); + if (result != null) { + ((CallableReference)result).getService().sayHello("John"); + } + result = myService.hello("Jane", null); + if (result != null) { + ((CallableReference)result).getService().sayHello("Jim"); + } + } + + public void sayHello(String name) { + System.out.println("Hello, client " + name + "!"); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/com/example/ExampleService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/com/example/ExampleService.java new file mode 100644 index 0000000000..db3e4a0a82 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/com/example/ExampleService.java @@ -0,0 +1,30 @@ +/* + * 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 com.example; + +import org.osoa.sca.CallableReference; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface ExampleService { + + CallableReference hello(String name, ServiceReference ref); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/com/example/ExampleServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/com/example/ExampleServiceImpl.java new file mode 100644 index 0000000000..25c4643ee4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/com/example/ExampleServiceImpl.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 com.example; + +import org.osoa.sca.CallableReference; +import org.osoa.sca.ServiceReference; + +public class ExampleServiceImpl implements ExampleService { + + public CallableReference hello(String name, ServiceReference ref) { + if (ref != null) { + ((ServiceReference)ref).getService().sayHello(name); + } + return (CallableReference)ref; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/Alpha.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/Alpha.java new file mode 100644 index 0000000000..bb5e57397d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/Alpha.java @@ -0,0 +1,26 @@ +/* + * 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 org.apache.tuscany.sca.itest.callablerefwsreturn; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Alpha { + boolean run(); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/AlphaImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/AlphaImpl.java new file mode 100644 index 0000000000..6e5f1cedf9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/AlphaImpl.java @@ -0,0 +1,96 @@ +/* + * 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 org.apache.tuscany.sca.itest.callablerefwsreturn; + +import org.osoa.sca.CallableReference; +import org.osoa.sca.ComponentContext; +import org.osoa.sca.Conversation; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(Alpha.class) +@Scope("COMPOSITE") +public class AlphaImpl implements Alpha { + @Reference + public Beta beta; + + @Context + protected ComponentContext componentContext; + + Object conversationId0 = null; + + public boolean run() { + CallableReference gammaRef = null; + try { + Object conversationId1 = null; + Object conversationId2 = null; + + // it is expected that this call returns a reference to Gamma that + // reuses the established Conversation + gammaRef = beta.getRef(); + + // no Conversation exists + Conversation con = gammaRef.getConversation(); + if (con == null) { + System.out.println("Alpha1: Conversation to gamma is null"); + } else { + System.out + .println("Alpha1: Conversation to gamma exists. conversationId=" + + con.getConversationID()); + conversationId1 = con.getConversationID(); + } + + // this call should reuse a Conversation, but as none exists it + // creates a new conversation + gammaRef.getService().doSomething(); + gammaRef.getService().doSomething(); + gammaRef.getService().doSomething(); + + con = gammaRef.getConversation(); + if (con == null) { + System.out.println("Alpha2: Conversation to gamma is null"); + } else { + System.out + .println("Alpha2: Conversation to gamma exists. conversationId=" + + con.getConversationID()); + conversationId2 = con.getConversationID(); + } + + boolean testPassed = conversationId1.equals(conversationId2); + + if (conversationId0 == null){ + conversationId0 = conversationId1; + return testPassed; + } else { + return testPassed && (!conversationId0.equals(conversationId1)); + } + + } catch (Exception e) { + e.printStackTrace(); + return false; + } finally { + if (gammaRef != null) { + gammaRef.getService().stop(); + } + } + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/Beta.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/Beta.java new file mode 100644 index 0000000000..995e4fcf39 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/Beta.java @@ -0,0 +1,27 @@ +/* + * 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 org.apache.tuscany.sca.itest.callablerefwsreturn; + +import org.osoa.sca.CallableReference; +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Beta { + CallableReference getRef(); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/BetaImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/BetaImpl.java new file mode 100644 index 0000000000..be72fd779e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/BetaImpl.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 org.apache.tuscany.sca.itest.callablerefwsreturn; + +import org.osoa.sca.CallableReference; +import org.osoa.sca.ComponentContext; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(Beta.class) +@Scope("COMPOSITE") +public class BetaImpl implements Beta { + @Context + protected ComponentContext componentContext; + + @Reference + public Gamma gamma; + + public CallableReference getRef() { + ServiceReference gammaRef = componentContext + .getServiceReference(Gamma.class, "gamma"); + Gamma g = gammaRef.getService(); + g.start(); + return gammaRef; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/Gamma.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/Gamma.java new file mode 100644 index 0000000000..b73f26b573 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/Gamma.java @@ -0,0 +1,34 @@ +/* + * 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 org.apache.tuscany.sca.itest.callablerefwsreturn; + +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.EndsConversation; +import org.osoa.sca.annotations.Remotable; + +@Remotable +@Conversational +public interface Gamma { + int start(); + + void doSomething(); + + @EndsConversation + void stop(); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/GammaImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/GammaImpl.java new file mode 100644 index 0000000000..c3abc4c65d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/java/org/apache/tuscany/sca/itest/callablerefwsreturn/GammaImpl.java @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.itest.callablerefwsreturn; + +import org.osoa.sca.annotations.ConversationID; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(Gamma.class) +@Scope("CONVERSATION") +public class GammaImpl implements Gamma { + @ConversationID + protected String conversationId; + + public GammaImpl() { + System.out.println("GammaImpl:GammaImpl(), conversationId=" + + conversationId); + } + + public int start() { + System.out.println("Gamma:start(), conversationId=" + conversationId); + return 1; + } + + public void doSomething() { + System.out.println("Gamma:doSomething(), conversationId=" + + conversationId); + } + + public void stop() { + System.out.println("Gamma:stop(), conversationId=" + conversationId); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/resources/CallableReferenceWsReturnTest.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/resources/CallableReferenceWsReturnTest.composite new file mode 100644 index 0000000000..3d782a0b84 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/resources/CallableReferenceWsReturnTest.composite @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/resources/example.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/resources/example.composite new file mode 100644 index 0000000000..ea0819a32e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/main/resources/example.composite @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/test/java/com/example/ExampleTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/test/java/com/example/ExampleTestCase.java new file mode 100644 index 0000000000..740af4f43d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/test/java/com/example/ExampleTestCase.java @@ -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. + */ +package com.example; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +public class ExampleTestCase extends TestCase { + + private SCADomain scaDomain; + private ExampleClient client; + + @Override + protected void setUp() throws Exception { + scaDomain = SCADomain.newInstance("example.composite"); + client = scaDomain.getService(ExampleClient.class, "ExampleClientComponent"); + } + + @Override + protected void tearDown() throws Exception { + scaDomain.close(); + } + + public void test() throws Exception { + client.runTest(); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/test/java/org/apache/tuscany/sca/itest/callablerefws/CallableReferenceReturnTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/test/java/org/apache/tuscany/sca/itest/callablerefws/CallableReferenceReturnTestCase.java new file mode 100644 index 0000000000..66fb2ef96c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences-ws/src/test/java/org/apache/tuscany/sca/itest/callablerefws/CallableReferenceReturnTestCase.java @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.itest.callablerefws; + +import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.apache.tuscany.sca.itest.callablerefwsreturn.Alpha; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class CallableReferenceReturnTestCase { + private static SCADomain domain; + private static Alpha alpha; + + @BeforeClass + public static void init() throws Exception { + domain = SCADomain.newInstance("CallableReferenceWsReturnTest.composite"); + alpha = domain.getService(Alpha.class, "Alpha"); + } + + @AfterClass + public static void destroy() throws Exception { + domain.close(); + } + + @Test + public void testCallableReferenceReturn() { + Assert.assertTrue(alpha.run()); + Assert.assertTrue(alpha.run()); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/pom.xml new file mode 100644 index 0000000000..d1ecc09ea2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/pom.xml @@ -0,0 +1,81 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-callablereferences + Apache Tuscany SCA Callable References Integration Tests + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-node-impl + 1.2.1-incubating-SNAPSHOT + test + + + + org.apache.tuscany.sca + tuscany-domain-impl + 1.2.1-incubating-SNAPSHOT + test + + + + org.apache.tuscany.sca + tuscany-host-tomcat + 1.2.1-incubating-SNAPSHOT + test + + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 1.2.1-incubating-SNAPSHOT + test + + + + org.apache.tuscany.sca + tuscany-binding-sca-axis2 + 1.2.1-incubating-SNAPSHOT + test + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponent.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponent.java new file mode 100644 index 0000000000..d6b3807d31 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponent.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 org.apache.tuscany.sca.itest.callableref; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface AComponent { + String foo(); + + String fooB(); + String fooB1(); + + String fooC(); + String fooC1(); + + String fooStringD(); + String fooD(); + + String fooBC(); + + DComponent getDReference(); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponentImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponentImpl.java new file mode 100644 index 0000000000..65c9bdad35 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponentImpl.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 org.apache.tuscany.sca.itest.callableref; + +import java.io.ByteArrayOutputStream; +import java.io.Externalizable; +import java.io.ObjectOutputStream; + +import org.apache.tuscany.sca.core.context.CallableReferenceImpl; +import org.apache.tuscany.sca.databinding.impl.XSDDataTypeConverter.Base64Binary; +import org.osoa.sca.CallableReference; +import org.osoa.sca.ComponentContext; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +@Service(AComponent.class) +public class AComponentImpl implements AComponent { + + @Context + protected ComponentContext componentContext; + + @Reference(name = "bReference") + protected BComponent b; + + @Reference + protected CComponent cReference; + + @Reference + protected ServiceReference cServiceReference; + + @Reference(required=false) + protected DComponent dReference; + + protected DComponent dReference1; + + @Reference(name = "dReference1") + public void setDReference(DComponent dReference) { + this.dReference1 = dReference; + } + + public String foo() { + return "AComponent"; + } + + public String fooB() { + return b.foo(); + } + + public String fooB1() { + CallableReference bRef = componentContext.cast(b); + return bRef.getService().foo(); + } + + public String fooC() { + return cReference.foo(); + } + + public String fooC1() { + return cServiceReference.getService().foo(); + } + + public String fooBC() { + CallableReference cReference = componentContext.getServiceReference(CComponent.class, "cReference"); + return b.fooC(cReference); + } + + public String fooD() { + CallableReference aReference = componentContext.createSelfReference(AComponent.class); + return dReference1.foo(aReference); + } + + /** + * A test case to work out what needs to be done in a transformer to get the + * callable reference across the wire. Let here for interest in case anyone + * is looking for how to get at the innards of callable references + */ + public String fooStringD() { + CallableReference aReference = componentContext.createSelfReference(AComponent.class); + ByteArrayOutputStream bos = null; + + try { + bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(aReference); + } catch (Exception ex) { + System.out.println(ex.toString()); + return null; + } + + String aReferenceString = Base64Binary.encode(bos.toByteArray()); + return dReference1.fooString(aReferenceString); + } + + public DComponent getDReference() { + return dReference; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponent.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponent.java new file mode 100644 index 0000000000..ade672b0ab --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponent.java @@ -0,0 +1,30 @@ +/* + * 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 org.apache.tuscany.sca.itest.callableref; + +import org.osoa.sca.CallableReference; +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface BComponent { + + String foo(); + + String fooC(CallableReference cComponent); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponentImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponentImpl.java new file mode 100644 index 0000000000..518e77d3a8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponentImpl.java @@ -0,0 +1,38 @@ +/* + * 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 org.apache.tuscany.sca.itest.callableref; + +import org.osoa.sca.CallableReference; +import org.osoa.sca.annotations.Service; + +@Service(BComponent.class) +public class BComponentImpl implements BComponent { + + public BComponentImpl() { + } + + public String foo() { + return "BComponent"; + } + + public String fooC(CallableReference cReference) { + return "B" + cReference.getService().foo(); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponent.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponent.java new file mode 100644 index 0000000000..fdf80cc1c8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponent.java @@ -0,0 +1,27 @@ +/* + * 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 org.apache.tuscany.sca.itest.callableref; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface CComponent { + + String foo(); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponentImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponentImpl.java new file mode 100644 index 0000000000..cc8ec8f000 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponentImpl.java @@ -0,0 +1,30 @@ +/* + * 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 org.apache.tuscany.sca.itest.callableref; + +import org.osoa.sca.annotations.Service; + +@Service(CComponent.class) +public class CComponentImpl implements CComponent { + + public String foo() { + return "CComponent"; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponent.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponent.java new file mode 100644 index 0000000000..eb8cbbf280 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponent.java @@ -0,0 +1,35 @@ +/* + * 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 org.apache.tuscany.sca.itest.callableref; + +import java.io.Externalizable; + +import javax.xml.stream.XMLStreamReader; + +import org.apache.tuscany.sca.core.context.CallableReferenceImpl; +import org.osoa.sca.CallableReference; +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface DComponent { + + String foo(CallableReference aReference); + + String fooString(String aReferenceString); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponentImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponentImpl.java new file mode 100644 index 0000000000..8117ed9235 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponentImpl.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 org.apache.tuscany.sca.itest.callableref; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.Externalizable; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; + +import org.apache.tuscany.sca.core.context.CallableReferenceImpl; +import org.apache.tuscany.sca.databinding.impl.XSDDataTypeConverter.Base64Binary; +import org.osoa.sca.CallableReference; +import org.osoa.sca.RequestContext; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Service; + +@Service(DComponent.class) +public class DComponentImpl implements DComponent { + + @Context + protected RequestContext requestContext; + + public String foo(CallableReference aReference) { + try { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(aReference); + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + Object obj = ois.readObject(); + aReference = (CallableReference) obj; + } catch (Exception e) { + e.printStackTrace(); + } + System.out.println("Invoking service: " + requestContext.getServiceName()); + return "D" + aReference.getService().foo(); + } + + public String fooString(String aReferenceString) { + CallableReference aReference = null; + try { + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(Base64Binary.decode(aReferenceString))); + Object obj = ois.readObject(); + aReference = (CallableReference) obj; + } catch (Exception e) { + e.printStackTrace(); + } + System.out.println("Invoking service: " + requestContext.getServiceName()); + return "D" + aReference.getService().foo(); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/Alpha.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/Alpha.java new file mode 100644 index 0000000000..ab21421c4d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/Alpha.java @@ -0,0 +1,27 @@ +/* + * 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 org.apache.tuscany.sca.itest.callablerefreturn; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Alpha +{ + boolean run(); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/AlphaImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/AlphaImpl.java new file mode 100644 index 0000000000..5b5984b164 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/AlphaImpl.java @@ -0,0 +1,86 @@ +/* + * 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 org.apache.tuscany.sca.itest.callablerefreturn; + +import org.osoa.sca.CallableReference; +import org.osoa.sca.ComponentContext; +import org.osoa.sca.Conversation; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; + +@Scope("COMPOSITE") +public class AlphaImpl implements Alpha { + @Reference + public Beta beta; + + @Context + protected ComponentContext componentContext; + + public boolean run() { + CallableReference gammaRef = null; + try { + Object conversationId1 = null; + Object conversationId2 = null; + + // it is expected that this call returns a reference to Gamma that + // reuses the established Conversation + gammaRef = beta.getRef(); + + // no Conversation exists + Conversation con = gammaRef.getConversation(); + if (con == null) { + System.out.println("Alpha: Conversation to gamma is null"); + } else { + System.out + .println("Alpha: Conversation to gamma exists. conversationId=" + + con.getConversationID()); + conversationId1 = con.getConversationID(); + } + + // this call should reuse a Conversation, but as none exists it + // creates a new conversation + gammaRef.getService().doSomething(); + con = gammaRef.getConversation(); + if (con == null) { + System.out.println("Alpha: Conversation to gamma is null"); + } else { + System.out + .println("Alpha: Conversation to gamma exists. conversationId=" + + con.getConversationID()); + conversationId2 = con.getConversationID(); + } + + if ((conversationId1 == null) || (conversationId2 == null)) { + return false; + } + + boolean testPassed = conversationId1.equals(conversationId2); + return testPassed; + } catch (Exception e) { + e.printStackTrace(); + return false; + } finally { + if (gammaRef != null) { + gammaRef.getService().stop(); + } + } + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/Beta.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/Beta.java new file mode 100644 index 0000000000..223c467f47 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/Beta.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 org.apache.tuscany.sca.itest.callablerefreturn; + +import org.osoa.sca.CallableReference; +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Beta +{ + CallableReference getRef(); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/BetaImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/BetaImpl.java new file mode 100644 index 0000000000..ed4e66bec3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/BetaImpl.java @@ -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. + */ +package org.apache.tuscany.sca.itest.callablerefreturn; + +import org.osoa.sca.CallableReference; +import org.osoa.sca.ComponentContext; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; + +@Scope("COMPOSITE") +public class BetaImpl implements Beta +{ + @Context + protected ComponentContext componentContext; + + @Reference + public Gamma gamma; + + public CallableReference getRef() + { + ServiceReference gammaRef = componentContext.getServiceReference(Gamma.class, "gamma"); + gammaRef.getService().start(); + return gammaRef; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/Gamma.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/Gamma.java new file mode 100644 index 0000000000..e32051373f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/Gamma.java @@ -0,0 +1,35 @@ +/* + * 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 org.apache.tuscany.sca.itest.callablerefreturn; + +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.EndsConversation; +import org.osoa.sca.annotations.Remotable; + +@Remotable +@Conversational +public interface Gamma +{ + void start(); + + void doSomething(); + + @EndsConversation + void stop(); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/GammaImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/GammaImpl.java new file mode 100644 index 0000000000..adf5a1c1ce --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/GammaImpl.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 org.apache.tuscany.sca.itest.callablerefreturn; + +import org.osoa.sca.annotations.ConversationID; +import org.osoa.sca.annotations.Scope; + +@Scope("CONVERSATION") +public class GammaImpl implements Gamma +{ + @ConversationID + protected String conversationId; + + + public void start() + { + System.out.println("Gamma:start(), conversationId=" + conversationId); + } + + + public void doSomething() + { + System.out.println("Gamma:doSomething(), conversationId=" + conversationId); + } + + + public void stop() + { + System.out.println("Gamma:stop(), conversationId=" + conversationId); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/CallableReferenceReturnTest.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/CallableReferenceReturnTest.composite new file mode 100644 index 0000000000..5b3add1e61 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/CallableReferenceReturnTest.composite @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/CallableReferenceTest.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/CallableReferenceTest.composite new file mode 100644 index 0000000000..49b75f56e4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/CallableReferenceTest.composite @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/nodeA/CompositeA.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/nodeA/CompositeA.composite new file mode 100644 index 0000000000..facbe45f50 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/nodeA/CompositeA.composite @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/nodeA/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/nodeA/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..95021f72a4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/nodeA/META-INF/sca-contribution.xml @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/nodeB/CompositeB.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/nodeB/CompositeB.composite new file mode 100644 index 0000000000..2849400be4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/nodeB/CompositeB.composite @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/nodeB/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/nodeB/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..2edda61601 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/main/resources/nodeB/META-INF/sca-contribution.xml @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceRemoteTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceRemoteTestCase.java new file mode 100644 index 0000000000..3277c57616 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceRemoteTestCase.java @@ -0,0 +1,142 @@ +/* + * 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 org.apache.tuscany.sca.itest.callableref; + + +import static junit.framework.Assert.assertEquals; + +import javax.xml.namespace.QName; + + +import junit.framework.Assert; + + +import org.apache.tuscany.sca.domain.SCADomain; +import org.apache.tuscany.sca.domain.SCADomainFactory; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + + +/** + * Runs a distributed domain in a single VM by using and in memory + * implementation of the distributed domain + */ +public class CallableReferenceRemoteTestCase { + + private static SCADomain domain; + private static SCANode nodeA; + private static SCANode nodeB; + + private static AComponent acomponent; + + @BeforeClass + public static void init() throws Exception { + + try { + System.out.println("Setting up domain"); + SCADomainFactory domainFactory = SCADomainFactory.newInstance(); + domain= domainFactory.createSCADomain("http://localhost:9999"); + + System.out.println("Setting up nodes"); + + ClassLoader cl = CallableReferenceRemoteTestCase.class.getClassLoader(); + + SCANodeFactory nodeFactory = SCANodeFactory.newInstance(); + + nodeA = nodeFactory.createSCANode("http://localhost:8100/nodeA", "http://localhost:9999"); + nodeA.addContribution("nodeA", cl.getResource("nodeA/")); + nodeA.addToDomainLevelComposite(new QName("http://foo", "CompositeA")); + + + nodeB = nodeFactory.createSCANode("http://localhost:8200/nodeB", "http://localhost:9999"); + nodeB.addContribution("nodeB", cl.getResource("nodeB/")); + nodeB.addToDomainLevelComposite(new QName("http://foo", "CompositeB")); + + domain.start(); + + // get a reference to the calculator service from domainA + // which will be running this component + acomponent = nodeA.getDomain().getService(AComponent.class, "AComponent/AComponent"); + } catch (Exception ex) { + System.out.println(ex.toString()); + } + } + + @AfterClass + public static void destroy() throws Exception { + // stop the nodes and hence the domains they contain + nodeA.destroy(); + nodeB.destroy(); + } + + //@Test + public void testKeepServerRunning1() throws Exception { + System.out.println("press enter to continue"); + System.in.read(); + } + + @Test + public void testBReference() { + assertEquals("BComponent", acomponent.fooB()); + } + + @Test + public void testBCast() { + assertEquals("BComponent", acomponent.fooB1()); + } + + @Test + public void testCReference() { + assertEquals("CComponent", acomponent.fooC()); + } + + @Test + public void testCServiceReference() { + assertEquals("CComponent", acomponent.fooC1()); + } + + @Test + public void testDReferenceString() { + assertEquals("DAComponent", acomponent.fooStringD()); + } + + @Test + public void testDReference() { + assertEquals("DAComponent", acomponent.fooD()); + } + + + @Test + public void testBCReference() { + assertEquals("BCComponent", acomponent.fooBC()); + } + + @Test + public void testRequiredFalseReference() { + try { + acomponent.getDReference().foo(null); + } catch (Exception e) { + Assert.assertTrue(true); + } + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceReturnTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceReturnTestCase.java new file mode 100644 index 0000000000..f2d8fe5d64 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceReturnTestCase.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 org.apache.tuscany.sca.itest.callableref; + +import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.apache.tuscany.sca.itest.callablerefreturn.Alpha; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class CallableReferenceReturnTestCase { + private static SCADomain domain; + private static Alpha alpha; + + @BeforeClass + public static void init() throws Exception { + domain = SCADomain.newInstance("CallableReferenceReturnTest.composite"); + alpha = domain.getService(Alpha.class, "Alpha"); + } + + @AfterClass + public static void destroy() throws Exception { + domain.close(); + } + + @Test + public void testCallableReferenceReturn() { + Assert.assertTrue(alpha.run()); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceTestCase.java new file mode 100644 index 0000000000..2b7750b443 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceTestCase.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 org.apache.tuscany.sca.itest.callableref; + +import static junit.framework.Assert.assertEquals; +import junit.framework.Assert; + +import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +public class CallableReferenceTestCase { + private static SCADomain domain; + private static AComponent acomponent; + + @BeforeClass + public static void init() throws Exception { + domain = SCADomain.newInstance("CallableReferenceTest.composite"); + acomponent = domain.getService(AComponent.class, "AComponent"); + } + + @AfterClass + public static void destroy() throws Exception { + domain.close(); + } + + @Test + public void testBReference() { + assertEquals("BComponent", acomponent.fooB()); + } + + @Test + public void testBCast() { + assertEquals("BComponent", acomponent.fooB1()); + } + + @Test + public void testCReference() { + assertEquals("CComponent", acomponent.fooC()); + } + + @Test + public void testCServiceReference() { + assertEquals("CComponent", acomponent.fooC1()); + } + + @Test + public void testDReference() { + assertEquals("DAComponent", acomponent.fooD()); + } + + @Test + public void testBCReference() { + assertEquals("BCComponent", acomponent.fooBC()); + } + + @Test + public void testRequiredFalseReference() { + try { + acomponent.getDReference().foo(null); + } catch (Exception e) { + Assert.assertTrue(true); + } + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/pom.xml new file mode 100644 index 0000000000..20cec68521 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/pom.xml @@ -0,0 +1,50 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-callback-api + Apache Tuscany SCA Callback API Integration Tests + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + + + ${basedir}/../build-was-integration.xml + ${basedir}/../wasAdmin.py + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java new file mode 100644 index 0000000000..de17ba2f0d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java @@ -0,0 +1,38 @@ +/* + * 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 org.apache.tuscany.sca.test; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +/** + * + */ +public interface CallBackApiCallBack { + /** + * This function is defined in CallBackApiClientImpl + */ + public void callBackMessage(String aString); + + /** + * This function is defined in CallBackApiClientImpl + */ + public void callBackIncrement(String aString); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java new file mode 100644 index 0000000000..5fd4a71466 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java @@ -0,0 +1,30 @@ +/* + * 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 org.apache.tuscany.sca.test; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface CallBackApiClient { + /** + * This function is defined in CallBackApiClientImpl + */ + public void run(); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java new file mode 100644 index 0000000000..5accbe801d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java @@ -0,0 +1,206 @@ +/* + * 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 org.apache.tuscany.sca.test; + +import junit.framework.Assert; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +@Service(CallBackApiClient.class) +public class CallBackApiClientImpl implements CallBackApiClient, CallBackApiCallBack { + + @Reference + protected CallBackApiService aCallBackService; + + private static String returnMessage = null; + private static int callBackCount = 0; + private static Object monitor = new Object(); + + /** + * This test calls function test 3a,3a1,3b,3c + */ + public void run() { + + // This tests basic callback patterns. + + // Test3a is the basic callback where the target calls back prior to + // returning to the client. + test3a(); + + test3a1(); + + // Test3b is where the target does not call back to the client. + test3b(); + + // Test3c is where the target calls back multiple times to the client. + test3c(); + + return; + } + + /** + * This test is the basic callback where the target calls back prior to returning to the client. + */ + + private void test3a() { + aCallBackService.knockKnock("Knock Knock"); + int count = 0; + + // + // If we cant get a response in 30 seconds consider this a failure + // + + synchronized (monitor) { + while (returnMessage == null && count++ < 30) { + try { + monitor.wait(1000L); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + + Assert.assertEquals("CallBackApiITest - test3a", "Who's There", this.getReturnMessage()); + + } + + /** + * This test is the basic callback where the target calls back prior to returning to the client. + */ + private void test3a1() { + aCallBackService.knockKnockByRef("Knock Knock"); + int count = 0; + + // + // If we cant get a response in 30 seconds consider this a failure + // + + synchronized (monitor) { + while (returnMessage == null && count++ < 30) { + try { + monitor.wait(1000L); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + + Assert.assertEquals("CallBackApiITest - test3a", "Who's There", this.getReturnMessage()); + + } + + /** + * This test is the basic callback where the target does not call back to the client + */ + private void test3b() { + aCallBackService.noCallBack("No Reply Desired"); + Assert.assertEquals("CallBackApiITest - test3b", 1, 1); + return; + } + + /** + * This test is the basic callback where the target calls back multiple times to the client + */ + + private void test3c() { + aCallBackService.multiCallBack("Call me back 3 times"); + int count = 0; + + // + // If we cant get a response in 30 seconds consider this a failure + // + + synchronized (monitor) { + while (this.getCallBackCount() < 3 && count++ < 30) { + try { + monitor.wait(1000L); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + + Assert.assertEquals("CallBackApiITest - test3c", 3, this.getCallBackCount()); + return; + } + + /** + * This function returns a string + * + * @param void + * @return String result string + */ + + public String getReturnMessage() { + return returnMessage; + } + + /** + * This function set the returnMessage string + * + * @param String + */ + public void setReturnMessage(String aReturnMessage) { + returnMessage = aReturnMessage; + } + + /** + * This function returns the callBackCount variable + * + * @return Integer callBackCount variable + */ + public int getCallBackCount() { + return callBackCount; + } + + /** + * This function increments callBackCount variable by 1 + */ + public void incrementCallBackCount() { + callBackCount++; + } + + /** + * This function prints a message synched with setReturnMessage function + * + * @param String + */ + public void callBackMessage(String aString) { + System.out.println("Entering callback callBackMessage: " + aString); + synchronized (monitor) { + this.setReturnMessage(aString); + monitor.notify(); + } + } + + /** + * This function prints a message synched with incrementCallBackCount function + * + * @param String + */ + public void callBackIncrement(String aString) { + System.out.println("Entering callback increment: " + aString); + synchronized (monitor) { + this.incrementCallBackCount(); + monitor.notify(); + } + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java new file mode 100644 index 0000000000..33de1e7739 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.test; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Remotable; + +@Remotable +@Callback(CallBackApiCallBack.class) +/** + * + */ +public interface CallBackApiService { + /** + * This function is defined in CallBackApiServiceImpl + */ + public void knockKnock(String aString); + + /** + * This function is defined in CallBackApiServiceImpl + */ + public void knockKnockByRef(String aString); + + /** + * This function is defined in CallBackApiServiceImpl + */ + public void noCallBack(String aString); + + /** + * This function is defined in CallBackApiServiceImpl + */ + public void multiCallBack(String aString); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java new file mode 100644 index 0000000000..202d346b47 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java @@ -0,0 +1,123 @@ +/* + * 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 org.apache.tuscany.sca.test; + +import org.osoa.sca.CallableReference; +import org.osoa.sca.ComponentContext; +import org.osoa.sca.RequestContext; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Service; + +@Service(CallBackApiService.class) +public class CallBackApiServiceImpl implements CallBackApiService { + + @Context + protected ComponentContext componentContext; + /** + * Object of CallBackApiCallBack class + */ + private CallBackApiCallBack callback; + + @Callback + protected CallableReference callbackRef; + + /** + * This function get an object of CallBackApiServiceImpl by calling getCallBackInterface function and calls the + * callBackMessage function. + * + * @param aString String passed by a function call + */ + + public void knockKnock(String aString) { + + System.out.println("CallBackApiServiceImpl message received: " + aString); + callback = this.getCallBackInterface(); + callback.callBackMessage("Who's There"); + System.out.println("CallBackApiServiceImpl response sent"); + return; + + } + + /** + * This function calls the callBackMessage function.
+ * The reference to this function is recieved from Call back reference to the class CallBackApiService. + * + * @param aString String passed by a function call + */ + public void knockKnockByRef(String aString) { + + System.out.println("CallBackApiServiceImpl message received: " + aString); + callbackRef.getService().callBackMessage("Who's There"); + System.out.println("CallBackApiServiceImpl response sent"); + return; + + } + + /** + * This function get an object of CallBackApiServiceImpl by calling getCallBackInterface function.
+ * This function then places multiple callBack using the callbackIncrement function defined in + * callBack.ApiServiceImpl + * + * @param aString String passed by a function call + */ + public void multiCallBack(String aString) { + + callback = this.getCallBackInterface(); + + System.out.println("CallBackApiServiceImpl message received: " + aString); + callback.callBackIncrement("Who's There 1"); + System.out.println("CallBackApiServiceImpl response sent"); + callback.callBackIncrement("Who's There 2"); + System.out.println("CallBackApiServiceImpl response sent"); + callback.callBackIncrement("Who's There 3"); + System.out.println("CallBackApiServiceImpl response sent"); + return; + + } + + /** + * This function does not callBack any function. + * + * @param aString String passed by a function call + */ + public void noCallBack(String aString) { + + System.out.println("CallBackApiServiceImpl message received: " + aString); + + return; + + } + + /** + * This function get an object of CallBackApiServiceImpl from the present componentContext + * + * @param void + */ + private CallBackApiCallBack getCallBackInterface() { + System.out.println("CallBackApiServiceImpl getting request context"); + RequestContext rc = componentContext.getRequestContext(); + System.out.println("CallBackApiServiceImpl getting callback from request context"); + callback = rc.getCallback(); + System.out.println("CallBackApiServiceImpl returning callback"); + return callback; + + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/resources/CallBackApiTest.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/resources/CallBackApiTest.composite new file mode 100644 index 0000000000..946c4862ee --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/resources/CallBackApiTest.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..19eb25631e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java new file mode 100644 index 0000000000..9471049c74 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.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 org.apache.tuscany.sca.test; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +public class CallBackApiTestCase extends TestCase { + + private static SCADomain domain; + private CallBackApiClient aCallBackClient; + + /** + * This function uses the Instance of CallBackApiClient.class
+ * This function calls the run function defined in the CallBackApiClinet Interface
+ * which in turn executes the following test cases.
+ * 1. Basic callback patterns
+ * 2. Test in which the target does not call back to the client
+ * 3. Test in which the target calls back multiple times to the client. + */ + public void testCallBackBasic() { + aCallBackClient.run(); + } + + /** + * This function creates the SCADomain instance and gets an Instance of CallBackApiClient.class + */ + @Override + protected void setUp() throws Exception { + if (domain == null) { + domain = SCADomain.newInstance("CallBackApiTest.composite"); + } + + aCallBackClient = domain.getService(CallBackApiClient.class, "CallBackApiClient"); + } + + /** + * This function destroys the SCADomain instance that was created in setUp() + */ + @Override + protected void tearDown() throws Exception { + domain.close(); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/pom.xml new file mode 100644 index 0000000000..a1e3f0b398 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/pom.xml @@ -0,0 +1,50 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-callback-basic + Apache Tuscany SCA Callback Basic Integration Tests + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + + + ${basedir}/../build-was-integration.xml + ${basedir}/../wasAdmin.py + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java new file mode 100644 index 0000000000..5e9d3d6821 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.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 org.apache.tuscany.sca.test; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +/** + * + */ +public interface CallBackBasicCallBack { + + public void callBackMessage(String aString); + + public void callBackIncrement(String aString); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java new file mode 100644 index 0000000000..9f4019f28c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.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 org.apache.tuscany.sca.test; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface CallBackBasicClient { + + public void run(); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java new file mode 100644 index 0000000000..1bb2dc22b7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.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 org.apache.tuscany.sca.test; + +import junit.framework.Assert; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +@Service(CallBackBasicClient.class) +public class CallBackBasicClientImpl implements CallBackBasicClient, CallBackBasicCallBack { + + @Reference + protected CallBackBasicService aCallBackService; + private static String returnMessage = null; + private static int callBackCount = 0; + private static Object monitor = new Object(); + + public void run() { + + // This tests basic callback patterns. + + // Test1 is the basic callback where the target calls back prior to + // returning to the client. + test1a(); + + // Test2 is where the target does not call back to the client. + test1b(); + + // Test3 is where the target calls back multiple times to the client. + test1c(); + + return; + } + + private void test1a() { + aCallBackService.knockKnock("Knock Knock"); + int count = 0; + + // + // If we cant get a response in 30 seconds consider this a failure + // + + synchronized (monitor) { + while (returnMessage == null && count++ < 30) { + try { + monitor.wait(1000L); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + + Assert.assertEquals("CallBackBasicITest - test1a", "Who's There", this.getReturnMessage()); + + } + + private void test1b() { + aCallBackService.noCallBack("No Reply Desired"); + Assert.assertEquals("CallBackBasicITest - test1b", 1, 1); + + return; + } + + private void test1c() { + aCallBackService.multiCallBack("Call me back 3 times"); + int count = 0; + + // + // If we cant get a response in 30 seconds consider this a failure + // + + synchronized (monitor) { + while (this.getCallBackCount() < 3 && count++ < 30) { + try { + monitor.wait(1000L); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + + Assert.assertEquals("CallBackBasicITest - test1c", 3, this.getCallBackCount()); + return; + } + + public String getReturnMessage() { + return returnMessage; + } + + public void setReturnMessage(String aReturnMessage) { + returnMessage = aReturnMessage; + } + + public int getCallBackCount() { + return callBackCount; + } + + public void incrementCallBackCount() { + callBackCount++; + } + + public void callBackMessage(String aString) { + System.out.println("Entering callback callBackMessage: " + aString); + synchronized (monitor) { + this.setReturnMessage(aString); + monitor.notify(); + } + } + + public void callBackIncrement(String aString) { + System.out.println("Entering callback increment: " + aString); + synchronized (monitor) { + this.incrementCallBackCount(); + monitor.notify(); + } + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java new file mode 100644 index 0000000000..bd41fa7037 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.test; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Remotable; + +@Remotable +@Callback(CallBackBasicCallBack.class) +/** + * + */ +public interface CallBackBasicService { + + public void knockKnock(String aString); + + public void noCallBack(String aString); + + public void multiCallBack(String aString); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java new file mode 100644 index 0000000000..4ca2dc9af9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.test; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Service; + +@Service(CallBackBasicService.class) +public class CallBackBasicServiceImpl implements CallBackBasicService { + + @Callback + protected CallBackBasicCallBack callback; + + public void knockKnock(String aString) { + + System.out.println("CallBackBasicServiceImpl message received: " + aString); + callback.callBackMessage("Who's There"); + System.out.println("CallBackBasicServiceImpl response sent"); + return; + + } + + public void multiCallBack(String aString) { + + System.out.println("CallBackBasicServiceImpl message received: " + aString); + callback.callBackIncrement("Who's There 1"); + System.out.println("CallBackBasicServiceImpl response sent"); + callback.callBackIncrement("Who's There 2"); + System.out.println("CallBackBasicServiceImpl response sent"); + callback.callBackIncrement("Who's There 3"); + System.out.println("CallBackBasicServiceImpl response sent"); + return; + + } + + public void noCallBack(String aString) { + + System.out.println("CallBackBasicServiceImpl message received: " + aString); + // System.out.println("CallBackBasicServiceImpl No response desired"); + return; + + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/resources/CallBackBasicTest.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/resources/CallBackBasicTest.composite new file mode 100644 index 0000000000..c506956088 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/resources/CallBackBasicTest.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..adf28214f6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java new file mode 100644 index 0000000000..32c26a348a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-basic/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.test; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +public class CallBackBasicTestCase extends TestCase { + + private static SCADomain domain; + private CallBackBasicClient aCallBackClient; + + public void testCallBackBasic() { + aCallBackClient.run(); + } + + @Override + protected void setUp() throws Exception { + if( domain==null ) { + domain = SCADomain.newInstance("CallBackBasicTest.composite"); + } + + aCallBackClient = domain.getService(CallBackBasicClient.class, "CallBackBasicClient"); + } + + @Override + protected void tearDown() throws Exception { + domain.close(); + } + + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/pom.xml new file mode 100644 index 0000000000..4a42b59b7b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/pom.xml @@ -0,0 +1,45 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-callback-complex-type + Apache Tuscany SCA Callback Complex Type Integration Tests + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeCallBack.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeCallBack.java new file mode 100644 index 0000000000..9fddb850ba --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeCallBack.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 org.apache.tuscany.sca.test; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +/** + * + */ +public interface CallBackCTypeCallBack { + + public void callBackMessage(String aString); + + public void callBackIncrement(String aString); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClient.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClient.java new file mode 100644 index 0000000000..739983c277 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClient.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 org.apache.tuscany.sca.test; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface CallBackCTypeClient { + + public void run(); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClientImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClientImpl.java new file mode 100644 index 0000000000..188b1f2c01 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClientImpl.java @@ -0,0 +1,142 @@ +/* + * 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 org.apache.tuscany.sca.test; + +import junit.framework.Assert; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +@Service(CallBackCTypeClient.class) +public class CallBackCTypeClientImpl implements CallBackCTypeClient, CallBackCTypeCallBack { + + @Reference + protected CallBackCTypeService aCallBackService; + private static String returnMessage = null; + private static int callBackCount = 0; + private static Object monitor = new Object(); + + public CallBackCTypeClientImpl() { + } + + public void run() { + + // This test is the same as the Basic Callback except it uses a + // componentType side file. + // This test currently fails because the integration test environment + // does not properly copy + // the componentType files to the target folder. This is documented in + // Tuscany-967. + + // Test12a is the basic callback where the target calls back prior to + // returning to the client. + test12a(); + + // Test12b is where the target does not call back to the client. + test12b(); + + // Test12c is where the target calls back multiple times to the client. + test12c(); + + return; + } + + private void test12a() { + aCallBackService.knockKnock("Knock Knock"); + int count = 0; + + // + // If we cant get a response in 30 seconds consider this a failure + // + + synchronized (monitor) { + while (returnMessage == null && count++ < 30) { + try { + monitor.wait(1000L); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + + Assert.assertEquals("CallBackBasicITest - test12a -", "Who's There", this.getReturnMessage()); + + } + + private void test12b() { + aCallBackService.noCallBack("No Reply Desired"); + Assert.assertEquals("CallBackBasicITest - test12b -", 1, 1); + return; + } + + private void test12c() { + aCallBackService.multiCallBack("Call me back 3 times"); + int count = 0; + + // + // If we cant get a response in 30 seconds consider this a failure + // + + synchronized (monitor) { + while (this.getCallBackCount() < 3 && count++ < 30) { + try { + monitor.wait(1000L); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + + Assert.assertEquals("CallBackBasicITest - test12c -", 3, this.getCallBackCount()); + return; + } + + public String getReturnMessage() { + return returnMessage; + } + + public void setReturnMessage(String aReturnMessage) { + returnMessage = aReturnMessage; + } + + public int getCallBackCount() { + return callBackCount; + } + + public void incrementCallBackCount() { + callBackCount++; + } + + public void callBackMessage(String aString) { + System.out.println("Entering callback callBackMessage: " + aString); + synchronized (monitor) { + this.setReturnMessage(aString); + monitor.notify(); + } + } + + public void callBackIncrement(String aString) { + System.out.println("Entering callback increment: " + aString); + synchronized (monitor) { + this.incrementCallBackCount(); + monitor.notify(); + } + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeService.java new file mode 100644 index 0000000000..ffbf4f35fa --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeService.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 org.apache.tuscany.sca.test; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +// @Callback(CallBackCTypeCallBack.class) +/** + * + */ +public interface CallBackCTypeService { + + public void knockKnock(String aString); + + public void noCallBack(String aString); + + public void multiCallBack(String aString); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java new file mode 100644 index 0000000000..dc31ed156b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.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 org.apache.tuscany.sca.test; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Service; + +@Service(CallBackCTypeService.class) +public class CallBackCTypeServiceImpl implements CallBackCTypeService { + + @Callback + protected CallBackCTypeCallBack callback; + + public CallBackCTypeServiceImpl() { + } + + public void knockKnock(String aString) { + + System.out.println("CallBackCTypeServiceImpl message received: " + aString); + callback.callBackMessage("Who's There"); + System.out.println("CallBackCTypeServiceImpl response sent"); + return; + + } + + public void multiCallBack(String aString) { + + System.out.println("CallBackCTypeServiceImpl message received: " + aString); + callback.callBackIncrement("Who's There 1"); + System.out.println("CallBackCTypeServiceImpl response sent"); + callback.callBackIncrement("Who's There 2"); + System.out.println("CallBackCTypeServiceImpl response sent"); + callback.callBackIncrement("Who's There 3"); + System.out.println("CallBackCTypeServiceImpl response sent"); + return; + + } + + public void noCallBack(String aString) { + + System.out.println("CallBackCTypeServiceImpl message received: " + aString); + System.out.println("CallBackCTypeServiceImpl No response desired"); + return; + + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/resources/CallBackCTypeClient.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/resources/CallBackCTypeClient.composite new file mode 100644 index 0000000000..3f48f16389 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/resources/CallBackCTypeClient.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/resources/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.componentType b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/resources/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.componentType new file mode 100644 index 0000000000..ff38134df5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/main/resources/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.componentType @@ -0,0 +1,28 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeTestCaseFIXME.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeTestCaseFIXME.java new file mode 100644 index 0000000000..33d1afaecd --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-complex-type/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeTestCaseFIXME.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 org.apache.tuscany.sca.test; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +//FIXME Fix this test case +public class CallBackCTypeTestCaseFIXME extends TestCase { + + private SCADomain domain; + private CallBackCTypeClient aCallBackClient; + + public void testCallBackBasic() { + aCallBackClient.run(); + } + + @Override + protected void setUp() throws Exception { + domain = SCADomain.newInstance("CallBackCTypeClient.composite"); + + aCallBackClient = + domain.getService(CallBackCTypeClient.class, "CallBackCTypeClient"); + } + + @Override + protected void tearDown() throws Exception { + domain.close(); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/pom.xml new file mode 100644 index 0000000000..106fdce5ac --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/pom.xml @@ -0,0 +1,45 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-callback-id + Apache Tuscany SCA Callback ID Integration Tests + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdCallBack.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdCallBack.java new file mode 100644 index 0000000000..b14560a8c3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdCallBack.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 org.apache.tuscany.sca.test; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +/** + * + */ +public interface CallBackIdCallBack { + + public void callBackMessage(String aString); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClient.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClient.java new file mode 100644 index 0000000000..a9e551f8b4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClient.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 org.apache.tuscany.sca.test; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface CallBackIdClient { + + public void run(); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClientImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClientImpl.java new file mode 100644 index 0000000000..fef0eb50b8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClientImpl.java @@ -0,0 +1,147 @@ +/* + * 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 org.apache.tuscany.sca.test; + +import junit.framework.Assert; + +import org.osoa.sca.ComponentContext; +import org.osoa.sca.RequestContext; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +@Service(CallBackIdClient.class) +public class CallBackIdClientImpl implements CallBackIdClient, CallBackIdCallBack { + + @Context + protected ComponentContext componentContext; + + @Reference + protected ServiceReference aCallBackService; + + private static String returnMessage = null; + private static Object monitor = new Object(); + private static Object callBackId; + + public void run() { + + // This tests the use of the set/get callbackId API both SCA generated + // and client specified. + + // Test1 uses a SCA generated callback ID and compare that with the + // callbackID returned during callback. + test11a(); + + // Test2 uses a Client specified callback ID and compare that with the + // callbackID returned during callback. + test11b(); + + return; + } + + private void test11a() { + + // Retrieve this services callback ID and save it. Once the callback is + // received the callback ID will be compared with the one + // returned. Equal is good. + + Object origCallBackId = aCallBackService.getCallbackID(); + aCallBackService.getService().knockKnock("Knock Knock - Test1"); + int count = 0; + + // + // If we cannot get a response in 30 seconds consider this a failure + // + + synchronized (monitor) { + while (returnMessage == null && count++ < 30) { + try { + monitor.wait(1000L); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + + Assert.assertEquals("CallBackIdITest - test11a - SCA Generated Id", origCallBackId, this.getCallBackId()); + + } + + private void test11b() { + + // Set the services callback ID and save it. Once the callback is + // received the callback ID will be compared with the one + // returned. Equal is good. + + String origCallBackId = "CallBackId1"; + aCallBackService.setCallbackID(origCallBackId); + + aCallBackService.getService().knockKnock("Knock Knock - Test2"); + int count = 0; + + // + // If we cant get a response in 30 seconds consider this a failure + // + + synchronized (monitor) { + while (returnMessage == null && count++ < 30) { + try { + monitor.wait(1000L); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + + Assert + .assertEquals("CallBackIdITest - 11b - Client Specified Id", origCallBackId, (String)this.getCallBackId()); + + } + + public String getReturnMessage() { + return returnMessage; + } + + public void setReturnMessage(String aReturnMessage) { + returnMessage = aReturnMessage; + } + + public void callBackMessage(String aString) { + + System.out.println("Entering callback callBackMessage: " + aString); + RequestContext rc = componentContext.getRequestContext(); + Object callBackId = rc.getServiceReference().getCallbackID(); + + synchronized (monitor) { + this.setReturnMessage(aString); + this.setCallBackId(callBackId); + monitor.notify(); + } + } + + protected Object getCallBackId() { + return callBackId; + } + + protected void setCallBackId(Object aCallBackId) { + callBackId = aCallBackId; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdService.java new file mode 100644 index 0000000000..18c592a1c1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdService.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 org.apache.tuscany.sca.test; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Remotable; + +@Remotable +@Callback(CallBackIdCallBack.class) +/** + * + */ +public interface CallBackIdService { + + public void knockKnock(String aString); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdServiceImpl.java new file mode 100644 index 0000000000..8b0a4b69cf --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdServiceImpl.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 org.apache.tuscany.sca.test; + +import org.osoa.sca.ComponentContext; +import org.osoa.sca.RequestContext; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Service; + +@Service(CallBackIdService.class) +public class CallBackIdServiceImpl implements CallBackIdService { + + @Callback + protected CallBackIdCallBack callback; + @Context + protected ComponentContext compositeContext; + + public void knockKnock(String aString) { + + System.out.println("CallBackIdServiceImpl message received: " + aString); + RequestContext rc = compositeContext.getRequestContext(); + Object callBackId = rc.getServiceReference().getCallbackID(); + System.out.println("CallBackIdServiceImpl callbackID: " + callBackId); + + callback.callBackMessage("Who's There"); + System.out.println("CallBackIdServiceImpl response sent"); + return; + + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/resources/CallBackIdClient.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/resources/CallBackIdClient.composite new file mode 100644 index 0000000000..c9a6ba6258 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/main/resources/CallBackIdClient.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/test/java/org/apache/tuscany/sca/test/CallBackIdTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/test/java/org/apache/tuscany/sca/test/CallBackIdTestCase.java new file mode 100644 index 0000000000..771fbb8ff7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-id/src/test/java/org/apache/tuscany/sca/test/CallBackIdTestCase.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 org.apache.tuscany.sca.test; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +public class CallBackIdTestCase extends TestCase { + + private SCADomain domain; + private CallBackIdClient aCallBackClient; + + public void testCallBackBasic() { + aCallBackClient.run(); + } + + @Override + protected void setUp() throws Exception { + domain = SCADomain.newInstance("CallBackIdClient.composite"); + + aCallBackClient = domain.getService(CallBackIdClient.class, "CallBackIdClient"); + } + + @Override + protected void tearDown() throws Exception { + domain.close(); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/pom.xml new file mode 100644 index 0000000000..4dcfd79fc9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/pom.xml @@ -0,0 +1,45 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-callback-multiple-wires + Apache Tuscany SCA Callback With Mutiple Wires Test + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClient.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClient.java new file mode 100644 index 0000000000..7c80d222fc --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClient.java @@ -0,0 +1,27 @@ +/* + * 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 org.apache.tuscany.sca.test.callback; + +/** + * The client interface + */ +public interface MyClient { + + void aClientMethod(); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl1.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl1.java new file mode 100644 index 0000000000..df91f3d268 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl1.java @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.test.callback; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +/** + * Demonstrates a component-to-component callback invocation + */ +@Service(MyClient.class) +@Scope("COMPOSITE") +public class MyClientImpl1 implements MyClient, MyServiceCallback { + + private MyService myService; + static String result; + + @Reference + public void setMyService(MyService myService) { + this.myService = myService; + } + + public void aClientMethod() { + myService.someMethod("-> someMethod1"); + } + + public void receiveResult(String result) { + System.out.println("Work thread " + Thread.currentThread()); + System.out.println("Result: " + result); + MyClientImpl1.result = result; + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl2.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl2.java new file mode 100644 index 0000000000..a0a9564002 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl2.java @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.test.callback; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +/** + * Demonstrates a component-to-component callback invocation + */ +@Service(MyClient.class) +@Scope("COMPOSITE") +public class MyClientImpl2 implements MyClient, MyServiceCallback { + + private MyService myService; + static String result; + + @Reference + public void setMyService(MyService myService) { + this.myService = myService; + } + + public void aClientMethod() { + myService.someMethod("-> someMethod2"); + } + + public void receiveResult(String result) { + System.out.println("Work thread " + Thread.currentThread()); + System.out.println("Result: " + result); + MyClientImpl2.result = result; + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyService.java new file mode 100644 index 0000000000..cfd601f546 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyService.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 org.apache.tuscany.sca.test.callback; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.OneWay; + +/** + * This service that will be invoked in a non-blocking fashion + */ +@Callback(MyServiceCallback.class) +public interface MyService { + + @OneWay + void someMethod(String arg); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceCallback.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceCallback.java new file mode 100644 index 0000000000..f198efae51 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceCallback.java @@ -0,0 +1,27 @@ +/* + * 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 org.apache.tuscany.sca.test.callback; + +/** + * The callback interface for {@link MyService}. + */ +public interface MyServiceCallback { + + void receiveResult(String result); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceImpl.java new file mode 100644 index 0000000000..d19b3fe355 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceImpl.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 org.apache.tuscany.sca.test.callback; + +import org.osoa.sca.RequestContext; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +/** + * This class implements MyService and uses a callback. + */ +@Service(MyService.class) +@Scope("COMPOSITE") +public class MyServiceImpl implements MyService { + + @Context + protected RequestContext requestContext; + + public void someMethod(String arg) { + // invoke the callback + try { + MyServiceCallback myServiceCallback = requestContext.getCallback(); + myServiceCallback.receiveResult(arg + " -> receiveResult"); + } catch(RuntimeException e) { + System.out.println("RuntimeException invoking receiveResult: " + e.toString()); + } + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite new file mode 100644 index 0000000000..3dae3ca3a8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/test/java/org/apache/tuscany/sca/test/callback/CallbackMultiWireTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/test/java/org/apache/tuscany/sca/test/callback/CallbackMultiWireTestCase.java new file mode 100644 index 0000000000..41ba766697 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-multiple-wires/src/test/java/org/apache/tuscany/sca/test/callback/CallbackMultiWireTestCase.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 org.apache.tuscany.sca.test.callback; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +/** + * A testcase that demonstrates resolving the client service and initiating the callback sequence + */ +public class CallbackMultiWireTestCase extends TestCase { + + private SCADomain scaDomain; + private MyClient myClient1; + private MyClient myClient2; + + @Override + protected void setUp() throws Exception { + scaDomain = SCADomain.newInstance("CallbackMultiWireTest.composite"); + myClient1 = scaDomain.getService(MyClient.class, "MyClientComponent1"); + myClient2 = scaDomain.getService(MyClient.class, "MyClientComponent2"); + } + + @Override + protected void tearDown() throws Exception { + scaDomain.close(); + } + + public void test() throws Exception { + System.out.println("Main thread " + Thread.currentThread()); + myClient1.aClientMethod(); + myClient2.aClientMethod(); + System.out.println("Sleeping ..."); + Thread.sleep(300); + assertEquals("-> someMethod1 -> receiveResult", MyClientImpl1.result); + assertEquals("-> someMethod2 -> receiveResult", MyClientImpl2.result); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/pom.xml new file mode 100644 index 0000000000..bfa968a561 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/pom.xml @@ -0,0 +1,45 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-callback-separatethread + Apache Tuscany SCA Callback Using Separate Thread Integration Tests + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClient.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClient.java new file mode 100644 index 0000000000..f812a39058 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClient.java @@ -0,0 +1,34 @@ +/* + * 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 org.apache.tuscany.sca.itest; + +import org.osoa.sca.annotations.Remotable; + +/** + * This is the client interface for the call backs in a separate thread tests + */ +@Remotable +public interface CallBackSeparateThreadClient { + + /** + * This tests call back patterns using separate threads. + */ + void runTests(); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClientImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClientImpl.java new file mode 100644 index 0000000000..e861f8a3d1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClientImpl.java @@ -0,0 +1,172 @@ +/* + * 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 org.apache.tuscany.sca.itest; + +import java.util.concurrent.atomic.AtomicInteger; + +import junit.framework.Assert; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * This is the client implementation for the call backs in a separate thread tests + */ +@Service(CallBackSeparateThreadClient.class) +public class CallBackSeparateThreadClientImpl implements CallBackSeparateThreadClient, EventProcessorCallBack { + /** + * Used to sleep for 60 seconds. + */ + private static final int SIXTY_SECONDS = 60 * 1000; + + /** + * Counts the number of one second call backs + */ + private static final AtomicInteger oneSecondCallbackCount = new AtomicInteger(); + + /** + * Counts the number of five second call backs + */ + private static final AtomicInteger fiveSecondCallbackCount = new AtomicInteger(); + + /** + * This is our injected reference to the EventProcessorService + */ + @Reference + protected EventProcessorService aCallBackService; + + /** + * This tests call back patterns using separate threads. + */ + public void runTests() { + // Register for 1 second call back + registerFor1SecondCallback(); + + // Wait for a few 1 second call backs + System.out.println("Waiting for some 1 second calls"); + waitForSome1SecondCallbacks(); + + // Register for 5 second call back + registerFor5SecondCallback(); + + // Wait for a few 1 second call backs + System.out.println("Waiting for some 1 second calls"); + waitForSome1SecondCallbacks(); + + // Wait for a few 5 second call backs + System.out.println("Waiting for some 5 second calls"); + waitForSome5SecondCallbacks(); + + System.out.println("Done"); + } + + /** + * Waits for some one second call backs to be fired + */ + private void waitForSome1SecondCallbacks() { + // Reset the one second call back count + oneSecondCallbackCount.set(0); + + // Wait until we have 10 1 second call backs or 60 seconds has passed + final long start = System.currentTimeMillis(); + do { + if (oneSecondCallbackCount.get() >= 10) { + System.out.println("Received enough 1 second notifications"); + return; + } + + try { + Thread.sleep(500); + } catch (InterruptedException e) { + Assert.fail("Unexpeceted exception " + e); + } + } + while (System.currentTimeMillis() - start < SIXTY_SECONDS); + + // If we get to here then we did not receive enough events + Assert.fail("Did not receive enough 1 second events"); + } + + /** + * Waits for some five second call backs to be fired + */ + private void waitForSome5SecondCallbacks() { + // Reset the five second call back count + fiveSecondCallbackCount.set(0); + + // Wait until we have 4 5 second call backs or 60 seconds has passed + final long start = System.currentTimeMillis(); + do + { + if (fiveSecondCallbackCount.get() >= 4) { + System.out.println("Received enough 5 second notifications"); + return; + } + + try + { + Thread.sleep(500); + } + catch (InterruptedException e) + { + Assert.fail("Unexpeceted exception " + e); + } + } + while (System.currentTimeMillis() - start < SIXTY_SECONDS); + + // If we get to here then we did not receive enough events + Assert.fail("Did not receive enough 5 second events"); + } + + /** + * Register to receive one second call backs + */ + private void registerFor1SecondCallback() { + aCallBackService.registerForEvent("ONE"); + return; + } + + /** + * Register to receive five second call backs + */ + private void registerFor5SecondCallback() { + aCallBackService.registerForEvent("FIVE"); + } + + /** + * Method that is called when an Event is delivered. + * + * @param aEventName The name of the Event + * @param aEventData The Event data + */ + public void eventNotification(String aEventName, Object aEventData) { + // System.out.println("Received Event : " + aEventName + " " + aEventData); + + if (aEventName.equals("ONE")) { + final int newValue = oneSecondCallbackCount.incrementAndGet(); + //System.out.println("Received total of " + newValue + " 1 second call backs"); + } else if (aEventName.equals("FIVE")) { + final int newValue = fiveSecondCallbackCount.incrementAndGet(); + //System.out.println("Received total of " + newValue + " 5 second call backs"); + } + else + System.out.println("Unknown event type of " + aEventName); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorCallBack.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorCallBack.java new file mode 100644 index 0000000000..ae41f596fc --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorCallBack.java @@ -0,0 +1,38 @@ +/* + * 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 org.apache.tuscany.sca.itest; + + +import org.osoa.sca.annotations.Remotable; + +/** + * The call back interface for the EventProcessorService that is implemented + * by the client to receive event notifications + */ +@Remotable +public interface EventProcessorCallBack { + /** + * Call back notifying client of an Event + * + * @param aEventName The name of the Event + * @param aEventData The data for the Event + */ + void eventNotification(String aEventName, Object aEventData); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorService.java new file mode 100644 index 0000000000..c22b8cceec --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorService.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 org.apache.tuscany.sca.itest; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.Remotable; + + +/** + * Sample Event Processor Service + */ +@Conversational +@Callback(EventProcessorCallBack.class) +@Remotable +public interface EventProcessorService { + + /** + * Registers the client to receive notifications for the specified event + * + * @param aEventName The name of the Event to register + */ + void registerForEvent(String aEventName); + + /** + * Unregisters the client so it no longer receives notifications for the specified event + * + * @param aEventName The name of the Event to unregister + */ + void unregisterForEvent(String aEventName); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorServiceImpl.java new file mode 100644 index 0000000000..a081f8866b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorServiceImpl.java @@ -0,0 +1,197 @@ +/* + * 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 org.apache.tuscany.sca.itest; + +import java.util.Map; +import java.util.Timer; +import java.util.TimerTask; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; + +import org.osoa.sca.CallableReference; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +/** + * Sample Event Processor Service Implementation + */ +@Service(EventProcessorService.class) +@Scope("CONVERSATION") +public class EventProcessorServiceImpl implements EventProcessorService { + + /** + * Reference to the call back + */ + @Callback + protected CallableReference clientCallback; + + /** + * This map contains the call backs for each of the registered Event names + */ + private final Map> eventListeners; + + /** + * The list of all Event Generators we create + */ + private final EventGenerator[] allEventGenerators; + + /** + * Constructor. Starts the Event Generators + */ + public EventProcessorServiceImpl() { + eventListeners = new ConcurrentHashMap>(); + + // We will simulate an Event generator + allEventGenerators = new EventGenerator[2]; + allEventGenerators[0] = new EventGenerator("ONE", 1); // Generate the SECOND event every second + allEventGenerators[1] = new EventGenerator("FIVE", 5); // Generate the FIVE event every 5 seconds + } + + /** + * Registers the client to receive notifications for the specified event + * + * @param aEventName The name of the Event to register + */ + public void registerForEvent(String aEventName) + { + // Register for the Event + eventListeners.put(aEventName, clientCallback); + + // Send the "register" started event to the client + receiveEvent(aEventName, "SameThread: Registered to receive notifications for " + aEventName); + } + + /** + * Unregisters the client so it no longer receives notifications for the specified event + * + * @param aEventName The name of the Event to unregister + */ + public void unregisterForEvent(String aEventName) + { + // Send the "register" started event to the client + receiveEvent(aEventName, "SameThread: Unregister from receiving notifications for " + aEventName); + + eventListeners.remove(aEventName); + } + + /** + * This method is called whenever the EventProcessorService receives an Event + * + * @param aEventName The name of the Event received + * @param aEventData The Event data + */ + private void receiveEvent(String aEventName, Object aEventData) + { + // Get the listener for the Event + final CallableReference callback = eventListeners.get(aEventName); + if (callback == null) + { + //System.out.println("No registered listeners for " + aEventName); + return; + } + + // Trigger the call back + // System.out.println("Notifying " + callback + " of event " + aEventName); + callback.getService().eventNotification(aEventName, aEventData); + // System.out.println("Done notify " + callback + " of event " + aEventName); + } + + /** + * Shuts down the Event Processor + */ + @Destroy + protected void shutdown() + { + System.out.println("Shutting down the EventProcessor"); + + // Clear list of call back locations as we don't want to send any more notifications + eventListeners.clear(); + + // Stop the Event Generators + for (EventGenerator generator : allEventGenerators) + { + generator.stop(); + } + } + + /** + * Utility class for generating Events + */ + private class EventGenerator + { + /** + * The Timer we are using to generate the events + */ + private final Timer timer = new Timer(); + + /** + * Constructor + * + * @param aEventName The name of the Event to generate + * @param frequencyInSeconds How frequently we should generate the Events + */ + private EventGenerator(String aEventName, int frequencyInSeconds) + { + timer.schedule(new EventGeneratorTimerTask(aEventName), + frequencyInSeconds * 1000, frequencyInSeconds * 1000); + } + + /** + * Stop this Event Generator + */ + private void stop() + { + timer.cancel(); + } + + /** + * The TimerTask that is invoked by the Timer for the EventGenerator + */ + private class EventGeneratorTimerTask extends TimerTask + { + /** + * The name of the Event we should generate + */ + private final String eventName; + + /** + * Constructor + * + * @param aEventName The name of the Event we should generate + */ + private EventGeneratorTimerTask(String aEventName) + { + eventName = aEventName; + } + + /** + * Timer calls this method and it will generate an Event + */ + @Override + public void run() + { + // System.out.println("Generating new event " + eventName); + receiveEvent(eventName, "Separate Thread Notification: " + UUID.randomUUID().toString()); + } + } + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite new file mode 100644 index 0000000000..e111e5074c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/test/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/test/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadTestCase.java new file mode 100644 index 0000000000..f7e7be2133 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-separatethread/src/test/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadTestCase.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 org.apache.tuscany.sca.itest; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +/** + * This test case will attempt to trigger a call back using a separate thread + */ +public class CallBackSeparateThreadTestCase extends TestCase { + + /** + * The SCADomain we are using + */ + private SCADomain domain; + + /** + * The client the tests should use + */ + private CallBackSeparateThreadClient aCallBackClient; + + /** + * Run the call back in separate thread tests + */ + public void testCallBackSeparateThread() { + aCallBackClient.runTests(); + } + + /** + * Load the Call back in separate thread composite and look up the client. + */ + @Override + protected void setUp() throws Exception { + domain = SCADomain.newInstance("CallBackSeparateThreadTest.composite"); + aCallBackClient = domain.getService(CallBackSeparateThreadClient.class, "CallBackSeparateThreadClient"); + } + + /** + * Shutdown the SCA domain + */ + @Override + protected void tearDown() throws Exception { + domain.close(); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/pom.xml new file mode 100644 index 0000000000..0513f68393 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/pom.xml @@ -0,0 +1,45 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-callback-set-callback + Apache Tuscany SCA Set Callback Integration Tests + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCalbackService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCalbackService.java new file mode 100644 index 0000000000..3b9599f53f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCalbackService.java @@ -0,0 +1,34 @@ +/* + * 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 org.apache.tuscany.sca.test; + +import org.osoa.sca.annotations.Callback; + +// @Remotable +@Callback(CallBackSetCallbackCallback.class) +/** + * + */ +public interface CallBackSetCalbackService { + + public void knockKnock(String aString); + + public boolean setCallbackIllegally(String aString); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackBadCallback.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackBadCallback.java new file mode 100644 index 0000000000..48752f2ea1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackBadCallback.java @@ -0,0 +1,38 @@ +/* + * 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 org.apache.tuscany.sca.test; + +import junit.framework.Assert; + +public class CallBackSetCallbackBadCallback { + + public CallBackSetCallbackBadCallback() { + super(); + } + + public void callback(String aString) { + // + // This callback method should never be called. + // + System.out.println("CallBackSetCallbackBadCallback: callback called"); + Assert.fail("CallBackSetCallbackBadCallback: callback called"); + return; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallback.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallback.java new file mode 100644 index 0000000000..ad0e0603a3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallback.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 org.apache.tuscany.sca.test; + +// @Remotable +/** + * + */ +public interface CallBackSetCallbackCallback { + + public void callBackMessage(String aString); + + public void callBackIncrement(String aString); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallbackImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallbackImpl.java new file mode 100644 index 0000000000..0a22b0e01f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallbackImpl.java @@ -0,0 +1,66 @@ +/* + * 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 org.apache.tuscany.sca.test; + +import java.io.File; + +import org.osoa.sca.annotations.Service; + +@Service(CallBackSetCallbackCallback.class) +public class CallBackSetCallbackCallbackImpl implements CallBackSetCallbackCallback { + + private static String returnMessage = null; + private static int callBackCount = 0; + + public String getReturnMessage() { + return returnMessage; + } + + public void setReturnMessage(String aReturnMessage) { + returnMessage = aReturnMessage; + } + + public int getCallBackCount() { + return callBackCount; + } + + public void incrementCallBackCount() { + callBackCount++; + } + + public void callBackMessage(String aString) { + + System.out.println("Entering CallBackSetCallbackCallbackImpl callBackMessage: " + aString); + + File aFile = new File("target/test4_marker"); + try { + aFile.createNewFile(); + } catch (Exception ex) { + System.out.println("Error Creating target/test4_marker marker file"); + ex.printStackTrace(); + } + + } + + public void callBackIncrement(String aString) { + System.out.println("Entering callback increment: " + aString); + this.incrementCallBackCount(); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClient.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClient.java new file mode 100644 index 0000000000..94cb6aa73b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClient.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 org.apache.tuscany.sca.test; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface CallBackSetCallbackClient { + + public void run(); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClientImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClientImpl.java new file mode 100644 index 0000000000..ee14467de0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClientImpl.java @@ -0,0 +1,190 @@ +/* + * 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 org.apache.tuscany.sca.test; + +import java.io.File; + +import junit.framework.Assert; + +import org.osoa.sca.NoRegisteredCallbackException; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +@Service(CallBackSetCallbackClient.class) +public class CallBackSetCallbackClientImpl implements CallBackSetCallbackClient { + + @Reference + protected ServiceReference aCallBackService; + @Reference + protected ServiceReference callBack; + + public void run() { + + // This test various aspects of the setCallback() API in a stateless + // scope. + + /* + * test4 Client does not implement the callback interface but calls + * setCallback with a service reference before invoking the target, + * Verify successful executon. + */ + + test4(); + + /* + * test5 The client does not implement the callback interface and does + * not call setCallback() before invoking the target. Verify a + * NoRegisteredCallbackException is thrown. + */ + + test5(); + + /* + * test6() The client calls setCallback() with an object that is not a + * service reference and the callback interface is stateless. Verify + * that an appropriate exception is thrown. When calling setCallback + * with an object the interface must be stateful. Stateless interfaces + * require a service Reference. + */ + + test6(); + + /* + * test10 The target calls setCallback() on its own service reference, + * e.g. getRequestContext().getServiceReference().getCallback(). Verify + * an appropriate exeception occurs. + */ + + test10(); + + return; + } + + private void test4() { + + // + // Since callbacks do not synchronously return and this test results in + // a callback to a component other + // than this client I am using a marker file to determine the outcome. + // The presence of the marker + // file will be used for the Assertion test. If it exists then the + // callback occurred and all is good. + // + + // Make sure the marker file is not present before starting the test. + File aFile = new File("target/test4_marker"); + if (aFile.exists()) + aFile.delete(); + + aCallBackService.setCallback(callBack); + + aCallBackService.getService().knockKnock("Knock Knock"); + + // Lets give the callback a little time to complete.... + + int count = 0; + long timeout = 1000; + + while (count++ < 30 && (aFile.exists() == false)) { + try { + Thread.sleep(timeout); + } catch (InterruptedException ie) { + } + } + + Assert.assertEquals("CallBackSetCallback - Test4", true, aFile.exists()); + + aCallBackService.setCallback(null); // leave this in the default state for next test + + } + + private void test5() { + + boolean correctException = false; + + // + // The backend service is expecting a callback reference to be set. This + // test will not + // set one so an exception is expected. According to the spec if a + // client calls a method on + // a service reference prior to calling setCallback() then a + // NoRegisteredCallbackException + // will be thrown on the client. + // + + try { + aCallBackService.getService().knockKnock("Knock Knock"); + } catch (NoRegisteredCallbackException NotRegEx) { + correctException = true; + } catch (Exception ex) { + ex.printStackTrace(); + } + + Assert.assertEquals("CallBackSetCallback - Test5", true, correctException); + + } + + private void test6() { + + boolean correctException = false; + + // + // This test is to specify an Object that is not a service reference + // that does implement + // the callback interface. However because this callback service is + // stateless the expected + // result is an appropriate exception. + // + + try { + aCallBackService.setCallback(new CallBackSetCallbackObjectCallback()); + aCallBackService.getService().knockKnock("Knock Knock"); + } + // + // This should catch an appropriate exception. + // + catch (IllegalArgumentException goodEx) { + correctException = true; + } catch (Exception ex) { + ex.printStackTrace(); + } + + Assert.assertEquals("CallBackSetCallback - Test6", true, correctException); + + } + + private void test10() { + + // + // The appropriate exception should be thrown and caught on the service side. + // If this happens, the setCallbackIllegally() method will return true. + // If not, this method will return false. + // + + aCallBackService.setCallback(callBack); // ensure no client-side exception + + boolean result = aCallBackService.getService().setCallbackIllegally + ("Try to set callback on your own service reference"); + + Assert.assertEquals("CallBackSetCallback - Test10", true, result); + + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackObjectCallback.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackObjectCallback.java new file mode 100644 index 0000000000..afedcdf7f1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackObjectCallback.java @@ -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. + */ +package org.apache.tuscany.sca.test; + +public class CallBackSetCallbackObjectCallback implements CallBackSetCallbackCallback { + + private int callBackCount = 0; + + public CallBackSetCallbackObjectCallback() { + super(); + } + + public void incrementCallBackCount() { + callBackCount++; + } + + public void callBackMessage(String aString) { + + System.out.println("Entering CallBackSetCallbackObjectCallback callBackMessage: " + aString); + + } + + public void callBackIncrement(String aString) { + System.out.println("Entering callback increment: " + aString); + this.incrementCallBackCount(); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackServiceImpl.java new file mode 100644 index 0000000000..8093093968 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackServiceImpl.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 org.apache.tuscany.sca.test; + +import java.io.File; + +import org.osoa.sca.ComponentContext; +import org.osoa.sca.RequestContext; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Service; + +@Service(CallBackSetCalbackService.class) +public class CallBackSetCallbackServiceImpl implements CallBackSetCalbackService { + + @Callback + protected CallBackSetCallbackCallback callback; + @Context + protected ComponentContext context; + + public void knockKnock(String aString) { + + try { + System.out.println("CallBackBasicServiceImpl message received: " + aString); + callback.callBackMessage("Who's There"); + System.out.println("CallBackBasicServiceImpl response sent"); + return; + } catch (Exception ex) { + ex.printStackTrace(); + } + + } + + public boolean setCallbackIllegally(String aString) { + + System.out.println("CallBackBasicServiceImpl.setCallbackIllegally() message received: " + aString); + + boolean exceptionProduced = false; + RequestContext requestContext = null; + ServiceReference serviceRef = null; + + try { + requestContext = context.getRequestContext(); + serviceRef = (ServiceReference) requestContext.getServiceReference(); + serviceRef.setCallback(serviceRef); + } catch (ClassCastException goodEx) { + exceptionProduced = true; + System.out.println("Test10 appropriate exception caught during setCallback to own service reference"); + } catch (Exception badEx) { + System.out.println("CallBackBasicServiceImpl.setCallbackIllegally() " + badEx.toString()); + badEx.printStackTrace(); + } + + // Return a flag indicating whether we got the exception we are looking for + return exceptionProduced; + + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/resources/CallBackSetCallbackTest.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/resources/CallBackSetCallbackTest.composite new file mode 100644 index 0000000000..3552ddecab --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/main/resources/CallBackSetCallbackTest.composite @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackTestCase.java new file mode 100644 index 0000000000..496ae0b1a5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-callback/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackTestCase.java @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.test; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +//FIXME Fix this test case +public class CallBackSetCallbackTestCase extends TestCase { + + private SCADomain domain; + private CallBackSetCallbackClient aCallBackClient; + + public void testCallBackSetCallback() { + aCallBackClient.run(); + } + + @Override + protected void setUp() throws Exception { + domain = SCADomain.newInstance("CallBackSetCallbackTest.composite"); + + aCallBackClient = + domain.getService(CallBackSetCallbackClient.class, + "CallBackSetCallbackClient"); + } + + @Override + protected void tearDown() throws Exception { + domain.close(); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/pom.xml new file mode 100644 index 0000000000..c70b2969ba --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/pom.xml @@ -0,0 +1,45 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-callback-set-conversation + Apache Tuscany SCA Callback Set Conversation Integration Tests + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java new file mode 100644 index 0000000000..eb840a006d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java @@ -0,0 +1,38 @@ +/* + * 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 org.apache.tuscany.sca.test; + +import junit.framework.Assert; + +public class CallBackSetCallbackConvBadCallback { + + public CallBackSetCallbackConvBadCallback() { + super(); + } + + public void callback(String aString) { + // + // This callback method should never be called. + // + System.out.println("CallBackSetCallbackBadCallback: callback called"); + Assert.fail("CallBackSetCallbackConvBadCallback: callback called"); + return; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java new file mode 100644 index 0000000000..a704fd0ece --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java @@ -0,0 +1,34 @@ +/* + * 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 org.apache.tuscany.sca.test; + +import org.osoa.sca.annotations.Conversational; + +// @Remotable +@Conversational +/** + * + */ +public interface CallBackSetCallbackConvCallback { + + public void callBackMessage(String aString); + + public void callBackIncrement(String aString); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java new file mode 100644 index 0000000000..013424bf5e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.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 org.apache.tuscany.sca.test; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface CallBackSetCallbackConvClient { + + public void run(); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java new file mode 100644 index 0000000000..475d7fc96d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java @@ -0,0 +1,174 @@ +/* + * 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 org.apache.tuscany.sca.test; + +import junit.framework.Assert; + +import org.osoa.sca.ComponentContext; +import org.osoa.sca.NoRegisteredCallbackException; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(CallBackSetCallbackConvClient.class) +@Scope("CONVERSATION") +public class CallBackSetCallbackConvClientImpl implements CallBackSetCallbackConvClient, + //FIXME: remove the following hack, needed to get around current JavaImplementationInvoker limitation + CallBackSetCallbackConvCallback { + + @Context + protected ComponentContext componentContext; + @Reference + protected CallBackSetCallbackConvService aCallBackService; + private CallBackSetCallbackConvObjectCallback aCallbackObject = null; + + public void run() { + + // This tests aspects of the setCallback() API within a conversational + // scope. + + /* + * test7 The client calls setCallback() with an object that is not a + * service reference and the callback interface is stateful. Verify + * successful execution. + */ + test7(); + + /* + * test8() The client calls setCallback() with an object that does not + * implement the callback interface. Verify an appropriate exception is + * thrown. This requires a STATEFUL interface. + */ + test8(); + + /* + * test9 The client calls setCallback() with an object that is not + * serializable. Verify an appropriate exception is thrown. This + * requires a STATEFUL callback interface. Move from the stateless test + * case. + */ + test9(); + + return; + } + + private void test7() { + + // + // This test is to specify an Object that is not a service reference + // that does implement + // the callback interface and is Serializeable. Verify successful + // execution. + // + + aCallbackObject = new CallBackSetCallbackConvObjectCallback(); + aCallbackObject.incrementCallBackCount(); + + ServiceReference aCallBackServiceRef + = componentContext.cast(aCallBackService); + aCallBackServiceRef.setCallback(aCallbackObject); + aCallBackService.knockKnock("Knock Knock"); + + Assert.assertEquals("CallBackSetCallbackConv - Test7", 2, aCallbackObject.getCount()); + + } + + private void test8() { + + boolean correctException = false; + + // + // This test is to specify an Object that is not a service reference + // that does not implement + // the callback interface. The expected result is an appropriate + // exception. + // + + try { + ServiceReference aCallBackServiceRef + = componentContext.cast(aCallBackService); + aCallBackServiceRef.setCallback(new CallBackSetCallbackConvBadCallback()); + aCallBackService.knockKnock("Knock Knock"); + } + + // + // This should catch an appropriate exception. + // + + catch (IllegalArgumentException goodEx) + { + System.out.println("correct exception " + goodEx); + correctException = true; + } + + catch (Exception ex) { + // This means an inappropriate exception occurred + ex.printStackTrace(); + } + + Assert.assertEquals("CallBackSetCallbackConv - Test8", true, correctException); + + } + + private void test9() { + + boolean correctException = false; + + // + // This test is to specify an Object that is not a service reference + // that does implement + // the callback interface but does not implement Serializeable. Verify + // an appropriate exception + // is thrown. + // + + try { + ServiceReference aCallBackServiceRef + = componentContext.cast(aCallBackService); + aCallBackServiceRef.setCallback(new CallBackSetCallbackConvNonSerCallback()); + aCallBackService.knockKnock("Knock Knock"); + } + // + // This should catch an appropriate exception. + // + catch (IllegalArgumentException goodEx) + { + System.out.println("correct exception " + goodEx); + correctException = true; + } catch (Exception ex) { + ex.printStackTrace(); + } + + Assert.assertEquals("CallBackSetCallbackConv - Test9", true, correctException); + + } + + //FIXME: remove the following methods, needed to get around current JavaImplementationInvoker limitation + + public void callBackMessage(String aString) { + throw new IllegalStateException("CallbackSetCallbackConvClientImpl.callbackMessage called"); + } + + public void callBackIncrement(String aString) { + throw new IllegalStateException("CallbackSetCallbackConvClientImpl.callbackIncrement called"); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java new file mode 100644 index 0000000000..789e04e907 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.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 org.apache.tuscany.sca.test; + +public class CallBackSetCallbackConvNonSerCallback implements CallBackSetCallbackConvCallback { + + private int callBackCount = 0; + private Object monitor; + + public CallBackSetCallbackConvNonSerCallback() { + super(); + } + + public synchronized void incrementCallBackCount() { + callBackCount++; + } + + public synchronized int getCount() { + return callBackCount; + } + + public void setMonitor(Object anObject) { + monitor = anObject; + } + + public void callBackMessage(String aString) { + + System.out.println("Entering CallBackSetCallbackConvNonSerCallback callBackMessage: " + aString); + + } + + public void callBackIncrement(String aString) { + + System.out.println("Entering callback increment: " + aString); + + synchronized (monitor) { + this.incrementCallBackCount(); + monitor.notify(); + } + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java new file mode 100644 index 0000000000..9b998df045 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java @@ -0,0 +1,54 @@ +/* + * 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 org.apache.tuscany.sca.test; + + +public class CallBackSetCallbackConvObjectCallback + //FIXME: remove the following hack, needed to get around current JavaImplementationInvoker limitation + extends CallBackSetCallbackConvClientImpl + //implements CallBackSetCallbackConvCallback +{ + private int callBackCount = 0; + + public CallBackSetCallbackConvObjectCallback() { + super(); + } + + public synchronized void incrementCallBackCount() { + callBackCount++; + } + + public synchronized int getCount() { + return callBackCount; + } + + public void callBackMessage(String aString) { + + System.out.println("Entering CallBackSetCallbackObjectCallback callBackMessage: " + aString); + + } + + public void callBackIncrement(String aString) { + + System.out.println("Entering callback increment: " + aString); + + this.incrementCallBackCount(); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java new file mode 100644 index 0000000000..692b6dfc35 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.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 org.apache.tuscany.sca.test; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Conversational; + +// @Remotable +@Conversational +@Callback(CallBackSetCallbackConvCallback.class) +/** + * + */ +public interface CallBackSetCallbackConvService { + + public void knockKnock(String aString); + + public void setCallbackIllegally(String aString); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java new file mode 100644 index 0000000000..bca94ce407 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.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 org.apache.tuscany.sca.test; + +import java.io.File; + +import org.osoa.sca.ComponentContext; +import org.osoa.sca.RequestContext; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(CallBackSetCallbackConvService.class) +@Scope("CONVERSATION") +public class CallBackSetCallbackConvServiceImpl implements CallBackSetCallbackConvService { + + @Callback + protected CallBackSetCallbackConvCallback callback; + @Context + protected ComponentContext context; + + public void knockKnock(String aString) { + + System.out.println("CallBackSetCallbackConvServiceImpl message received: " + aString); + callback.callBackMessage("Who's There"); + callback.callBackIncrement("This should do it"); + System.out.println("CallBackSetCallbackConvServiceImpl response sent"); + + } + + public void setCallbackIllegally(String aString) { + + System.out.println("CallBackBasicServiceImpl.setCallbackIllegally() message received: " + aString); + + boolean exceptionProduced = false; + RequestContext requestContext = null; + ServiceReference serviceRef = null; + + // Context is not working properly so we can't trust that this is + // working..... + try { + requestContext = context.getRequestContext(); + serviceRef = (ServiceReference) requestContext.getServiceReference(); + } catch (Exception ex) { + System.out.println("CallBackBasicServiceImpl.setCallbackIllegally() " + ex.toString()); + ex.printStackTrace(); + return; + } + + // Ok, call setCallback with my own service reference. + try { + serviceRef.setCallback(serviceRef); + } catch (NullPointerException npe) { + // This is not an appropriate exception. + System.out.println("Test10 NPE exception during setCallback to own service reference"); + npe.printStackTrace(); + return; + } + // This needs to catch the appropriate exception, once we figure out + // what is needs to be! + catch (Exception ex) { + exceptionProduced = true; + System.out.println("Test10 appropriate exception caught during setCallback to own service reference"); + } + ; + + // If we get the exception we are looking for then create the marker + // file. + if (exceptionProduced == true) { + File aFile = new File("target/test10_marker"); + try { + aFile.createNewFile(); + } catch (Exception ex) { + System.out.println("Error Creating target/test10_marker marker file"); + ex.printStackTrace(); + } + } + + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/resources/CallBackSetCallbackConvTest.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/resources/CallBackSetCallbackConvTest.composite new file mode 100644 index 0000000000..ce73417f94 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/main/resources/CallBackSetCallbackConvTest.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvTestCase.java new file mode 100644 index 0000000000..45bdaea9ab --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/callback-set-conversation/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvTestCase.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 org.apache.tuscany.sca.test; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +public class CallBackSetCallbackConvTestCase extends TestCase { + + private SCADomain domain; + private CallBackSetCallbackConvClient aCallBackClient; + + public void testCallBackSetCallback() { + aCallBackClient.run(); + } + + @Override + protected void setUp() throws Exception { + domain = SCADomain.newInstance("CallBackSetCallbackConvTest.composite"); + + aCallBackClient = + domain.getService(CallBackSetCallbackConvClient.class, + "CallBackSetCallbackConvClient"); + } + + @Override + protected void tearDown() throws Exception { + domain.close(); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/pom.xml new file mode 100644 index 0000000000..b9630653d9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-component-type + Apache Tuscany SCA Component Type Integration Tests + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/AddService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/AddService.java new file mode 100644 index 0000000000..188451ebac --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/AddService.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 calculator; + +/** + * The Add service interface + */ +public interface AddService { + + double add(double n1, double n2); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/AddServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/AddServiceImpl.java new file mode 100644 index 0000000000..8b6fe066a6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/AddServiceImpl.java @@ -0,0 +1,30 @@ +/* + * 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 calculator; + +/** + * An implementation of the Add service + */ +public class AddServiceImpl implements AddService { + + public double add(double n1, double n2) { + return n1 + n2; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/CalculatorClient.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/CalculatorClient.java new file mode 100644 index 0000000000..08afd922b3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/CalculatorClient.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 calculator; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +/** + * This client program shows how to create an SCA runtime, start it, + * and locate and invoke a SCA component + */ +public class CalculatorClient { + public static void main(String[] args) throws Exception { + + SCADomain scaDomain = SCADomain.newInstance("Calculator.composite"); + + CalculatorService calculatorService = + scaDomain.getService(CalculatorService.class, "CalculatorServiceComponent/CalculatorService"); + + // Calculate + System.out.println("3 + 2=" + calculatorService.add(3, 2)); + System.out.println("3 - 2=" + calculatorService.subtract(3, 2)); + System.out.println("3 * 2=" + calculatorService.multiply(3, 2)); + System.out.println("3 / 2=" + calculatorService.divide(3, 2)); + + scaDomain.close(); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/CalculatorService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/CalculatorService.java new file mode 100644 index 0000000000..031fa8b912 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/CalculatorService.java @@ -0,0 +1,35 @@ +/* + * 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 calculator; + + +/** + * The Calculator service interface. + */ +public interface CalculatorService { + + double add(double n1, double n2); + + double subtract(double n1, double n2); + + double multiply(double n1, double n2); + + double divide(double n1, double n2); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/CalculatorServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/CalculatorServiceImpl.java new file mode 100644 index 0000000000..f14ee506df --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/CalculatorServiceImpl.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 calculator; + +import org.osoa.sca.annotations.Reference; + + + +/** + * An implementation of the Calculator service. + */ +public class CalculatorServiceImpl implements CalculatorService { + + private AddService addService; + private SubtractService subtractService; + private MultiplyService multiplyService; + private DivideService divideService; + + public void setAddService(AddService addService) { + this.addService = addService; + } + + public void setSubtractService(SubtractService subtractService) { + this.subtractService = subtractService; + } + + public void setDivideService(DivideService divideService) { + this.divideService = divideService; + } + + public void setMultiplyService(MultiplyService multiplyService) { + this.multiplyService = multiplyService; + } + + public double add(double n1, double n2) { + return addService.add(n1, n2); + } + + public double subtract(double n1, double n2) { + return subtractService.subtract(n1, n2); + } + + public double multiply(double n1, double n2) { + return multiplyService.multiply(n1, n2); + } + + public double divide(double n1, double n2) { + return divideService.divide(n1, n2); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/DivideService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/DivideService.java new file mode 100644 index 0000000000..30d248208b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/DivideService.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 calculator; + +/** + * The divide service interface + */ +public interface DivideService { + + double divide(double n1, double n2); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/DivideServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/DivideServiceImpl.java new file mode 100644 index 0000000000..f7ac0b7287 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/DivideServiceImpl.java @@ -0,0 +1,30 @@ +/* + * 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 calculator; + +/** + * An implementation of the Divide service. + */ +public class DivideServiceImpl implements DivideService { + + public double divide(double n1, double n2) { + return n1 / n2; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/MultiplyService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/MultiplyService.java new file mode 100644 index 0000000000..5290605938 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/MultiplyService.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 calculator; + +/** + * The interface for the multiply service + */ +public interface MultiplyService { + + double multiply(double n1, double n2); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/MultiplyServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/MultiplyServiceImpl.java new file mode 100644 index 0000000000..b7dca792b2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/MultiplyServiceImpl.java @@ -0,0 +1,30 @@ +/* + * 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 calculator; + +/** + * An implementation of the Multiply service. + */ +public class MultiplyServiceImpl implements MultiplyService { + + public double multiply(double n1, double n2) { + return n1 * n2; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/SubtractService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/SubtractService.java new file mode 100644 index 0000000000..bf0d1882b6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/SubtractService.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 calculator; + +/** + * The interface for the multiply service + */ +public interface SubtractService { + + double subtract(double n1, double n2); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/SubtractServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/SubtractServiceImpl.java new file mode 100644 index 0000000000..77b128ab8d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/java/calculator/SubtractServiceImpl.java @@ -0,0 +1,30 @@ +/* + * 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 calculator; + +/** + * An implementation of the subtract service. + */ +public class SubtractServiceImpl implements SubtractService { + + public double subtract(double n1, double n2) { + return n1 - n2; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/Calculator.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/Calculator.composite new file mode 100644 index 0000000000..b229787657 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/Calculator.composite @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/calculator/AddServiceImpl.componentType b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/calculator/AddServiceImpl.componentType new file mode 100644 index 0000000000..00c48e5a35 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/calculator/AddServiceImpl.componentType @@ -0,0 +1,27 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/calculator/CalculatorServiceImpl.componentType b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/calculator/CalculatorServiceImpl.componentType new file mode 100644 index 0000000000..74bedc0a98 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/calculator/CalculatorServiceImpl.componentType @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/calculator/DivideServiceImpl.componentType b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/calculator/DivideServiceImpl.componentType new file mode 100644 index 0000000000..289fcc3e11 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/calculator/DivideServiceImpl.componentType @@ -0,0 +1,27 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/calculator/MultiplyServiceImpl.componentType b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/calculator/MultiplyServiceImpl.componentType new file mode 100644 index 0000000000..2d8a879cda --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/calculator/MultiplyServiceImpl.componentType @@ -0,0 +1,27 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/calculator/SubtractServiceImpl.componentType b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/calculator/SubtractServiceImpl.componentType new file mode 100644 index 0000000000..6214955141 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/main/resources/calculator/SubtractServiceImpl.componentType @@ -0,0 +1,27 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/test/java/calculator/CalculatorTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/test/java/calculator/CalculatorTestCase.java new file mode 100644 index 0000000000..08fc8e33bf --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/component-type/src/test/java/calculator/CalculatorTestCase.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 calculator; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +/** + * This shows how to test the Calculator service component. + */ +public class CalculatorTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCADomain scaDomain; + + @Override + protected void setUp() throws Exception { + scaDomain = SCADomain.newInstance("Calculator.composite"); + calculatorService = scaDomain.getService(CalculatorService.class, "CalculatorServiceComponent/CalculatorService"); + } + + @Override + protected void tearDown() throws Exception { + scaDomain.close(); + } + + public void testCalculator() throws Exception { + // Calculate + assertEquals(calculatorService.add(3, 2), 5.0); + assertEquals(calculatorService.subtract(3, 2), 1.0); + assertEquals(calculatorService.multiply(3, 2), 6.0); + assertEquals(calculatorService.divide(3, 2), 1.5); + + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/build-jar.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/build-jar.xml new file mode 100644 index 0000000000..299ce6864f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/build-jar.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/pom.xml new file mode 100644 index 0000000000..9f3b84ad7a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/pom.xml @@ -0,0 +1,203 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-contribution-classloader-classes + Apache Tuscany Contribution ClassLoader Test : Contribution Classes + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + + junit + junit + 4.2 + test + + + + + + itest-contribution-classloader-classes + + + org.apache.maven.plugins + maven-antrun-plugin + 1.1 + + + + ant + ant-trax + 1.6.5 + + + + + + create-jar + generate-test-sources + + run + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/customer/Customer.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/customer/Customer.java new file mode 100644 index 0000000000..814c38777a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/customer/Customer.java @@ -0,0 +1,35 @@ +/* + * 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 purchaseGoods(); + + @OneWay + public void notifyShipment(String order); + + public int outstandingOrderCount(); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java new file mode 100644 index 0000000000..e4daf0ec02 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java @@ -0,0 +1,63 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package supplychain.customer; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import supplychain.retailer.Retailer; + +/** + * This class implements the Customer service component (POJO implementation). + */ +@Service(Customer.class) +@Scope("COMPOSITE") +public class JavaCustomerComponentImpl implements Customer { + + private static int outstandingOrderCount; + + private Retailer retailer; + + public JavaCustomerComponentImpl() { + System.out.println("Created " + this.getClass().getName() + + " using: " + this.getClass().getClassLoader()); + } + + @Reference + public void setRetailer(Retailer retailer) { + this.retailer = retailer; + } + + public void purchaseGoods() { + outstandingOrderCount++; + retailer.submitOrder("Order"); + } + + public void notifyShipment(String order) { + outstandingOrderCount--; + System.out.print("Work thread " + Thread.currentThread() + " - "); + System.out.println(order); + } + + public int outstandingOrderCount() { + return outstandingOrderCount; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/illegal/JavaCustomerComponentImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/illegal/JavaCustomerComponentImpl.java new file mode 100644 index 0000000000..e4b3bc7048 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/illegal/JavaCustomerComponentImpl.java @@ -0,0 +1,74 @@ +/* + * 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.illegal; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import supplychain.customer.Customer; +import supplychain.retailer.JavaRetailerComponentImpl; +import supplychain.retailer.Retailer; +import supplychain.warehouse.JavaWarehouseComponentImpl; +import supplychain.warehouse.Warehouse; + +/** + * This class implements the Customer service component (POJO implementation). + */ +@Service(Customer.class) +@Scope("COMPOSITE") +public class JavaCustomerComponentImpl implements Customer { + + private static int outstandingOrderCount; + + private Retailer retailer; + + public JavaCustomerComponentImpl() { + System.out.println("Created " + this.getClass().getName() + + " using: " + this.getClass().getClassLoader()); + } + + @Reference + public void setRetailer(Retailer retailer) { + this.retailer = retailer; + } + + public void purchaseGoods() { + + Retailer retailerImpl = new JavaRetailerComponentImpl(); + System.out.println("Created a retailer from Customer " + retailerImpl); + + Warehouse warehouseImpl = new JavaWarehouseComponentImpl(); + System.out.println("Created a warehouse from Customer " + warehouseImpl); + + outstandingOrderCount++; + retailer.submitOrder("Order"); + } + + public void notifyShipment(String order) { + outstandingOrderCount--; + System.out.print("Work thread " + Thread.currentThread() + " - "); + System.out.println(order); + } + + public int outstandingOrderCount() { + return outstandingOrderCount; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java new file mode 100644 index 0000000000..698aa2aa5d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package supplychain.retailer; + + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import supplychain.warehouse.Warehouse; + +/** + * This class implements the Retailer service component (POJO implementation). + */ +@Service(Retailer.class) +@Scope("STATELESS") +public class JavaRetailerComponentImpl implements Retailer { + + private Warehouse warehouse; + + public JavaRetailerComponentImpl() { + System.out.println("Created " + this.getClass().getName() + + " using: " + this.getClass().getClassLoader()); + } + + @Reference + public void setWarehouse(Warehouse warehouse) { + this.warehouse = warehouse; + } + + + public Warehouse getWarehouse() { + return warehouse; + } + + public void submitOrder(String order) { + + warehouse.fulfillOrder(order + ", submitted"); + + } + + + + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/retailer/Retailer.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/retailer/Retailer.java new file mode 100644 index 0000000000..1e87d59af1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/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-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/shipper/JavaShipperComponentImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/shipper/JavaShipperComponentImpl.java new file mode 100644 index 0000000000..9e01f00a79 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/shipper/JavaShipperComponentImpl.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.shipper; + + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import supplychain.customer.Customer; + +/** + * This class implements the Shipper service component (POJO implementation). + */ +@Service(Shipper.class) +@Scope("COMPOSITE") +public class JavaShipperComponentImpl implements Shipper { + + private Customer customer; + + public JavaShipperComponentImpl() { + System.out.println("Created " + this.getClass().getCanonicalName() + + " using: " + this.getClass().getClassLoader()); + } + + @Reference + public void setCustomer(Customer customer) { + this.customer = customer; + } + + public void processShipment(String order) { + customer.notifyShipment(order + ", shipped"); + } + + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/shipper/Shipper.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/shipper/Shipper.java new file mode 100644 index 0000000000..2514928c10 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/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-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java new file mode 100644 index 0000000000..cdd12d589d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.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.warehouse; + +import org.osoa.sca.annotations.Scope; + +import supplychain.shipper.Shipper; + +/** + * This class implements the Warehouse service component (POJO implementation). + */ +@Scope("STATELESS") +public class JavaWarehouseComponentImpl implements Warehouse { + + private Shipper shipper; + + public JavaWarehouseComponentImpl() { + System.out.println("Created " + this.getClass().getCanonicalName() + + " using: " + this.getClass().getClassLoader()); + } + + public void setShipper(Shipper shipper) { + this.shipper = shipper; + } + + public void fulfillOrder(String order) { + shipper.processShipment(order + ", fulfilled"); + } + + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/warehouse/Warehouse.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/warehouse/Warehouse.java new file mode 100644 index 0000000000..6f1f6b8730 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/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-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/complete-supplychain-sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/complete-supplychain-sca-contribution.xml new file mode 100644 index 0000000000..714d1826e1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/complete-supplychain-sca-contribution.xml @@ -0,0 +1,26 @@ + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/customer-impl-sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/customer-impl-sca-contribution.xml new file mode 100644 index 0000000000..7f7dc969e2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/customer-impl-sca-contribution.xml @@ -0,0 +1,26 @@ + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/customer-interface-sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/customer-interface-sca-contribution.xml new file mode 100644 index 0000000000..7f7dc969e2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/customer-interface-sca-contribution.xml @@ -0,0 +1,26 @@ + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/customer-sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/customer-sca-contribution.xml new file mode 100644 index 0000000000..8a2bec308f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/customer-sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/illegal-customer-sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/illegal-customer-sca-contribution.xml new file mode 100644 index 0000000000..c77c4c1c7e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/illegal-customer-sca-contribution.xml @@ -0,0 +1,26 @@ + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/illegal1-supplychain-sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/illegal1-supplychain-sca-contribution.xml new file mode 100644 index 0000000000..210a68011f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/illegal1-supplychain-sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/illegal2-supplychain-sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/illegal2-supplychain-sca-contribution.xml new file mode 100644 index 0000000000..d118cceef9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/illegal2-supplychain-sca-contribution.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/retailer-sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/retailer-sca-contribution.xml new file mode 100644 index 0000000000..d37b6659da --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/retailer-sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/shipper-sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/shipper-sca-contribution.xml new file mode 100644 index 0000000000..77b28d9023 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/shipper-sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/supplychain-sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/supplychain-sca-contribution.xml new file mode 100644 index 0000000000..8ec290a831 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/supplychain-sca-contribution.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/warehouse-sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/warehouse-sca-contribution.xml new file mode 100644 index 0000000000..1398416978 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/warehouse-sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/supplychain/illegalsupplychain.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/supplychain/illegalsupplychain.composite new file mode 100644 index 0000000000..db1f0d34e7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/supplychain/illegalsupplychain.composite @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/supplychain/supplychain.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/supplychain/supplychain.composite new file mode 100644 index 0000000000..5be79b741a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/supplychain/supplychain.composite @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/supplychain/warehouse/JavaWarehouseComponentImpl.componentType b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/supplychain/warehouse/JavaWarehouseComponentImpl.componentType new file mode 100644 index 0000000000..a76fae8090 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-classes/src/main/resources/supplychain/warehouse/JavaWarehouseComponentImpl.componentType @@ -0,0 +1,28 @@ + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-test/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-test/pom.xml new file mode 100644 index 0000000000..0ee17cbae6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-test/pom.xml @@ -0,0 +1,53 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-contribution-classloader-test + Apache Tuscany Contribution Classloader tests + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + + junit + junit + 4.2 + test + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-test/src/test/java/org/apache/tuscany/sca/test/contribution/ContributionTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-test/src/test/java/org/apache/tuscany/sca/test/contribution/ContributionTestCase.java new file mode 100644 index 0000000000..5f92342b8c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-test/src/test/java/org/apache/tuscany/sca/test/contribution/ContributionTestCase.java @@ -0,0 +1,371 @@ +/* + * 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 org.apache.tuscany.sca.test.contribution; + + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URLClassLoader; + +import org.apache.tuscany.sca.contribution.Contribution; +import org.apache.tuscany.sca.contribution.resolver.ClassReference; +import org.apache.tuscany.sca.contribution.service.ContributionResolveException; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +/* + * + * Contribution classloading integration tests + */ + +public class ContributionTestCase { + + private SupplyChain supplyChain; + + + @Before + public void setUp() throws Exception { + supplyChain = new SupplyChain(); + } + + + @After + public void tearDown() throws Exception { + + supplyChain.tearDown(); + + } + + + /** + * Test static classloading for classes that are visible from contribution + * + * @throws Exception + */ + public void staticClassLoadingTestForVisibleClasses() throws Exception { + + Contribution customerContribution = supplyChain.getContribution("Customer"); + ClassReference customerClassRef = new ClassReference("supplychain.customer.Customer"); + customerClassRef = customerContribution.getModelResolver().resolveModel(ClassReference.class, customerClassRef); + Class customerClass = customerClassRef.getJavaClass(); + + Class customerClassFromContribution = customerContribution.getClassLoader().loadClass("supplychain.customer.Customer"); + Assert.assertEquals(customerClass, customerClassFromContribution); + + Object customer = supplyChain.getCustomer(customerClass); + + Method m = customerClass.getMethod("purchaseGoods"); + m.invoke(customer); + + + m = customerClass.getMethod("outstandingOrderCount"); + + int retries = 10; + int outstandingCount = 1; + while (retries-- > 0) { + + outstandingCount = (int)(Integer)m.invoke(customer); + if (outstandingCount == 0) + break; + else + Thread.sleep(100); + } + Assert.assertEquals(0, outstandingCount); + + + } + + + /** + * Test dynamic classloading for classes that are visible from contribution + * + * @throws Exception + */ + public void dynamicClassLoadingTestForVisibleClasses() throws Exception { + + Contribution customerContribution = supplyChain.getContribution("Customer"); + Contribution retailerContribution = supplyChain.getContribution("Retailer"); + Contribution warehouseContribution = supplyChain.getContribution("Warehouse"); + Contribution shipperContribution = supplyChain.getContribution("Shipper"); + Contribution supplyChainContribution = supplyChain.getContribution("SupplyChain"); + + ClassReference customerClassRef = new ClassReference("supplychain.customer.Customer"); + customerClassRef = customerContribution.getModelResolver().resolveModel(ClassReference.class, customerClassRef); + Class customerClass = customerClassRef.getJavaClass(); + + Class customerClassFromContribution = customerContribution.getClassLoader().loadClass("supplychain.customer.Customer"); + Assert.assertEquals(customerClass, customerClassFromContribution); + + Object customer = supplyChain.getCustomer(customerClass); + Assert.assertTrue(customerClass.isInstance(customer)); + + ClassReference retailerClassRef = new ClassReference("supplychain.retailer.Retailer"); + retailerClassRef = retailerContribution.getModelResolver().resolveModel(ClassReference.class, retailerClassRef); + Class retailerClass = retailerClassRef.getJavaClass(); + + Class retailerClassFromContribution = retailerContribution.getClassLoader().loadClass("supplychain.retailer.Retailer"); + Assert.assertEquals(retailerClass, retailerClassFromContribution); + + Class retailerClassFromCustomer = customerContribution.getClassLoader().loadClass("supplychain.retailer.Retailer"); + Assert.assertEquals(retailerClass, retailerClassFromCustomer); + + ClassReference warehouseClassRef = new ClassReference("supplychain.warehouse.Warehouse"); + warehouseClassRef = warehouseContribution.getModelResolver().resolveModel(ClassReference.class, warehouseClassRef); + Class warehouseClass = warehouseClassRef.getJavaClass(); + + Class warehouseClassFromContribution = warehouseContribution.getClassLoader().loadClass("supplychain.warehouse.Warehouse"); + Assert.assertEquals(warehouseClass, warehouseClassFromContribution); + + Class warehouseClassFromRetailer = retailerContribution.getClassLoader().loadClass("supplychain.warehouse.Warehouse"); + Assert.assertEquals(warehouseClass, warehouseClassFromRetailer); + + ClassReference shipperClassRef = new ClassReference("supplychain.shipper.Shipper"); + shipperClassRef = shipperContribution.getModelResolver().resolveModel(ClassReference.class, shipperClassRef); + Class shipperClass = shipperClassRef.getJavaClass(); + + Class shipperClassFromContribution = shipperContribution.getClassLoader().loadClass("supplychain.shipper.Shipper"); + Assert.assertEquals(shipperClass, shipperClassFromContribution); + + Class shipperClassFromWarehouse = shipperContribution.getClassLoader().loadClass("supplychain.shipper.Shipper"); + Assert.assertEquals(shipperClass, shipperClassFromWarehouse); + + Class customerClassFromShipper = shipperContribution.getClassLoader().loadClass("supplychain.customer.Customer"); + Assert.assertEquals(customerClass, customerClassFromShipper); + + Class customerClassFromSupplyChain = supplyChainContribution.getClassLoader().loadClass("supplychain.customer.Customer"); + Assert.assertEquals(customerClass, customerClassFromSupplyChain); + Class retailerClassFromSupplyChain = supplyChainContribution.getClassLoader().loadClass("supplychain.retailer.Retailer"); + Assert.assertEquals(retailerClass, retailerClassFromSupplyChain); + Class warehouseClassFromSupplyChain = supplyChainContribution.getClassLoader().loadClass("supplychain.warehouse.Warehouse"); + Assert.assertEquals(warehouseClass, warehouseClassFromSupplyChain); + Class shipperClassFromSupplyChain = supplyChainContribution.getClassLoader().loadClass("supplychain.shipper.Shipper"); + Assert.assertEquals(shipperClass, shipperClassFromSupplyChain); + + } + + /** + * Test dynamic classloading for classes that are visible from contribution + * + * @throws Exception + */ + public void dynamicClassLoadingTestForNonImportedClasses() throws Exception { + + Contribution customerContribution = supplyChain.getContribution("Customer"); + Contribution shipperContribution = supplyChain.getContribution("Shipper"); + + Class customerClass = customerContribution.getClassLoader().loadClass("supplychain.customer.Customer"); + Class shipperClass = shipperContribution.getClassLoader().loadClass("supplychain.shipper.Shipper"); + + try { + customerClass.getClassLoader().loadClass("supplychain.warehouse.Warehouse"); + Assert.fail("Non-imported class loaded incorrectly"); + } catch (ClassNotFoundException e) { + } + try { + customerClass.getClassLoader().loadClass("supplychain.shipper.JavaShipperComponentImpl"); + Assert.fail("Non-imported class loaded incorrectly"); + } catch (ClassNotFoundException e) { + } + + try { + Class.forName("supplychain.warehouse.Warehouse", true, customerClass.getClassLoader()); + Assert.fail("Non-imported class loaded incorrectly"); + } catch (ClassNotFoundException e) { + } + try { + Class.forName("supplychain.shipper.JavaShipperComponentImpl", true, customerClass.getClassLoader()); + Assert.fail("Non-imported class loaded incorrectly"); + } catch (ClassNotFoundException e) { + } + + try { + shipperClass.getClassLoader().loadClass("supplychain.warehouse.JavaWarehouseComponentImpl"); + Assert.fail("Non-imported class loaded incorrectly"); + } catch (ClassNotFoundException e) { + } + try { + shipperClass.getClassLoader().loadClass("supplychain.retailer.Retailer"); + Assert.fail("Non-imported class loaded incorrectly"); + } catch (ClassNotFoundException e) { + } + + try { + Class.forName("supplychain.warehouse.JavaWarehouseComponentImpl", true, shipperClass.getClassLoader()); + Assert.fail("Non-imported class loaded incorrectly"); + } catch (ClassNotFoundException e) { + } + try { + Class.forName("supplychain.retailer.Retailer", true, shipperClass.getClassLoader()); + Assert.fail("Non-imported class loaded incorrectly"); + } catch (ClassNotFoundException e) { + } + + + } + + + /** + * This test ensures that classes from imported packages can be statically loaded + * from other contributions even though the classes are not on CLASSPATH or on the + * parent classloader, or the thread context classloader. + * + * @throws Exception + */ + @Test + public void testValidStaticClassLoading() throws Exception { + + supplyChain.setUp(this.getClass().getClassLoader()); + + staticClassLoadingTestForVisibleClasses(); + } + + /** + * This test ensures that all imported classes are loaded from the exporting contributions + * rather than the parent classLoader. If any of the interface classes were incorrectly loaded + * through the parent classloader, LinkageError should result. + * + * @throws Exception + */ + @Test + public void testValidStaticClassLoadingWithContributionsInParentClassLoader() throws Exception { + + + URLClassLoader parentClassLoader = new URLClassLoader( + supplyChain.getContributionURLs(), + this.getClass().getClassLoader()); + + supplyChain.setUp(parentClassLoader); + + staticClassLoadingTestForVisibleClasses(); + } + + + /** + * This test ensures that classes from imported packages can be dynamically loaded from + * other contributions even though the classes are not on CLASSPATH or on the + * parent classloader, or the thread context classloader. + * + * @throws Exception + */ + @Test + public void testValidDynamicClassLoading() throws Exception { + + supplyChain.setUp(this.getClass().getClassLoader()); + + dynamicClassLoadingTestForVisibleClasses(); + } + + /** + * This test ensures that all imported classes are dynamically loaded from the exporting + * contributions rather than the parent classLoader. If any of the interface classes were + * incorrectly loaded through the parent, NoClassDefFoundError or LinkageError should result. + * + * @throws Exception + */ + @Test + public void testValidDynamicClassLoadingWithContributionsInParentClassLoader() throws Exception { + + + URLClassLoader parentClassLoader = new URLClassLoader( + supplyChain.getContributionURLs(), + this.getClass().getClassLoader()); + + supplyChain.setUp(parentClassLoader); + + dynamicClassLoadingTestForVisibleClasses(); + } + + @Test + public void testIllegalStaticClassLoading1() throws Exception { + + try { + supplyChain.setUp(this.getClass().getClassLoader(), SupplyChain.SUPPLYCHAIN_ILLEGAL_1); + + Assert.fail("Composite containing unresolved references resolved incorrectly"); + } catch (ContributionResolveException e) { + } + } + + @Test + public void testIllegalStaticClassLoading2() throws Exception { + + supplyChain.setUp(this.getClass().getClassLoader(), SupplyChain.SUPPLYCHAIN_ILLEGAL_2); + + Contribution customerContribution = supplyChain.getContribution("Customer"); + ClassReference customerClassRef = new ClassReference("supplychain.customer.Customer"); + customerClassRef = customerContribution.getModelResolver().resolveModel(ClassReference.class, customerClassRef); + Class customerClass = customerClassRef.getJavaClass(); + + Object customer = supplyChain.getCustomer(customerClass); + + try { + Method m = customerClass.getMethod("purchaseGoods"); + m.invoke(customer); + + Assert.fail("Classloading exception not thrown as expected"); + } catch (InvocationTargetException e) { + + Throwable cause = e.getCause(); + Assert.assertTrue(cause instanceof NoClassDefFoundError); + Assert.assertTrue(cause.getMessage().indexOf("JavaWarehouseComponentImpl") > -1); } + + } + + /** + * This test ensures that classes from imported packages can be dynamically loaded from + * other contributions even though the classes are not on CLASSPATH or on the + * parent classloader, or the thread context classloader. + * + * @throws Exception + */ + @Test + public void testIllegalDynamicClassLoading() throws Exception { + + supplyChain.setUp(this.getClass().getClassLoader()); + + dynamicClassLoadingTestForNonImportedClasses(); + } + + + /** + * Self-contained contribution containing composites, componentType files and implementations + * should not require import/export statements for these files to find each other or for Tuscany + * to load these files. + * @throws Exception + */ + @Test + public void testSelfContainedContribution() throws Exception { + + supplyChain.setUp(this.getClass().getClassLoader(), SupplyChain.SUPPLYCHAIN_SELFCONTAINED); + + staticClassLoadingTestForVisibleClasses(); + } + + @Test + public void testContributionsWithSplitPackage() throws Exception { + + supplyChain.setUp(this.getClass().getClassLoader(), SupplyChain.SUPPLYCHAIN_SPLITPACKAGE); + + staticClassLoadingTestForVisibleClasses(); + + dynamicClassLoadingTestForNonImportedClasses(); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-test/src/test/java/org/apache/tuscany/sca/test/contribution/SupplyChain.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-test/src/test/java/org/apache/tuscany/sca/test/contribution/SupplyChain.java new file mode 100644 index 0000000000..05da52edc6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-test/src/test/java/org/apache/tuscany/sca/test/contribution/SupplyChain.java @@ -0,0 +1,231 @@ +/* + * 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 org.apache.tuscany.sca.test.contribution; + + +import java.io.File; +import java.net.URL; +import java.util.Hashtable; + +import org.apache.tuscany.sca.assembly.Composite; +import org.apache.tuscany.sca.contribution.Contribution; +import org.apache.tuscany.sca.contribution.service.ContributionService; +import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain; +import org.junit.Assert; + +/* + * + * Contribution classloading integration tests + */ + +public class SupplyChain { + + public static final int SUPPLYCHAIN = 0; + public static final int SUPPLYCHAIN_ILLEGAL_1 = 1; + public static final int SUPPLYCHAIN_ILLEGAL_2 = 2; + public static final int SUPPLYCHAIN_SELFCONTAINED = 3; + public static final int SUPPLYCHAIN_SPLITPACKAGE = 4; + + private String folderName = "../contribution-classes/target/classes"; + + private String customerJarName = "Customer"; + private String retailerJarName = "Retailer"; + private String warehouseJarName = "Warehouse"; + private String shipperJarName = "Shipper"; + private String supplychainJarName = "SupplyChain"; + private String illegalSupplyChain1JarName = "IllegalSupplyChain1"; + private String illegalSupplyChain2JarName = "IllegalSupplyChain2"; + private String illegalCustomerJarName = "IllegalCustomer"; + private String completeSupplychainJarName = "CompleteSupplyChain"; + private String customerInterfaceJarName = "CustomerInterface"; + private String customerImplJarName = "CustomerImpl"; + + + private EmbeddedSCADomain domain; + private ContributionService contributionService; + private int supplyChainVersion; + + private Hashtable contributions = new Hashtable(); + + private URL customerContribURL; + private URL retailerContribURL; + private URL warehouseContribURL; + private URL shipperContribURL; + private URL supplyChainContribURL; + private URL illegalSupplyChain1ContribURL; + private URL illegalSupplyChain2ContribURL; + private URL illegalCustomerContribURL; + private URL completeSupplyChainContribURL; + private URL customerInterfaceContribURL; + private URL customerImplContribURL; + + public SupplyChain() throws Exception { + + customerContribURL = new File(folderName + "/" + customerJarName + ".jar").toURI().toURL(); + retailerContribURL = new File(folderName + "/" + retailerJarName + ".jar").toURI().toURL(); + warehouseContribURL = new File(folderName + "/" + warehouseJarName + ".jar").toURI().toURL(); + shipperContribURL = new File(folderName + "/" + shipperJarName + ".jar").toURI().toURL(); + supplyChainContribURL = new File(folderName + "/" + supplychainJarName + ".jar").toURI().toURL(); + illegalSupplyChain1ContribURL = new File(folderName + "/" + illegalSupplyChain1JarName + ".jar").toURI().toURL(); + illegalSupplyChain2ContribURL = new File(folderName + "/" + illegalSupplyChain2JarName + ".jar").toURI().toURL(); + illegalCustomerContribURL = new File(folderName + "/" + illegalCustomerJarName + ".jar").toURI().toURL(); + completeSupplyChainContribURL = new File(folderName + "/" + completeSupplychainJarName + ".jar").toURI().toURL(); + customerInterfaceContribURL = new File(folderName + "/" + customerInterfaceJarName + ".jar").toURI().toURL(); + customerImplContribURL = new File(folderName + "/" + customerImplJarName + ".jar").toURI().toURL(); + } + + public void setUp(ClassLoader parentClassLoader) throws Exception { + this.setUp(parentClassLoader, SUPPLYCHAIN); + } + + public void setUp(ClassLoader parentClassLoader, int supplyChainVersion) throws Exception { + + this.supplyChainVersion = supplyChainVersion; + + Thread.currentThread().setContextClassLoader(parentClassLoader); + + //Create an embedded SCA domain + domain = new EmbeddedSCADomain(parentClassLoader, "http://localhost"); + + //Start the domain + domain.start(); + + this.contributionService = domain.getContributionService(); + + addContributions(supplyChainVersion); + } + + protected void addContributions(int supplyChainVersion) throws Exception { + + Contribution contribution; + + if (supplyChainVersion != SUPPLYCHAIN_SELFCONTAINED) { + contribution = contributionService.contribute("Shipper", shipperContribURL, true); + contributions.put("Shipper", contribution); + contribution = contributionService.contribute("Warehouse", warehouseContribURL, true); + contributions.put("Warehouse", contribution); + contribution = contributionService.contribute("Retailer", retailerContribURL, true); + contributions.put("Retailer", contribution); + } + + switch (supplyChainVersion) { + case SUPPLYCHAIN: + contribution = contributionService.contribute("Customer", customerContribURL, true); + contributions.put("Customer", contribution); + + contribution = contributionService.contribute("SupplyChain", supplyChainContribURL, true); + contributions.put("SupplyChain", contribution); + break; + case SUPPLYCHAIN_ILLEGAL_1: + contribution = contributionService.contribute("Customer", customerContribURL, true); + contributions.put("Customer", contribution); + + contribution = contributionService.contribute("SupplyChain", illegalSupplyChain1ContribURL, true); + contributions.put("SupplyChain", contribution); + break; + case SUPPLYCHAIN_ILLEGAL_2: + contribution = contributionService.contribute("Customer", illegalCustomerContribURL, true); + contributions.put("Customer", contribution); + + contribution = contributionService.contribute("SupplyChain", illegalSupplyChain2ContribURL, true); + contributions.put("SupplyChain", contribution); + break; + case SUPPLYCHAIN_SELFCONTAINED: + contribution = contributionService.contribute("SupplyChain", completeSupplyChainContribURL, true); + contributions.put("SupplyChain", contribution); + break; + case SUPPLYCHAIN_SPLITPACKAGE: + contribution = contributionService.contribute("Customer", customerInterfaceContribURL, true); + contributions.put("Customer", contribution); + + contribution = contributionService.contribute("CustomerImpl", customerImplContribURL, true); + contributions.put("CustomerImpl", contribution); + + contribution = contributionService.contribute("SupplyChain", supplyChainContribURL, true); + contributions.put("SupplyChain", contribution); + break; + } + + // SUPPLYCHAIN_ILLEGAL_1 should throw an exception when the composite is resolved, and hence + // should not get this far. + Assert.assertTrue(supplyChainVersion != SUPPLYCHAIN_ILLEGAL_1); + + + for (Contribution c : contributions.values()) { + + for (Composite deployable : c.getDeployables()) { + domain.getDomainComposite().getIncludes().add(deployable); + domain.buildComposite(deployable); + } + + } + + // Start Components from my composite + for (Composite deployable : contributions.get("SupplyChain").getDeployables() ) { + domain.getCompositeActivator().activate(deployable); + domain.getCompositeActivator().start(deployable); + } + } + + public void tearDown() throws Exception { + + if (domain == null) + return; + + for (String contributionURI : contributions.keySet()) { + contributionService.remove(contributionURI); + } + + + if (contributions.get("SupplyChain") != null) { + // Stop Components from my composite + for (Composite deployable : contributions.get("SupplyChain").getDeployables() ) { + domain.getCompositeActivator().stop(deployable); + domain.getCompositeActivator().deactivate(deployable); + } + } + + domain.stop(); + + domain.close(); + } + + public Contribution getContribution(String uri) { + if (supplyChainVersion == SUPPLYCHAIN_SELFCONTAINED) + return contributions.get("SupplyChain"); + else + return contributions.get(uri); + } + + public Object getCustomer(Class customerClass) { + return domain.getService(customerClass, "CustomerComponent"); + } + + public URL[] getContributionURLs() { + return new URL[] { + customerContribURL, + retailerContribURL, + warehouseContribURL, + shipperContribURL, + supplyChainContribURL + }; + } + + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-test/src/test/java/org/apache/tuscany/sca/test/contribution/TuscanyClassloadingTestCaseFIXME.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-test/src/test/java/org/apache/tuscany/sca/test/contribution/TuscanyClassloadingTestCaseFIXME.java new file mode 100644 index 0000000000..e0c11cdbee --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/contribution-test/src/test/java/org/apache/tuscany/sca/test/contribution/TuscanyClassloadingTestCaseFIXME.java @@ -0,0 +1,381 @@ +/* + * 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 org.apache.tuscany.sca.test.contribution; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; + +import org.apache.tuscany.sca.assembly.Composite; +import org.apache.tuscany.sca.extensibility.ServiceDiscovery; +import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.osoa.sca.ServiceReference; + +/* + * + * Contribution classloading integration tests + */ + +//FIXME This test case needs some serious rework! +// First it is very dependent on the names of the Tuscany runtime JARs +// and this is going to be difficult to maintain +// Second its usage of reflection requires the Tuscany implementation classes +// to be made public and this breaks isolation between modules. +public class TuscanyClassloadingTestCaseFIXME { + + // private static final int SCA_API = 1; + // private static final int TUSCANY_CORE_SPI = 2; + // private static final int TUSCANY_RUNTIME = 3; + // private static final int TUSCANY_EXTENSIONS = 4; + // private static final int TUSCANY_DEPENDENCIES = 0; + + private static final String[] scaApiJars = {"sca-api"}; + private static final String[] tuscanyCoreSpiJars = + {"core-spi", "interface", "interface-java", "interface-wsdl", "assembly", "policy", "databinding", + "contribution", "definitions"}; + private static final String[] tuscanyRuntimeJars = + { + + "binding-sca-xml", "binding-sca", "assembly-java-dsl", "assembly-xml", "assembly-xsd", "contribution-impl", + "contribution-java", "contribution-namespace", "core-databinding", "core-spring", "core", "definitions-xml", + "domain-api", "domain-impl", "domain", "extension-helper", "host-embedded", "interface-java-xml", + "interface-wsdl-xml", "java2wsdl", "node-api", "node-impl", "node", "osgi-runtime", "policy-logging", + "policy-security", "policy-transaction", "policy-xml", "wsdl2java"}; + private static final String[] tuscanyExtensionJars = + {"binding-dwr", "binding-ejb", "binding-feed", "binding-http", "binding-jms", "binding-jsonrpc", + "binding-notification", "binding-rmi", "binding-sca-axis2", "binding-ws-axis2", "binding-ws-xml", + "binding-ws", "databinding-axiom", "databinding-fastinfoset", "databinding-jaxb", "databinding-json", + "databinding-saxon", "databinding-sdo-axiom", "databinding-sdo", "databinding-xmlbeans", "host-http", + "host-jetty", "host-rmi", "host-tomcat", "host-webapp", "implementation-das.jar", "implementation-data.jar", + "implementation-java-runtime", "implementation-java-xml", "implementation-java", + "implementation-node-runtime", "implementation-node-xml", "implementation-node", + "implementation-notification", "implementation-osgi", "implementation-resource", "implementation-script", + "implementation-spring", "implementation-xquery", "contribution-osgi"}; + + private Class embeddedDomainClass; + Object domain; + + @Before + public void setUp() throws Exception { + + embeddedDomainClass = getEmbeddedDomainClass(); + + Constructor c = embeddedDomainClass.getConstructor(ClassLoader.class, String.class); + // Create an embedded domain + domain = c.newInstance(embeddedDomainClass.getClassLoader(), "http://localhost"); + + // Start the domain + invokeNoArgsMethod(domain, "start"); + + } + + @After + public void tearDown() throws Exception { + + // Stop the domain + invokeNoArgsMethod(domain, "stop"); + + } + + /** + * Create a classloader hierarchy for Tuscany runtime + * Dependencies <- SCA-API <- Core-SPI+ Runtime <- Extensions + * Load the embedded SCA domain class using the runtime classloader + * + * @return embedded SCA domain class + * @throws Exception + */ + private Class getEmbeddedDomainClass() throws Exception { + + URL[] scaApiUrls; + URL[] runtimeUrls; + URL[] extensionUrls; + URL[] dependencyUrls; + + // When the test is run under Eclipse, the classloader for the test is + // sun.misc.Launcher$AppClassLoader. The first code path is taken. + // When the test is run under maven, the classloader for the test is + // org.apache.maven.surefire.booter.IsolatedClassLoader, which is a subclass + // of URLClassLoader. The second code path is taken. + if (!(this.getClass().getClassLoader() instanceof URLClassLoader)) { + String classPath = System.getProperty("java.class.path"); + String[] classPathEntries = classPath.split(System.getProperty("path.separator")); + HashSet dependentJars = new HashSet(); + for (int i = 0; i < classPathEntries.length; i++) { + dependentJars.add(classPathEntries[i]); + } + + scaApiUrls = getTuscanyClassLoaderURLs(classPathEntries, dependentJars, scaApiJars); + runtimeUrls = + getTuscanyClassLoaderURLs(classPathEntries, dependentJars, tuscanyCoreSpiJars, tuscanyRuntimeJars); + extensionUrls = getTuscanyClassLoaderURLs(classPathEntries, dependentJars, tuscanyExtensionJars); + dependencyUrls = getTuscanyClassLoaderURLs(classPathEntries, dependentJars); + } else { + HashSet dependentJars = new HashSet(); + URL[] classPathEntries = ((URLClassLoader)this.getClass().getClassLoader()).getURLs(); + for (int i = 0; i < classPathEntries.length; i++) { + dependentJars.add(classPathEntries[i]); + } + scaApiUrls = getTuscanyClassLoaderURLs(classPathEntries, dependentJars, scaApiJars); + runtimeUrls = + getTuscanyClassLoaderURLs(classPathEntries, dependentJars, tuscanyCoreSpiJars, tuscanyRuntimeJars); + extensionUrls = getTuscanyClassLoaderURLs(classPathEntries, dependentJars, tuscanyExtensionJars); + dependencyUrls = getTuscanyClassLoaderURLs(classPathEntries, dependentJars); + + } + + boolean useSingleClassLoader = + (scaApiUrls == null || scaApiUrls.length == 0) || (runtimeUrls == null || runtimeUrls.length == 0) + || (extensionUrls == null || extensionUrls.length == 0) + || (dependencyUrls == null || dependencyUrls.length == 0); + + if (useSingleClassLoader) { + return EmbeddedSCADomain.class; + } else { + + ClassLoader dependencyLoader = new URLClassLoader(dependencyUrls, null); + ClassLoader scaApiLoader = new URLClassLoader(scaApiUrls, dependencyLoader); + ClassLoader runtimeClassLoader = new URLClassLoader(runtimeUrls, scaApiLoader); + ClassLoader extensionClassLoader = new URLClassLoader(extensionUrls, runtimeClassLoader); + + Class serviceDiscoveryClass = runtimeClassLoader.loadClass(ServiceDiscovery.class.getName()); + Method getInstanceMethod = serviceDiscoveryClass.getMethod("getInstance"); + Object serviceDiscoveryObj = getInstanceMethod.invoke(null); + Method registerClassLoaderMethod = + serviceDiscoveryClass.getMethod("registerClassLoader", ClassLoader.class); + registerClassLoaderMethod.invoke(serviceDiscoveryObj, extensionClassLoader); + + Thread.currentThread().setContextClassLoader(extensionClassLoader); + + return runtimeClassLoader.loadClass(EmbeddedSCADomain.class.getName()); + + } + + } + + /** + * From the list of entries in the test classloader, match + * Tuscany jars corresponding to a classloader, and return the list + * of matching entries as URLs. + * This method is used when the test is run under eclipse, using CLASSPATH + * based application classloader. + * + * @param classPathEntries List of entries on CLASSPATH + * @param dependentJars Complete set of jars, remove jars corresponding to this + * classloader from the set. + * @param jars List of Tuscany jars corresponding to this classloader + * @return Matching URLs for the classloader + * @throws IOException + */ + private URL[] getTuscanyClassLoaderURLs(String[] classPathEntries, HashSet dependentJars, String[]... jars) + throws IOException { + + String pathSeparator = System.getProperty("file.separator"); + HashSet classPathEntrySet; + + if (jars.length == 0) + classPathEntrySet = dependentJars; + else { + classPathEntrySet = new HashSet(); + + for (int i = 0; i < classPathEntries.length; i++) { + + String classPathEntry = classPathEntries[i]; + for (int j = 0; j < jars.length; j++) { + String[] jarList = jars[j]; + if (jarList != null) { + for (int k = 0; k < jarList.length; k++) { + String jarName = "tuscany-" + jarList[k]; + String alternateJarName = "modules" + pathSeparator + jarList[k]; + if (classPathEntry.indexOf(jarName) >= 0 || classPathEntry.indexOf(alternateJarName) >= 0) { + classPathEntrySet.add(classPathEntry); + dependentJars.remove(classPathEntry); + } + } + } + } + } + + } + ArrayList urls = new ArrayList(); + + for (String fileName : classPathEntrySet) { + File file = new File((String)fileName); + if (!file.exists()) { + throw new FileNotFoundException(fileName); + + } else { + urls.add(file.toURL()); + + } + } + + return (URL[])urls.toArray(new URL[urls.size()]); + } + + /** + * From the list of URLs of the test classloader, match + * Tuscany jars corresponding to a classloader, and return the matching URLs + * This method is used when the test is run under maven. The test classloader is + * org.apache.maven.surefire.booter.IsolatedClassLoader, which is a subclass + * of URLClassLoader + * + * @param classPathEntries List of URLs from the test classloader + * @param dependentJars Complete set of jars, remove jars corresponding to this + * classloader from the set. + * @param jars List of Tuscany jars corresponding to this classloader + * @return Matching URLs for the classloader + * @throws IOException + */ + private URL[] getTuscanyClassLoaderURLs(URL[] classPathEntries, HashSet dependentJars, String[]... jars) + throws IOException { + + String pathSeparator = System.getProperty("file.separator"); + HashSet classPathEntrySet; + + if (jars.length == 0) + classPathEntrySet = dependentJars; + else { + classPathEntrySet = new HashSet(); + + for (int i = 0; i < classPathEntries.length; i++) { + + URL classPathEntry = classPathEntries[i]; + String classPathEntryStr = classPathEntry.getPath(); + for (int j = 0; j < jars.length; j++) { + String[] jarList = jars[j]; + if (jarList != null) { + for (int k = 0; k < jarList.length; k++) { + String jarName = "tuscany-" + jarList[k]; + String alternateJarName = "modules" + pathSeparator + jarList[k]; + if (classPathEntryStr.indexOf(jarName) >= 0 || classPathEntryStr.indexOf(alternateJarName) >= 0) { + classPathEntrySet.add(classPathEntry); + dependentJars.remove(classPathEntry); + } + } + } + } + } + + } + return (URL[])classPathEntrySet.toArray(new URL[classPathEntrySet.size()]); + } + + private Object invokeNoArgsMethod(Object obj, String methodName) throws Exception { + + return obj.getClass().getMethod(methodName).invoke(obj); + } + + private Object invokeOneArgMethod(Object obj, String methodName, Class argType, Object arg) throws Exception { + + return obj.getClass().getMethod(methodName, argType).invoke(obj, arg); + } + + /** + * + * Load Tuscany runtime using multiple classloaders, and run supplychain + * test. + * + * @throws Exception + */ + @SuppressWarnings("unchecked") + @Test + public void test() throws Exception { + + ClassLoader runtimeClassloader = embeddedDomainClass.getClassLoader(); + + if (runtimeClassloader == this.getClass().getClassLoader()) { + System.out.println("Runtime and test loaded using the same classloader " + runtimeClassloader); + } else { + System.out + .println("Running test using separate Tuscany classloaders, runtime classloader=" + runtimeClassloader); + ClassLoader apiClassLoader = + runtimeClassloader.loadClass(ServiceReference.class.getName()).getClassLoader(); + Assert.assertTrue(apiClassLoader != runtimeClassloader); + + try { + runtimeClassloader.loadClass("org.apache.tuscany.sca.implementation.java.JavaImplementation"); + Assert.fail("Loaded extension class incorrectly from runtimeClassLoader"); + } catch (ClassNotFoundException e) { + } + + } + + // Contribute supplychain (as single contribution) + Object contributionService = invokeNoArgsMethod(domain, "getContributionService"); + Method contributeMethod = + contributionService.getClass().getMethod("contribute", String.class, URL.class, boolean.class); + + String folderName = "../contribution-classes/target/classes"; + String supplychainJarName = "CompleteSupplyChain"; + URL supplyChainContribURL = new File(folderName + "/" + supplychainJarName + ".jar").toURL(); + Object contribution = contributeMethod.invoke(contributionService, "SupplyChain", supplyChainContribURL, true); + + Object composite = ((List)invokeNoArgsMethod(contribution, "getDeployables")).get(0); + Object domainComposite = invokeNoArgsMethod(domain, "getDomainComposite"); + List includes = (List)invokeNoArgsMethod(domainComposite, "getIncludes"); + includes.add(composite); + //Object compositeBuilder = invokeNoArgsMethod(domain, "getCompositeBuilder"); + Object compositeActivator = invokeNoArgsMethod(domain, "getCompositeActivator"); + + Class compositeClass = embeddedDomainClass.getClassLoader().loadClass(Composite.class.getName()); + invokeOneArgMethod(domain, "buildComposite", compositeClass, composite); + invokeOneArgMethod(compositeActivator, "activate", compositeClass, composite); + invokeOneArgMethod(compositeActivator, "start", compositeClass, composite); + + // Get customer service + Method getClassLoaderMethod = contribution.getClass().getMethod("getClassLoader"); + ClassLoader classLoader = (ClassLoader)getClassLoaderMethod.invoke(contribution); + + Class customerClass = classLoader.loadClass("supplychain.customer.Customer"); + Method getServiceMethod = embeddedDomainClass.getMethod("getService", Class.class, String.class); + Object customer = getServiceMethod.invoke(domain, customerClass, "CustomerComponent"); + + // Invoke purchaseGoods + Method m = customerClass.getMethod("purchaseGoods"); + m.invoke(customer); + + m = customerClass.getMethod("outstandingOrderCount"); + + int retries = 10; + int outstandingCount = 1; + while (retries-- > 0) { + + outstandingCount = (int)(Integer)m.invoke(customer); + if (outstandingCount == 0) + break; + else + Thread.sleep(100); + } + Assert.assertEquals(0, outstandingCount); + + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/pom.xml new file mode 100644 index 0000000000..c9ca36e531 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-classloader/pom.xml @@ -0,0 +1,51 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-contribution-classloader + pom + Apache Tuscany Contribution ClassLoader Integration Tests + + + contribution-classes + contribution-test + + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-contribution-impl + 1.2.1-incubating-SNAPSHOT + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/pom.xml new file mode 100644 index 0000000000..597b7b3fa2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/pom.xml @@ -0,0 +1,67 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-contribution-export-composite + Apache Tuscany SCA Contribution Export Integration Tests + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-tomcat + 1.2.1-incubating-SNAPSHOT + runtime + + + + junit + junit + 4.2 + test + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/src/main/java/hello/Hello.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/src/main/java/hello/Hello.java new file mode 100644 index 0000000000..669821261c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/src/main/java/hello/Hello.java @@ -0,0 +1,30 @@ +/* + * 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 hello; + +import org.osoa.sca.annotations.Remotable; + +/** + * This is the business interface of the Hello service. + */ +@Remotable +public interface Hello { + + public String getGreetings(String name); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/src/main/java/hello/HelloImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/src/main/java/hello/HelloImpl.java new file mode 100644 index 0000000000..ff9f6e75f3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/src/main/java/hello/HelloImpl.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 hello; + +import org.osoa.sca.annotations.Service; + +/** + * This class implements the HelloWorld service. + */ +@Service(Hello.class) +public class HelloImpl implements Hello { + + public String getGreetings(String name) { + return "Hello " + name; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..bea6f39932 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/src/main/resources/hello.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/src/main/resources/hello.composite new file mode 100644 index 0000000000..636b7111d9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/src/main/resources/hello.composite @@ -0,0 +1,31 @@ + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/src/test/java/org/apache/tuscany/sca/test/contribution/HelloTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/src/test/java/org/apache/tuscany/sca/test/contribution/HelloTestCase.java new file mode 100644 index 0000000000..44614f243a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-composite/src/test/java/org/apache/tuscany/sca/test/contribution/HelloTestCase.java @@ -0,0 +1,91 @@ +/* + * 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 org.apache.tuscany.sca.test.contribution; + +import hello.Hello; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.assembly.Composite; +import org.apache.tuscany.sca.contribution.Contribution; +import org.apache.tuscany.sca.contribution.service.ContributionService; +import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain; + +/** + * Tests that the helloworld server is available + */ +public class HelloTestCase extends TestCase { + private ClassLoader cl; + private EmbeddedSCADomain domain; + + @Override + protected void setUp() throws Exception { + // Create a test embedded SCA domain + cl = getClass().getClassLoader(); + domain = new EmbeddedSCADomain(cl, "http://localhost"); + + // Start the domain + domain.start(); + + // Contribute the SCA contribution + ContributionService contributionService = domain.getContributionService(); + + URL helloURL = getContributionURL(Hello.class); + + // File helloContrib = new File("./target/classes/"); + // URL helloURL = helloContrib.toURL(); + Contribution consumerContribution = + contributionService.contribute("http://import-export/hello", helloURL, false); + Composite consumerComposite = consumerContribution.getDeployables().get(0); + domain.getDomainComposite().getIncludes().add(consumerComposite); + domain.buildComposite(consumerComposite); + + // Start Components from my composite + domain.getCompositeActivator().activate(consumerComposite); + domain.getCompositeActivator().start(consumerComposite); + } + + private URL getContributionURL(Class cls) throws MalformedURLException { + String flag = "/" + cls.getName().replace('.', '/') + ".class"; + URL url = cls.getResource(flag); + String root = url.toExternalForm(); + root = root.substring(0, root.length() - flag.length() + 1); + if (root.startsWith("jar:") && root.endsWith("!/")) { + root = root.substring(4, root.length() - 2); + } + url = new URL(root); + return url; + } + + public void testHello() throws IOException { + Hello hello = domain.getService(Hello.class, "HelloServiceComponent"); + assertNotNull(hello); + assertEquals(hello.getGreetings("lresende"), "Hello lresende"); + } + + @Override + public void tearDown() throws Exception { + domain.close(); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-java/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-java/pom.xml new file mode 100644 index 0000000000..9ef7139f3a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-java/pom.xml @@ -0,0 +1,67 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-contribution-export-java + Apache Tuscany SCA Contribution Java Export Integration Tests + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-tomcat + 1.2.1-incubating-SNAPSHOT + runtime + + + + junit + junit + 4.2 + test + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-java/src/main/java/helloworld/HelloWorldService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-java/src/main/java/helloworld/HelloWorldService.java new file mode 100644 index 0000000000..268d90e910 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-java/src/main/java/helloworld/HelloWorldService.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package helloworld; + +import org.osoa.sca.annotations.Remotable; + +/** + * This is the business interface of the HelloWorld greetings service. + */ +@Remotable +public interface HelloWorldService { + + public String getGreetings(String name); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-java/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-java/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..7e11adcec7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-java/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-1.2.1/itest/contribution-import-export/export-java/src/main/resources/helloworld/HelloWorldImpl.componentType b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-java/src/main/resources/helloworld/HelloWorldImpl.componentType new file mode 100644 index 0000000000..5a14b41650 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-java/src/main/resources/helloworld/HelloWorldImpl.componentType @@ -0,0 +1,30 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-resource/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-resource/pom.xml new file mode 100644 index 0000000000..129a06095f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-resource/pom.xml @@ -0,0 +1,31 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-contribution-export-resource + Apache Tuscany SCA Contribution Resource Export Integration Tests + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-resource/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-resource/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..f11eacb416 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-resource/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-1.2.1/itest/contribution-import-export/export-resource/src/main/resources/ufservices/store.html b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-resource/src/main/resources/ufservices/store.html new file mode 100644 index 0000000000..1ff281373a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-resource/src/main/resources/ufservices/store.html @@ -0,0 +1,27 @@ + + + +Store + + + +

Sample Store Page

+ + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-wsdl/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-wsdl/pom.xml new file mode 100644 index 0000000000..8586f9e81a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-wsdl/pom.xml @@ -0,0 +1,31 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-contribution-export-wsdl + Apache Tuscany SCA Contribution WSDL Export Integration Tests + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-wsdl/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-wsdl/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..8254b667f2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-wsdl/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-1.2.1/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.wsdl b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.wsdl new file mode 100644 index 0000000000..9b31363e1a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.wsdl @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.xsd new file mode 100644 index 0000000000..d49e2ead99 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.xsd @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/pom.xml new file mode 100644 index 0000000000..3697a228d7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/pom.xml @@ -0,0 +1,73 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-contribution-import-composite + Apache Tuscany SCA Contribution Import Integration Tests + + + + org.apache.tuscany.sca + itest-contribution-export-composite + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-tomcat + 1.2.1-incubating-SNAPSHOT + runtime + + + + junit + junit + 4.2 + test + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldImpl.java new file mode 100644 index 0000000000..c062afaed0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldImpl.java @@ -0,0 +1,38 @@ +/* + * 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 hello.Hello; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * This class implements the HelloWorld service. + */ +@Service(HelloWorldService.class) +public class HelloWorldImpl implements HelloWorldService { + @Reference + protected Hello helloServiceRef; + + public String getGreetings(String name) { + return helloServiceRef.getGreetings(name); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldServer.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldServer.java new file mode 100644 index 0000000000..e03ed4dc25 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldServer.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 helloworld; + +import java.io.IOException; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +/** + * This server program shows how to create an SCA runtime, and start it which + * activates the helloworld Web service endpoint. + */ +public class HelloWorldServer { + + public static void main(String[] args) { + + SCADomain scaDomain = SCADomain.newInstance("helloworldws.composite"); + + try { + System.out.println("HelloWorld server started (press enter to shutdown)"); + System.in.read(); + } catch (IOException e) { + e.printStackTrace(); + } + + scaDomain.close(); + System.out.println("HelloWorld server stopped"); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldService.java new file mode 100644 index 0000000000..268d90e910 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldService.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package helloworld; + +import org.osoa.sca.annotations.Remotable; + +/** + * This is the business interface of the HelloWorld greetings service. + */ +@Remotable +public interface HelloWorldService { + + public String getGreetings(String name); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..130aa91093 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,27 @@ + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/resources/helloworld.wsdl b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/resources/helloworld.wsdl new file mode 100644 index 0000000000..9b31363e1a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/resources/helloworld.wsdl @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/resources/helloworld.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/resources/helloworld.xsd new file mode 100644 index 0000000000..d49e2ead99 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/resources/helloworld.xsd @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/resources/helloworldws.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/resources/helloworldws.composite new file mode 100644 index 0000000000..e2f852ff7e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/main/resources/helloworldws.composite @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/test/java/org/apache/tuscany/test/contribution/HelloWorldServerTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/test/java/org/apache/tuscany/test/contribution/HelloWorldServerTestCase.java new file mode 100644 index 0000000000..3cc6784eca --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-composite/src/test/java/org/apache/tuscany/test/contribution/HelloWorldServerTestCase.java @@ -0,0 +1,126 @@ +/* + * 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 org.apache.tuscany.test.contribution; + +import hello.Hello; +import helloworld.HelloWorldService; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.Socket; +import java.net.URL; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.assembly.Composite; +import org.apache.tuscany.sca.contribution.Contribution; +import org.apache.tuscany.sca.contribution.service.ContributionService; +import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain; + +/** + * Tests that the helloworld server is available + */ +public class HelloWorldServerTestCase extends TestCase { + private ClassLoader cl; + private EmbeddedSCADomain domain; + private Contribution helloWorldContribution; + private Contribution compositeContribution; + + @Override + protected void setUp() throws Exception { + //Create a test embedded SCA domain + cl = getClass().getClassLoader(); + domain = new EmbeddedSCADomain(cl, "http://localhost"); + + //Start the domain + domain.start(); + + // Contribute the SCA contribution + ContributionService contributionService = domain.getContributionService(); + + // File compositeContribLocation = new File("../export-composite/target/classes"); + // URL compositeContribURL = compositeContribLocation.toURL(); + URL compositeContribURL = getContributionURL(Hello.class); + compositeContribution = + contributionService.contribute("http://import-export/export-composite", compositeContribURL, false); + for (Composite deployable : compositeContribution.getDeployables()) { + domain.getDomainComposite().getIncludes().add(deployable); + domain.buildComposite(deployable); + } + +// File helloWorldContribLocation = new File("./target/classes/"); +// URL helloWorldContribURL = helloWorldContribLocation.toURL(); + URL helloWorldContribURL = getContributionURL(HelloWorldService.class); + helloWorldContribution = + contributionService.contribute("http://import-export/helloworld", helloWorldContribURL, false); + for (Composite deployable : helloWorldContribution.getDeployables()) { + domain.getDomainComposite().getIncludes().add(deployable); + domain.buildComposite(deployable); + } + + // Start Components from my composite + for (Composite deployable : helloWorldContribution.getDeployables()) { + domain.getCompositeActivator().activate(deployable); + domain.getCompositeActivator().start(deployable); + } + } + + private URL getContributionURL(Class cls) throws MalformedURLException { + String flag = "/" + cls.getName().replace('.', '/') + ".class"; + URL url = cls.getResource(flag); + String root = url.toExternalForm(); + root = root.substring(0, root.length() - flag.length() + 1); + if (root.startsWith("jar:") && root.endsWith("!/")) { + root = root.substring(4, root.length() - 2); + } + url = new URL(root); + return url; + } + + public void testPing() throws IOException { + new Socket("127.0.0.1", 8085); + } + + public void testServiceCall() throws IOException { + HelloWorldService helloWorldService = + domain.getService(HelloWorldService.class, "HelloWorldServiceComponent/HelloWorldService"); + assertNotNull(helloWorldService); + + assertEquals("Hello Smith", helloWorldService.getGreetings("Smith")); + } + + @Override + public void tearDown() throws Exception { + ContributionService contributionService = domain.getContributionService(); + + // Remove the contribution from the in-memory repository + contributionService.remove("http://import-export/helloworld"); + contributionService.remove("http://import-export/export-composite"); + + //Stop Components from my composite + for (Composite deployable : helloWorldContribution.getDeployables()) { + domain.getCompositeActivator().stop(deployable); + domain.getCompositeActivator().deactivate(deployable); + } + + domain.stop(); + domain.close(); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-java/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-java/pom.xml new file mode 100644 index 0000000000..408807e5ea --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-java/pom.xml @@ -0,0 +1,73 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-contribution-import-java + Apache Tuscany SCA Contribution Java Import Java Integration Tests + + + + org.apache.tuscany.sca + itest-contribution-export-java + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-tomcat + 1.2.1-incubating-SNAPSHOT + runtime + + + + junit + junit + 4.2 + test + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-java/src/main/java/helloworld/HelloWorldImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-java/src/main/java/helloworld/HelloWorldImpl.java new file mode 100644 index 0000000000..0de3c70303 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-java/src/main/java/helloworld/HelloWorldImpl.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 helloworld; + +import org.osoa.sca.annotations.Service; + +/** + * This class implements the HelloWorld service. + */ +@Service(HelloWorldService.class) +public class HelloWorldImpl implements HelloWorldService { + + public String getGreetings(String name) { + return "Hello " + name; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-java/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-java/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..be9bbc6cad --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-java/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-java/src/main/resources/helloworldws.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-java/src/main/resources/helloworldws.composite new file mode 100644 index 0000000000..9b650e4acc --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-java/src/main/resources/helloworldws.composite @@ -0,0 +1,29 @@ + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-java/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-java/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java new file mode 100644 index 0000000000..9bc94525e0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-java/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java @@ -0,0 +1,127 @@ +/* + * 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 org.apache.tuscany.sca.test.contribution; + +import helloworld.HelloWorldImpl; +import helloworld.HelloWorldService; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.assembly.Composite; +import org.apache.tuscany.sca.contribution.Contribution; +import org.apache.tuscany.sca.contribution.service.ContributionService; +import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain; + +/** + * Tests that the helloworld server is available + */ +public class HelloWorldServerTestCase extends TestCase { + private ClassLoader cl; + private EmbeddedSCADomain domain; + private Contribution helloWorldContribution; + private Contribution javaContribution; + + @Override + protected void setUp() throws Exception { + //Create a test embedded SCA domain + cl = getClass().getClassLoader(); + domain = new EmbeddedSCADomain(cl, "http://localhost"); + + //Start the domain + domain.start(); + + // Contribute the SCA contribution + ContributionService contributionService = domain.getContributionService(); + + //File javaContribLocation = new File("../export-java/target/classes"); + //URL javaContribURL = javaContribLocation.toURL(); + URL javaContribURL = getContributionURL(HelloWorldService.class); + javaContribution = contributionService.contribute("http://import-export/export-java", javaContribURL, false); + for (Composite deployable : javaContribution.getDeployables()) { + domain.getDomainComposite().getIncludes().add(deployable); + domain.buildComposite(deployable); + } + + //File helloWorldContribLocation = new File("./target/classes/"); + //URL helloWorldContribURL = helloWorldContribLocation.toURL(); + URL helloWorldContribURL = getContributionURL(HelloWorldImpl.class); + helloWorldContribution = contributionService.contribute("http://import-export/helloworld", helloWorldContribURL, false); + for (Composite deployable : helloWorldContribution.getDeployables()) { + domain.getDomainComposite().getIncludes().add(deployable); + domain.buildComposite(deployable); + } + + // Start Components from my composite + for (Composite deployable : helloWorldContribution.getDeployables()) { + domain.getCompositeActivator().activate(deployable); + domain.getCompositeActivator().start(deployable); + } + } + + private URL getContributionURL(Class cls) throws MalformedURLException { + String flag = "/" + cls.getName().replace('.', '/') + ".class"; + URL url = cls.getResource(flag); + String root = url.toExternalForm(); + root = root.substring(0, root.length() - flag.length() + 1); + if (root.startsWith("jar:") && root.endsWith("!/")) { + root = root.substring(4, root.length() - 2); + } + url = new URL(root); + return url; + } + + public void testPing() throws IOException { + HelloWorldService helloWorldService = + domain.getService(HelloWorldService.class, "HelloWorldServiceComponent/HelloWorldService"); + assertNotNull(helloWorldService); + assertEquals("Hello test", helloWorldService.getGreetings("test")); + } + + public void testServiceCall() throws IOException { + HelloWorldService helloWorldService = + domain.getService(HelloWorldService.class, "HelloWorldServiceComponent/HelloWorldService"); + assertNotNull(helloWorldService); + + assertEquals("Hello Smith", helloWorldService.getGreetings("Smith")); + } + + @Override + public void tearDown() throws Exception { + ContributionService contributionService = domain.getContributionService(); + + // Remove the contribution from the in-memory repository + contributionService.remove("http://import-export/helloworld"); + contributionService.remove("http://import-export/export-java"); + + // Stop Components from my composite + for (Composite deployable : helloWorldContribution.getDeployables()) { + domain.getCompositeActivator().stop(deployable); + domain.getCompositeActivator().deactivate(deployable); + } + + domain.stop(); + + domain.close(); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-resource/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-resource/pom.xml new file mode 100644 index 0000000000..f775805b8d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-resource/pom.xml @@ -0,0 +1,95 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-contribution-import-resource + Apache Tuscany SCA Contribution Resource Import Java Integration Tests + + + + + org.apache.tuscany.sca + itest-contribution-export-resource + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-http + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-binding-http + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-resource + 1.2.1-incubating-SNAPSHOT + test + + + + javax.servlet + servlet-api + 2.5 + provided + + + + org.apache.tuscany.sca + tuscany-host-tomcat + 1.2.1-incubating-SNAPSHOT + runtime + + + + junit + junit + 4.2 + test + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-resource/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-resource/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..ac6d7becb3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-resource/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-resource/src/main/resources/store.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-resource/src/main/resources/store.composite new file mode 100644 index 0000000000..bb5a7b764f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-resource/src/main/resources/store.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-resource/src/test/java/org/apache/tuscany/sca/test/contribution/StoreTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-resource/src/test/java/org/apache/tuscany/sca/test/contribution/StoreTestCase.java new file mode 100644 index 0000000000..1b7542b7d9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-resource/src/test/java/org/apache/tuscany/sca/test/contribution/StoreTestCase.java @@ -0,0 +1,129 @@ +/* + * 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 org.apache.tuscany.sca.test.contribution; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.Socket; +import java.net.URL; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.assembly.Composite; +import org.apache.tuscany.sca.contribution.Contribution; +import org.apache.tuscany.sca.contribution.service.ContributionService; +import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain; + +/** + * Tests that the helloworld server is available + */ +public class StoreTestCase extends TestCase { + private ClassLoader cl; + private EmbeddedSCADomain domain; + private Contribution storeContribution; + private Contribution resourceContribution; + + @Override + protected void setUp() throws Exception { + //Create a test embedded SCA domain + cl = getClass().getClassLoader(); + domain = new EmbeddedSCADomain(cl, "http://localhost"); + + //Start the domain + domain.start(); + + // Contribute the SCA contribution + ContributionService contributionService = domain.getContributionService(); + + URL javaContribURL = getContributionURL(cl, "ufservices/store.html"); + resourceContribution = contributionService.contribute("http://import-export/export-resource", javaContribURL, false); + for (Composite deployable : resourceContribution.getDeployables()) { + domain.getDomainComposite().getIncludes().add(deployable); + domain.buildComposite(deployable); + } + + URL storeContributionURL = getContributionURL(cl, "store.composite"); + + storeContribution = + contributionService.contribute("http://import-export/store", storeContributionURL, false); + for (Composite deployable : storeContribution.getDeployables()) { + domain.getDomainComposite().getIncludes().add(deployable); + domain.buildComposite(deployable); + } + + // Start Components from my composite + for (Composite deployable : storeContribution.getDeployables()) { + domain.getCompositeActivator().activate(deployable); + domain.getCompositeActivator().start(deployable); + } + } + + public void testPing() throws IOException { + new Socket("127.0.0.1", 8085); + } + + + @Override + public void tearDown() throws Exception { + ContributionService contributionService = domain.getContributionService(); + + // Remove the contribution from the in-memory repository + contributionService.remove("http://import-export/store"); + contributionService.remove("http://import-export/export-resource"); + + // Stop Components from my composite + for (Composite deployable : storeContribution.getDeployables()) { + domain.getCompositeActivator().stop(deployable); + domain.getCompositeActivator().deactivate(deployable); + } + + domain.stop(); + + domain.close(); + } + + + /** + * Utility methods + */ + + + private URL getContributionURL(ClassLoader cl, Class cls) throws MalformedURLException { + String flag = "/" + cls.getName().replace('.', '/') + ".class"; + URL url = cl.getResource(flag); + String root = url.toExternalForm(); + root = root.substring(0, root.length() - flag.length() + 1); + if (root.startsWith("jar:") && root.endsWith("!/")) { + root = root.substring(4, root.length() - 2); + } + url = new URL(root); + return url; + } + + private URL getContributionURL(ClassLoader cl, String uri) throws MalformedURLException { + URL url = cl.getResource(uri); + String root = url.toExternalForm(); + root = root.substring(0, root.length() - uri.length()); + if (root.startsWith("jar:") && root.endsWith("!/")) { + root = root.substring(4, root.length() - 2); + } + url = new URL(root); + return url; + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/pom.xml new file mode 100644 index 0000000000..f4d03f0184 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/pom.xml @@ -0,0 +1,73 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-contribution-import-wsdl + Apache Tuscany SCA Contribution WSDL Import Integration Tests + + + + org.apache.tuscany.sca + itest-contribution-export-wsdl + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-tomcat + 1.2.1-incubating-SNAPSHOT + runtime + + + + junit + junit + 4.2 + test + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldImpl.java new file mode 100644 index 0000000000..0de3c70303 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldImpl.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 helloworld; + +import org.osoa.sca.annotations.Service; + +/** + * This class implements the HelloWorld service. + */ +@Service(HelloWorldService.class) +public class HelloWorldImpl implements HelloWorldService { + + public String getGreetings(String name) { + return "Hello " + name; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldServer.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldServer.java new file mode 100644 index 0000000000..e03ed4dc25 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldServer.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 helloworld; + +import java.io.IOException; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +/** + * This server program shows how to create an SCA runtime, and start it which + * activates the helloworld Web service endpoint. + */ +public class HelloWorldServer { + + public static void main(String[] args) { + + SCADomain scaDomain = SCADomain.newInstance("helloworldws.composite"); + + try { + System.out.println("HelloWorld server started (press enter to shutdown)"); + System.in.read(); + } catch (IOException e) { + e.printStackTrace(); + } + + scaDomain.close(); + System.out.println("HelloWorld server stopped"); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldService.java new file mode 100644 index 0000000000..268d90e910 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldService.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package helloworld; + +import org.osoa.sca.annotations.Remotable; + +/** + * This is the business interface of the HelloWorld greetings service. + */ +@Remotable +public interface HelloWorldService { + + public String getGreetings(String name); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..a47b9a71e9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/main/resources/helloworldws.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/main/resources/helloworldws.composite new file mode 100644 index 0000000000..5008a2ea5b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/main/resources/helloworldws.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java new file mode 100644 index 0000000000..66227eacaa --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/import-wsdl/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java @@ -0,0 +1,137 @@ +/* + * 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 org.apache.tuscany.sca.test.contribution; + +import helloworld.HelloWorldService; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.Socket; +import java.net.URL; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.assembly.Composite; +import org.apache.tuscany.sca.contribution.Contribution; +import org.apache.tuscany.sca.contribution.service.ContributionService; +import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain; + +/** + * Tests that the helloworld server is available + */ +public class HelloWorldServerTestCase extends TestCase { + private ClassLoader cl; + private EmbeddedSCADomain domain; + private Contribution wsdlContribution; + private Contribution consumerContribution; + + @Override + protected void setUp() throws Exception { + // Create a test embedded SCA domain + cl = getClass().getClassLoader(); + domain = new EmbeddedSCADomain(cl, "http://localhost"); + + //Start the domain + domain.start(); + + // Contribute the SCA contribution + ContributionService contributionService = domain.getContributionService(); + + // File wsdlContribLocation = new File("../export-wsdl/target/classes"); + // URL wsdlContribURL = wsdlContribLocation.toURL(); + URL wsdlContribURL = getContributionURL(getClass().getClassLoader(), "helloworld.wsdl"); + wsdlContribution = contributionService.contribute("http://import-export/export-wsdl", wsdlContribURL, false); + for (Composite deployable : wsdlContribution.getDeployables()) { + domain.getDomainComposite().getIncludes().add(deployable); + domain.buildComposite(deployable); + } + + // File helloWorldContribLocation = new File("./target/classes/"); + // URL helloWorldContribURL = helloWorldContribLocation.toURL(); + URL helloWorldContribURL = getContributionURL(HelloWorldService.class); + consumerContribution = + contributionService.contribute("http://import-export/helloworld", helloWorldContribURL, false); + for (Composite deployable : consumerContribution.getDeployables()) { + domain.getDomainComposite().getIncludes().add(deployable); + domain.buildComposite(deployable); + } + + // Start Components from my composite + for (Composite deployable : consumerContribution.getDeployables()) { + domain.getCompositeActivator().activate(deployable); + domain.getCompositeActivator().start(deployable); + } + } + + public void testPing() throws IOException { + new Socket("127.0.0.1", 8085); + } + + private URL getContributionURL(Class cls) throws MalformedURLException { + String flag = "/" + cls.getName().replace('.', '/') + ".class"; + URL url = cls.getResource(flag); + String root = url.toExternalForm(); + root = root.substring(0, root.length() - flag.length() + 1); + if (root.startsWith("jar:") && root.endsWith("!/")) { + root = root.substring(4, root.length() - 2); + } + url = new URL(root); + return url; + } + + private URL getContributionURL(ClassLoader cl, String flag) throws MalformedURLException { + URL url = cl.getResource(flag); + String root = url.toExternalForm(); + root = root.substring(0, root.length() - flag.length()); + if (root.startsWith("jar:") && root.endsWith("!/")) { + root = root.substring(4, root.length() - 2); + } + url = new URL(root); + // System.out.println(url); + return url; + } + + public void testServiceCall() throws IOException { + HelloWorldService helloWorldService = + domain.getService(HelloWorldService.class, "HelloWorldServiceComponent/HelloWorldService"); + assertNotNull(helloWorldService); + + assertEquals("Hello Smith", helloWorldService.getGreetings("Smith")); + } + + @Override + public void tearDown() throws Exception { + ContributionService contributionService = domain.getContributionService(); + + // Remove the contribution from the in-memory repository + contributionService.remove("http://import-export/helloworld"); + contributionService.remove("http://import-export/export-wsdl"); + + // Stop Components from my composite + for (Composite deployable : consumerContribution.getDeployables()) { + domain.getCompositeActivator().stop(deployable); + domain.getCompositeActivator().deactivate(deployable); + } + + domain.stop(); + + domain.close(); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/pom.xml new file mode 100644 index 0000000000..5bc4bc57a7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-import-export/pom.xml @@ -0,0 +1,56 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-contribution-import-export + pom + Apache Tuscany SCA Contribution Import/Export Integration Tests + + + export-composite + export-java + export-resource + export-wsdl + import-composite + import-java + import-resource + import-wsdl + + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-contribution-impl + 1.2.1-incubating-SNAPSHOT + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/pom.xml new file mode 100644 index 0000000000..15b4a2b79b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/pom.xml @@ -0,0 +1,51 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-contribution-multiple + Apache Tuscany SCA Multiple Contribution Integration Tests + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-contribution-impl + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/hello/Hello.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/hello/Hello.java new file mode 100644 index 0000000000..313a58a0bf --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/hello/Hello.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 hello; + +import org.osoa.sca.annotations.Remotable; + +/** + * This is the business interface of the Hello service. + */ +public interface Hello { + + public String getGreetings(String name); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/hello/HelloImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/hello/HelloImpl.java new file mode 100644 index 0000000000..ff9f6e75f3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/hello/HelloImpl.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 hello; + +import org.osoa.sca.annotations.Service; + +/** + * This class implements the HelloWorld service. + */ +@Service(Hello.class) +public class HelloImpl implements Hello { + + public String getGreetings(String name) { + return "Hello " + name; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/helloworld/HelloWorldImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/helloworld/HelloWorldImpl.java new file mode 100644 index 0000000000..c062afaed0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/helloworld/HelloWorldImpl.java @@ -0,0 +1,38 @@ +/* + * 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 hello.Hello; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * This class implements the HelloWorld service. + */ +@Service(HelloWorldService.class) +public class HelloWorldImpl implements HelloWorldService { + @Reference + protected Hello helloServiceRef; + + public String getGreetings(String name) { + return helloServiceRef.getGreetings(name); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/helloworld/HelloWorldService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/helloworld/HelloWorldService.java new file mode 100644 index 0000000000..a84a578344 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/helloworld/HelloWorldService.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; + +/** + * This is the business interface of the HelloWorld greetings service. + */ +public interface HelloWorldService { + + public String getGreetings(String name); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/test/ContributionCycleTestCaseFIXME.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/test/ContributionCycleTestCaseFIXME.java new file mode 100644 index 0000000000..ec5123eb2d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/test/ContributionCycleTestCaseFIXME.java @@ -0,0 +1,121 @@ +/* + * 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 test; + +import helloworld.HelloWorldService; + +import java.io.IOException; +import java.net.URL; + +import org.apache.tuscany.sca.assembly.Composite; +import org.apache.tuscany.sca.contribution.Contribution; +import org.apache.tuscany.sca.contribution.service.ContributionService; +import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain; + +import junit.framework.TestCase; + +/** + * Test multiple contributions scenario + * + * FIXME This test case causes a StackOverflowException instead of + * reporting an error when a composite is not found, as there's a + * dependency cycle in the test contributions and the model resolvers + * do not handle import cycles properly. + * + */ +public class ContributionCycleTestCaseFIXME extends TestCase { + + private String helloContribution_dir = "target/test-classes/contribution-cycle-export"; + private String helloWorldContribution_one_dir = "target/test-classes/contribution-cycle-import"; + + private ClassLoader cl; + private EmbeddedSCADomain domain; + private Contribution helloContribution; + private Contribution helloWorldContribution_one; + + protected void setUp() throws Exception { + URL helloContribution_URL = new java.io.File(helloContribution_dir).toURI().toURL(); + URL helloWorldContribution_one_URL = new java.io.File(helloWorldContribution_one_dir).toURI().toURL(); + + // Create a test embedded SCA domain + cl = getClass().getClassLoader(); + domain = new EmbeddedSCADomain(cl, "http://localhost"); + + // Start the domain + domain.start(); + + // Contribute the SCA contribution + ContributionService contributionService = domain.getContributionService(); + + helloContribution = + contributionService.contribute("http://contribution-multiple/helloworld", helloContribution_URL, false); + + for (Composite deployable : helloContribution.getDeployables()) { + domain.getDomainComposite().getIncludes().add(deployable); + domain.buildComposite(deployable); + } + for (Composite deployable : helloContribution.getDeployables()) { + domain.getCompositeActivator().activate(deployable); + domain.getCompositeActivator().start(deployable); + } + + helloWorldContribution_one = + contributionService.contribute("http://contribution-multiple/helloworld_one", helloWorldContribution_one_URL, false); + for (Composite deployable : helloWorldContribution_one.getDeployables()) { + domain.getDomainComposite().getIncludes().add(deployable); + domain.buildComposite(deployable); + } + + for (Composite deployable : helloWorldContribution_one.getDeployables()) { + domain.getCompositeActivator().activate(deployable); + domain.getCompositeActivator().start(deployable); + } + + } + + public void testServiceCall() throws IOException { + HelloWorldService helloWorldService_one = + domain.getService(HelloWorldService.class, "HelloWorldServiceComponent_one/HelloWorldService"); + assertNotNull(helloWorldService_one); + + assertEquals("Hello Smith", helloWorldService_one.getGreetings("Smith")); + + } + + public void tearDown() throws Exception { + ContributionService contributionService = domain.getContributionService(); + + // Remove the contribution from the in-memory repository + contributionService.remove("http://contribution-multiple/helloworld"); + contributionService.remove("http://contribution-multiple/helloworld_one"); + + // Stop Components from my composite + for (Composite deployable : helloWorldContribution_one.getDeployables()) { + domain.getCompositeActivator().stop(deployable); + domain.getCompositeActivator().deactivate(deployable); + } + for (Composite deployable : helloContribution.getDeployables()) { + domain.getCompositeActivator().stop(deployable); + domain.getCompositeActivator().deactivate(deployable); + } + // domain.stop(); + domain.close(); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/test/ContributionTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/test/ContributionTestCase.java new file mode 100644 index 0000000000..c1df23ce14 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/java/test/ContributionTestCase.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 test; + +import helloworld.HelloWorldService; + +import java.io.IOException; +import java.net.URL; + +import org.apache.tuscany.sca.assembly.Composite; +import org.apache.tuscany.sca.contribution.Contribution; +import org.apache.tuscany.sca.contribution.service.ContributionService; +import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain; + +import junit.framework.TestCase; + +/** + * Test multiple contributio scenario + * Contributed by TUSCANY-1756 + */ +public class ContributionTestCase extends TestCase { + + private String helloContribution_dir = "target/test-classes/contribution-export"; + private String helloWorldContribution_one_dir = "target/test-classes/contribution-import-one"; + + private ClassLoader cl; + private EmbeddedSCADomain domain; + private Contribution helloContribution; + private Contribution helloWorldContribution_one; + + protected void setUp() throws Exception { + URL helloContribution_URL = new java.io.File(helloContribution_dir).toURI().toURL(); + URL helloWorldContribution_one_URL = new java.io.File(helloWorldContribution_one_dir).toURI().toURL(); + + // Create a test embedded SCA domain + cl = getClass().getClassLoader(); + domain = new EmbeddedSCADomain(cl, "http://localhost"); + + // Start the domain + domain.start(); + + // Contribute the SCA contribution + ContributionService contributionService = domain.getContributionService(); + + helloContribution = + contributionService.contribute("http://contribution-multiple/helloworld", helloContribution_URL, false); + + for (Composite deployable : helloContribution.getDeployables()) { + domain.getDomainComposite().getIncludes().add(deployable); + domain.buildComposite(deployable); + } + for (Composite deployable : helloContribution.getDeployables()) { + domain.getCompositeActivator().activate(deployable); + domain.getCompositeActivator().start(deployable); + } + + helloWorldContribution_one = + contributionService.contribute("http://contribution-multiple/helloworld_one", helloWorldContribution_one_URL, false); + for (Composite deployable : helloWorldContribution_one.getDeployables()) { + domain.getDomainComposite().getIncludes().add(deployable); + domain.buildComposite(deployable); + } + + for (Composite deployable : helloWorldContribution_one.getDeployables()) { + domain.getCompositeActivator().activate(deployable); + domain.getCompositeActivator().start(deployable); + } + + } + + public void testServiceCall() throws IOException { + HelloWorldService helloWorldService_one = + domain.getService(HelloWorldService.class, "HelloWorldServiceComponent_one/HelloWorldService"); + assertNotNull(helloWorldService_one); + + assertEquals("Hello Smith", helloWorldService_one.getGreetings("Smith")); + + } + + public void tearDown() throws Exception { + ContributionService contributionService = domain.getContributionService(); + + // Remove the contribution from the in-memory repository + contributionService.remove("http://contribution-multiple/helloworld"); + contributionService.remove("http://contribution-multiple/helloworld_one"); + + // Stop Components from my composite + for (Composite deployable : helloWorldContribution_one.getDeployables()) { + domain.getCompositeActivator().stop(deployable); + domain.getCompositeActivator().deactivate(deployable); + } + for (Composite deployable : helloContribution.getDeployables()) { + domain.getCompositeActivator().stop(deployable); + domain.getCompositeActivator().deactivate(deployable); + } + // domain.stop(); + domain.close(); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-cycle-export/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-cycle-export/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..8b76783c3d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-cycle-export/META-INF/sca-contribution.xml @@ -0,0 +1,26 @@ + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-cycle-export/hello.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-cycle-export/hello.composite new file mode 100644 index 0000000000..aeeab337fa --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-cycle-export/hello.composite @@ -0,0 +1,31 @@ + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-cycle-import/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-cycle-import/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..bfbf74373a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-cycle-import/META-INF/sca-contribution.xml @@ -0,0 +1,26 @@ + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-cycle-import/helloworld_one.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-cycle-import/helloworld_one.composite new file mode 100644 index 0000000000..7a8003577e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-cycle-import/helloworld_one.composite @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-export/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-export/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..bea6f39932 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-export/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-export/hello.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-export/hello.composite new file mode 100644 index 0000000000..aeeab337fa --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-export/hello.composite @@ -0,0 +1,31 @@ + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-import-one/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-import-one/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..bfbf74373a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-import-one/META-INF/sca-contribution.xml @@ -0,0 +1,26 @@ + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-import-one/helloworld_one.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-import-one/helloworld_one.composite new file mode 100644 index 0000000000..45cb504ea4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution-multiple/src/test/resources/contribution-import-one/helloworld_one.composite @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/pom.xml new file mode 100644 index 0000000000..bf9d32d8a7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/pom.xml @@ -0,0 +1,45 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-contribution + Apache Tuscany SCA Contribution Integration Tests + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-contribution-impl + 1.2.1-incubating-SNAPSHOT + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/AddService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/AddService.java new file mode 100644 index 0000000000..ff475408ef --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/AddService.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 calculator; + +/** + * It is an Interface which has method declarations. Methods which are to be accessed as a service are declared in this + * interface. Implementation for these methods is provided in AddServiceImpl Class + */ +public interface AddService { + + /** + * This is an add method which takes 2 parameters of double type and returns the sum of two parameters + */ + double add(double n1, double n2); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/AddServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/AddServiceImpl.java new file mode 100644 index 0000000000..8b6fe066a6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/AddServiceImpl.java @@ -0,0 +1,30 @@ +/* + * 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 calculator; + +/** + * An implementation of the Add service + */ +public class AddServiceImpl implements AddService { + + public double add(double n1, double n2) { + return n1 + n2; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/CalculatorClient.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/CalculatorClient.java new file mode 100644 index 0000000000..616867ca31 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/CalculatorClient.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 calculator; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +/** + * This client program shows how to create an SCA runtime, start it, + * and locate and invoke a SCA component + */ +public class CalculatorClient { + public static void main(String[] args) throws Exception { + + SCADomain domain = SCADomain.newInstance("Calculator.composite"); + + CalculatorService calculatorService = domain.getService(CalculatorService.class, + "CalculatorServiceComponent"); + + // Calculate + System.out.println("3 + 2=" + calculatorService.add(3, 2)); + System.out.println("3 - 2=" + calculatorService.subtract(3, 2)); + System.out.println("3 * 2=" + calculatorService.multiply(3, 2)); + System.out.println("3 / 2=" + calculatorService.divide(3, 2)); + + domain.close(); + + } + +} \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/CalculatorService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/CalculatorService.java new file mode 100644 index 0000000000..f25d66c80f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/CalculatorService.java @@ -0,0 +1,35 @@ +/* + * 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 calculator; + +/** + * This is a Calculator service interface. All the methods which are to be accessed as a service are declared in this + * interface but not the implementation of those methods. + */ +public interface CalculatorService { + + double add(double n1, double n2); + + double subtract(double n1, double n2); + + double multiply(double n1, double n2); + + double divide(double n1, double n2); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/CalculatorServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/CalculatorServiceImpl.java new file mode 100644 index 0000000000..3d861f2018 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/CalculatorServiceImpl.java @@ -0,0 +1,70 @@ +/* + * 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 calculator; + +import org.osoa.sca.annotations.Reference; + + +/** + * An implementation of the Calculator service. + */ +public class CalculatorServiceImpl implements CalculatorService { + + private AddService addService; + private SubtractService subtractService; + private MultiplyService multiplyService; + private DivideService divideService; + + @Reference + public void setAddService(AddService addService) { + this.addService = addService; + } + + @Reference + public void setSubtractService(SubtractService subtractService) { + this.subtractService = subtractService; + } + + @Reference + public void setDivideService(DivideService divideService) { + this.divideService = divideService; + } + + @Reference + public void setMultiplyService(MultiplyService multiplyService) { + this.multiplyService = multiplyService; + } + + public double add(double n1, double n2) { + return addService.add(n1, n2); + } + + public double subtract(double n1, double n2) { + return subtractService.subtract(n1, n2); + } + + public double multiply(double n1, double n2) { + return multiplyService.multiply(n1, n2); + } + + public double divide(double n1, double n2) { + return divideService.divide(n1, n2); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/DivideService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/DivideService.java new file mode 100644 index 0000000000..709afc9460 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/DivideService.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 calculator; + +/** + * This is an interface for Divide Service which has divide method declared which is implemented in DivideServiceImpl + * class + */ +public interface DivideService { + + /** + * This is a divide method which takes 2 parameters of double type and returns the result of division + */ + double divide(double n1, double n2); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/DivideServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/DivideServiceImpl.java new file mode 100644 index 0000000000..f7ac0b7287 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/DivideServiceImpl.java @@ -0,0 +1,30 @@ +/* + * 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 calculator; + +/** + * An implementation of the Divide service. + */ +public class DivideServiceImpl implements DivideService { + + public double divide(double n1, double n2) { + return n1 / n2; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/MultiplyService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/MultiplyService.java new file mode 100644 index 0000000000..4a1d69d060 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/MultiplyService.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 calculator; + +/** + * This is an interface for Multiply Service which has multiply method declared which is implemented in + * MultiplyServiceImpl class + */ +public interface MultiplyService { + + /** + * This is a multiply method which takes 2 parameters of double type and returns the result of multiplication of the + * two parameters + */ + double multiply(double n1, double n2); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/MultiplyServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/MultiplyServiceImpl.java new file mode 100644 index 0000000000..b7dca792b2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/MultiplyServiceImpl.java @@ -0,0 +1,30 @@ +/* + * 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 calculator; + +/** + * An implementation of the Multiply service. + */ +public class MultiplyServiceImpl implements MultiplyService { + + public double multiply(double n1, double n2) { + return n1 * n2; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/SubtractService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/SubtractService.java new file mode 100644 index 0000000000..f0caeafe7f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/SubtractService.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 calculator; + +/** + * This is an interface for Subtract Service which has subtract method declared which is implemented in + * SubtractServiceImpl class + */ + +public interface SubtractService { + + /** + * This is a subtract method which takes 2 parameters of double type and returns the result of subtraction. + */ + double subtract(double n1, double n2); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/SubtractServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/SubtractServiceImpl.java new file mode 100644 index 0000000000..77b128ab8d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/java/calculator/SubtractServiceImpl.java @@ -0,0 +1,30 @@ +/* + * 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 calculator; + +/** + * An implementation of the subtract service. + */ +public class SubtractServiceImpl implements SubtractService { + + public double subtract(double n1, double n2) { + return n1 - n2; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/resources/ContributionTest.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/resources/ContributionTest.composite new file mode 100644 index 0000000000..d814e439e2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/resources/ContributionTest.composite @@ -0,0 +1,24 @@ + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/resources/calculator/Calculator.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/resources/calculator/Calculator.composite new file mode 100644 index 0000000000..657a2f95d8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/resources/calculator/Calculator.composite @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/resources/calculator/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/resources/calculator/sca-contribution.xml new file mode 100644 index 0000000000..2d5157cf57 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/main/resources/calculator/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/test/java/org/apache/tuscany/sca/test/contribution/ContributionServiceTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/test/java/org/apache/tuscany/sca/test/contribution/ContributionServiceTestCase.java new file mode 100644 index 0000000000..b26c9ad95e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/test/java/org/apache/tuscany/sca/test/contribution/ContributionServiceTestCase.java @@ -0,0 +1,201 @@ +/* + * 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 org.apache.tuscany.sca.test.contribution; + +import java.io.File; +import java.io.InputStream; +import java.net.URL; +import java.util.List; + +import javax.xml.namespace.QName; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.assembly.Composite; +import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; +import org.apache.tuscany.sca.contribution.Artifact; +import org.apache.tuscany.sca.contribution.Contribution; +import org.apache.tuscany.sca.contribution.service.ContributionService; +import org.apache.tuscany.sca.contribution.service.util.FileHelper; +import org.apache.tuscany.sca.contribution.service.util.IOHelper; +import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain; + +/** + * This is more intended to be a integration test then a unit test. * + */ +public class ContributionServiceTestCase extends TestCase { + private static final String CONTRIBUTION_001_ID = "contribution001/"; + private static final String CONTRIBUTION_002_ID = "contribution002/"; + private static final String JAR_CONTRIBUTION = "/repository/sample-calculator.jar"; + private static final String FOLDER_CONTRIBUTION = "target/classes/"; + + private ClassLoader cl; + private EmbeddedSCADomain domain; + private ContributionService contributionService; + + /** + * setUp() is a method in JUnit Frame Work which is executed before all others methods in the class extending + * unit.framework.TestCase. So this method is used to create a test Embedded SCA Domain, to start the SCA Domain and + * to get a reference to the contribution service + */ + + @Override + protected void setUp() throws Exception { + //Create a test embedded SCA domain + cl = getClass().getClassLoader(); + domain = new EmbeddedSCADomain(cl, "http://localhost"); + + //Start the domain + domain.start(); + + //get a reference to the contribution service + contributionService = domain.getContributionService(); + } + + /** + * Method prefixed with 'test' is a test method where testing logic is written using various assert methods. This + * test verifies the string assigned to contrututionId with the value retrieved from the SCA runtime. + */ + public void testContributeJAR() throws Exception { + URL contributionLocation = getClass().getResource(JAR_CONTRIBUTION); + //URL contributionLocation = new URL("file:/D:/dev/Opensource/Apache/Tuscany/source/java/sca/samples/calculator/target/sample-calculator.jar"); + String contributionId = CONTRIBUTION_001_ID; + contributionService.contribute(contributionId, contributionLocation, false); + assertNotNull(contributionService.getContribution(contributionId)); + } + + /** + * Method prefixed with 'test' is a test method where testing logic is written using various assert methods. This + * test verifies the string assigned to contrututionId with the value retrieved from the SCA runtime using + * contributionService. + */ + public void testStoreContributionPackageInRepository() throws Exception { + URL contributionLocation = getClass().getResource(JAR_CONTRIBUTION); + String contributionId = CONTRIBUTION_001_ID; + contributionService.contribute(contributionId, contributionLocation, true); + + assertTrue(FileHelper.toFile(new URL(contributionService.getContribution(contributionId).getLocation())) + .exists()); + + assertNotNull(contributionId); + + Contribution contributionModel = contributionService.getContribution(contributionId); + + File contributionFile = FileHelper.toFile(new URL(contributionModel.getLocation())); + assertTrue(contributionFile.exists()); + } + + /** + * Method prefixed with 'test' is a test method where testing logic is written using various assert methods. This + * test verifies the string assigned to contrututionId with the value retrieved from the SCA runtime using + * contributionService. + */ + public void testStoreContributionStreamInRepository() throws Exception { + URL contributionLocation = getClass().getResource(JAR_CONTRIBUTION); + String contributionId = CONTRIBUTION_001_ID; + + InputStream contributionStream = contributionLocation.openStream(); + try { + contributionService.contribute(contributionId, contributionLocation, contributionStream); + } finally { + IOHelper.closeQuietly(contributionStream); + } + + assertTrue(FileHelper.toFile(new URL(contributionService.getContribution(contributionId).getLocation())) + .exists()); + + assertNotNull(contributionId); + + Contribution contributionModel = contributionService.getContribution(contributionId); + + File contributionFile = FileHelper.toFile(new URL(contributionModel.getLocation())); + assertTrue(contributionFile.exists()); + } + + /** + * Method prefixed with 'test' is a test method where testing logic is written using various assert methods. This + * test verifies the string assigned to contributionId1,contributionId2 with the value retrieved from the SCA + * runtime using contributionService. + */ + public void testStoreDuplicatedContributionInRepository() throws Exception { + URL contributionLocation = getClass().getResource(JAR_CONTRIBUTION); + String contributionId1 = CONTRIBUTION_001_ID; + contributionService.contribute(contributionId1, contributionLocation, true); + assertNotNull(contributionService.getContribution(contributionId1)); + String contributionId2 = CONTRIBUTION_002_ID; + contributionService.contribute(contributionId2, contributionLocation, true); + assertNotNull(contributionService.getContribution(contributionId2)); + } + + /** + * Method prefixed with 'test' is a test method where testing logic is written using various assert methods. This + * test verifies the string assigned to contributionId with the value retrieved from the SCA runtime using + * contributionService. + */ + public void testContributeFolder() throws Exception { + File rootContributionFolder = new File(FOLDER_CONTRIBUTION); + String contributionId = CONTRIBUTION_001_ID; + //first rename the sca-contribution metadata file + //File calculatorMetadataFile = new File("target/classes/calculator/sca-contribution.xml"); + //File metadataDirectory = new File("target/classes/META-INF/"); + //if (!metadataDirectory.exists()) { + // FileHelper.forceMkdir(metadataDirectory); + //} + //FileHelper.copyFileToDirectory(calculatorMetadataFile, metadataDirectory); + contributionService.contribute(contributionId, rootContributionFolder.toURL(), false); + assertNotNull(contributionService.getContribution(contributionId)); + } + + /** + * Method prefixed with 'test' is a test method where testing logic is written using various assert methods. This + * test verifies the string assigned to contributionId, artifactId with the value retrieved from the SCA runtime + * using contributionService. + */ + public void testAddDeploymentComposites() throws Exception { + URL contributionLocation = getClass().getResource(JAR_CONTRIBUTION); + String contributionId = CONTRIBUTION_001_ID; + Contribution contribution = contributionService.contribute(contributionId, contributionLocation, false); + assertNotNull(contributionService.getContribution(contributionId)); + + String artifactId = "contributionComposite.composite"; + Composite composite = (new DefaultAssemblyFactory()).createComposite(); + composite.setName(new QName(null, "contributionComposite")); + composite.setURI("contributionComposite.composite"); + + contributionService.addDeploymentComposite(contribution, composite); + + List deployables = contributionService.getContribution(contributionId).getDeployables(); + Composite composite1 = (Composite)deployables.get(deployables.size() - 1); + assertEquals("contributionComposite", composite1.getName().toString()); + + Artifact artifact = null; + contribution = contributionService.getContribution(contributionId); + String id = artifactId.toString(); + for (Artifact a : contribution.getArtifacts()) { + if (id.equals(a.getURI())) { + artifact = a; + break; + } + } + Composite composite2 = (Composite)artifact.getModel(); + assertEquals("contributionComposite", composite2.getName().toString()); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/test/resources/deployables/sample-calculator.jar b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/test/resources/deployables/sample-calculator.jar new file mode 100644 index 0000000000..0ca3a1b781 Binary files /dev/null and b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/test/resources/deployables/sample-calculator.jar differ diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/test/resources/repository/sample-calculator.jar b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/test/resources/repository/sample-calculator.jar new file mode 100644 index 0000000000..0ca3a1b781 Binary files /dev/null and b/sca-java-1.x/branches/sca-java-1.2.1/itest/contribution/src/test/resources/repository/sample-calculator.jar differ diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/pom.xml new file mode 100644 index 0000000000..e7d13967ab --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/pom.xml @@ -0,0 +1,64 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-conversations-ws + Apache Tuscany SCA Conversations Over binding.ws Integration Tests + + + + org.apache.tuscany.sca + tuscany-node-api + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-node-impl + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-host-tomcat + 1.2.1-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/BusinessException.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/BusinessException.java new file mode 100644 index 0000000000..4f3a4573fc --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/BusinessException.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 org.apache.tuscany.sca.itest.conversational; + +public class BusinessException extends Exception { + + private String message; + + public BusinessException() { + super(); + } + + public BusinessException(String message) { + super(message); + setMessage(message); + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationIdService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationIdService.java new file mode 100644 index 0000000000..15c397b902 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationIdService.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 org.apache.tuscany.sca.itest.conversational; + +import org.osoa.sca.annotations.Conversational; + +@Conversational +public interface ConversationIdService { + + String getCIDField(); + String getCIDSetter(); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalCallback.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalCallback.java new file mode 100644 index 0000000000..b1dc926318 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalCallback.java @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.itest.conversational; + +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.EndsConversation; +import org.osoa.sca.annotations.Remotable; + + +/** + * The callback interface used when testing caonversational callbacks + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ +@Remotable +@Conversational +public interface ConversationalCallback { + + // public void init(); + + // public void destroy(); + + public void initializeCount(int count); + + public void incrementCount(); + + public int retrieveCount(); + + public void businessException() throws BusinessException; + + @EndsConversation + public String endConversation(); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalClient.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalClient.java new file mode 100644 index 0000000000..a5b7fd9e1a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalClient.java @@ -0,0 +1,51 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational; + +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Remotable; + +/** + * The client for the conversational itest. Is implemented by clients + * offering both stateless and stateful callbacks + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ + +@Remotable +public interface ConversationalClient { + + public int runConversationFromInjectedReference(); + public int runConversationFromInjectedReference2(); + public int runConversationFromServiceReference(); + public int runConversationWithUserDefinedConversationId(); + public String runConversationCheckUserDefinedConversationId(); + public int runConversationCheckingScope(); + public int runConversationWithCallback(); + public int runConversationHavingPassedReference(); + public String runConversationBusinessException(); + public String runConversationBusinessExceptionCallback(); + public int runConversationCallingEndedConversation(); + public int runConversationCallingEndedConversationCallback(); + public String runConversationCallingEndedConversationCheckConversationId(); + public String runConversationCallingEndedConversationCallbackCheckConversationId(); + public int runConversationAgeTimeout(); + public int runConversationIdleTimeout(); + public int runConversationPrincipleError(); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalReferenceClient.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalReferenceClient.java new file mode 100644 index 0000000000..6f8d2d0b6f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalReferenceClient.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 org.apache.tuscany.sca.itest.conversational; + +import org.osoa.sca.CallableReference; +import org.osoa.sca.annotations.Remotable; + +/** + * The client that calls into an existing conversation by accepting + * a reference to that conversation + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ + +@Remotable +public interface ConversationalReferenceClient { + + public void incrementCount(CallableReference conversationalService); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalService.java new file mode 100644 index 0000000000..3a6f8fb97f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalService.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 org.apache.tuscany.sca.itest.conversational; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.EndsConversation; +import org.osoa.sca.annotations.Remotable; + + +/** + * The service interface used when testing conversations + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ +@Remotable +@Conversational +@Callback(ConversationalCallback.class) +public interface ConversationalService { + + public void initializeCount(int count); + + public void incrementCount(); + + public int retrieveCount(); + + //public void businessException() throws BusinessException; + + public void initializeCountCallback(int count); + + public void incrementCountCallback(); + + public int retrieveCountCallback(); + + //public void businessExceptionCallback() throws BusinessException; + + @EndsConversation + public String endConversation(); + + public String endConversationCallback(); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalServiceNonConversationalCallback.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalServiceNonConversationalCallback.java new file mode 100644 index 0000000000..580c404448 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalServiceNonConversationalCallback.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.itest.conversational; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.EndsConversation; +import org.osoa.sca.annotations.Remotable; + + +/** + * The service interface used when testing conversations + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ +@Remotable +@Conversational +@Callback(NonConversationalCallback.class) +public interface ConversationalServiceNonConversationalCallback { + + + public void initializeCount(int count); + + public void incrementCount(); + + public int retrieveCount(); + + public void businessException() throws BusinessException; + + public void initializeCountCallback(int count); + + public void incrementCountCallback(); + + public int retrieveCountCallback(); + + public void businessExceptionCallback() throws BusinessException; + + @EndsConversation + public String endConversation(); + + public String endConversationCallback(); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallback.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallback.java new file mode 100644 index 0000000000..0db328b3d8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallback.java @@ -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. + */ +package org.apache.tuscany.sca.itest.conversational; + +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.EndsConversation; +import org.osoa.sca.annotations.Remotable; + + +/** + * The callback interface used when testing caonversational callbacks + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ +@Remotable +public interface NonConversationalCallback { + + public void initializeCount(int count); + + public void incrementCount(); + + public int retrieveCount(); + + public void businessException() throws BusinessException; + + public String endConversation(); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationAgeComponentImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationAgeComponentImpl.java new file mode 100644 index 0000000000..a3b76352bd --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationAgeComponentImpl.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 org.apache.tuscany.sca.itest.conversational.impl; + +import org.apache.tuscany.sca.itest.conversational.BusinessException; +import org.apache.tuscany.sca.itest.conversational.ConversationalService; +import org.osoa.sca.annotations.ConversationAttributes; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(ConversationalService.class) +@Scope("CONVERSATION") +@ConversationAttributes(maxAge="1 seconds") +public class ConversationAgeComponentImpl implements ConversationalService { + + private int count; + + public void businessException() throws BusinessException { + } + + public void businessExceptionCallback() throws BusinessException { + } + + public void destroy() { + } + + public String endConversation() { + return null; + } + + public String endConversationCallback() { + return null; + } + + public void incrementCount() { + } + + public void incrementCountCallback() { + } + + public void init() { + } + + public void initializeCount(int count) { + this.count = count; + } + + public void initializeCountCallback(int count) { + } + + public int retrieveCount() { + return count; + } + + public int retrieveCountCallback() { + return 0; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationIdComponentImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationIdComponentImpl.java new file mode 100644 index 0000000000..cffa76186a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationIdComponentImpl.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 org.apache.tuscany.sca.itest.conversational.impl; + +import org.apache.tuscany.sca.itest.conversational.ConversationIdService; +import org.osoa.sca.annotations.ConversationID; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(ConversationIdService.class) +@Scope("CONVERSATION") +public class ConversationIdComponentImpl implements ConversationIdService { + + @ConversationID + public String cid; + + private String setterCid; + + public String getCIDField() { + return cid; + } + public String getCIDSetter() { + return setterCid; + } + + + @ConversationID + public void setCID(String cid) { + this.setterCid = cid; + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationMaxIdleComponentImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationMaxIdleComponentImpl.java new file mode 100644 index 0000000000..a9d247ed40 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationMaxIdleComponentImpl.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 org.apache.tuscany.sca.itest.conversational.impl; + +import org.apache.tuscany.sca.itest.conversational.BusinessException; +import org.apache.tuscany.sca.itest.conversational.ConversationalService; +import org.osoa.sca.annotations.ConversationAttributes; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(ConversationalService.class) +@Scope("CONVERSATION") +@ConversationAttributes(maxIdleTime="1 seconds") +public class ConversationMaxIdleComponentImpl implements ConversationalService { + + private int count; + + public void businessException() throws BusinessException { + } + + public void businessExceptionCallback() throws BusinessException { + } + + public void destroy() { + } + + public String endConversation() { + return null; + } + + public String endConversationCallback() { + return null; + } + + public void incrementCount() { + } + + public void incrementCountCallback() { + } + + public void init() { + } + + public void initializeCount(int count) { + this.count = count; + } + + public void initializeCountCallback(int count) { + } + + public int retrieveCount() { + return count; + } + + public int retrieveCountCallback() { + return 0; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulImpl.java new file mode 100644 index 0000000000..0b50bae846 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulImpl.java @@ -0,0 +1,322 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational.impl; + +import org.apache.tuscany.sca.itest.conversational.BusinessException; +import org.apache.tuscany.sca.itest.conversational.ConversationalCallback; +import org.apache.tuscany.sca.itest.conversational.ConversationalClient; +import org.apache.tuscany.sca.itest.conversational.ConversationalReferenceClient; +import org.apache.tuscany.sca.itest.conversational.ConversationalService; +import org.osoa.sca.ComponentContext; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.ConversationAttributes; +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +/** + * The client for the conversational itest which presents a stateful + * callback interface + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ + +@Service(interfaces={ConversationalClient.class}) +@Scope("CONVERSATION") +@ConversationAttributes(maxAge="10 minutes", + maxIdleTime="5 minutes", + singlePrincipal=false) +public class ConversationalClientStatefulImpl implements ConversationalClient, ConversationalCallback { + + @Context + protected ComponentContext componentContext; + + @Reference + protected ConversationalService conversationalService; + + @Reference + protected ConversationalService conversationalService2; + + @Reference + protected ConversationalReferenceClient conversationalReferenceClient; + + private int clientCount = 0; + private int callbackCount = 0; + + + // a static member variable that records the number of times this service is called + public static StringBuffer calls = new StringBuffer(); + + // From ConversationalClient + public int runConversationFromInjectedReference(){ + calls.append("runConversationFromInjectedReference,"); + conversationalService.initializeCount(1); + conversationalService.incrementCount(); + clientCount = conversationalService.retrieveCount(); + conversationalService.endConversation(); + + return clientCount; + } + public int runConversationFromInjectedReference2(){ + calls.append("runConversationFromInjectedReference2,"); + + conversationalService2.initializeCount(1); + conversationalService2.incrementCount(); + + // stick in a call to the first reference to + // make sure the two references don't clash + conversationalService.initializeCount(1); + + clientCount = conversationalService2.retrieveCount(); + conversationalService2.endConversation(); + + // end the conversation through the first reference + conversationalService.endConversation(); + + return clientCount; + } + public int runConversationFromServiceReference(){ + calls.append("runConversationFromServiceReference,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + // serviceReference.getConversation().end(); + + return clientCount; + } + public int runConversationWithUserDefinedConversationId(){ + calls.append("runConversationWithUserDefinedConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation1"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + // serviceReference.getConversation().end(); + + return clientCount; + } + public String runConversationCheckUserDefinedConversationId(){ + calls.append("runConversationCheckUserDefinedConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation2"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + + String clientConversationId = serviceReference.getConversationID().toString(); + String serverConversationId = callableReference.endConversation(); + + if (clientConversationId.equals("MyConversation2") && + serverConversationId.equals("MyConversation2") ) { + return clientConversationId; + } else { + return "client = " + clientConversationId + + "server = " + serverConversationId; + } + + } + public int runConversationCheckingScope(){ + calls.append("runConversationCheckingScope,"); + // run a conversation + return runConversationFromInjectedReference(); + + // test will then use a static method to find out how many times + // init/destroy were called + } + public int runConversationWithCallback(){ + calls.append("runConversationWithCallback,"); + callbackCount = 2; + conversationalService.initializeCountCallback(1); + conversationalService.incrementCountCallback(); + clientCount = conversationalService.retrieveCountCallback(); + conversationalService.endConversationCallback(); + + return clientCount; + } + public int runConversationHavingPassedReference(){ + calls.append("runConversationHavingPassedReference,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + conversationalReferenceClient.incrementCount(serviceReference); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + serviceReference.getConversation().end(); + + return clientCount; + } + public String runConversationBusinessException(){ + calls.append("runConversationbusinessException,"); + try { + conversationalService.initializeCount(1); +// conversationalService.businessException(); + clientCount = conversationalService.retrieveCount(); + conversationalService.endConversation(); + } catch(Exception ex) { + return ex.getMessage(); + } + + return "No Exception Returned"; + } + + public String runConversationBusinessExceptionCallback(){ + calls.append("runConversationbusinessExceptionCallback,"); + try { + conversationalService.initializeCountCallback(1); +// conversationalService.businessExceptionCallback(); + clientCount = conversationalService.retrieveCountCallback(); + conversationalService.endConversationCallback(); + } catch(Exception ex) { + return ex.getMessage(); + } + + return "No Exception Returned"; + } + + public int runConversationCallingEndedConversation(){ + calls.append("runConversationCallingEndedConversation,"); + conversationalService.initializeCount(1); + conversationalService.endConversation(); + return conversationalService.retrieveCount(); + } + + public int runConversationCallingEndedConversationCallback(){ + calls.append("runConversationCallingEndedConversationCallback,"); + conversationalService.initializeCountCallback(1); + conversationalService.endConversationCallback(); + return conversationalService.retrieveCountCallback(); + } + + public String runConversationCallingEndedConversationCheckConversationId(){ + calls.append("runConversationCallingEndedConversationCheckConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation3"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + if (serviceReference.getConversation() ==null ) { + return null; + } else { + return serviceReference.getConversation().getConversationID().toString(); + } + } + + public String runConversationCallingEndedConversationCallbackCheckConversationId(){ + calls.append("runConversationCallingEndedConversationCallbackCheckConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation3"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversationCallback(); + + if (serviceReference.getConversation() ==null ) { + return null; + } else { + return serviceReference.getConversation().getConversationID().toString(); + } + } + + public int runConversationAgeTimeout(){ + calls.append("runConversationAgeTimeout,"); + // done in other testing + return clientCount; + } + public int runConversationIdleTimeout(){ + calls.append("runConversationIdleTimeout,"); + // done in other testing + return clientCount; + } + public int runConversationPrincipleError(){ + calls.append("runConversationPrincipleError,"); + // TODO - when policy framework is done + return clientCount; + } + + + // From ConversationalCallback + @Init + public void init(){ + calls.append("init,"); + } + + @Destroy + public void destroy(){ + calls.append("destroy,"); + } + + public void initializeCount(int count){ + calls.append("initializeCount,"); + callbackCount += count; + } + + public void incrementCount(){ + calls.append("incrementCount,"); + callbackCount++; + } + + public int retrieveCount(){ + calls.append("retrieveCount,"); + return callbackCount; + } + + public void businessException() throws BusinessException { + throw new BusinessException("Business Exception"); + } + + public String endConversation(){ + calls.append("endConversation,"); + callbackCount = 0; + return null; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulNonConversationalCallbackImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulNonConversationalCallbackImpl.java new file mode 100644 index 0000000000..31b2cc7849 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulNonConversationalCallbackImpl.java @@ -0,0 +1,311 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational.impl; + +import org.apache.tuscany.sca.itest.conversational.BusinessException; +import org.apache.tuscany.sca.itest.conversational.ConversationalClient; +import org.apache.tuscany.sca.itest.conversational.ConversationalReferenceClient; +import org.apache.tuscany.sca.itest.conversational.ConversationalService; +import org.apache.tuscany.sca.itest.conversational.NonConversationalCallback; +import org.osoa.sca.ComponentContext; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.ConversationAttributes; +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +/** + * The client for the conversational itest which presents a stateful + * callback interface + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ + +@Service(interfaces={ConversationalClient.class}) +@Scope("CONVERSATION") +@ConversationAttributes(maxAge="10 minutes", + maxIdleTime="5 minutes", + singlePrincipal=false) +public class ConversationalClientStatefulNonConversationalCallbackImpl implements ConversationalClient, NonConversationalCallback { + + @Context + protected ComponentContext componentContext; + + @Reference + protected ConversationalService conversationalService; + + @Reference + protected ConversationalService conversationalService2; + + @Reference + protected ConversationalReferenceClient conversationalReferenceClient; + + private int clientCount = 0; + private int callbackCount = 0; + + + // a static member variable that records the number of times this service is called + public static StringBuffer calls = new StringBuffer(); + + // From ConversationalClient + public int runConversationFromInjectedReference(){ + calls.append("runConversationFromInjectedReference,"); + conversationalService.initializeCount(1); + conversationalService.incrementCount(); + clientCount = conversationalService.retrieveCount(); + conversationalService.endConversation(); + + return clientCount; + } + public int runConversationFromInjectedReference2(){ + calls.append("runConversationFromInjectedReference2,"); + + conversationalService2.initializeCount(1); + conversationalService2.incrementCount(); + + // stick in a call to the first reference to + // make sure the two references don't clash + conversationalService.initializeCount(1); + + clientCount = conversationalService2.retrieveCount(); + conversationalService2.endConversation(); + + // end the conversation through the first reference + conversationalService.endConversation(); + + return clientCount; + } + public int runConversationFromServiceReference(){ + calls.append("runConversationFromServiceReference,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + // serviceReference.getConversation().end(); + + return clientCount; + } + public int runConversationWithUserDefinedConversationId(){ + calls.append("runConversationWithUserDefinedConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation1"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + // serviceReference.getConversation().end(); + + return clientCount; + } + public String runConversationCheckUserDefinedConversationId(){ + calls.append("runConversationCheckUserDefinedConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation2"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + return callableReference.endConversation(); + + } + public int runConversationCheckingScope(){ + calls.append("runConversationCheckingScope,"); + // run a conversation + return runConversationFromInjectedReference(); + + // test will then use a static method to find out how many times + // init/destroy were called + } + public int runConversationWithCallback(){ + calls.append("runConversationWithCallback,"); + callbackCount = 2; + conversationalService.initializeCountCallback(1); + conversationalService.incrementCountCallback(); + clientCount = conversationalService.retrieveCountCallback(); + conversationalService.endConversationCallback(); + + return clientCount; + } + public int runConversationHavingPassedReference(){ + calls.append("runConversationHavingPassedReference,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + conversationalReferenceClient.incrementCount(serviceReference); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + // serviceReference.getConversation().end(); + + return clientCount; + } + public String runConversationBusinessException(){ + calls.append("runConversationbusinessException,"); + try { + conversationalService.initializeCount(1); +// conversationalService.businessException(); + clientCount = conversationalService.retrieveCount(); + conversationalService.endConversation(); + } catch(Exception ex) { + return ex.getMessage(); + } + + return "No Exception Returned"; + } + + public String runConversationBusinessExceptionCallback(){ + calls.append("runConversationbusinessExceptionCallback,"); + try { + conversationalService.initializeCountCallback(1); +// conversationalService.businessExceptionCallback(); + clientCount = conversationalService.retrieveCountCallback(); + conversationalService.endConversationCallback(); + } catch(Exception ex) { + return ex.getMessage(); + } + + return "No Exception Returned"; + } + + public String runConversationCallingEndedConversationCheckConversationId(){ + calls.append("runConversationCallingEndedConversationCheckConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation3"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + if (serviceReference.getConversation() ==null ) { + return null; + } else { + return serviceReference.getConversation().getConversationID().toString(); + } + } + + public String runConversationCallingEndedConversationCallbackCheckConversationId(){ + calls.append("runConversationCallingEndedConversationCallbackCheckConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation3"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversationCallback(); + + if (serviceReference.getConversation() ==null ) { + return null; + } else { + return serviceReference.getConversation().getConversationID().toString(); + } + } + + public int runConversationCallingEndedConversation(){ + calls.append("runConversationCallingEndedConversation,"); + conversationalService.initializeCount(1); + conversationalService.endConversation(); + return conversationalService.retrieveCount(); + } + + public int runConversationCallingEndedConversationCallback(){ + calls.append("runConversationCallingEndedConversationCallback,"); + conversationalService.initializeCountCallback(1); + conversationalService.endConversationCallback(); + return conversationalService.retrieveCountCallback(); + } + + public int runConversationAgeTimeout(){ + calls.append("runConversationAgeTimeout,"); + // done in other testing + return clientCount; + } + public int runConversationIdleTimeout(){ + calls.append("runConversationIdleTimeout,"); + // done in other testing + return clientCount; + } + public int runConversationPrincipleError(){ + calls.append("runConversationPrincipleError,"); + // TODO - when policy framework is done + return clientCount; + } + + + // From ConversationalCallback + @Init + public void init(){ + calls.append("init,"); + } + + @Destroy + public void destroy(){ + calls.append("destroy,"); + } + + public void initializeCount(int count){ + calls.append("initializeCount,"); + callbackCount += count; + } + + public void incrementCount(){ + calls.append("incrementCount,"); + callbackCount++; + } + + public int retrieveCount(){ + calls.append("retrieveCount,"); + return callbackCount; + } + + public void businessException() throws BusinessException { + throw new BusinessException("Business Exception"); + } + + public String endConversation(){ + calls.append("endConversation,"); + return null; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatelessImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatelessImpl.java new file mode 100644 index 0000000000..d5fe3bbb6c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatelessImpl.java @@ -0,0 +1,318 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational.impl; + +import org.apache.tuscany.sca.itest.conversational.BusinessException; +import org.apache.tuscany.sca.itest.conversational.ConversationalCallback; +import org.apache.tuscany.sca.itest.conversational.ConversationalClient; +import org.apache.tuscany.sca.itest.conversational.ConversationalReferenceClient; +import org.apache.tuscany.sca.itest.conversational.ConversationalService; +import org.osoa.sca.ComponentContext; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * The client for the conversational itest which presents a stateful + * callback interface + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ + +@Service(interfaces={ConversationalClient.class}) +public class ConversationalClientStatelessImpl implements ConversationalClient, ConversationalCallback { + + @Context + protected ComponentContext componentContext; + + @Reference + protected ConversationalService conversationalService; + + @Reference + protected ConversationalService conversationalService2; + + @Reference + protected ConversationalReferenceClient conversationalReferenceClient; + + private int clientCount = 0; + private int callbackCount = 0; + + // a static member variable that records the number of times this service is called + public static StringBuffer calls = new StringBuffer(); + + // From ConversationalClient + public int runConversationFromInjectedReference(){ + calls.append("runConversationFromInjectedReference,"); + conversationalService.initializeCount(1); + conversationalService.incrementCount(); + clientCount = conversationalService.retrieveCount(); + conversationalService.endConversation(); + + return clientCount; + } + public int runConversationFromInjectedReference2(){ + calls.append("runConversationFromInjectedReference2,"); + + // now test the second reference + conversationalService2.initializeCount(1); + conversationalService2.incrementCount(); + + // stick in a call to the first reference to + // make sure the two references don't clash + conversationalService.initializeCount(1); + + clientCount = conversationalService2.retrieveCount(); + conversationalService2.endConversation(); + + // end the conversation through the first reference + conversationalService.endConversation(); + + return clientCount; + } + public int runConversationFromServiceReference(){ + calls.append("runConversationFromServiceReference,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + // serviceReference.getConversation().end(); + + return clientCount; + } + public int runConversationWithUserDefinedConversationId(){ + calls.append("runConversationWithUserDefinedConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation1"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + // serviceReference.getConversation().end(); + + return clientCount; + } + public String runConversationCheckUserDefinedConversationId(){ + calls.append("runConversationCheckUserDefinedConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation2"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + + String clientConversationId = serviceReference.getConversationID().toString(); + String serverConfersationId = callableReference.endConversation(); + + if (clientConversationId.equals("MyConversation2") && + serverConfersationId.equals("MyConversation2") ) { + return clientConversationId; + } else { + return "client = " + clientConversationId + + "server = " + serverConfersationId; + } + } + public int runConversationCheckingScope(){ + calls.append("runConversationCheckingScope,"); + // run a conversation + return runConversationFromInjectedReference(); + + // test will then use a static method to find out how many times + // init/destroy were called + } + public int runConversationWithCallback(){ + calls.append("runConversationWithCallback,"); + conversationalService.initializeCountCallback(1); + conversationalService.incrementCountCallback(); + clientCount = conversationalService.retrieveCountCallback(); + conversationalService.endConversationCallback(); + + return clientCount; + } + + public int runConversationHavingPassedReference(){ + calls.append("runConversationHavingPassedReference,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + conversationalReferenceClient.incrementCount(serviceReference); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + serviceReference.getConversation().end(); + + return clientCount; + } + + public String runConversationBusinessException(){ + calls.append("runConversationbusinessException,"); + try { + conversationalService.initializeCount(1); +// conversationalService.businessException(); + clientCount = conversationalService.retrieveCount(); + conversationalService.endConversation(); + } catch(Exception ex) { + return ex.getMessage(); + } + + return "No Exception Returned"; + } + + public String runConversationBusinessExceptionCallback(){ + calls.append("runConversationbusinessExceptionCallback,"); + try { + conversationalService.initializeCountCallback(1); +// conversationalService.businessExceptionCallback(); + clientCount = conversationalService.retrieveCountCallback(); + conversationalService.endConversationCallback(); + } catch(Exception ex) { + return ex.getMessage(); + } + + return "No Exception Returned"; + } + + public int runConversationCallingEndedConversation(){ + calls.append("runConversationCallingEndedConversation,"); + conversationalService.initializeCount(1); + conversationalService.endConversation(); + return conversationalService.retrieveCount(); + } + + public int runConversationCallingEndedConversationCallback(){ + calls.append("runConversationCallingEndedConversationCallback,"); + conversationalService.initializeCountCallback(1); + conversationalService.endConversationCallback(); + return conversationalService.retrieveCountCallback(); + } + + public String runConversationCallingEndedConversationCheckConversationId(){ + calls.append("runConversationCallingEndedConversationCheckConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation3"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + if (serviceReference.getConversation() ==null ) { + return null; + } else { + return serviceReference.getConversation().getConversationID().toString(); + } + } + + public String runConversationCallingEndedConversationCallbackCheckConversationId(){ + calls.append("runConversationCallingEndedConversationCallbackCheckConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation3"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversationCallback(); + + if (serviceReference.getConversation() ==null ) { + return null; + } else { + return serviceReference.getConversation().getConversationID().toString(); + } + } + + public int runConversationAgeTimeout(){ + calls.append("runConversationAgeTimeout,"); + // done in other testing + return clientCount; + } + public int runConversationIdleTimeout(){ + calls.append("runConversationIdleTimeout,"); + // done in other testing + return clientCount; + } + public int runConversationPrincipleError(){ + calls.append("runConversationPrincipleError,"); + // TODO - when policy framework is done + return clientCount; + } + + + // From ConversationalCallback + @Init + public void init(){ + calls.append("init,"); + + } + + @Destroy + public void destroy(){ + calls.append("destroy,"); + + } + + public void initializeCount(int count){ + calls.append("initializeCount,"); + callbackCount = 0; + } + + public void incrementCount(){ + calls.append("incrementCount,"); + callbackCount++; + } + + public int retrieveCount(){ + calls.append("retrieveCount,"); + return callbackCount; + } + + public void businessException() throws BusinessException { + throw new BusinessException("Business Exception"); + } + + public String endConversation(){ + calls.append("endConversation,"); + callbackCount = 0; + return null; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalReferenceClientImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalReferenceClientImpl.java new file mode 100644 index 0000000000..9895032f53 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalReferenceClientImpl.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 org.apache.tuscany.sca.itest.conversational.impl; + +import org.apache.tuscany.sca.itest.conversational.ConversationalReferenceClient; +import org.apache.tuscany.sca.itest.conversational.ConversationalService; +import org.osoa.sca.CallableReference; +import org.osoa.sca.annotations.Service; + +/** + * A client component that accepts a reference to an ongoing conversation + * and takes part in that conversation + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ + +@Service(interfaces={ConversationalReferenceClient.class}) +public class ConversationalReferenceClientImpl implements ConversationalReferenceClient{ + + public void incrementCount(CallableReference conversationalService){ + ConversationalService callableReference = conversationalService.getService(); + + callableReference.incrementCount(); + } + + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceRequestImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceRequestImpl.java new file mode 100644 index 0000000000..d83cb65046 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceRequestImpl.java @@ -0,0 +1,124 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational.impl; + +import java.util.HashMap; + +import org.apache.tuscany.sca.itest.conversational.BusinessException; +import org.apache.tuscany.sca.itest.conversational.ConversationalCallback; +import org.apache.tuscany.sca.itest.conversational.ConversationalService; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.ConversationID; +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + + +/** + * The service used when testing stateful conversations + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ +@Service(ConversationalService.class) +@Scope("REQUEST") +public class ConversationalServiceRequestImpl implements ConversationalService { + + @ConversationID + protected String conversationId; + + @Callback + protected ConversationalCallback conversationalCallback; + + // static area in which to hold conversational data + private static HashMap conversationalState = new HashMap(); + + // a static member variable that records the number of times this service is called + public static StringBuffer calls = new StringBuffer(); + + @Init + public void init(){ + calls.append("init,"); + } + + @Destroy + public void destroy(){ + calls.append("destroy,"); + } + + public void initializeCount(int count){ + calls.append("initializeCount,"); + Integer conversationalCount = new Integer(count); + conversationalState.put(conversationId, conversationalCount); + } + + public void incrementCount(){ + calls.append("incrementCount,"); + Integer conversationalCount = conversationalState.get(conversationId); + conversationalCount++; + conversationalState.put(conversationId, conversationalCount); + } + + public int retrieveCount(){ + calls.append("retrieveCount,"); + Integer count = conversationalState.get(conversationId); + if (count != null){ + return count.intValue(); + } else { + return -999; + } + } + + public void businessException() throws BusinessException { + throw new BusinessException("Business Exception"); + } + + public void initializeCountCallback(int count){ + calls.append("initializeCountCallback,"); + initializeCount(count); + conversationalCallback.initializeCount(count); + } + + public void incrementCountCallback(){ + calls.append("incrementCountCallback,"); + incrementCount(); + conversationalCallback.incrementCount(); + } + + public int retrieveCountCallback(){ + calls.append("retrieveCountCallback,"); + return conversationalCallback.retrieveCount(); + } + + public void businessExceptionCallback() throws BusinessException { + calls.append("businessExceptionCallback,"); + conversationalCallback.businessException(); + } + + public String endConversation(){ + calls.append("endConversation,"); + conversationalState.remove(conversationId); + return conversationId; + } + + public String endConversationCallback(){ + calls.append("endConversationCallback,"); + return conversationalCallback.endConversation(); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulImpl.java new file mode 100644 index 0000000000..be1d4bc4d9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulImpl.java @@ -0,0 +1,119 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational.impl; + +import org.apache.tuscany.sca.itest.conversational.BusinessException; +import org.apache.tuscany.sca.itest.conversational.ConversationalCallback; +import org.apache.tuscany.sca.itest.conversational.ConversationalService; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.ConversationAttributes; +import org.osoa.sca.annotations.ConversationID; +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + + +/** + * The service used when testing stateful conversations + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ +@Service(ConversationalService.class) +@Scope("CONVERSATION") +@ConversationAttributes(maxAge="10 minutes", + maxIdleTime="5 minutes", + singlePrincipal=false) +public class ConversationalServiceStatefulImpl implements ConversationalService { + + @ConversationID + protected String conversationId; + + @Callback + protected ConversationalCallback conversationalCallback; + + // local count - accumulates during the conversation + private int count = 0; + + // a static member variable that records the number of times this service is called + public static StringBuffer calls = new StringBuffer(); + + @Init + public void init(){ + calls.append("init,"); + } + + @Destroy + public void destroy(){ + calls.append("destroy,"); + } + + public void initializeCount(int count){ + calls.append("initializeCount,"); + this.count = count; + } + + public void incrementCount(){ + calls.append("incrementCount,"); + count++; + } + + public int retrieveCount(){ + calls.append("retrieveCount,"); + return count; + } + + public void businessException() throws BusinessException { + calls.append("businessException,"); + throw new BusinessException("Business Exception"); + } + + public void initializeCountCallback(int count){ + calls.append("initializeCountCallback,"); + this.count = count; + conversationalCallback.initializeCount(count); + } + + public void incrementCountCallback(){ + calls.append("incrementCountCallback,"); + count++; + conversationalCallback.incrementCount(); + } + + public int retrieveCountCallback(){ + calls.append("retrieveCountCallback,"); + return conversationalCallback.retrieveCount(); + } + + public void businessExceptionCallback() throws BusinessException { + calls.append("businessExceptionCallback,"); + conversationalCallback.businessException(); + } + + public String endConversation(){ + calls.append("endConversation,"); + count = 0; + return conversationId; + } + + public String endConversationCallback(){ + calls.append("endConversationCallback,"); + return conversationalCallback.endConversation(); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulNonConversationalCallbackImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulNonConversationalCallbackImpl.java new file mode 100644 index 0000000000..514880c37c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulNonConversationalCallbackImpl.java @@ -0,0 +1,118 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational.impl; + +import org.apache.tuscany.sca.itest.conversational.BusinessException; +import org.apache.tuscany.sca.itest.conversational.ConversationalServiceNonConversationalCallback; +import org.apache.tuscany.sca.itest.conversational.NonConversationalCallback; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.ConversationAttributes; +import org.osoa.sca.annotations.ConversationID; +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + + +/** + * The service used when testing stateful conversations + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ +@Service(ConversationalServiceNonConversationalCallback.class) +@Scope("CONVERSATION") +@ConversationAttributes(maxAge="10 minutes", + maxIdleTime="5 minutes", + singlePrincipal=false) +public class ConversationalServiceStatefulNonConversationalCallbackImpl implements ConversationalServiceNonConversationalCallback { + + @ConversationID + protected String conversationId; + + @Callback + protected NonConversationalCallback nonConversationalCallback; + + // local count - accumulates during the conversation + private int count = 0; + + // a static member variable that records the number of times this service is called + public static StringBuffer calls = new StringBuffer(); + + @Init + public void init(){ + calls.append("init,"); + } + + @Destroy + public void destroy(){ + calls.append("destroy,"); + } + + public void initializeCount(int count){ + calls.append("initializeCount,"); + this.count = count; + } + + public void incrementCount(){ + calls.append("incrementCount,"); + count++; + } + + public int retrieveCount(){ + calls.append("retrieveCount,"); + return count; + } + + public void businessException() throws BusinessException { + throw new BusinessException("Business Exception"); + } + + public void initializeCountCallback(int count){ + calls.append("initializeCountCallback,"); + this.count = count; + nonConversationalCallback.initializeCount(count); + } + + public void incrementCountCallback(){ + calls.append("incrementCountCallback,"); + count++; + nonConversationalCallback.incrementCount(); + } + + public int retrieveCountCallback(){ + calls.append("retrieveCountCallback,"); + return nonConversationalCallback.retrieveCount(); + } + + public void businessExceptionCallback() throws BusinessException { + calls.append("businessExceptionCallback,"); + nonConversationalCallback.businessException(); + } + + public String endConversation(){ + calls.append("endConversation,"); + count = 0; + return conversationId; + } + + public String endConversationCallback(){ + calls.append("endConversationCallback,"); + return nonConversationalCallback.endConversation(); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessImpl.java new file mode 100644 index 0000000000..19724149a3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessImpl.java @@ -0,0 +1,123 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational.impl; + +import java.util.HashMap; + +import org.apache.tuscany.sca.itest.conversational.BusinessException; +import org.apache.tuscany.sca.itest.conversational.ConversationalCallback; +import org.apache.tuscany.sca.itest.conversational.ConversationalService; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.ConversationID; +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + + +/** + * The service used when testing stateful conversations + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ +@Service(ConversationalService.class) +public class ConversationalServiceStatelessImpl implements ConversationalService { + + @ConversationID + protected String conversationId; + + @Callback + protected ConversationalCallback conversationalCallback; + + // static area in which to hold conversational data + private static HashMap conversationalState = new HashMap(); + + // a static member variable that records the number of times this service is called + public static StringBuffer calls = new StringBuffer(); + + @Init + public void init(){ + calls.append("init,"); + } + + @Destroy + public void destroy(){ + calls.append("destroy,"); + } + + public void initializeCount(int count){ + calls.append("initializeCount,"); + Integer conversationalCount = new Integer(count); + conversationalState.put(conversationId, conversationalCount); + } + + public void incrementCount(){ + calls.append("incrementCount,"); + Integer conversationalCount = conversationalState.get(conversationId); + conversationalCount++; + conversationalState.put(conversationId, conversationalCount); + } + + public int retrieveCount(){ + calls.append("retrieveCount,"); + Integer count = conversationalState.get(conversationId); + if (count != null){ + return count.intValue(); + } else { + return -999; + } + } + + public void businessException() throws BusinessException { + throw new BusinessException("Business Exception"); + } + + public void initializeCountCallback(int count){ + calls.append("initializeCountCallback,"); + initializeCount(count); + conversationalCallback.initializeCount(count); + } + + public void incrementCountCallback(){ + calls.append("incrementCountCallback,"); + incrementCount(); + conversationalCallback.incrementCount(); + } + + public int retrieveCountCallback(){ + calls.append("retrieveCountCallback,"); + return conversationalCallback.retrieveCount(); + } + + public void businessExceptionCallback() throws BusinessException { + calls.append("businessExceptionCallback,"); + conversationalCallback.businessException(); + } + + public String endConversation(){ + calls.append("endConversation,"); + conversationalState.remove(conversationId); + return conversationId; + } + + public String endConversationCallback(){ + calls.append("endConversationCallback,"); + return conversationalCallback.endConversation(); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessScopeImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessScopeImpl.java new file mode 100644 index 0000000000..6ab5e554e4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessScopeImpl.java @@ -0,0 +1,94 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational.impl; + +import java.util.HashMap; +import java.util.Map; + +import org.apache.tuscany.sca.itest.conversational.BusinessException; +import org.apache.tuscany.sca.itest.conversational.ConversationalService; +import org.osoa.sca.annotations.ConversationID; +import org.osoa.sca.annotations.Service; + +@Service(ConversationalService.class) +public class ConversationalServiceStatelessScopeImpl implements ConversationalService { + + @ConversationID + protected String cid; + + static Map state = new HashMap(); + + public void destroy() { + // TODO Auto-generated method stub + + } + + public String endConversation() { + state.remove(cid); + return cid; + } + + public String endConversationCallback() { + // TODO Auto-generated method stub + return null; + + } + + public void incrementCount() { + state.put(cid, Integer.valueOf(state.get(cid)+1)); + } + + public void businessException() throws BusinessException { + throw new BusinessException("Business Exception"); + } + + public void incrementCountCallback() { + // TODO Auto-generated method stub + + } + + public void init() { + // TODO Auto-generated method stub + + } + + public void initializeCount(int count) { + state.put(cid, Integer.valueOf(count)); + } + + public void initializeCountCallback(int count) { + // TODO Auto-generated method stub + + } + + public void businessExceptionCallback() throws BusinessException { + throw new BusinessException("Business Exception"); + } + + public int retrieveCount() { + return state.get(cid); + } + + public int retrieveCountCallback() { + // TODO Auto-generated method stub + return 0; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/resources/Conversational/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/resources/Conversational/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..090e115fa6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/resources/Conversational/META-INF/sca-contribution.xml @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/resources/Conversational/conversational.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/resources/Conversational/conversational.composite new file mode 100644 index 0000000000..b1885bd772 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/resources/Conversational/conversational.composite @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/resources/ConversationalWSDL/ConversationalServiceStateful.wsdl b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/resources/ConversationalWSDL/ConversationalServiceStateful.wsdl new file mode 100644 index 0000000000..20a92c9dc7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/resources/ConversationalWSDL/ConversationalServiceStateful.wsdl @@ -0,0 +1,383 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/resources/ConversationalWSDL/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/resources/ConversationalWSDL/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..f4f0c1be7d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/resources/ConversationalWSDL/META-INF/sca-contribution.xml @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/resources/ConversationalWSDL/conversationalWSDL.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/resources/ConversationalWSDL/conversationalWSDL.composite new file mode 100644 index 0000000000..93bf866712 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/main/resources/ConversationalWSDL/conversationalWSDL.composite @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationWSDLTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationWSDLTestCase.java new file mode 100644 index 0000000000..61b5892dc2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationWSDLTestCase.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 org.apache.tuscany.sca.itest.conversational; + + +import java.net.URL; + +import javax.xml.namespace.QName; + +import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatelessImpl; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.apache.tuscany.sca.node.impl.SCANodeFactoryImpl; +import org.apache.tuscany.sca.node.util.SCAContributionUtil; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +public class ConversationWSDLTestCase { + + private SCANode node; + private ConversationalClient conversationalStatelessClientStatefulService; + + @Before + public void setUp() throws Exception { + node = SCANodeFactory.newInstance().createSCANode(null, null); + node.addContribution("mycontribution", + ConversationWSDLTestCase.class.getResource("/ConversationalWSDL/.")); + node.addToDomainLevelComposite(new QName("http://conversations", "ConversationalWSDLITest")); + node.start(); + + conversationalStatelessClientStatefulService = node.getDomain().getService(ConversationalClient.class, + "ConversationalStatelessClientStatefulService"); + + ConversationalClientStatelessImpl.calls = new StringBuffer(); + } + + @After + public void tearDown() throws Exception { + node.destroy(); + conversationalStatelessClientStatefulService = null; + } + + @Test + public void testStatelessStatefulConversationFromInjectedReference() { + int count = conversationalStatelessClientStatefulService.runConversationFromInjectedReference(); + Assert.assertEquals(2, count); + } + + //@Test + public void testKeepServerRunning() throws Exception { + System.out.println("press enter to continue"); + System.in.read(); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalTestCaseOff.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalTestCaseOff.java new file mode 100644 index 0000000000..f97a8689be --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalTestCaseOff.java @@ -0,0 +1,610 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulNonConversationalCallbackImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatelessImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceRequestImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulNonConversationalCallbackImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatelessImpl; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class ConversationalTestCaseOff { + + private static SCADomain domain; + private static ConversationalClient conversationalStatelessClientStatelessService; + private static ConversationalClient conversationalStatelessClientStatefulService; + private static ConversationalClient conversationalStatefulClientStatelessService; + private static ConversationalClient conversationalStatefulClientStatefulService; + private static ConversationalClient conversationalStatelessClientRequestService; + private static ConversationalClient conversationalStatefulClientNonConversationalCallbackStatelessService; + + @BeforeClass + public static void setUp() throws Exception { + try { + domain = SCADomain.newInstance("conversational.composite"); + + conversationalStatelessClientStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientStatelessService"); + + conversationalStatelessClientStatefulService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientStatefulService"); + + conversationalStatefulClientStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientStatelessService"); + + conversationalStatefulClientStatefulService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientStatefulService"); + conversationalStatelessClientRequestService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientRequestService"); + conversationalStatefulClientNonConversationalCallbackStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientNonConversationalCallbackStatefulService"); + + // reset the place where we record the sequence of calls passing + // through each component instance + ConversationalServiceStatelessImpl.calls = new StringBuffer(); + ConversationalServiceStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatelessImpl.calls = new StringBuffer(); + ConversationalClientStatefulImpl.calls = new StringBuffer(); + + } catch(Exception ex) { + System.err.println(ex.toString()); + } + + } + + @AfterClass + public static void tearDown() throws Exception { + domain.close(); + } + + private static void resetCallStack() { + + // reset the place where we record the sequence of calls passing + // through each component instance + ConversationalServiceStatelessImpl.calls = new StringBuffer(); + ConversationalServiceStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatelessImpl.calls = new StringBuffer(); + ConversationalClientStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatefulNonConversationalCallbackImpl.calls = new StringBuffer(); + + } + + // stateless client stateful service tests + // ======================================= + @Test + public void testStatelessStatefulConversationFromInjectedReference() { + int count = conversationalStatelessClientStatefulService.runConversationFromInjectedReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessStatefulConversationFromInjectedReference2() { + int count = conversationalStatelessClientStatefulService.runConversationFromInjectedReference2(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessStatefulConversationFromServiceReference() { + int count = conversationalStatelessClientStatefulService.runConversationFromServiceReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessStatefulConversationWithUserDefinedConversationId() { + int count = conversationalStatelessClientStatefulService.runConversationWithUserDefinedConversationId(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessStatefulConversationCheckUserDefinedConversationId() { + String conversationId = conversationalStatelessClientStatefulService.runConversationCheckUserDefinedConversationId(); + Assert.assertEquals("MyConversation2", conversationId); + } + + @Test + public void testStatelessStatefulConversationCheckingScope() { + resetCallStack(); + conversationalStatelessClientStatefulService.runConversationCheckingScope(); + Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,destroy,", + ConversationalServiceStatefulImpl.calls.toString()); + } + + @Test + public void testStatelessStatefulConversationWithCallback() { + resetCallStack(); + int count = conversationalStatelessClientStatefulService.runConversationWithCallback(); + Assert.assertEquals(0, count); + + Assert.assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,destroy,", + ConversationalClientStatelessImpl.calls.toString()); + } + + //@Test + public void testStatelessStatefulConversationHavingPassedReference() { + int count = conversationalStatelessClientStatefulService.runConversationHavingPassedReference(); + Assert.assertEquals(3, count); + } + + //@Test + public void testStatelessStatefulConversationBusinessException() { + String message = conversationalStatelessClientStatefulService.runConversationBusinessException(); + Assert.assertEquals("Business Exception", message); + } + + //@Test + public void testStatelessStatefulConversationBusinessExceptionCallback() { + String message = conversationalStatelessClientStatefulService.runConversationBusinessExceptionCallback(); + Assert.assertEquals("Business Exception", message); + } + + @Test + public void testStatelessStatefulConversationCallingEndedConversation() { + int count = conversationalStatelessClientStatefulService.runConversationCallingEndedConversation(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatelessStatefulConversationCallingEndedConversationCallback() { + int count = conversationalStatelessClientStatefulService.runConversationCallingEndedConversationCallback(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatelessStatefulConversationCallingEndedConversationCheckConversationId() { + String id = conversationalStatelessClientStatefulService.runConversationCallingEndedConversationCheckConversationId(); + Assert.assertEquals(null, id); + } + + //@Test + public void testStatelessStatefulConversationCallingEndedConversationCallbackCheckConversationId() { + String id = conversationalStatelessClientStatefulService.runConversationCallingEndedConversationCallbackCheckConversationId(); + Assert.assertEquals(null, id); + } + + // stateless client stateless service tests + // ======================================== + + @Test + public void testStatelessStatelessConversationFromInjectedReference() { + int count = conversationalStatelessClientStatelessService.runConversationFromInjectedReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessStatelessConversationFromInjectedReference2() { + int count = conversationalStatelessClientStatelessService.runConversationFromInjectedReference2(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessStatelessConversationFromServiceReference() { + int count = conversationalStatelessClientStatelessService.runConversationFromServiceReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessStatelessConversationWithUserDefinedConversationId() { + int count = conversationalStatelessClientStatelessService.runConversationWithUserDefinedConversationId(); + Assert.assertEquals(2, count); + } + @Test + public void testStatelessStatelessConversationCheckUserDefinedConversationId() { + String conversationId = conversationalStatelessClientStatelessService.runConversationCheckUserDefinedConversationId(); + Assert.assertEquals("MyConversation2", conversationId); + } + + @Test + public void testStatelessStatelessConversationCheckingScope() { + resetCallStack(); + conversationalStatelessClientStatelessService.runConversationCheckingScope(); + Assert.assertEquals("init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,", + ConversationalServiceStatelessImpl.calls.toString()); + } + + @Test + public void testStatelessStatelessConversationWithCallback() { + resetCallStack(); + int count = conversationalStatelessClientStatelessService.runConversationWithCallback(); + Assert.assertEquals(0, count); + + Assert.assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,destroy,", + ConversationalClientStatelessImpl.calls.toString()); + } + //@Test + public void testStatelessStatelessConversationHavingPassedReference() { + int count = conversationalStatelessClientStatelessService.runConversationHavingPassedReference(); + Assert.assertEquals(3, count); + } + + @Test + public void testStatelessStatelessConversationCallingEndedConversation() { + int count = conversationalStatelessClientStatelessService.runConversationCallingEndedConversation(); + Assert.assertEquals(-999, count); + } + + @Test + public void testStatelessStatelessConversationCallingEndedConversationCallback() { + int count = conversationalStatelessClientStatelessService.runConversationCallingEndedConversationCallback(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatelessStatelessConversationCallingEndedConversationCheckConversationId() { + String id = conversationalStatelessClientStatelessService.runConversationCallingEndedConversationCheckConversationId(); + Assert.assertEquals(null, id); + } + + //@Test + public void testStatelessStatelessConversationCallingEndedConversationCallbackCheckConversationId() { + String id = conversationalStatelessClientStatelessService.runConversationCallingEndedConversationCallbackCheckConversationId(); + Assert.assertEquals(null, id); + } + + // stateful client stateful service tests + // ====================================== + @Test + public void testStatefulStatefulConversationFromInjectedReference() { + int count = conversationalStatefulClientStatefulService.runConversationFromInjectedReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatefulConversationFromInjectedReference2() { + int count = conversationalStatefulClientStatefulService.runConversationFromInjectedReference2(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatefulConversationFromServiceReference() { + int count = conversationalStatefulClientStatefulService.runConversationFromServiceReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatefulConversationWithUserDefinedConversationId() { + int count = conversationalStatefulClientStatefulService.runConversationWithUserDefinedConversationId(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatefulConversationCheckUserDefinedConversationId() { + String conversationId = conversationalStatefulClientStatefulService.runConversationCheckUserDefinedConversationId(); + Assert.assertEquals("MyConversation2", conversationId); + } + + @Test + public void testStatefulStatefulConversationCheckingScope() { + resetCallStack(); + conversationalStatefulClientStatefulService.runConversationCheckingScope(); + Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,destroy,", + ConversationalServiceStatefulImpl.calls.toString()); + } + + @Test + public void testStatefulStatefulConversationWithCallback() { + resetCallStack(); + int count = conversationalStatefulClientStatefulService.runConversationWithCallback(); + Assert.assertEquals(4, count); + + Assert.assertEquals("init,runConversationWithCallback,initializeCount,incrementCount,retrieveCount,endConversation,destroy,", + ConversationalClientStatefulImpl.calls.toString()); + } + + //@Test + public void testStatefulStatefulConversationHavingPassedReference() { + int count = conversationalStatefulClientStatefulService.runConversationHavingPassedReference(); + Assert.assertEquals(3, count); + } + + @Test + public void testStatefulStatefulConversationCallingEndedConversation() { + int count = conversationalStatefulClientStatefulService.runConversationCallingEndedConversation(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatefulStatefulConversationCallingEndedConversationCallback() { + int count = conversationalStatefulClientStatefulService.runConversationCallingEndedConversationCallback(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatefulStatefulConversationCallingEndedConversationCheckConversationId() { + String id = conversationalStatefulClientStatefulService.runConversationCallingEndedConversationCheckConversationId(); + Assert.assertEquals(null, id); + } + + @Test + public void testStatefulStatefulConversationCallingEndedConversationCallbackCheckConversationId() { + String id = conversationalStatefulClientStatefulService.runConversationCallingEndedConversationCallbackCheckConversationId(); + Assert.assertEquals(null, id); + } + + // stateful client stateless service tests + // ======================================= + @Test + public void testStatefulStatelessConversationFromInjectedReference() { + int count = conversationalStatefulClientStatelessService.runConversationFromInjectedReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatelessConversationFromInjectedReference2() { + int count = conversationalStatefulClientStatelessService.runConversationFromInjectedReference2(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatelessConversationFromServiceReference() { + int count = conversationalStatefulClientStatelessService.runConversationFromServiceReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatelessConversationWithUserDefinedConversationId() { + int count = conversationalStatefulClientStatelessService.runConversationWithUserDefinedConversationId(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatelessConversationCheckUserDefinedConversationId() { + String conversationId = conversationalStatefulClientStatelessService.runConversationCheckUserDefinedConversationId(); + Assert.assertEquals("MyConversation2", conversationId); + } + + @Test + public void testStatefulStatelessConversationCheckingScope() { + resetCallStack(); + conversationalStatefulClientStatelessService.runConversationCheckingScope(); + Assert.assertEquals("init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,", + ConversationalServiceStatelessImpl.calls.toString()); + } + + @Test + public void testStatefulStatelessConversationWithCallback() { + resetCallStack(); + int count = conversationalStatefulClientStatelessService.runConversationWithCallback(); + Assert.assertEquals(4, count); + + Assert.assertEquals("init,runConversationWithCallback,initializeCount,incrementCount,retrieveCount,endConversation,destroy,", + ConversationalClientStatefulImpl.calls.toString()); + } + + //@Test + public void testStatefulStatelessConversationHavingPassedReference() { + int count = conversationalStatefulClientStatelessService.runConversationHavingPassedReference(); + Assert.assertEquals(3, count); + } + + @Test + public void testStatefulStatelessConversationCallingEndedConversation() { + int count = conversationalStatefulClientStatelessService.runConversationCallingEndedConversation(); + Assert.assertEquals(-999, count); + } + + @Test + public void testStatefulStatelessConversationCallingEndedConversationCallback() { + int count = conversationalStatefulClientStatelessService.runConversationCallingEndedConversationCallback(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatefulStatelessConversationCallingEndedConversationCheckConversationId() { + String id = conversationalStatefulClientStatelessService.runConversationCallingEndedConversationCheckConversationId(); + Assert.assertEquals(null, id); + } + + @Test + public void testStatefulStatelessConversationCallingEndedConversationCallbackCheckConversationId() { + String id = conversationalStatefulClientStatelessService.runConversationCallingEndedConversationCallbackCheckConversationId(); + Assert.assertEquals(null, id); + } + + // stateless client request scope service tests + // ============================================ + @Test + public void testStatelessRequestConversationFromInjectedReference() { + int count = conversationalStatelessClientRequestService.runConversationFromInjectedReference(); + Assert.assertEquals(2, count); + } + + //@Test + public void testStatelessRequestConversationFromInjectedReference2() { + int count = conversationalStatelessClientRequestService.runConversationFromInjectedReference2(); + Assert.assertEquals(1, count); + } + + @Test + public void testStatelessRequestConversationFromServiceReference() { + int count = conversationalStatelessClientRequestService.runConversationFromServiceReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessRequestConversationWithUserDefinedConversationId() { + int count = conversationalStatelessClientRequestService.runConversationWithUserDefinedConversationId(); + Assert.assertEquals(2, count); + } + + //@Test + public void testStatelessRequestConversationCheckUserDefinedConversationId() { + String conversationId = conversationalStatelessClientRequestService.runConversationCheckUserDefinedConversationId(); + Assert.assertEquals("MyConversation2", conversationId); + } + + //@Test + public void testStatelessRequestConversationCheckingScope() { + resetCallStack(); + ConversationalServiceRequestImpl.calls = new StringBuffer(); + conversationalStatelessClientRequestService.runConversationCheckingScope(); + Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,", + ConversationalServiceRequestImpl.calls.toString()); + //init,initializeCount,init,incrementCount,init,retrieveCount,init,endConversation, + } + + @Test + public void testStatelessRequestConversationWithCallback() { + resetCallStack(); + ConversationalClientStatelessImpl.calls = new StringBuffer(); + int count = conversationalStatelessClientRequestService.runConversationWithCallback(); + Assert.assertEquals(0, count); + + Assert.assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,destroy,", + ConversationalClientStatelessImpl.calls.toString()); + } + + //@Test + public void testStatelessRequestConversationHavingPassedReference() { + int count = conversationalStatelessClientRequestService.runConversationHavingPassedReference(); + Assert.assertEquals(3, count); + } + + //@Test + public void testStatelessRequestConversationBusinessException() { + String message = conversationalStatelessClientRequestService.runConversationBusinessException(); + Assert.assertEquals("Business Exception", message); + } + + //@Test + public void testStatelessRequestConversationBusinessExceptionCallback() { + String message = conversationalStatelessClientRequestService.runConversationBusinessExceptionCallback(); + Assert.assertEquals("Business Exception", message); + } + + @Test + public void testStatelessRequestConversationCallingEndedConversation() { + int count = conversationalStatelessClientRequestService.runConversationCallingEndedConversation(); + Assert.assertEquals(-999, count); + } + + @Test + public void testStatelessRequestConversationCallingEndedConversationCallback() { + int count = conversationalStatelessClientRequestService.runConversationCallingEndedConversationCallback(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatelessRequestConversationCallingEndedConversationCheckConversationId() { + String id = conversationalStatelessClientRequestService.runConversationCallingEndedConversationCheckConversationId(); + Assert.assertEquals(null, id); + } + + //@Test + public void testStatelessRequestConversationCallingEndedConversationCallbackCheckConversationId() { + String id = conversationalStatelessClientRequestService.runConversationCallingEndedConversationCallbackCheckConversationId(); + Assert.assertEquals(null, id); + } + + // stateful client non conversational callback stateful service tests + // ================================================================== + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationFromInjectedReference() { + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationFromInjectedReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationFromInjectedReference2() { + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationFromInjectedReference2(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationFromServiceReference() { + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationFromServiceReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationWithUserDefinedConversationId() { + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationWithUserDefinedConversationId(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationCheckUserDefinedConversationId() { + String conversationId = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCheckUserDefinedConversationId(); + Assert.assertEquals("MyConversation2", conversationId); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationCheckingScope() { + resetCallStack(); + ConversationalServiceStatefulNonConversationalCallbackImpl.calls = new StringBuffer(); + conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCheckingScope(); + Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,destroy,", + ConversationalServiceStatefulNonConversationalCallbackImpl.calls.toString()); + } + + //@Test + public void testStatefulNonConversationalCallbackStatefulConversationWithCallback() { + resetCallStack(); + ConversationalClientStatefulNonConversationalCallbackImpl.calls = new StringBuffer(); + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationWithCallback(); + Assert.assertEquals(0, count); + + Assert.assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,", + ConversationalClientStatefulNonConversationalCallbackImpl.calls.toString()); + } + + //@Test + public void testStatefulNonConversationalCallbackStatefulConversationHavingPassedReference() { + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationHavingPassedReference(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationCallingEndedConversation() { + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCallingEndedConversation(); + Assert.assertEquals(0, count); + } + + //@Test + public void testStatefulNonConversationalCallbackStatefulConversationCallingEndedConversationCallback() { + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCallingEndedConversationCallback(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationCallingEndedConversationCheckConversationId() { + String id = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCallingEndedConversationCheckConversationId(); + Assert.assertEquals(null, id); + } + + //@Test + public void testStatefulNonConversationalCallbackStatefulConversationCallingEndedConversationCallbackCheckConversationId() { + String id = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCallingEndedConversationCallbackCheckConversationId(); + Assert.assertEquals("MyConversation3", id); + } + + + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallbackTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallbackTestCase.java new file mode 100644 index 0000000000..2d7af475a7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallbackTestCase.java @@ -0,0 +1,202 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational; + +import javax.xml.namespace.QName; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.domain.SCADomain; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulNonConversationalCallbackImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatelessImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceRequestImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulNonConversationalCallbackImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatelessImpl; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class NonConversationalCallbackTestCase { + + private static SCADomain domain; + private static SCANode node; + private static ConversationalClient conversationalStatelessClientStatelessService; + private static ConversationalClient conversationalStatelessClientStatefulService; + private static ConversationalClient conversationalStatefulClientStatelessService; + private static ConversationalClient conversationalStatefulClientStatefulService; + private static ConversationalClient conversationalStatelessClientRequestService; + private static ConversationalClient conversationalStatefulClientNonConversationalCallbackStatelessService; + + @BeforeClass + public static void setUp() throws Exception { + try { + node = SCANodeFactory.newInstance().createSCANode(null, null); + node.addContribution("mycontribution", + StatefulStatefulTestCase.class.getResource("/Conversational/.")); + node.addToDomainLevelComposite(new QName("http://conversations", "ConversationalITest")); + node.start(); + domain = node.getDomain(); + + conversationalStatelessClientStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientStatelessService"); + + conversationalStatelessClientStatefulService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientStatefulService"); + + conversationalStatefulClientStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientStatelessService"); + + conversationalStatefulClientStatefulService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientStatefulService"); + conversationalStatelessClientRequestService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientRequestService"); + conversationalStatefulClientNonConversationalCallbackStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientNonConversationalCallbackStatefulService"); + + // reset the place where we record the sequence of calls passing + // through each component instance + ConversationalServiceStatelessImpl.calls = new StringBuffer(); + ConversationalServiceStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatelessImpl.calls = new StringBuffer(); + ConversationalClientStatefulImpl.calls = new StringBuffer(); + + } catch(Exception ex) { + System.err.println(ex.toString()); + } + + } + + @AfterClass + public static void tearDown() throws Exception { + node.destroy(); + domain = null; + conversationalStatelessClientStatelessService = null; + conversationalStatelessClientStatefulService = null; + conversationalStatefulClientStatelessService = null; + conversationalStatefulClientStatefulService = null; + conversationalStatelessClientRequestService = null; + conversationalStatefulClientNonConversationalCallbackStatelessService = null; + + } + + private static void resetCallStack() { + + // reset the place where we record the sequence of calls passing + // through each component instance + ConversationalServiceStatelessImpl.calls = new StringBuffer(); + ConversationalServiceStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatelessImpl.calls = new StringBuffer(); + ConversationalClientStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatefulNonConversationalCallbackImpl.calls = new StringBuffer(); + + } + + // stateful client non conversational callback stateful service tests + // ================================================================== + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationFromInjectedReference() { + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationFromInjectedReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationFromInjectedReference2() { + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationFromInjectedReference2(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationFromServiceReference() { + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationFromServiceReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationWithUserDefinedConversationId() { + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationWithUserDefinedConversationId(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationCheckUserDefinedConversationId() { + String conversationId = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCheckUserDefinedConversationId(); + Assert.assertEquals("MyConversation2", conversationId); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationCheckingScope() { + resetCallStack(); + ConversationalServiceStatefulNonConversationalCallbackImpl.calls = new StringBuffer(); + conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCheckingScope(); + Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,destroy,", + ConversationalServiceStatefulNonConversationalCallbackImpl.calls.toString()); + } + + //@Test + public void testStatefulNonConversationalCallbackStatefulConversationWithCallback() { + resetCallStack(); + ConversationalClientStatefulNonConversationalCallbackImpl.calls = new StringBuffer(); + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationWithCallback(); + Assert.assertEquals(0, count); + + Assert.assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,", + ConversationalClientStatefulNonConversationalCallbackImpl.calls.toString()); + } + + //@Test + public void testStatefulNonConversationalCallbackStatefulConversationHavingPassedReference() { + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationHavingPassedReference(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationCallingEndedConversation() { + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCallingEndedConversation(); + Assert.assertEquals(0, count); + } + + //@Test + public void testStatefulNonConversationalCallbackStatefulConversationCallingEndedConversationCallback() { + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCallingEndedConversationCallback(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationCallingEndedConversationCheckConversationId() { + String id = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCallingEndedConversationCheckConversationId(); + Assert.assertEquals(null, id); + } + + //@Test + public void testStatefulNonConversationalCallbackStatefulConversationCallingEndedConversationCallbackCheckConversationId() { + String id = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCallingEndedConversationCallbackCheckConversationId(); + Assert.assertEquals("MyConversation3", id); + } + + + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/RequestScopeTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/RequestScopeTestCase.java new file mode 100644 index 0000000000..d3868ddaf4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/RequestScopeTestCase.java @@ -0,0 +1,211 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational; + +import javax.xml.namespace.QName; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.domain.SCADomain; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulNonConversationalCallbackImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatelessImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceRequestImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulNonConversationalCallbackImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatelessImpl; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class RequestScopeTestCase { + + private static SCADomain domain; + private static SCANode node; + private static ConversationalClient conversationalStatelessClientStatelessService; + private static ConversationalClient conversationalStatelessClientStatefulService; + private static ConversationalClient conversationalStatefulClientStatelessService; + private static ConversationalClient conversationalStatefulClientStatefulService; + private static ConversationalClient conversationalStatelessClientRequestService; + private static ConversationalClient conversationalStatefulClientNonConversationalCallbackStatelessService; + + @BeforeClass + public static void setUp() throws Exception { + try { + node = SCANodeFactory.newInstance().createSCANode(null, null); + node.addContribution("mycontribution", + StatefulStatefulTestCase.class.getResource("/Conversational/.")); + node.addToDomainLevelComposite(new QName("http://conversations", "ConversationalITest")); + node.start(); + domain = node.getDomain(); + + conversationalStatelessClientStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientStatelessService"); + + conversationalStatelessClientStatefulService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientStatefulService"); + + conversationalStatefulClientStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientStatelessService"); + + conversationalStatefulClientStatefulService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientStatefulService"); + conversationalStatelessClientRequestService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientRequestService"); + conversationalStatefulClientNonConversationalCallbackStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientNonConversationalCallbackStatefulService"); + + // reset the place where we record the sequence of calls passing + // through each component instance + ConversationalServiceStatelessImpl.calls = new StringBuffer(); + ConversationalServiceStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatelessImpl.calls = new StringBuffer(); + ConversationalClientStatefulImpl.calls = new StringBuffer(); + + } catch(Exception ex) { + System.err.println(ex.toString()); + } + + } + + @AfterClass + public static void tearDown() throws Exception { + node.destroy(); + domain = null; + conversationalStatelessClientStatelessService = null; + conversationalStatelessClientStatefulService = null; + conversationalStatefulClientStatelessService = null; + conversationalStatefulClientStatefulService = null; + conversationalStatelessClientRequestService = null; + conversationalStatefulClientNonConversationalCallbackStatelessService = null; + } + + private static void resetCallStack() { + + // reset the place where we record the sequence of calls passing + // through each component instance + ConversationalServiceStatelessImpl.calls = new StringBuffer(); + ConversationalServiceStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatelessImpl.calls = new StringBuffer(); + ConversationalClientStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatefulNonConversationalCallbackImpl.calls = new StringBuffer(); + + } + + // stateless client request scope service tests + // ============================================ + @Test + public void testStatelessRequestConversationFromInjectedReference() { + int count = conversationalStatelessClientRequestService.runConversationFromInjectedReference(); + Assert.assertEquals(2, count); + } + + //@Test + public void testStatelessRequestConversationFromInjectedReference2() { + int count = conversationalStatelessClientRequestService.runConversationFromInjectedReference2(); + Assert.assertEquals(1, count); + } + + @Test + public void testStatelessRequestConversationFromServiceReference() { + int count = conversationalStatelessClientRequestService.runConversationFromServiceReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessRequestConversationWithUserDefinedConversationId() { + int count = conversationalStatelessClientRequestService.runConversationWithUserDefinedConversationId(); + Assert.assertEquals(2, count); + } + + //@Test + public void testStatelessRequestConversationCheckUserDefinedConversationId() { + String conversationId = conversationalStatelessClientRequestService.runConversationCheckUserDefinedConversationId(); + Assert.assertEquals("MyConversation2", conversationId); + } + + //@Test + public void testStatelessRequestConversationCheckingScope() { + resetCallStack(); + ConversationalServiceRequestImpl.calls = new StringBuffer(); + conversationalStatelessClientRequestService.runConversationCheckingScope(); + Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,", + ConversationalServiceRequestImpl.calls.toString()); + //init,initializeCount,init,incrementCount,init,retrieveCount,init,endConversation, + } + + @Test + public void testStatelessRequestConversationWithCallback() { + resetCallStack(); + ConversationalClientStatelessImpl.calls = new StringBuffer(); + int count = conversationalStatelessClientRequestService.runConversationWithCallback(); + Assert.assertEquals(0, count); + + Assert.assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,destroy,", + ConversationalClientStatelessImpl.calls.toString()); + } + + //@Test + public void testStatelessRequestConversationHavingPassedReference() { + int count = conversationalStatelessClientRequestService.runConversationHavingPassedReference(); + Assert.assertEquals(3, count); + } + + //@Test + public void testStatelessRequestConversationBusinessException() { + String message = conversationalStatelessClientRequestService.runConversationBusinessException(); + Assert.assertEquals("Business Exception", message); + } + + //@Test + public void testStatelessRequestConversationBusinessExceptionCallback() { + String message = conversationalStatelessClientRequestService.runConversationBusinessExceptionCallback(); + Assert.assertEquals("Business Exception", message); + } + + @Test + public void testStatelessRequestConversationCallingEndedConversation() { + int count = conversationalStatelessClientRequestService.runConversationCallingEndedConversation(); + Assert.assertEquals(-999, count); + } + + @Test + public void testStatelessRequestConversationCallingEndedConversationCallback() { + int count = conversationalStatelessClientRequestService.runConversationCallingEndedConversationCallback(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatelessRequestConversationCallingEndedConversationCheckConversationId() { + String id = conversationalStatelessClientRequestService.runConversationCallingEndedConversationCheckConversationId(); + Assert.assertEquals(null, id); + } + + //@Test + public void testStatelessRequestConversationCallingEndedConversationCallbackCheckConversationId() { + String id = conversationalStatelessClientRequestService.runConversationCallingEndedConversationCallbackCheckConversationId(); + Assert.assertEquals(null, id); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/StatefulStatefulTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/StatefulStatefulTestCase.java new file mode 100644 index 0000000000..6fc0391b34 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/StatefulStatefulTestCase.java @@ -0,0 +1,197 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational; + +import javax.xml.namespace.QName; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.domain.SCADomain; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulNonConversationalCallbackImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatelessImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceRequestImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulNonConversationalCallbackImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatelessImpl; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.apache.tuscany.sca.node.util.SCAContributionUtil; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class StatefulStatefulTestCase { + + private static SCADomain domain; + private static SCANode node; + private static ConversationalClient conversationalStatelessClientStatelessService; + private static ConversationalClient conversationalStatelessClientStatefulService; + private static ConversationalClient conversationalStatefulClientStatelessService; + private static ConversationalClient conversationalStatefulClientStatefulService; + private static ConversationalClient conversationalStatelessClientRequestService; + private static ConversationalClient conversationalStatefulClientNonConversationalCallbackStatelessService; + + @BeforeClass + public static void setUp() throws Exception { + try { + node = SCANodeFactory.newInstance().createSCANode(null, null); + node.addContribution("mycontribution", + StatefulStatefulTestCase.class.getResource("/Conversational/.")); + node.addToDomainLevelComposite(new QName("http://conversations", "ConversationalITest")); + node.start(); + domain = node.getDomain(); + + conversationalStatelessClientStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientStatelessService"); + + conversationalStatelessClientStatefulService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientStatefulService"); + + conversationalStatefulClientStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientStatelessService"); + + conversationalStatefulClientStatefulService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientStatefulService"); + conversationalStatelessClientRequestService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientRequestService"); + conversationalStatefulClientNonConversationalCallbackStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientNonConversationalCallbackStatefulService"); + + // reset the place where we record the sequence of calls passing + // through each component instance + ConversationalServiceStatelessImpl.calls = new StringBuffer(); + ConversationalServiceStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatelessImpl.calls = new StringBuffer(); + ConversationalClientStatefulImpl.calls = new StringBuffer(); + + } catch(Exception ex) { + System.err.println(ex.toString()); + } + + } + + @AfterClass + public static void tearDown() throws Exception { + node.destroy(); + domain = null; + conversationalStatelessClientStatelessService = null; + conversationalStatelessClientStatefulService = null; + conversationalStatefulClientStatelessService = null; + conversationalStatefulClientStatefulService = null; + conversationalStatelessClientRequestService = null; + conversationalStatefulClientNonConversationalCallbackStatelessService = null; + } + + private static void resetCallStack() { + + // reset the place where we record the sequence of calls passing + // through each component instance + ConversationalServiceStatelessImpl.calls = new StringBuffer(); + ConversationalServiceStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatelessImpl.calls = new StringBuffer(); + ConversationalClientStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatefulNonConversationalCallbackImpl.calls = new StringBuffer(); + + } + + // stateful client stateful service tests + // ====================================== + @Test + public void testStatefulStatefulConversationFromInjectedReference() { + int count = conversationalStatefulClientStatefulService.runConversationFromInjectedReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatefulConversationFromInjectedReference2() { + int count = conversationalStatefulClientStatefulService.runConversationFromInjectedReference2(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatefulConversationFromServiceReference() { + int count = conversationalStatefulClientStatefulService.runConversationFromServiceReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatefulConversationWithUserDefinedConversationId() { + int count = conversationalStatefulClientStatefulService.runConversationWithUserDefinedConversationId(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatefulConversationCheckUserDefinedConversationId() { + String conversationId = conversationalStatefulClientStatefulService.runConversationCheckUserDefinedConversationId(); + Assert.assertEquals("MyConversation2", conversationId); + } + + @Test + public void testStatefulStatefulConversationCheckingScope() { + resetCallStack(); + conversationalStatefulClientStatefulService.runConversationCheckingScope(); + Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,destroy,", + ConversationalServiceStatefulImpl.calls.toString()); + } + + @Test + public void testStatefulStatefulConversationWithCallback() { + resetCallStack(); + int count = conversationalStatefulClientStatefulService.runConversationWithCallback(); + Assert.assertEquals(4, count); + + Assert.assertEquals("init,runConversationWithCallback,initializeCount,incrementCount,retrieveCount,endConversation,destroy,", + ConversationalClientStatefulImpl.calls.toString()); + } + + //@Test + public void testStatefulStatefulConversationHavingPassedReference() { + int count = conversationalStatefulClientStatefulService.runConversationHavingPassedReference(); + Assert.assertEquals(3, count); + } + + @Test + public void testStatefulStatefulConversationCallingEndedConversation() { + int count = conversationalStatefulClientStatefulService.runConversationCallingEndedConversation(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatefulStatefulConversationCallingEndedConversationCallback() { + int count = conversationalStatefulClientStatefulService.runConversationCallingEndedConversationCallback(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatefulStatefulConversationCallingEndedConversationCheckConversationId() { + String id = conversationalStatefulClientStatefulService.runConversationCallingEndedConversationCheckConversationId(); + Assert.assertEquals(null, id); + } + + @Test + public void testStatefulStatefulConversationCallingEndedConversationCallbackCheckConversationId() { + String id = conversationalStatefulClientStatefulService.runConversationCallingEndedConversationCallbackCheckConversationId(); + Assert.assertEquals(null, id); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/StatefulStatelessTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/StatefulStatelessTestCase.java new file mode 100644 index 0000000000..432039d15d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/StatefulStatelessTestCase.java @@ -0,0 +1,196 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational; + +import javax.xml.namespace.QName; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.domain.SCADomain; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulNonConversationalCallbackImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatelessImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceRequestImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulNonConversationalCallbackImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatelessImpl; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class StatefulStatelessTestCase { + + private static SCADomain domain; + private static SCANode node; + private static ConversationalClient conversationalStatelessClientStatelessService; + private static ConversationalClient conversationalStatelessClientStatefulService; + private static ConversationalClient conversationalStatefulClientStatelessService; + private static ConversationalClient conversationalStatefulClientStatefulService; + private static ConversationalClient conversationalStatelessClientRequestService; + private static ConversationalClient conversationalStatefulClientNonConversationalCallbackStatelessService; + + @BeforeClass + public static void setUp() throws Exception { + try { + node = SCANodeFactory.newInstance().createSCANode(null, null); + node.addContribution("mycontribution", + StatefulStatefulTestCase.class.getResource("/Conversational/.")); + node.addToDomainLevelComposite(new QName("http://conversations", "ConversationalITest")); + node.start(); + domain = node.getDomain(); + + conversationalStatelessClientStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientStatelessService"); + + conversationalStatelessClientStatefulService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientStatefulService"); + + conversationalStatefulClientStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientStatelessService"); + + conversationalStatefulClientStatefulService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientStatefulService"); + conversationalStatelessClientRequestService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientRequestService"); + conversationalStatefulClientNonConversationalCallbackStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientNonConversationalCallbackStatefulService"); + + // reset the place where we record the sequence of calls passing + // through each component instance + ConversationalServiceStatelessImpl.calls = new StringBuffer(); + ConversationalServiceStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatelessImpl.calls = new StringBuffer(); + ConversationalClientStatefulImpl.calls = new StringBuffer(); + + } catch(Exception ex) { + System.err.println(ex.toString()); + } + + } + + @AfterClass + public static void tearDown() throws Exception { + node.destroy(); + domain = null; + conversationalStatelessClientStatelessService = null; + conversationalStatelessClientStatefulService = null; + conversationalStatefulClientStatelessService = null; + conversationalStatefulClientStatefulService = null; + conversationalStatelessClientRequestService = null; + conversationalStatefulClientNonConversationalCallbackStatelessService = null; + } + + private static void resetCallStack() { + + // reset the place where we record the sequence of calls passing + // through each component instance + ConversationalServiceStatelessImpl.calls = new StringBuffer(); + ConversationalServiceStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatelessImpl.calls = new StringBuffer(); + ConversationalClientStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatefulNonConversationalCallbackImpl.calls = new StringBuffer(); + + } + + // stateful client stateless service tests + // ======================================= + @Test + public void testStatefulStatelessConversationFromInjectedReference() { + int count = conversationalStatefulClientStatelessService.runConversationFromInjectedReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatelessConversationFromInjectedReference2() { + int count = conversationalStatefulClientStatelessService.runConversationFromInjectedReference2(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatelessConversationFromServiceReference() { + int count = conversationalStatefulClientStatelessService.runConversationFromServiceReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatelessConversationWithUserDefinedConversationId() { + int count = conversationalStatefulClientStatelessService.runConversationWithUserDefinedConversationId(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatelessConversationCheckUserDefinedConversationId() { + String conversationId = conversationalStatefulClientStatelessService.runConversationCheckUserDefinedConversationId(); + Assert.assertEquals("MyConversation2", conversationId); + } + + @Test + public void testStatefulStatelessConversationCheckingScope() { + resetCallStack(); + conversationalStatefulClientStatelessService.runConversationCheckingScope(); + Assert.assertEquals("init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,", + ConversationalServiceStatelessImpl.calls.toString()); + } + + @Test + public void testStatefulStatelessConversationWithCallback() { + resetCallStack(); + int count = conversationalStatefulClientStatelessService.runConversationWithCallback(); + Assert.assertEquals(4, count); + + Assert.assertEquals("init,runConversationWithCallback,initializeCount,incrementCount,retrieveCount,endConversation,destroy,", + ConversationalClientStatefulImpl.calls.toString()); + } + + //@Test + public void testStatefulStatelessConversationHavingPassedReference() { + int count = conversationalStatefulClientStatelessService.runConversationHavingPassedReference(); + Assert.assertEquals(3, count); + } + + @Test + public void testStatefulStatelessConversationCallingEndedConversation() { + int count = conversationalStatefulClientStatelessService.runConversationCallingEndedConversation(); + Assert.assertEquals(-999, count); + } + + @Test + public void testStatefulStatelessConversationCallingEndedConversationCallback() { + int count = conversationalStatefulClientStatelessService.runConversationCallingEndedConversationCallback(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatefulStatelessConversationCallingEndedConversationCheckConversationId() { + String id = conversationalStatefulClientStatelessService.runConversationCallingEndedConversationCheckConversationId(); + Assert.assertEquals(null, id); + } + + @Test + public void testStatefulStatelessConversationCallingEndedConversationCallbackCheckConversationId() { + String id = conversationalStatefulClientStatelessService.runConversationCallingEndedConversationCallbackCheckConversationId(); + Assert.assertEquals(null, id); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/StatelessStatefulTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/StatelessStatefulTestCase.java new file mode 100644 index 0000000000..4db651a88a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/StatelessStatefulTestCase.java @@ -0,0 +1,209 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational; + +import javax.xml.namespace.QName; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.domain.SCADomain; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulNonConversationalCallbackImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatelessImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceRequestImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulNonConversationalCallbackImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatelessImpl; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class StatelessStatefulTestCase { + + private static SCADomain domain; + private static SCANode node; + private static ConversationalClient conversationalStatelessClientStatelessService; + private static ConversationalClient conversationalStatelessClientStatefulService; + private static ConversationalClient conversationalStatefulClientStatelessService; + private static ConversationalClient conversationalStatefulClientStatefulService; + private static ConversationalClient conversationalStatelessClientRequestService; + private static ConversationalClient conversationalStatefulClientNonConversationalCallbackStatelessService; + + @BeforeClass + public static void setUp() throws Exception { + try { + node = SCANodeFactory.newInstance().createSCANode(null, null); + node.addContribution("mycontribution", + StatefulStatefulTestCase.class.getResource("/Conversational/.")); + node.addToDomainLevelComposite(new QName("http://conversations", "ConversationalITest")); + node.start(); + domain = node.getDomain(); + + conversationalStatelessClientStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientStatelessService"); + + conversationalStatelessClientStatefulService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientStatefulService"); + + conversationalStatefulClientStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientStatelessService"); + + conversationalStatefulClientStatefulService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientStatefulService"); + conversationalStatelessClientRequestService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientRequestService"); + conversationalStatefulClientNonConversationalCallbackStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientNonConversationalCallbackStatefulService"); + + // reset the place where we record the sequence of calls passing + // through each component instance + ConversationalServiceStatelessImpl.calls = new StringBuffer(); + ConversationalServiceStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatelessImpl.calls = new StringBuffer(); + ConversationalClientStatefulImpl.calls = new StringBuffer(); + + } catch(Exception ex) { + System.err.println(ex.toString()); + } + + } + + @AfterClass + public static void tearDown() throws Exception { + node.destroy(); + domain = null; + conversationalStatelessClientStatelessService = null; + conversationalStatelessClientStatefulService = null; + conversationalStatefulClientStatelessService = null; + conversationalStatefulClientStatefulService = null; + conversationalStatelessClientRequestService = null; + conversationalStatefulClientNonConversationalCallbackStatelessService = null; + } + + private static void resetCallStack() { + + // reset the place where we record the sequence of calls passing + // through each component instance + ConversationalServiceStatelessImpl.calls = new StringBuffer(); + ConversationalServiceStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatelessImpl.calls = new StringBuffer(); + ConversationalClientStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatefulNonConversationalCallbackImpl.calls = new StringBuffer(); + + } + + // stateless client stateful service tests + // ======================================= + @Test + public void testStatelessStatefulConversationFromInjectedReference() { + int count = conversationalStatelessClientStatefulService.runConversationFromInjectedReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessStatefulConversationFromInjectedReference2() { + int count = conversationalStatelessClientStatefulService.runConversationFromInjectedReference2(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessStatefulConversationFromServiceReference() { + int count = conversationalStatelessClientStatefulService.runConversationFromServiceReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessStatefulConversationWithUserDefinedConversationId() { + int count = conversationalStatelessClientStatefulService.runConversationWithUserDefinedConversationId(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessStatefulConversationCheckUserDefinedConversationId() { + String conversationId = conversationalStatelessClientStatefulService.runConversationCheckUserDefinedConversationId(); + Assert.assertEquals("MyConversation2", conversationId); + } + + @Test + public void testStatelessStatefulConversationCheckingScope() { + resetCallStack(); + conversationalStatelessClientStatefulService.runConversationCheckingScope(); + Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,destroy,", + ConversationalServiceStatefulImpl.calls.toString()); + } + + @Test + public void testStatelessStatefulConversationWithCallback() { + resetCallStack(); + int count = conversationalStatelessClientStatefulService.runConversationWithCallback(); + Assert.assertEquals(0, count); + + Assert.assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,destroy,", + ConversationalClientStatelessImpl.calls.toString()); + } + + //@Test + public void testStatelessStatefulConversationHavingPassedReference() { + int count = conversationalStatelessClientStatefulService.runConversationHavingPassedReference(); + Assert.assertEquals(3, count); + } + + //@Test + public void testStatelessStatefulConversationBusinessException() { + String message = conversationalStatelessClientStatefulService.runConversationBusinessException(); + Assert.assertEquals("Business Exception", message); + } + + //@Test + public void testStatelessStatefulConversationBusinessExceptionCallback() { + String message = conversationalStatelessClientStatefulService.runConversationBusinessExceptionCallback(); + Assert.assertEquals("Business Exception", message); + } + + @Test + public void testStatelessStatefulConversationCallingEndedConversation() { + int count = conversationalStatelessClientStatefulService.runConversationCallingEndedConversation(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatelessStatefulConversationCallingEndedConversationCallback() { + int count = conversationalStatelessClientStatefulService.runConversationCallingEndedConversationCallback(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatelessStatefulConversationCallingEndedConversationCheckConversationId() { + String id = conversationalStatelessClientStatefulService.runConversationCallingEndedConversationCheckConversationId(); + Assert.assertEquals(null, id); + } + + //@Test + public void testStatelessStatefulConversationCallingEndedConversationCallbackCheckConversationId() { + String id = conversationalStatelessClientStatefulService.runConversationCallingEndedConversationCallbackCheckConversationId(); + Assert.assertEquals(null, id); + } + + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/StatelessStatelessTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/StatelessStatelessTestCase.java new file mode 100644 index 0000000000..3846a8a38a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations-ws/src/test/java/org/apache/tuscany/sca/itest/conversational/StatelessStatelessTestCase.java @@ -0,0 +1,196 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational; + +import javax.xml.namespace.QName; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.domain.SCADomain; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulNonConversationalCallbackImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatelessImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceRequestImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulNonConversationalCallbackImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatelessImpl; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class StatelessStatelessTestCase { + + private static SCADomain domain; + private static SCANode node; + private static ConversationalClient conversationalStatelessClientStatelessService; + private static ConversationalClient conversationalStatelessClientStatefulService; + private static ConversationalClient conversationalStatefulClientStatelessService; + private static ConversationalClient conversationalStatefulClientStatefulService; + private static ConversationalClient conversationalStatelessClientRequestService; + private static ConversationalClient conversationalStatefulClientNonConversationalCallbackStatelessService; + + @BeforeClass + public static void setUp() throws Exception { + try { + node = SCANodeFactory.newInstance().createSCANode(null, null); + node.addContribution("mycontribution", + StatefulStatefulTestCase.class.getResource("/Conversational/.")); + node.addToDomainLevelComposite(new QName("http://conversations", "ConversationalITest")); + node.start(); + domain = node.getDomain(); + + conversationalStatelessClientStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientStatelessService"); + + conversationalStatelessClientStatefulService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientStatefulService"); + + conversationalStatefulClientStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientStatelessService"); + + conversationalStatefulClientStatefulService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientStatefulService"); + conversationalStatelessClientRequestService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientRequestService"); + conversationalStatefulClientNonConversationalCallbackStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientNonConversationalCallbackStatefulService"); + + // reset the place where we record the sequence of calls passing + // through each component instance + ConversationalServiceStatelessImpl.calls = new StringBuffer(); + ConversationalServiceStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatelessImpl.calls = new StringBuffer(); + ConversationalClientStatefulImpl.calls = new StringBuffer(); + + } catch(Exception ex) { + System.err.println(ex.toString()); + } + + } + + @AfterClass + public static void tearDown() throws Exception { + node.destroy(); + domain = null; + conversationalStatelessClientStatelessService = null; + conversationalStatelessClientStatefulService = null; + conversationalStatefulClientStatelessService = null; + conversationalStatefulClientStatefulService = null; + conversationalStatelessClientRequestService = null; + conversationalStatefulClientNonConversationalCallbackStatelessService = null; + } + + private static void resetCallStack() { + + // reset the place where we record the sequence of calls passing + // through each component instance + ConversationalServiceStatelessImpl.calls = new StringBuffer(); + ConversationalServiceStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatelessImpl.calls = new StringBuffer(); + ConversationalClientStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatefulNonConversationalCallbackImpl.calls = new StringBuffer(); + + } + + + // stateless client stateless service tests + // ======================================== + + @Test + public void testStatelessStatelessConversationFromInjectedReference() { + int count = conversationalStatelessClientStatelessService.runConversationFromInjectedReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessStatelessConversationFromInjectedReference2() { + int count = conversationalStatelessClientStatelessService.runConversationFromInjectedReference2(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessStatelessConversationFromServiceReference() { + int count = conversationalStatelessClientStatelessService.runConversationFromServiceReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessStatelessConversationWithUserDefinedConversationId() { + int count = conversationalStatelessClientStatelessService.runConversationWithUserDefinedConversationId(); + Assert.assertEquals(2, count); + } + @Test + public void testStatelessStatelessConversationCheckUserDefinedConversationId() { + String conversationId = conversationalStatelessClientStatelessService.runConversationCheckUserDefinedConversationId(); + Assert.assertEquals("MyConversation2", conversationId); + } + + @Test + public void testStatelessStatelessConversationCheckingScope() { + resetCallStack(); + conversationalStatelessClientStatelessService.runConversationCheckingScope(); + Assert.assertEquals("init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,", + ConversationalServiceStatelessImpl.calls.toString()); + } + + @Test + public void testStatelessStatelessConversationWithCallback() { + resetCallStack(); + int count = conversationalStatelessClientStatelessService.runConversationWithCallback(); + Assert.assertEquals(0, count); + + Assert.assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,destroy,", + ConversationalClientStatelessImpl.calls.toString()); + } + //@Test + public void testStatelessStatelessConversationHavingPassedReference() { + int count = conversationalStatelessClientStatelessService.runConversationHavingPassedReference(); + Assert.assertEquals(3, count); + } + + @Test + public void testStatelessStatelessConversationCallingEndedConversation() { + int count = conversationalStatelessClientStatelessService.runConversationCallingEndedConversation(); + Assert.assertEquals(-999, count); + } + + @Test + public void testStatelessStatelessConversationCallingEndedConversationCallback() { + int count = conversationalStatelessClientStatelessService.runConversationCallingEndedConversationCallback(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatelessStatelessConversationCallingEndedConversationCheckConversationId() { + String id = conversationalStatelessClientStatelessService.runConversationCallingEndedConversationCheckConversationId(); + Assert.assertEquals(null, id); + } + + //@Test + public void testStatelessStatelessConversationCallingEndedConversationCallbackCheckConversationId() { + String id = conversationalStatelessClientStatelessService.runConversationCallingEndedConversationCallbackCheckConversationId(); + Assert.assertEquals(null, id); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/pom.xml new file mode 100644 index 0000000000..6b748f14a0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/pom.xml @@ -0,0 +1,45 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + itest-conversations + Apache Tuscany SCA Conversations Integration Tests + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2.1-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2.1-incubating-SNAPSHOT + runtime + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/AService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/AService.java new file mode 100644 index 0000000000..46c5b9c857 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/AService.java @@ -0,0 +1,56 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational; + +import org.osoa.sca.annotations.Conversational; + +/** + * Simple conversational Service that uses another Conversational Service + */ +@Conversational +public interface AService { + + /** + * Returns the state for this service. + * + * @return The state for this service + */ + String getState(); + + /** + * Returns the state for the other service that this service is using + * + * @return The state for the other service that this service is using + */ + String getStateOnB(); + + /** + * Sets the state for this service. + * + * @param aState The state for this service + */ + void setState(String aState); + + /** + * Sets the state for the other service that this service is using + * + * @param aState The state for the other service that this service is using + */ + void setStateOnB(String aState); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/BService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/BService.java new file mode 100644 index 0000000000..2d88b697cc --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/BService.java @@ -0,0 +1,42 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational; + +import org.osoa.sca.annotations.Conversational; + +/** + * Simple conversational Service + */ +@Conversational +public interface BService { + + /** + * Returns the state for this service. + * + * @return The state for this service + */ + String getState(); + + /** + * Sets the state for this service. + * + * @param aState The state for this service + */ + void setState(String aState); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/CService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/CService.java new file mode 100644 index 0000000000..a6dbf56797 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/CService.java @@ -0,0 +1,42 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational; + +import org.osoa.sca.annotations.Conversational; + +/** + * Simple conversational Service that uses another Conversational Service + */ +@Conversational +public interface CService { + + String getState(); + + void setState(String aState); + + Object getConversationID(); + + Object getConversationObjectConversationId(); + + void setConversationID(String theID); + + void endConversation(); + + void endConversationViaAnnotatedMethod(); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Constants.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Constants.java new file mode 100644 index 0000000000..e21b6f1ba7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Constants.java @@ -0,0 +1,25 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational; + +public interface Constants { + + String A_INITIAL_VALUE = "Initial Value of A"; + String B_INITIAL_VALUE = "Initial Value of B"; +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationIdService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationIdService.java new file mode 100644 index 0000000000..15c397b902 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationIdService.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 org.apache.tuscany.sca.itest.conversational; + +import org.osoa.sca.annotations.Conversational; + +@Conversational +public interface ConversationIdService { + + String getCIDField(); + String getCIDSetter(); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalCallback.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalCallback.java new file mode 100644 index 0000000000..5d7a72118f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalCallback.java @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.itest.conversational; + +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.EndsConversation; +import org.osoa.sca.annotations.Remotable; + + +/** + * The callback interface used when testing caonversational callbacks + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ +@Remotable +@Conversational +public interface ConversationalCallback { + + public void init(); + + public void destroy(); + + public void initializeCount(int count); + + public void incrementCount(); + + public int retrieveCount(); + + public void businessException() throws Exception; + + @EndsConversation + public String endConversation(); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalClient.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalClient.java new file mode 100644 index 0000000000..a5b7fd9e1a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalClient.java @@ -0,0 +1,51 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational; + +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Remotable; + +/** + * The client for the conversational itest. Is implemented by clients + * offering both stateless and stateful callbacks + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ + +@Remotable +public interface ConversationalClient { + + public int runConversationFromInjectedReference(); + public int runConversationFromInjectedReference2(); + public int runConversationFromServiceReference(); + public int runConversationWithUserDefinedConversationId(); + public String runConversationCheckUserDefinedConversationId(); + public int runConversationCheckingScope(); + public int runConversationWithCallback(); + public int runConversationHavingPassedReference(); + public String runConversationBusinessException(); + public String runConversationBusinessExceptionCallback(); + public int runConversationCallingEndedConversation(); + public int runConversationCallingEndedConversationCallback(); + public String runConversationCallingEndedConversationCheckConversationId(); + public String runConversationCallingEndedConversationCallbackCheckConversationId(); + public int runConversationAgeTimeout(); + public int runConversationIdleTimeout(); + public int runConversationPrincipleError(); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalReferenceClient.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalReferenceClient.java new file mode 100644 index 0000000000..6f8d2d0b6f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalReferenceClient.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 org.apache.tuscany.sca.itest.conversational; + +import org.osoa.sca.CallableReference; +import org.osoa.sca.annotations.Remotable; + +/** + * The client that calls into an existing conversation by accepting + * a reference to that conversation + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ + +@Remotable +public interface ConversationalReferenceClient { + + public void incrementCount(CallableReference conversationalService); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalService.java new file mode 100644 index 0000000000..d306c21209 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalService.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 org.apache.tuscany.sca.itest.conversational; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.EndsConversation; +import org.osoa.sca.annotations.Remotable; + + +/** + * The service interface used when testing conversations + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ +@Remotable +@Conversational +@Callback(ConversationalCallback.class) +public interface ConversationalService { + + public void init(); + + public void destroy(); + + public void initializeCount(int count); + + public void incrementCount(); + + public int retrieveCount(); + + public void businessException() throws Exception; + + public void initializeCountCallback(int count); + + public void incrementCountCallback(); + + public int retrieveCountCallback(); + + public void businessExceptionCallback() throws Exception; + + @EndsConversation + public String endConversation(); + + public String endConversationCallback(); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalServiceNonConversationalCallback.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalServiceNonConversationalCallback.java new file mode 100644 index 0000000000..7a2f30c7e6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalServiceNonConversationalCallback.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 org.apache.tuscany.sca.itest.conversational; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.EndsConversation; +import org.osoa.sca.annotations.Remotable; + + +/** + * The service interface used when testing conversations + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ +@Remotable +@Conversational +@Callback(NonConversationalCallback.class) +public interface ConversationalServiceNonConversationalCallback { + + public void init(); + + public void destroy(); + + public void initializeCount(int count); + + public void incrementCount(); + + public int retrieveCount(); + + public void businessException() throws Exception; + + public void initializeCountCallback(int count); + + public void incrementCountCallback(); + + public int retrieveCountCallback(); + + public void businessExceptionCallback() throws Exception; + + @EndsConversation + public String endConversation(); + + public String endConversationCallback(); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/DService.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/DService.java new file mode 100644 index 0000000000..74afbfb763 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/DService.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 org.apache.tuscany.sca.itest.conversational; + +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.EndsConversation; + +/** + * Simple conversational Service + */ +@Conversational +public interface DService { + + /** + * Returns the state for this service. + * + * @return The state for this service + */ + String getState(); + + /** + * Sets the state for this service. + * + * @param aState The state for this service + */ + void setState(String aState); + + @EndsConversation + void endConversationViaAnnotatedMethod(); +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallback.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallback.java new file mode 100644 index 0000000000..83eb28dad8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallback.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 org.apache.tuscany.sca.itest.conversational; + +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.EndsConversation; +import org.osoa.sca.annotations.Remotable; + + +/** + * The callback interface used when testing caonversational callbacks + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ +@Remotable +public interface NonConversationalCallback { + + public void init(); + + public void destroy(); + + public void initializeCount(int count); + + public void incrementCount(); + + public int retrieveCount(); + + public void businessException() throws Exception; + + public String endConversation(); + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AServiceImpl.java new file mode 100644 index 0000000000..f3cb69275d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AServiceImpl.java @@ -0,0 +1,111 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational.impl; + +import java.lang.reflect.Proxy; +import org.apache.tuscany.sca.core.invocation.JDKInvocationHandler; + +import org.apache.tuscany.sca.itest.conversational.AService; +import org.apache.tuscany.sca.itest.conversational.BService; +import org.apache.tuscany.sca.itest.conversational.Constants; +import org.osoa.sca.annotations.ConversationID; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +/** + * Simple conversational Service that uses another Conversational Service + */ +@Service(AService.class) +@Scope("CONVERSATION") +public class AServiceImpl implements AService { + + /** + * The state + */ + private String state = Constants.A_INITIAL_VALUE; + + /** + * The reference to the other service + */ + private BService b; + + /** + * Constructor + * + */ + public AServiceImpl() { + System.out.println("---> AServiceImpl constructor for " + this); + } + + /** + * Inject the reference to the other service + * @param aB The other service. + */ + @Reference(name="b") + public void setB(BService aB) { + System.out.println("---> Setting reference to B on " + this + " to " + aB); + this.b = aB; + } + + /** + * Returns the state for this service. + * + * @return The state for this service + */ + public String getState() { + return state; + } + + /** + * Returns the state for the other service that this service is using + * + * @return The state for the other service that this service is using + */ + public String getStateOnB() { + return b.getState(); + } + + /** + * Sets the state for this service. + * + * @param aState The state for this service + */ + public void setState(String aState) { + this.state = aState; + } + + /** + * Sets the state for the other service that this service is using + * + * @param aState The state for the other service that this service is using + */ + public void setStateOnB(String aState) { + b.setState(aState); + } + + /** + * Sets the conversation ID for this service + * @param id The Conversation ID + */ + @ConversationID + public void setConversationID(String id) { + System.out.println("Conversation ID for " + this + " is set to " + id); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BServiceImpl.java new file mode 100644 index 0000000000..ee242f7e7d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BServiceImpl.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 org.apache.tuscany.sca.itest.conversational.impl; + + +import org.apache.tuscany.sca.itest.conversational.BService; +import org.apache.tuscany.sca.itest.conversational.Constants; +import org.osoa.sca.annotations.ConversationID; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +/** + * Simple conversational Service + */ +@Service(BService.class) +@Scope("CONVERSATION") +public class BServiceImpl implements BService { + + /** + * The state for this service + */ + private String state = Constants.B_INITIAL_VALUE; + + /** + * Constructor + */ + public BServiceImpl() { + System.out.println("---> BServiceImpl constructor for " + this); + } + + /** + * Returns the state for this service. + * + * @return The state for this service + */ + public String getState() { + return state; + } + + /** + * Sets the state for this service. + * + * @param aState The state for this service + */ + public void setState(String aState) { + this.state = aState; + } + + /** + * Sets the conversation ID for this service + * @param id The Conversation ID + */ + @ConversationID + public void setConversationID(String id) { + System.out.println("Conversation ID for " + this + " is set to " + id); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/CServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/CServiceImpl.java new file mode 100644 index 0000000000..b21f956bd9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/CServiceImpl.java @@ -0,0 +1,85 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational.impl; + +import org.apache.tuscany.sca.itest.conversational.CService; +import org.apache.tuscany.sca.itest.conversational.DService; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +/** + * Simple conversational Service that uses another Conversational Service + */ +@Service(CService.class) +@Scope("CONVERSATION") +public class CServiceImpl implements CService { + + private ServiceReference dServiceRef; + + @Reference(name = "d") + public void setD(ServiceReference servRef) { + this.dServiceRef = servRef; + } + + public String getState() { + return dServiceRef.getService().getState(); + } + + public void setState(String aState) { + dServiceRef.getService().setState(aState); + } + + + /* + * When the coversationId is set manually the client may access the + * conversation id that will be used by the reference using + * ServiceReference.getConversationId() + */ + public Object getConversationID() { + return dServiceRef.getConversationID(); + } + + /* + * Whether the conversation ID is chosen by the client or is generated by + * the system, the client may access the conversation ID by calling + * Conversation.getConversationID(). + */ + public Object getConversationObjectConversationId() { + // TODO Auto-generated method stub + if (dServiceRef.getConversation() != null){ + return dServiceRef.getConversation().getConversationID(); + } else { + return null; + } + } + + public void endConversation() { + dServiceRef.getConversation().end(); + } + + public void endConversationViaAnnotatedMethod() { + dServiceRef.getService().endConversationViaAnnotatedMethod(); + } + + public void setConversationID(String theID) { + dServiceRef.setConversationID(theID); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationAgeComponentImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationAgeComponentImpl.java new file mode 100644 index 0000000000..9deef312ac --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationAgeComponentImpl.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 org.apache.tuscany.sca.itest.conversational.impl; + +import org.apache.tuscany.sca.itest.conversational.ConversationalService; +import org.osoa.sca.annotations.ConversationAttributes; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(ConversationalService.class) +@Scope("CONVERSATION") +@ConversationAttributes(maxAge="1 seconds") +public class ConversationAgeComponentImpl implements ConversationalService { + + private int count; + + public void businessException() throws Exception { + } + + public void businessExceptionCallback() throws Exception { + } + + public void destroy() { + } + + public String endConversation() { + return null; + } + + public String endConversationCallback() { + return null; + } + + public void incrementCount() { + } + + public void incrementCountCallback() { + } + + public void init() { + } + + public void initializeCount(int count) { + this.count = count; + } + + public void initializeCountCallback(int count) { + } + + public int retrieveCount() { + return count; + } + + public int retrieveCountCallback() { + return 0; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationIdComponentImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationIdComponentImpl.java new file mode 100644 index 0000000000..cffa76186a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationIdComponentImpl.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 org.apache.tuscany.sca.itest.conversational.impl; + +import org.apache.tuscany.sca.itest.conversational.ConversationIdService; +import org.osoa.sca.annotations.ConversationID; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(ConversationIdService.class) +@Scope("CONVERSATION") +public class ConversationIdComponentImpl implements ConversationIdService { + + @ConversationID + public String cid; + + private String setterCid; + + public String getCIDField() { + return cid; + } + public String getCIDSetter() { + return setterCid; + } + + + @ConversationID + public void setCID(String cid) { + this.setterCid = cid; + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationMaxIdleComponentImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationMaxIdleComponentImpl.java new file mode 100644 index 0000000000..1272c7ab7f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationMaxIdleComponentImpl.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 org.apache.tuscany.sca.itest.conversational.impl; + +import org.apache.tuscany.sca.itest.conversational.ConversationalService; +import org.osoa.sca.annotations.ConversationAttributes; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(ConversationalService.class) +@Scope("CONVERSATION") +@ConversationAttributes(maxIdleTime="1 seconds") +public class ConversationMaxIdleComponentImpl implements ConversationalService { + + private int count; + + public void businessException() throws Exception { + } + + public void businessExceptionCallback() throws Exception { + } + + public void destroy() { + } + + public String endConversation() { + return null; + } + + public String endConversationCallback() { + return null; + } + + public void incrementCount() { + } + + public void incrementCountCallback() { + } + + public void init() { + } + + public void initializeCount(int count) { + this.count = count; + } + + public void initializeCountCallback(int count) { + } + + public int retrieveCount() { + return count; + } + + public int retrieveCountCallback() { + return 0; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulImpl.java new file mode 100644 index 0000000000..6efb7f9a19 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulImpl.java @@ -0,0 +1,321 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational.impl; + +import org.apache.tuscany.sca.itest.conversational.ConversationalCallback; +import org.apache.tuscany.sca.itest.conversational.ConversationalClient; +import org.apache.tuscany.sca.itest.conversational.ConversationalReferenceClient; +import org.apache.tuscany.sca.itest.conversational.ConversationalService; +import org.osoa.sca.ComponentContext; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.ConversationAttributes; +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +/** + * The client for the conversational itest which presents a stateful + * callback interface + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ + +@Service(interfaces={ConversationalClient.class}) +@Scope("CONVERSATION") +@ConversationAttributes(maxAge="10 minutes", + maxIdleTime="5 minutes", + singlePrincipal=false) +public class ConversationalClientStatefulImpl implements ConversationalClient, ConversationalCallback { + + @Context + protected ComponentContext componentContext; + + @Reference + protected ConversationalService conversationalService; + + @Reference + protected ConversationalService conversationalService2; + + @Reference + protected ConversationalReferenceClient conversationalReferenceClient; + + private int clientCount = 0; + private int callbackCount = 0; + + + // a static member variable that records the number of times this service is called + public static StringBuffer calls = new StringBuffer(); + + // From ConversationalClient + public int runConversationFromInjectedReference(){ + calls.append("runConversationFromInjectedReference,"); + conversationalService.initializeCount(1); + conversationalService.incrementCount(); + clientCount = conversationalService.retrieveCount(); + conversationalService.endConversation(); + + return clientCount; + } + public int runConversationFromInjectedReference2(){ + calls.append("runConversationFromInjectedReference2,"); + + conversationalService2.initializeCount(1); + conversationalService2.incrementCount(); + + // stick in a call to the first reference to + // make sure the two references don't clash + conversationalService.initializeCount(1); + + clientCount = conversationalService2.retrieveCount(); + conversationalService2.endConversation(); + + // end the conversation through the first reference + conversationalService.endConversation(); + + return clientCount; + } + public int runConversationFromServiceReference(){ + calls.append("runConversationFromServiceReference,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + // serviceReference.getConversation().end(); + + return clientCount; + } + public int runConversationWithUserDefinedConversationId(){ + calls.append("runConversationWithUserDefinedConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation1"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + // serviceReference.getConversation().end(); + + return clientCount; + } + public String runConversationCheckUserDefinedConversationId(){ + calls.append("runConversationCheckUserDefinedConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation2"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + + String clientConversationId = serviceReference.getConversationID().toString(); + String serverConversationId = callableReference.endConversation(); + + if (clientConversationId.equals("MyConversation2") && + serverConversationId.equals("MyConversation2") ) { + return clientConversationId; + } else { + return "client = " + clientConversationId + + "server = " + serverConversationId; + } + + } + public int runConversationCheckingScope(){ + calls.append("runConversationCheckingScope,"); + // run a conversation + return runConversationFromInjectedReference(); + + // test will then use a static method to find out how many times + // init/destroy were called + } + public int runConversationWithCallback(){ + calls.append("runConversationWithCallback,"); + callbackCount = 2; + conversationalService.initializeCountCallback(1); + conversationalService.incrementCountCallback(); + clientCount = conversationalService.retrieveCountCallback(); + conversationalService.endConversationCallback(); + + return clientCount; + } + public int runConversationHavingPassedReference(){ + calls.append("runConversationHavingPassedReference,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + conversationalReferenceClient.incrementCount(serviceReference); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + serviceReference.getConversation().end(); + + return clientCount; + } + public String runConversationBusinessException(){ + calls.append("runConversationbusinessException,"); + try { + conversationalService.initializeCount(1); + conversationalService.businessException(); + clientCount = conversationalService.retrieveCount(); + conversationalService.endConversation(); + } catch(Exception ex) { + return ex.getMessage(); + } + + return "No Exception Returned"; + } + + public String runConversationBusinessExceptionCallback(){ + calls.append("runConversationbusinessExceptionCallback,"); + try { + conversationalService.initializeCountCallback(1); + conversationalService.businessExceptionCallback(); + clientCount = conversationalService.retrieveCountCallback(); + conversationalService.endConversationCallback(); + } catch(Exception ex) { + return ex.getMessage(); + } + + return "No Exception Returned"; + } + + public int runConversationCallingEndedConversation(){ + calls.append("runConversationCallingEndedConversation,"); + conversationalService.initializeCount(1); + conversationalService.endConversation(); + return conversationalService.retrieveCount(); + } + + public int runConversationCallingEndedConversationCallback(){ + calls.append("runConversationCallingEndedConversationCallback,"); + conversationalService.initializeCountCallback(1); + conversationalService.endConversationCallback(); + return conversationalService.retrieveCountCallback(); + } + + public String runConversationCallingEndedConversationCheckConversationId(){ + calls.append("runConversationCallingEndedConversationCheckConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation3"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + if (serviceReference.getConversation() ==null ) { + return null; + } else { + return serviceReference.getConversation().getConversationID().toString(); + } + } + + public String runConversationCallingEndedConversationCallbackCheckConversationId(){ + calls.append("runConversationCallingEndedConversationCallbackCheckConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation3"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversationCallback(); + + if (serviceReference.getConversation() ==null ) { + return null; + } else { + return serviceReference.getConversation().getConversationID().toString(); + } + } + + public int runConversationAgeTimeout(){ + calls.append("runConversationAgeTimeout,"); + // done in other testing + return clientCount; + } + public int runConversationIdleTimeout(){ + calls.append("runConversationIdleTimeout,"); + // done in other testing + return clientCount; + } + public int runConversationPrincipleError(){ + calls.append("runConversationPrincipleError,"); + // TODO - when policy framework is done + return clientCount; + } + + + // From ConversationalCallback + @Init + public void init(){ + calls.append("init,"); + } + + @Destroy + public void destroy(){ + calls.append("destroy,"); + } + + public void initializeCount(int count){ + calls.append("initializeCount,"); + callbackCount += count; + } + + public void incrementCount(){ + calls.append("incrementCount,"); + callbackCount++; + } + + public int retrieveCount(){ + calls.append("retrieveCount,"); + return callbackCount; + } + + public void businessException() throws Exception { + throw new Exception("Business Exception"); + } + + public String endConversation(){ + calls.append("endConversation,"); + callbackCount = 0; + return null; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulNonConversationalCallbackImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulNonConversationalCallbackImpl.java new file mode 100644 index 0000000000..43567d34e4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulNonConversationalCallbackImpl.java @@ -0,0 +1,310 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational.impl; + +import org.apache.tuscany.sca.itest.conversational.ConversationalClient; +import org.apache.tuscany.sca.itest.conversational.ConversationalReferenceClient; +import org.apache.tuscany.sca.itest.conversational.ConversationalService; +import org.apache.tuscany.sca.itest.conversational.NonConversationalCallback; +import org.osoa.sca.ComponentContext; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.ConversationAttributes; +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +/** + * The client for the conversational itest which presents a stateful + * callback interface + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ + +@Service(interfaces={ConversationalClient.class}) +@Scope("CONVERSATION") +@ConversationAttributes(maxAge="10 minutes", + maxIdleTime="5 minutes", + singlePrincipal=false) +public class ConversationalClientStatefulNonConversationalCallbackImpl implements ConversationalClient, NonConversationalCallback { + + @Context + protected ComponentContext componentContext; + + @Reference + protected ConversationalService conversationalService; + + @Reference + protected ConversationalService conversationalService2; + + @Reference + protected ConversationalReferenceClient conversationalReferenceClient; + + private int clientCount = 0; + private int callbackCount = 0; + + + // a static member variable that records the number of times this service is called + public static StringBuffer calls = new StringBuffer(); + + // From ConversationalClient + public int runConversationFromInjectedReference(){ + calls.append("runConversationFromInjectedReference,"); + conversationalService.initializeCount(1); + conversationalService.incrementCount(); + clientCount = conversationalService.retrieveCount(); + conversationalService.endConversation(); + + return clientCount; + } + public int runConversationFromInjectedReference2(){ + calls.append("runConversationFromInjectedReference2,"); + + conversationalService2.initializeCount(1); + conversationalService2.incrementCount(); + + // stick in a call to the first reference to + // make sure the two references don't clash + conversationalService.initializeCount(1); + + clientCount = conversationalService2.retrieveCount(); + conversationalService2.endConversation(); + + // end the conversation through the first reference + conversationalService.endConversation(); + + return clientCount; + } + public int runConversationFromServiceReference(){ + calls.append("runConversationFromServiceReference,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + // serviceReference.getConversation().end(); + + return clientCount; + } + public int runConversationWithUserDefinedConversationId(){ + calls.append("runConversationWithUserDefinedConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation1"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + // serviceReference.getConversation().end(); + + return clientCount; + } + public String runConversationCheckUserDefinedConversationId(){ + calls.append("runConversationCheckUserDefinedConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation2"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + return callableReference.endConversation(); + + } + public int runConversationCheckingScope(){ + calls.append("runConversationCheckingScope,"); + // run a conversation + return runConversationFromInjectedReference(); + + // test will then use a static method to find out how many times + // init/destroy were called + } + public int runConversationWithCallback(){ + calls.append("runConversationWithCallback,"); + callbackCount = 2; + conversationalService.initializeCountCallback(1); + conversationalService.incrementCountCallback(); + clientCount = conversationalService.retrieveCountCallback(); + conversationalService.endConversationCallback(); + + return clientCount; + } + public int runConversationHavingPassedReference(){ + calls.append("runConversationHavingPassedReference,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + conversationalReferenceClient.incrementCount(serviceReference); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + // serviceReference.getConversation().end(); + + return clientCount; + } + public String runConversationBusinessException(){ + calls.append("runConversationbusinessException,"); + try { + conversationalService.initializeCount(1); + conversationalService.businessException(); + clientCount = conversationalService.retrieveCount(); + conversationalService.endConversation(); + } catch(Exception ex) { + return ex.getMessage(); + } + + return "No Exception Returned"; + } + + public String runConversationBusinessExceptionCallback(){ + calls.append("runConversationbusinessExceptionCallback,"); + try { + conversationalService.initializeCountCallback(1); + conversationalService.businessExceptionCallback(); + clientCount = conversationalService.retrieveCountCallback(); + conversationalService.endConversationCallback(); + } catch(Exception ex) { + return ex.getMessage(); + } + + return "No Exception Returned"; + } + + public String runConversationCallingEndedConversationCheckConversationId(){ + calls.append("runConversationCallingEndedConversationCheckConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation3"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + if (serviceReference.getConversation() ==null ) { + return null; + } else { + return serviceReference.getConversation().getConversationID().toString(); + } + } + + public String runConversationCallingEndedConversationCallbackCheckConversationId(){ + calls.append("runConversationCallingEndedConversationCallbackCheckConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation3"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversationCallback(); + + if (serviceReference.getConversation() ==null ) { + return null; + } else { + return serviceReference.getConversation().getConversationID().toString(); + } + } + + public int runConversationCallingEndedConversation(){ + calls.append("runConversationCallingEndedConversation,"); + conversationalService.initializeCount(1); + conversationalService.endConversation(); + return conversationalService.retrieveCount(); + } + + public int runConversationCallingEndedConversationCallback(){ + calls.append("runConversationCallingEndedConversationCallback,"); + conversationalService.initializeCountCallback(1); + conversationalService.endConversationCallback(); + return conversationalService.retrieveCountCallback(); + } + + public int runConversationAgeTimeout(){ + calls.append("runConversationAgeTimeout,"); + // done in other testing + return clientCount; + } + public int runConversationIdleTimeout(){ + calls.append("runConversationIdleTimeout,"); + // done in other testing + return clientCount; + } + public int runConversationPrincipleError(){ + calls.append("runConversationPrincipleError,"); + // TODO - when policy framework is done + return clientCount; + } + + + // From ConversationalCallback + @Init + public void init(){ + calls.append("init,"); + } + + @Destroy + public void destroy(){ + calls.append("destroy,"); + } + + public void initializeCount(int count){ + calls.append("initializeCount,"); + callbackCount += count; + } + + public void incrementCount(){ + calls.append("incrementCount,"); + callbackCount++; + } + + public int retrieveCount(){ + calls.append("retrieveCount,"); + return callbackCount; + } + + public void businessException() throws Exception { + throw new Exception("Business Exception"); + } + + public String endConversation(){ + calls.append("endConversation,"); + return null; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatelessImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatelessImpl.java new file mode 100644 index 0000000000..c5a0ceaaa9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatelessImpl.java @@ -0,0 +1,317 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational.impl; + +import org.apache.tuscany.sca.itest.conversational.ConversationalCallback; +import org.apache.tuscany.sca.itest.conversational.ConversationalClient; +import org.apache.tuscany.sca.itest.conversational.ConversationalReferenceClient; +import org.apache.tuscany.sca.itest.conversational.ConversationalService; +import org.osoa.sca.ComponentContext; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * The client for the conversational itest which presents a stateful + * callback interface + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ + +@Service(interfaces={ConversationalClient.class}) +public class ConversationalClientStatelessImpl implements ConversationalClient, ConversationalCallback { + + @Context + protected ComponentContext componentContext; + + @Reference + protected ConversationalService conversationalService; + + @Reference + protected ConversationalService conversationalService2; + + @Reference + protected ConversationalReferenceClient conversationalReferenceClient; + + private int clientCount = 0; + private int callbackCount = 0; + + // a static member variable that records the number of times this service is called + public static StringBuffer calls = new StringBuffer(); + + // From ConversationalClient + public int runConversationFromInjectedReference(){ + calls.append("runConversationFromInjectedReference,"); + conversationalService.initializeCount(1); + conversationalService.incrementCount(); + clientCount = conversationalService.retrieveCount(); + conversationalService.endConversation(); + + return clientCount; + } + public int runConversationFromInjectedReference2(){ + calls.append("runConversationFromInjectedReference2,"); + + // now test the second reference + conversationalService2.initializeCount(1); + conversationalService2.incrementCount(); + + // stick in a call to the first reference to + // make sure the two references don't clash + conversationalService.initializeCount(1); + + clientCount = conversationalService2.retrieveCount(); + conversationalService2.endConversation(); + + // end the conversation through the first reference + conversationalService.endConversation(); + + return clientCount; + } + public int runConversationFromServiceReference(){ + calls.append("runConversationFromServiceReference,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + // serviceReference.getConversation().end(); + + return clientCount; + } + public int runConversationWithUserDefinedConversationId(){ + calls.append("runConversationWithUserDefinedConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation1"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + // serviceReference.getConversation().end(); + + return clientCount; + } + public String runConversationCheckUserDefinedConversationId(){ + calls.append("runConversationCheckUserDefinedConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation2"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + + String clientConversationId = serviceReference.getConversationID().toString(); + String serverConfersationId = callableReference.endConversation(); + + if (clientConversationId.equals("MyConversation2") && + serverConfersationId.equals("MyConversation2") ) { + return clientConversationId; + } else { + return "client = " + clientConversationId + + "server = " + serverConfersationId; + } + } + public int runConversationCheckingScope(){ + calls.append("runConversationCheckingScope,"); + // run a conversation + return runConversationFromInjectedReference(); + + // test will then use a static method to find out how many times + // init/destroy were called + } + public int runConversationWithCallback(){ + calls.append("runConversationWithCallback,"); + conversationalService.initializeCountCallback(1); + conversationalService.incrementCountCallback(); + clientCount = conversationalService.retrieveCountCallback(); + conversationalService.endConversationCallback(); + + return clientCount; + } + + public int runConversationHavingPassedReference(){ + calls.append("runConversationHavingPassedReference,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + conversationalReferenceClient.incrementCount(serviceReference); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + serviceReference.getConversation().end(); + + return clientCount; + } + + public String runConversationBusinessException(){ + calls.append("runConversationbusinessException,"); + try { + conversationalService.initializeCount(1); + conversationalService.businessException(); + clientCount = conversationalService.retrieveCount(); + conversationalService.endConversation(); + } catch(Exception ex) { + return ex.getMessage(); + } + + return "No Exception Returned"; + } + + public String runConversationBusinessExceptionCallback(){ + calls.append("runConversationbusinessExceptionCallback,"); + try { + conversationalService.initializeCountCallback(1); + conversationalService.businessExceptionCallback(); + clientCount = conversationalService.retrieveCountCallback(); + conversationalService.endConversationCallback(); + } catch(Exception ex) { + return ex.getMessage(); + } + + return "No Exception Returned"; + } + + public int runConversationCallingEndedConversation(){ + calls.append("runConversationCallingEndedConversation,"); + conversationalService.initializeCount(1); + conversationalService.endConversation(); + return conversationalService.retrieveCount(); + } + + public int runConversationCallingEndedConversationCallback(){ + calls.append("runConversationCallingEndedConversationCallback,"); + conversationalService.initializeCountCallback(1); + conversationalService.endConversationCallback(); + return conversationalService.retrieveCountCallback(); + } + + public String runConversationCallingEndedConversationCheckConversationId(){ + calls.append("runConversationCallingEndedConversationCheckConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation3"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversation(); + + if (serviceReference.getConversation() ==null ) { + return null; + } else { + return serviceReference.getConversation().getConversationID().toString(); + } + } + + public String runConversationCallingEndedConversationCallbackCheckConversationId(){ + calls.append("runConversationCallingEndedConversationCallbackCheckConversationId,"); + ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, + "conversationalService"); + serviceReference.setConversationID("MyConversation3"); + + ConversationalService callableReference = serviceReference.getService(); + + callableReference.initializeCount(1); + callableReference.incrementCount(); + clientCount = callableReference.retrieveCount(); + callableReference.endConversationCallback(); + + if (serviceReference.getConversation() ==null ) { + return null; + } else { + return serviceReference.getConversation().getConversationID().toString(); + } + } + + public int runConversationAgeTimeout(){ + calls.append("runConversationAgeTimeout,"); + // done in other testing + return clientCount; + } + public int runConversationIdleTimeout(){ + calls.append("runConversationIdleTimeout,"); + // done in other testing + return clientCount; + } + public int runConversationPrincipleError(){ + calls.append("runConversationPrincipleError,"); + // TODO - when policy framework is done + return clientCount; + } + + + // From ConversationalCallback + @Init + public void init(){ + calls.append("init,"); + + } + + @Destroy + public void destroy(){ + calls.append("destroy,"); + + } + + public void initializeCount(int count){ + calls.append("initializeCount,"); + callbackCount = 0; + } + + public void incrementCount(){ + calls.append("incrementCount,"); + callbackCount++; + } + + public int retrieveCount(){ + calls.append("retrieveCount,"); + return callbackCount; + } + + public void businessException() throws Exception { + throw new Exception("Business Exception"); + } + + public String endConversation(){ + calls.append("endConversation,"); + callbackCount = 0; + return null; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalReferenceClientImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalReferenceClientImpl.java new file mode 100644 index 0000000000..9895032f53 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalReferenceClientImpl.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 org.apache.tuscany.sca.itest.conversational.impl; + +import org.apache.tuscany.sca.itest.conversational.ConversationalReferenceClient; +import org.apache.tuscany.sca.itest.conversational.ConversationalService; +import org.osoa.sca.CallableReference; +import org.osoa.sca.annotations.Service; + +/** + * A client component that accepts a reference to an ongoing conversation + * and takes part in that conversation + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ + +@Service(interfaces={ConversationalReferenceClient.class}) +public class ConversationalReferenceClientImpl implements ConversationalReferenceClient{ + + public void incrementCount(CallableReference conversationalService){ + ConversationalService callableReference = conversationalService.getService(); + + callableReference.incrementCount(); + } + + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceRequestImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceRequestImpl.java new file mode 100644 index 0000000000..c05124e441 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceRequestImpl.java @@ -0,0 +1,123 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational.impl; + +import java.util.HashMap; + +import org.apache.tuscany.sca.itest.conversational.ConversationalCallback; +import org.apache.tuscany.sca.itest.conversational.ConversationalService; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.ConversationID; +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + + +/** + * The service used when testing stateful conversations + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ +@Service(ConversationalService.class) +@Scope("REQUEST") +public class ConversationalServiceRequestImpl implements ConversationalService { + + @ConversationID + protected String conversationId; + + @Callback + protected ConversationalCallback conversationalCallback; + + // static area in which to hold conversational data + private static HashMap conversationalState = new HashMap(); + + // a static member variable that records the number of times this service is called + public static StringBuffer calls = new StringBuffer(); + + @Init + public void init(){ + calls.append("init,"); + } + + @Destroy + public void destroy(){ + calls.append("destroy,"); + } + + public void initializeCount(int count){ + calls.append("initializeCount,"); + Integer conversationalCount = new Integer(count); + conversationalState.put(conversationId, conversationalCount); + } + + public void incrementCount(){ + calls.append("incrementCount,"); + Integer conversationalCount = conversationalState.get(conversationId); + conversationalCount++; + conversationalState.put(conversationId, conversationalCount); + } + + public int retrieveCount(){ + calls.append("retrieveCount,"); + Integer count = conversationalState.get(conversationId); + if (count != null){ + return count.intValue(); + } else { + return -999; + } + } + + public void businessException() throws Exception { + throw new Exception("Business Exception"); + } + + public void initializeCountCallback(int count){ + calls.append("initializeCountCallback,"); + initializeCount(count); + conversationalCallback.initializeCount(count); + } + + public void incrementCountCallback(){ + calls.append("incrementCountCallback,"); + incrementCount(); + conversationalCallback.incrementCount(); + } + + public int retrieveCountCallback(){ + calls.append("retrieveCountCallback,"); + return conversationalCallback.retrieveCount(); + } + + public void businessExceptionCallback() throws Exception { + calls.append("businessExceptionCallback,"); + conversationalCallback.businessException(); + } + + public String endConversation(){ + calls.append("endConversation,"); + conversationalState.remove(conversationId); + return conversationId; + } + + public String endConversationCallback(){ + calls.append("endConversationCallback,"); + return conversationalCallback.endConversation(); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulImpl.java new file mode 100644 index 0000000000..1317219ff7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulImpl.java @@ -0,0 +1,117 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational.impl; + +import org.apache.tuscany.sca.itest.conversational.ConversationalCallback; +import org.apache.tuscany.sca.itest.conversational.ConversationalService; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.ConversationAttributes; +import org.osoa.sca.annotations.ConversationID; +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + + +/** + * The service used when testing stateful conversations + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ +@Service(ConversationalService.class) +@Scope("CONVERSATION") +@ConversationAttributes(maxAge="10 minutes", + maxIdleTime="5 minutes", + singlePrincipal=false) +public class ConversationalServiceStatefulImpl implements ConversationalService { + + @ConversationID + protected String conversationId; + + @Callback + protected ConversationalCallback conversationalCallback; + + // local count - accumulates during the conversation + private int count = 0; + + // a static member variable that records the number of times this service is called + public static StringBuffer calls = new StringBuffer(); + + @Init + public void init(){ + calls.append("init,"); + } + + @Destroy + public void destroy(){ + calls.append("destroy,"); + } + + public void initializeCount(int count){ + calls.append("initializeCount,"); + this.count = count; + } + + public void incrementCount(){ + calls.append("incrementCount,"); + count++; + } + + public int retrieveCount(){ + calls.append("retrieveCount,"); + return count; + } + + public void businessException() throws Exception { + throw new Exception("Business Exception"); + } + + public void initializeCountCallback(int count){ + calls.append("initializeCountCallback,"); + this.count = count; + conversationalCallback.initializeCount(count); + } + + public void incrementCountCallback(){ + calls.append("incrementCountCallback,"); + count++; + conversationalCallback.incrementCount(); + } + + public int retrieveCountCallback(){ + calls.append("retrieveCountCallback,"); + return conversationalCallback.retrieveCount(); + } + + public void businessExceptionCallback() throws Exception { + calls.append("businessExceptionCallback,"); + conversationalCallback.businessException(); + } + + public String endConversation(){ + calls.append("endConversation,"); + count = 0; + return conversationId; + } + + public String endConversationCallback(){ + calls.append("endConversationCallback,"); + return conversationalCallback.endConversation(); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulNonConversationalCallbackImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulNonConversationalCallbackImpl.java new file mode 100644 index 0000000000..a547d2cb40 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulNonConversationalCallbackImpl.java @@ -0,0 +1,117 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational.impl; + +import org.apache.tuscany.sca.itest.conversational.ConversationalServiceNonConversationalCallback; +import org.apache.tuscany.sca.itest.conversational.NonConversationalCallback; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.ConversationAttributes; +import org.osoa.sca.annotations.ConversationID; +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + + +/** + * The service used when testing stateful conversations + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ +@Service(ConversationalServiceNonConversationalCallback.class) +@Scope("CONVERSATION") +@ConversationAttributes(maxAge="10 minutes", + maxIdleTime="5 minutes", + singlePrincipal=false) +public class ConversationalServiceStatefulNonConversationalCallbackImpl implements ConversationalServiceNonConversationalCallback { + + @ConversationID + protected String conversationId; + + @Callback + protected NonConversationalCallback nonConversationalCallback; + + // local count - accumulates during the conversation + private int count = 0; + + // a static member variable that records the number of times this service is called + public static StringBuffer calls = new StringBuffer(); + + @Init + public void init(){ + calls.append("init,"); + } + + @Destroy + public void destroy(){ + calls.append("destroy,"); + } + + public void initializeCount(int count){ + calls.append("initializeCount,"); + this.count = count; + } + + public void incrementCount(){ + calls.append("incrementCount,"); + count++; + } + + public int retrieveCount(){ + calls.append("retrieveCount,"); + return count; + } + + public void businessException() throws Exception { + throw new Exception("Business Exception"); + } + + public void initializeCountCallback(int count){ + calls.append("initializeCountCallback,"); + this.count = count; + nonConversationalCallback.initializeCount(count); + } + + public void incrementCountCallback(){ + calls.append("incrementCountCallback,"); + count++; + nonConversationalCallback.incrementCount(); + } + + public int retrieveCountCallback(){ + calls.append("retrieveCountCallback,"); + return nonConversationalCallback.retrieveCount(); + } + + public void businessExceptionCallback() throws Exception { + calls.append("businessExceptionCallback,"); + nonConversationalCallback.businessException(); + } + + public String endConversation(){ + calls.append("endConversation,"); + count = 0; + return conversationId; + } + + public String endConversationCallback(){ + calls.append("endConversationCallback,"); + return nonConversationalCallback.endConversation(); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessImpl.java new file mode 100644 index 0000000000..b869c9f1e1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessImpl.java @@ -0,0 +1,123 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational.impl; + +import java.util.HashMap; + +import org.apache.tuscany.sca.itest.conversational.ConversationalCallback; +import org.apache.tuscany.sca.itest.conversational.ConversationalService; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.ConversationID; +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + + +/** + * The service used when testing stateful conversations + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ +@Service(ConversationalService.class) +@Scope("STATELESS") +public class ConversationalServiceStatelessImpl implements ConversationalService { + + @ConversationID + protected String conversationId; + + @Callback + protected ConversationalCallback conversationalCallback; + + // static area in which to hold conversational data + private static HashMap conversationalState = new HashMap(); + + // a static member variable that records the number of times this service is called + public static StringBuffer calls = new StringBuffer(); + + @Init + public void init(){ + calls.append("init,"); + } + + @Destroy + public void destroy(){ + calls.append("destroy,"); + } + + public void initializeCount(int count){ + calls.append("initializeCount,"); + Integer conversationalCount = new Integer(count); + conversationalState.put(conversationId, conversationalCount); + } + + public void incrementCount(){ + calls.append("incrementCount,"); + Integer conversationalCount = conversationalState.get(conversationId); + conversationalCount++; + conversationalState.put(conversationId, conversationalCount); + } + + public int retrieveCount(){ + calls.append("retrieveCount,"); + Integer count = conversationalState.get(conversationId); + if (count != null){ + return count.intValue(); + } else { + return -999; + } + } + + public void businessException() throws Exception { + throw new Exception("Business Exception"); + } + + public void initializeCountCallback(int count){ + calls.append("initializeCountCallback,"); + initializeCount(count); + conversationalCallback.initializeCount(count); + } + + public void incrementCountCallback(){ + calls.append("incrementCountCallback,"); + incrementCount(); + conversationalCallback.incrementCount(); + } + + public int retrieveCountCallback(){ + calls.append("retrieveCountCallback,"); + return conversationalCallback.retrieveCount(); + } + + public void businessExceptionCallback() throws Exception { + calls.append("businessExceptionCallback,"); + conversationalCallback.businessException(); + } + + public String endConversation(){ + calls.append("endConversation,"); + conversationalState.remove(conversationId); + return conversationId; + } + + public String endConversationCallback(){ + calls.append("endConversationCallback,"); + return conversationalCallback.endConversation(); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessScopeImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessScopeImpl.java new file mode 100644 index 0000000000..205723315d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessScopeImpl.java @@ -0,0 +1,93 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational.impl; + +import java.util.HashMap; +import java.util.Map; + +import org.apache.tuscany.sca.itest.conversational.ConversationalService; +import org.osoa.sca.annotations.ConversationID; +import org.osoa.sca.annotations.Service; + +@Service(ConversationalService.class) +public class ConversationalServiceStatelessScopeImpl implements ConversationalService { + + @ConversationID + protected String cid; + + static Map state = new HashMap(); + + public void destroy() { + // TODO Auto-generated method stub + + } + + public String endConversation() { + state.remove(cid); + return cid; + } + + public String endConversationCallback() { + // TODO Auto-generated method stub + return null; + + } + + public void incrementCount() { + state.put(cid, Integer.valueOf(state.get(cid)+1)); + } + + public void businessException() throws Exception { + throw new Exception("Business Exception"); + } + + public void incrementCountCallback() { + // TODO Auto-generated method stub + + } + + public void init() { + // TODO Auto-generated method stub + + } + + public void initializeCount(int count) { + state.put(cid, Integer.valueOf(count)); + } + + public void initializeCountCallback(int count) { + // TODO Auto-generated method stub + + } + + public void businessExceptionCallback() throws Exception { + throw new Exception("Business Exception"); + } + + public int retrieveCount() { + return state.get(cid); + } + + public int retrieveCountCallback() { + // TODO Auto-generated method stub + return 0; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/DServiceImpl.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/DServiceImpl.java new file mode 100644 index 0000000000..8d79bb75e8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/DServiceImpl.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 org.apache.tuscany.sca.itest.conversational.impl; + + +import org.apache.tuscany.sca.itest.conversational.Constants; +import org.apache.tuscany.sca.itest.conversational.DService; +import org.osoa.sca.annotations.ConversationID; +import org.osoa.sca.annotations.EndsConversation; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +/** + * Simple conversational Service + */ +@Service(DService.class) +@Scope("CONVERSATION") +public class DServiceImpl implements DService { + + /** + * The state for this service + */ + private String state = "Initial state value"; + + /** + * Returns the state for this service. + * + * @return The state for this service + */ + public String getState() { + return state; + } + + /** + * Sets the state for this service. + * + * @param aState The state for this service + */ + public void setState(String aState) { + this.state = aState; + } + + /** + * Sets the conversation ID for this service + * @param id The Conversation ID + */ + @ConversationID + public void setConversationID(String id) { + System.out.println ("Setting conversation ID at service = " + id ); + } + + public void endConversationViaAnnotatedMethod() { + System.out.println ("Annotated Ends Conversation"); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/resources/ConversationAge.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/resources/ConversationAge.composite new file mode 100644 index 0000000000..abd1c35ced --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/resources/ConversationAge.composite @@ -0,0 +1,31 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/resources/conversationId.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/resources/conversationId.composite new file mode 100644 index 0000000000..e61eb08194 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/resources/conversationId.composite @@ -0,0 +1,27 @@ + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/resources/conversationLifetime.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/resources/conversationLifetime.composite new file mode 100644 index 0000000000..3b79dc43d9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/resources/conversationLifetime.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/resources/conversational.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/resources/conversational.composite new file mode 100644 index 0000000000..4da3ce74d5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/main/resources/conversational.composite @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationIdTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationIdTestCase.java new file mode 100644 index 0000000000..3e750bdd1e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationIdTestCase.java @@ -0,0 +1,54 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational; + + +import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +public class ConversationIdTestCase { + + private SCADomain domain; + + @Before + public void setUp() throws Exception { + domain = SCADomain.newInstance("conversationId.composite"); + + } + + @After + public void tearDown() throws Exception { + if (domain != null) { + domain.close(); + } + } + + @Test + public void testConversationId() { + ConversationIdService service = + domain.getService(ConversationIdService.class, "ConversationIdComponent"); + Assert.assertNotNull(service.getCIDField()); + Assert.assertNotNull(service.getCIDSetter()); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationLifetimeTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationLifetimeTestCase.java new file mode 100644 index 0000000000..fffd146c38 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationLifetimeTestCase.java @@ -0,0 +1,204 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational; + +import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; + +public class ConversationLifetimeTestCase { + + private SCADomain domain; + + @Before + public void setUp() throws Exception { + domain = SCADomain.newInstance("conversationLifetime.composite"); + } + + @After + public void tearDown() throws Exception { + if (domain != null) { + domain.close(); + } + } + + /** + * Following a clarification re. the wording of the Java Common Annotations and APIs 1.00 Specification + * (see TUSCANY-2055) the following is accepted to be the intended operation + * + * Whether the conversation ID is chosen by the user or is generated by the system, the client + * may access the conversation ID by calling getConversationID() on the current conversation object. + * + * ServiceReference.getConversationID() - Returns the id supplied by the user that will be associated with + * future conversations initiated through this reference, or null if no ID has been set by the user. + * + * ServiceReference.setConversationID(Object conversationId) - Set an ID, supplied by the user, to associate with any future conversation + * started through this reference. If the value supplied is null then the id will be generated + * by the implementation. Throws an IllegalStateException if a conversation is currently + * associated with this reference. + * + */ + + /** + * Verify that ServiceReference.getConversationID() returns null before a conversation + * ID has been set manually. + */ + @Test + public void getConversationID() { + CService service = domain.getService(CService.class, "ConversationalCComponent"); + service.getState(); + Assert.assertNull(service.getConversationID()); + } + + /** + * Verify that ServiceReference.getConversationID() returns any value previous set through the + * setConversationID() api. + */ + @Test + public void getConversationID2() { + String userProvidedID = "A conversation ID"; + CService service = domain.getService(CService.class, "ConversationalCComponent"); + service.setConversationID(userProvidedID); + service.getState(); + Assert.assertEquals(service.getConversationID(), userProvidedID); + } + + /** + * Whether the conversation ID is chosen by the user or is generated by the system, the client + * may access the conversation ID by calling getConversationID() on the current conversation object. + * Here test the manually set conversationID + */ + @Test + public void getConversationID3() { + String userProvidedID = "A conversation ID"; + CService service = domain.getService(CService.class, "ConversationalCComponent"); + service.setConversationID(userProvidedID); + service.getState(); + Assert.assertEquals(service.getConversationObjectConversationId(), userProvidedID); + } + + /** + * Whether the conversation ID is chosen by the user or is generated by the system, the client + * may access the conversation ID by calling getConversationID() on the current conversation object. + * Here test the auto generated conversationId + */ + @Test + public void getConversationID4() { + CService service = domain.getService(CService.class, "ConversationalCComponent"); + service.getState(); + Assert.assertNotNull(service.getConversationObjectConversationId()); + } + + /** + * Java Common Annotations and APIs 1.00 Specification line 494-495 Verify: + * If a method is invoked on a service reference after an + * "@EndsConversation" method has been called then a new conversation will + * automatically be started. + */ + @Test + public void implicitStartNewConversationAfterEnd() { + CService service = domain.getService(CService.class, "ConversationalCComponent"); + service.getState(); + Object firstID = service.getConversationObjectConversationId(); + service.endConversationViaAnnotatedMethod(); + service.getState(); + Assert.assertNotSame(firstID, service.getConversationObjectConversationId()); + } + + /** + * Java Common Annotations and APIs 1.00 Spec line 495-495 Verify: If a + * method is invoked on a service reference after an "@EndsConversation" + * method has been called then a new conversation will automatically be + * started. Note: Uses Conversation.end() rather than "@EndsConversation" + */ + @Test + public void implicitStartNewConversationAfterEnd2() { + CService service = domain.getService(CService.class, "ConversationalCComponent"); + service.getState(); + Object firstID = service.getConversationObjectConversationId(); + service.endConversation(); + service.getState(); + Assert.assertNotSame(firstID, service.getConversationObjectConversationId()); + } + + /** + * Java Common Annotations and APIs 1.00 Specification line 495-497 Verify: + * If ServiceReference.getConversationID() is called after the + * "@EndsConversation" method is called, but before the next conversation + * has been started, it will return null. + */ + @Test + public void nullConversationIDAfterEndConversation() { + CService service = domain.getService(CService.class, "ConversationalCComponent"); + service.getState(); + service.endConversationViaAnnotatedMethod(); + Assert.assertNull(service.getConversationObjectConversationId()); + } + + /** + * Java Common Annotations and APIs 1.00 Specification line 495-497 Verify: + * If ServiceReference.getConversationID() is called after the + * "@EndsConversation" method is called, but before the next conversation + * has been started, it will return null. Note: Uses explicit set of Conversation ID + */ + @Test + public void nullConversationIDAfterEndConversation1a() { + CService service = domain.getService(CService.class, "ConversationalCComponent"); + service.setConversationID("User provided ID"); + service.getState(); + service.endConversationViaAnnotatedMethod(); + Assert.assertNull(service.getConversationObjectConversationId()); + } + + /** + * Java Common Annotations and APIs 1.00 Spec line 495-497 Verify: If + * ServiceReference.getConversationID() is called after the + * "@EndsConversationmethod" is called, but before the next conversation has + * been started, it will return null. Note: Uses Conversation.end() rather + * than "@EndsConversation" + */ + @Test + public void nullConversationIDAfterEndConversation2() { + CService service = domain.getService(CService.class, "ConversationalCComponent"); + service.getState(); + service.endConversation(); + Assert.assertNull(service.getConversationObjectConversationId()); + } + + /** + * Java Common Annotations and APIs 1.00 Spec line 495-497 Verify: If + * ServiceReference.getConversationID() is called after the + * "@EndsConversationmethod" is called, but before the next conversation has + * been started, it will return null. Note: Uses Conversation.end() rather + * than "@EndsConversation". Note 2: Uses explicit set of Conversation ID + */ + @Test + public void nullConversationIDAfterEndConversation2a() { + CService service = domain.getService(CService.class, "ConversationalCComponent"); + service.setConversationID("User provided ID"); + service.getState(); + service.endConversation(); + Assert.assertNull(service.getConversationObjectConversationId()); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalAgeTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalAgeTestCase.java new file mode 100644 index 0000000000..cc31c77873 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalAgeTestCase.java @@ -0,0 +1,103 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational; + +import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.osoa.sca.ConversationEndedException; + +public class ConversationalAgeTestCase { + + private SCADomain domain; + + @Before + public void setUp() throws Exception { + System.setProperty("org.apache.tuscany.sca.core.scope.ConversationalScopeContainer.ReaperInterval", "2"); + domain = SCADomain.newInstance("ConversationAge.composite"); + + } + + @After + public void tearDown() throws Exception { + System.clearProperty("org.apache.tuscany.sca.core.scope.ConversationalScopeContainer.ReaperInterval"); + if (domain != null) { + domain.close(); + } + } + + @Test + public void testMaxAge() throws InterruptedException { + + ConversationalService conversationalService = + domain.getService(ConversationalService.class, "ConversationAgeComponent"); + + Assert.assertEquals(0, conversationalService.retrieveCount()); + conversationalService.initializeCount(42); + Assert.assertEquals(42, conversationalService.retrieveCount()); + Assert.assertEquals(42, conversationalService.retrieveCount()); + Thread.sleep(500); + try { + Assert.assertEquals(42, conversationalService.retrieveCount()); + } catch (ConversationEndedException e) { + Assert.fail(); + } + } + + @Test + public void testAgeExpired() throws InterruptedException { + + ConversationalService conversationalService = + domain.getService(ConversationalService.class, "ConversationAgeComponent"); + + Assert.assertEquals(0, conversationalService.retrieveCount()); + conversationalService.initializeCount(42); + Assert.assertEquals(42, conversationalService.retrieveCount()); + Assert.assertEquals(42, conversationalService.retrieveCount()); + Thread.sleep(1100); + try { + Assert.assertEquals(0, conversationalService.retrieveCount()); + Assert.fail(); + } catch (ConversationEndedException e) { + // expected + } + } + + @Test + public void testMaxIdle() throws InterruptedException { + + ConversationalService conversationalService = + domain.getService(ConversationalService.class, "ConversationIdleComponent"); + + Assert.assertEquals(0, conversationalService.retrieveCount()); + conversationalService.initializeCount(42); + Assert.assertEquals(42, conversationalService.retrieveCount()); + Assert.assertEquals(42, conversationalService.retrieveCount()); + Thread.sleep(1100); + try { + Assert.assertEquals(0, conversationalService.retrieveCount()); + } catch (ConversationEndedException e) { + // expected + } + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalJ2SETestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalJ2SETestCase.java new file mode 100644 index 0000000000..8480e04028 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalJ2SETestCase.java @@ -0,0 +1,84 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational; + +import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +public class ConversationalJ2SETestCase { + + private SCADomain domain; + + @Before + public void setUp() throws Exception { + domain = SCADomain.newInstance("conversational.composite"); + + } + + @After + public void tearDown() throws Exception { + if (domain != null) { + domain.close(); + } + } + + @Test + public void testStatefulConversation() { + ConversationalService conversationalService = + domain.getService(ConversationalService.class, "ConversationalServiceStateful"); + + conversationalService.initializeCount(1); + Assert.assertEquals(1, conversationalService.retrieveCount()); + conversationalService.incrementCount(); + Assert.assertEquals(2, conversationalService.retrieveCount()); + conversationalService.endConversation(); + + Assert.assertEquals(0, conversationalService.retrieveCount()); + + conversationalService.initializeCount(4); + Assert.assertEquals(4, conversationalService.retrieveCount()); + conversationalService.incrementCount(); + Assert.assertEquals(5, conversationalService.retrieveCount()); + conversationalService.endConversation(); + + } + + @Test + public void testStatelessConversation() { + ConversationalService conversationalService = + domain.getService(ConversationalService.class, "ConversationalServiceStateless"); + + conversationalService.initializeCount(1); + Assert.assertEquals(1, conversationalService.retrieveCount()); + conversationalService.incrementCount(); + Assert.assertEquals(2, conversationalService.retrieveCount()); + conversationalService.endConversation(); + + conversationalService.initializeCount(4); + Assert.assertEquals(4, conversationalService.retrieveCount()); + conversationalService.incrementCount(); + Assert.assertEquals(5, conversationalService.retrieveCount()); + conversationalService.endConversation(); + + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalTestCase.java new file mode 100644 index 0000000000..37fd352325 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalTestCase.java @@ -0,0 +1,651 @@ +/* + * 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 org.apache.tuscany.sca.itest.conversational; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulNonConversationalCallbackImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatelessImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceRequestImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulNonConversationalCallbackImpl; +import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatelessImpl; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class ConversationalTestCase { + + private static SCADomain domain; + private static ConversationalClient conversationalStatelessClientStatelessService; + private static ConversationalClient conversationalStatelessClientStatefulService; + private static ConversationalClient conversationalStatefulClientStatelessService; + private static ConversationalClient conversationalStatefulClientStatefulService; + private static ConversationalClient conversationalStatelessClientRequestService; + private static ConversationalClient conversationalStatefulClientNonConversationalCallbackStatelessService; + + @BeforeClass + public static void setUp() throws Exception { + try { + domain = SCADomain.newInstance("conversational.composite"); + + conversationalStatelessClientStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientStatelessService"); + + conversationalStatelessClientStatefulService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientStatefulService"); + + conversationalStatefulClientStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientStatelessService"); + + conversationalStatefulClientStatefulService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientStatefulService"); + conversationalStatelessClientRequestService = domain.getService(ConversationalClient.class, + "ConversationalStatelessClientRequestService"); + conversationalStatefulClientNonConversationalCallbackStatelessService = domain.getService(ConversationalClient.class, + "ConversationalStatefulClientNonConversationalCallbackStatefulService"); + + } catch(Exception ex) { + System.err.println(ex.toString()); + } + + } + + @AfterClass + public static void tearDown() throws Exception { + domain.close(); + } + + private void resetCallStack() { + + // reset the place where we record the sequence of calls passing + // through each component instance + ConversationalServiceStatelessImpl.calls = new StringBuffer(); + ConversationalServiceStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatelessImpl.calls = new StringBuffer(); + ConversationalClientStatefulImpl.calls = new StringBuffer(); + ConversationalClientStatefulNonConversationalCallbackImpl.calls = new StringBuffer(); + ConversationalServiceStatefulNonConversationalCallbackImpl.calls = new StringBuffer(); + + } + + // stateless client stateful service tests + // ======================================= + @Test + public void testStatelessStatefulConversationFromInjectedReference() { + int count = conversationalStatelessClientStatefulService.runConversationFromInjectedReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessStatefulConversationFromInjectedReference2() { + int count = conversationalStatelessClientStatefulService.runConversationFromInjectedReference2(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessStatefulConversationFromServiceReference() { + int count = conversationalStatelessClientStatefulService.runConversationFromServiceReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessStatefulConversationWithUserDefinedConversationId() { + int count = conversationalStatelessClientStatefulService.runConversationWithUserDefinedConversationId(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessStatefulConversationCheckUserDefinedConversationId() { + String conversationId = conversationalStatelessClientStatefulService.runConversationCheckUserDefinedConversationId(); + Assert.assertEquals("MyConversation2", conversationId); + } + + @Test + public void testStatelessStatefulConversationCheckingScope() { + resetCallStack(); + conversationalStatelessClientStatefulService.runConversationCheckingScope(); + Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,destroy,", + ConversationalServiceStatefulImpl.calls.toString()); + } + + @Test + public void testStatelessStatefulConversationWithCallback() { + resetCallStack(); + int count = conversationalStatelessClientStatefulService.runConversationWithCallback(); + Assert.assertEquals(0, count); + + Assert.assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,destroy,", + ConversationalClientStatelessImpl.calls.toString()); + } + + //@Test + public void testStatelessStatefulConversationHavingPassedReference() { + int count = conversationalStatelessClientStatefulService.runConversationHavingPassedReference(); + Assert.assertEquals(3, count); + } + + @Test + public void testStatelessStatefulConversationBusinessException() { + String message = conversationalStatelessClientStatefulService.runConversationBusinessException(); + Assert.assertEquals("Business Exception", message); + } + + @Test + public void testStatelessStatefulConversationBusinessExceptionCallback() { + String message = conversationalStatelessClientStatefulService.runConversationBusinessExceptionCallback(); + Assert.assertEquals("Business Exception", message); + } + + @Test + public void testStatelessStatefulConversationCallingEndedConversation() { + int count = conversationalStatelessClientStatefulService.runConversationCallingEndedConversation(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatelessStatefulConversationCallingEndedConversationCallback() { + int count = conversationalStatelessClientStatefulService.runConversationCallingEndedConversationCallback(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatelessStatefulConversationCallingEndedConversationCheckConversationId() { + String id = conversationalStatelessClientStatefulService.runConversationCallingEndedConversationCheckConversationId(); + Assert.assertEquals(null, id); + } + + //@Test + public void testStatelessStatefulConversationCallingEndedConversationCallbackCheckConversationId() { + String id = conversationalStatelessClientStatefulService.runConversationCallingEndedConversationCallbackCheckConversationId(); + Assert.assertEquals(null, id); + } + + // stateless client stateless service tests + // ======================================== + @Test + public void testStatelessStatelessConversationFromInjectedReference() { + int count = conversationalStatelessClientStatelessService.runConversationFromInjectedReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessStatelessConversationFromInjectedReference2() { + int count = conversationalStatelessClientStatelessService.runConversationFromInjectedReference2(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessStatelessConversationFromServiceReference() { + int count = conversationalStatelessClientStatelessService.runConversationFromServiceReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessStatelessConversationWithUserDefinedConversationId() { + int count = conversationalStatelessClientStatelessService.runConversationWithUserDefinedConversationId(); + Assert.assertEquals(2, count); + } + @Test + public void testStatelessStatelessConversationCheckUserDefinedConversationId() { + String conversationId = conversationalStatelessClientStatelessService.runConversationCheckUserDefinedConversationId(); + Assert.assertEquals("MyConversation2", conversationId); + } + + @Test + public void testStatelessStatelessConversationCheckingScope() { + resetCallStack(); + conversationalStatelessClientStatelessService.runConversationCheckingScope(); + Assert.assertEquals("init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,", + ConversationalServiceStatelessImpl.calls.toString()); + } + + @Test + public void testStatelessStatelessConversationWithCallback() { + resetCallStack(); + int count = conversationalStatelessClientStatelessService.runConversationWithCallback(); + Assert.assertEquals(0, count); + + Assert.assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,destroy,", + ConversationalClientStatelessImpl.calls.toString()); + } + //@Test + public void testStatelessStatelessConversationHavingPassedReference() { + int count = conversationalStatelessClientStatelessService.runConversationHavingPassedReference(); + Assert.assertEquals(3, count); + } + + @Test + public void testStatelessStatelessConversationCallingEndedConversation() { + int count = conversationalStatelessClientStatelessService.runConversationCallingEndedConversation(); + Assert.assertEquals(-999, count); + } + + @Test + public void testStatelessStatelessConversationCallingEndedConversationCallback() { + int count = conversationalStatelessClientStatelessService.runConversationCallingEndedConversationCallback(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatelessStatelessConversationCallingEndedConversationCheckConversationId() { + String id = conversationalStatelessClientStatelessService.runConversationCallingEndedConversationCheckConversationId(); + Assert.assertEquals(null, id); + } + + //@Test + public void testStatelessStatelessConversationCallingEndedConversationCallbackCheckConversationId() { + String id = conversationalStatelessClientStatelessService.runConversationCallingEndedConversationCallbackCheckConversationId(); + Assert.assertEquals(null, id); + } + + // stateful client stateful service tests + // ====================================== + @Test + public void testStatefulStatefulConversationFromInjectedReference() { + int count = conversationalStatefulClientStatefulService.runConversationFromInjectedReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatefulConversationFromInjectedReference2() { + int count = conversationalStatefulClientStatefulService.runConversationFromInjectedReference2(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatefulConversationFromServiceReference() { + int count = conversationalStatefulClientStatefulService.runConversationFromServiceReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatefulConversationWithUserDefinedConversationId() { + int count = conversationalStatefulClientStatefulService.runConversationWithUserDefinedConversationId(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatefulConversationCheckUserDefinedConversationId() { + String conversationId = conversationalStatefulClientStatefulService.runConversationCheckUserDefinedConversationId(); + Assert.assertEquals("MyConversation2", conversationId); + } + + @Test + public void testStatefulStatefulConversationCheckingScope() { + resetCallStack(); + conversationalStatefulClientStatefulService.runConversationCheckingScope(); + Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,destroy,", + ConversationalServiceStatefulImpl.calls.toString()); + } + + @Test + public void testStatefulStatefulConversationWithCallback() { + resetCallStack(); + int count = conversationalStatefulClientStatefulService.runConversationWithCallback(); + Assert.assertEquals(4, count); + + Assert.assertEquals("init,runConversationWithCallback,initializeCount,incrementCount,retrieveCount,endConversation,destroy,", + ConversationalClientStatefulImpl.calls.toString()); + } + + //@Test + public void testStatefulStatefulConversationHavingPassedReference() { + int count = conversationalStatefulClientStatefulService.runConversationHavingPassedReference(); + Assert.assertEquals(3, count); + } + + @Test + public void testStatefulStatefulConversationCallingEndedConversation() { + int count = conversationalStatefulClientStatefulService.runConversationCallingEndedConversation(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatefulStatefulConversationCallingEndedConversationCallback() { + int count = conversationalStatefulClientStatefulService.runConversationCallingEndedConversationCallback(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatefulStatefulConversationCallingEndedConversationCheckConversationId() { + String id = conversationalStatefulClientStatefulService.runConversationCallingEndedConversationCheckConversationId(); + Assert.assertEquals(null, id); + } + + @Test + public void testStatefulStatefulConversationCallingEndedConversationCallbackCheckConversationId() { + String id = conversationalStatefulClientStatefulService.runConversationCallingEndedConversationCallbackCheckConversationId(); + Assert.assertEquals(null, id); + } + + // stateful client stateless service tests + // ======================================= + @Test + public void testStatefulStatelessConversationFromInjectedReference() { + int count = conversationalStatefulClientStatelessService.runConversationFromInjectedReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatelessConversationFromInjectedReference2() { + int count = conversationalStatefulClientStatelessService.runConversationFromInjectedReference2(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatelessConversationFromServiceReference() { + int count = conversationalStatefulClientStatelessService.runConversationFromServiceReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatelessConversationWithUserDefinedConversationId() { + int count = conversationalStatefulClientStatelessService.runConversationWithUserDefinedConversationId(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulStatelessConversationCheckUserDefinedConversationId() { + String conversationId = conversationalStatefulClientStatelessService.runConversationCheckUserDefinedConversationId(); + Assert.assertEquals("MyConversation2", conversationId); + } + + @Test + public void testStatefulStatelessConversationCheckingScope() { + resetCallStack(); + conversationalStatefulClientStatelessService.runConversationCheckingScope(); + Assert.assertEquals("init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,", + ConversationalServiceStatelessImpl.calls.toString()); + } + + @Test + public void testStatefulStatelessConversationWithCallback() { + resetCallStack(); + int count = conversationalStatefulClientStatelessService.runConversationWithCallback(); + Assert.assertEquals(4, count); + + Assert.assertEquals("init,runConversationWithCallback,initializeCount,incrementCount,retrieveCount,endConversation,destroy,", + ConversationalClientStatefulImpl.calls.toString()); + } + + //@Test + public void testStatefulStatelessConversationHavingPassedReference() { + int count = conversationalStatefulClientStatelessService.runConversationHavingPassedReference(); + Assert.assertEquals(3, count); + } + + @Test + public void testStatefulStatelessConversationCallingEndedConversation() { + int count = conversationalStatefulClientStatelessService.runConversationCallingEndedConversation(); + Assert.assertEquals(-999, count); + } + + @Test + public void testStatefulStatelessConversationCallingEndedConversationCallback() { + int count = conversationalStatefulClientStatelessService.runConversationCallingEndedConversationCallback(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatefulStatelessConversationCallingEndedConversationCheckConversationId() { + String id = conversationalStatefulClientStatelessService.runConversationCallingEndedConversationCheckConversationId(); + Assert.assertEquals(null, id); + } + + @Test + public void testStatefulStatelessConversationCallingEndedConversationCallbackCheckConversationId() { + String id = conversationalStatefulClientStatelessService.runConversationCallingEndedConversationCallbackCheckConversationId(); + Assert.assertEquals(null, id); + } + + // stateless client request scope service tests + // ============================================ + @Test + public void testStatelessRequestConversationFromInjectedReference() { + int count = conversationalStatelessClientRequestService.runConversationFromInjectedReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessRequestConversationFromInjectedReference2() { + int count = conversationalStatelessClientRequestService.runConversationFromInjectedReference2(); + Assert.assertEquals(1, count); + } + + @Test + public void testStatelessRequestConversationFromServiceReference() { + int count = conversationalStatelessClientRequestService.runConversationFromServiceReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatelessRequestConversationWithUserDefinedConversationId() { + int count = conversationalStatelessClientRequestService.runConversationWithUserDefinedConversationId(); + Assert.assertEquals(2, count); + } + + //@Test + public void testStatelessRequestConversationCheckUserDefinedConversationId() { + String conversationId = conversationalStatelessClientRequestService.runConversationCheckUserDefinedConversationId(); + Assert.assertEquals("MyConversation2", conversationId); + } + + @Test + public void testStatelessRequestConversationCheckingScope() { + resetCallStack(); + ConversationalServiceRequestImpl.calls = new StringBuffer(); + conversationalStatelessClientRequestService.runConversationCheckingScope(); + Assert.assertEquals("initializeCount,incrementCount,retrieveCount,endConversation,", + ConversationalServiceRequestImpl.calls.toString()); + } + + @Test + public void testStatelessRequestConversationWithCallback() { + resetCallStack(); + ConversationalClientStatelessImpl.calls = new StringBuffer(); + int count = conversationalStatelessClientRequestService.runConversationWithCallback(); + Assert.assertEquals(0, count); + + Assert.assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,destroy,", + ConversationalClientStatelessImpl.calls.toString()); + } + + //@Test + public void testStatelessRequestConversationHavingPassedReference() { + int count = conversationalStatelessClientRequestService.runConversationHavingPassedReference(); + Assert.assertEquals(3, count); + } + + @Test + public void testStatelessRequestConversationBusinessException() { + String message = conversationalStatelessClientRequestService.runConversationBusinessException(); + Assert.assertEquals("Business Exception", message); + } + + @Test + public void testStatelessRequestConversationBusinessExceptionCallback() { + String message = conversationalStatelessClientRequestService.runConversationBusinessExceptionCallback(); + Assert.assertEquals("Business Exception", message); + } + + @Test + public void testStatelessRequestConversationCallingEndedConversation() { + int count = conversationalStatelessClientRequestService.runConversationCallingEndedConversation(); + Assert.assertEquals(-999, count); + } + + @Test + public void testStatelessRequestConversationCallingEndedConversationCallback() { + int count = conversationalStatelessClientRequestService.runConversationCallingEndedConversationCallback(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatelessRequestConversationCallingEndedConversationCheckConversationId() { + String id = conversationalStatelessClientRequestService.runConversationCallingEndedConversationCheckConversationId(); + Assert.assertEquals(null, id); + } + + //@Test + public void testStatelessRequestConversationCallingEndedConversationCallbackCheckConversationId() { + String id = conversationalStatelessClientRequestService.runConversationCallingEndedConversationCallbackCheckConversationId(); + Assert.assertEquals(null, id); + } + + // stateful client non conversational callback stateful service tests + // ================================================================== + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationFromInjectedReference() { + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationFromInjectedReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationFromInjectedReference2() { + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationFromInjectedReference2(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationFromServiceReference() { + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationFromServiceReference(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationWithUserDefinedConversationId() { + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationWithUserDefinedConversationId(); + Assert.assertEquals(2, count); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationCheckUserDefinedConversationId() { + String conversationId = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCheckUserDefinedConversationId(); + Assert.assertEquals("MyConversation2", conversationId); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationCheckingScope() { + resetCallStack(); + conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCheckingScope(); + Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,destroy,", + ConversationalServiceStatefulNonConversationalCallbackImpl.calls.toString()); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationWithCallback() { + resetCallStack(); + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationWithCallback(); + Assert.assertEquals(0, count); + + Assert.assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,", + ConversationalClientStatefulNonConversationalCallbackImpl.calls.toString()); + } + + //@Test + public void testStatefulNonConversationalCallbackStatefulConversationHavingPassedReference() { + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationHavingPassedReference(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationCallingEndedConversation() { + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCallingEndedConversation(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationCallingEndedConversationCallback() { + int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCallingEndedConversationCallback(); + Assert.assertEquals(0, count); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationCallingEndedConversationCheckConversationId() { + String id = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCallingEndedConversationCheckConversationId(); + Assert.assertEquals(null, id); + } + + @Test + public void testStatefulNonConversationalCallbackStatefulConversationCallingEndedConversationCallbackCheckConversationId() { + String id = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCallingEndedConversationCallbackCheckConversationId(); + Assert.assertEquals("MyConversation3", id); + } + + private static final String NEW_A_VALUE = "First Instance - TestCode Set state on A"; + private static final String NEW_B_VALUE = "First Instance - TestCode Set state on B"; + private static final String SECOND_NEW_A_VALUE = "Second Instance - TestCode Set state on A"; + private static final String SECOND_NEW_B_VALUE = "Second Instance - TestCode Set state on B"; + + @Test + public void testMultipleConversations() { + ////////// + // Tests on first instance + ////////// + System.out.println("========= First instance tests ========="); + AService aService = domain.getService(AService.class, "ConversationalAComponent"); + + // Make sure initial values are correct + Assert.assertEquals(Constants.A_INITIAL_VALUE, aService.getState()); + Assert.assertEquals(Constants.B_INITIAL_VALUE, aService.getStateOnB()); + + // Set some new values + aService.setState(NEW_A_VALUE); + aService.setStateOnB(NEW_B_VALUE); + + // Verify the set worked + Assert.assertEquals(NEW_A_VALUE, aService.getState()); + Assert.assertEquals(NEW_B_VALUE, aService.getStateOnB()); + + + ////////// + // Tests on second instance + ////////// + System.out.println("========= Second instance tests ========="); + + // Do another look up + AService aService2 = domain.getService(AService.class, "ConversationalAComponent"); + + // Make sure initial values are correct on the second instance + Assert.assertEquals(Constants.A_INITIAL_VALUE, aService2.getState()); + Assert.assertEquals(Constants.B_INITIAL_VALUE, aService2.getStateOnB()); + + // Set some new values on the second instance + aService2.setState(SECOND_NEW_A_VALUE); + aService2.setStateOnB(SECOND_NEW_B_VALUE); + + // Verify the set worked on the second instance + Assert.assertEquals(SECOND_NEW_A_VALUE, aService2.getState()); + Assert.assertEquals(SECOND_NEW_B_VALUE, aService2.getStateOnB()); + + // Verify the values have not been changed on the first instance + Assert.assertEquals(NEW_A_VALUE, aService.getState()); + Assert.assertEquals(NEW_B_VALUE, aService.getStateOnB()); + + System.out.println("========= Done instance tests ========="); + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/pom.xml new file mode 100644 index 0000000000..b9e9fe59c2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/pom.xml @@ -0,0 +1,126 @@ + + + + + org.apache.tuscany.sca + itest-databindings + 1.2.1-incubating-SNAPSHOT + + + 4.0.0 + + itest-databindings-common + 1.2.1-incubating-SNAPSHOT + jar + Apache Tuscany SCA Databinding Common Integration Tests + + + + + true + + java.net + java.net Maven 1.x Repository + http://download.java.net/maven/1 + legacy + + + + + + + true + + java.net + java.net Maven 1.x Repository + http://download.java.net/maven/1 + legacy + + + + + + org.apache.tuscany.sca + tuscany-databinding-sdo + ${pom.version} + compile + + + org.apache.tuscany.sdo + tuscany-sdo-tools + 1.0-incubating + compile + + + velocity + velocity + 1.4 + compile + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-test-source + generate-sources + + add-test-source + + + + target/sdo-source + + + + + + + org.apache.tuscany.sdo + tuscany-sdo-plugin + 1.0-incubating + + + generate-sdo + generate-sources + + + + ${basedir}/src/main/resources/generate/generate.xsd + + + true + true + true + + + generate + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/java/org/apache/tuscany/sca/itest/generate/Generate.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/java/org/apache/tuscany/sca/itest/generate/Generate.java new file mode 100644 index 0000000000..1c1ba3660c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/java/org/apache/tuscany/sca/itest/generate/Generate.java @@ -0,0 +1,181 @@ +/* + * 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 org.apache.tuscany.sca.itest.generate; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileWriter; +import java.util.List; +import java.util.Properties; + +import org.apache.tuscany.generate.GenerateFactory; +import org.apache.tuscany.generate.GenerateType; +import org.apache.tuscany.generate.InputFileType; +import org.apache.tuscany.generate.TemplateType; +import org.apache.tuscany.sdo.generate.XSD2JavaGenerator; +import org.apache.tuscany.sdo.util.SDOUtil; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; + +import commonj.sdo.helper.HelperContext; +import commonj.sdo.helper.XMLDocument; + +/** + * Generates test files based on the information in a configuration files (generate.xml) + * and a set of velocity templates. The process is + * + * for each template + * for each xsd file + * generate SDOs + * include the factory into the composite + * for each type + * add client iface method + * add client impl method + * add service iface method + * add service impl method + * add test method + * add wsdl type and method + * + * @version $Rev$ $Date$ + */ +public class Generate { + + /** + * Does all the hard work of running the velocity templates against the + * the list of types to test. Both the list of templates and the list of + * XSD files is held in the configuration file (generate.xsd) which lives in the + * resources/generate directory of the project being generated. + * + * @param projectBuildDir the path to the target dir of the project being generated. + */ + public static void generate(String projectBuildDir) { + System.out.println(">> Building project from dir: " + projectBuildDir); + FileInputStream fis = null; + + try { + // Load the config file into a stream + fis = new FileInputStream(projectBuildDir + "/classes/generate/generate.xml"); + + // Load the stream into SDO + // We are just using SDO as a convenient way to parse the XML config file + HelperContext scope = SDOUtil.createHelperContext(); + GenerateFactory.INSTANCE.register(scope); + XMLDocument xmlDoc = scope.getXMLHelper().load(fis); + GenerateType generateType = (GenerateType)xmlDoc.getRootObject(); + + // Get the file list. This is the list of XSD that is passed into the + // the velocity templates. Each configured file holds a list of types + // that the velocity templates expand into appropriate methods and method calls + List fileList = generateType.getInputFile(); + + //Intialise velocity ready to generate the various files + Properties p = new Properties(); + p.setProperty("file.resource.loader.path", projectBuildDir + "/classes/generate"); + Velocity.init(p); + VelocityContext context = new VelocityContext(); + context.put("fileList", fileList); + + List templateList = generateType.getTemplate(); + + // For each velocity template in the template list pass in the XSD file list + for ( Object item: templateList){ + TemplateType template = (TemplateType)item; + context.put("template", template); + String tmp = template.getTemplateName(); + String filename = projectBuildDir + "/" + template.getTemplateTargetDir() + "/" + tmp.substring(0,tmp.length() - 3); + File f = new File(filename); + // Create folders since the package doesn't exist before the code-gen for the 1st time + f.getParentFile().mkdirs(); + FileWriter fw = new FileWriter(f); + System.out.println(">> Processing " + template.getTemplateName() + " to " + filename); + Velocity.mergeTemplate(template.getTemplateName(), context, fw ); + fw.flush(); + fw.close(); + } + + + } catch (Exception e) { + System.out.println("Exception : " + e.toString()); + e.printStackTrace(); + return; + } + } + + /** + * The SDO generator tool does all of the hard work + * + * @param projectBuildDir the path to the target dir of the project being generated. + */ + public static void generateSDO(String projectBuildDir) { + System.out.println(">> Building SDOs from dir: " + projectBuildDir); + FileInputStream fis = null; + + try { + // Load the config file into a stream + fis = new FileInputStream(projectBuildDir + "/classes/generate/generate.xml"); + + // Load the stream into SDO + // We are just using SDO as a convenient way to parse the XML config file + HelperContext scope = SDOUtil.createHelperContext(); + GenerateFactory.INSTANCE.register(scope); + XMLDocument xmlDoc = scope.getXMLHelper().load(fis); + GenerateType generateType = (GenerateType)xmlDoc.getRootObject(); + + // Get the file list. This is the list of XSD that is passed into the + // the velocity templates. Each configured file holds a list of types + // that the velocity templates expand into appropriate methods and method calls + List fileList = generateType.getInputFile(); + + // for each XSD in the XSD file list generate an SDO. + XSD2JavaGenerator generator = new XSD2JavaGenerator(); + + for ( Object item : fileList){ + InputFileType file = (InputFileType)item; + + XSD2JavaGenerator.generateFromXMLSchema(projectBuildDir + "/classes/xsd/" + file.getFileName(), + file.getNamespace(), + projectBuildDir + "/sdo-source", + file.getJavaPackage(), + null, //file.getPrefix(), + XSD2JavaGenerator.OPTION_NO_CONTAINMENT | XSD2JavaGenerator.OPTION_NO_NOTIFICATION | XSD2JavaGenerator.OPTION_NO_UNSETTABLE); + + } + + } catch (Exception e) { + System.out.println("Exception : " + e.toString()); + e.printStackTrace(); + return; + } + } + + /** + * The mainline + * + * @param args the target directory where project in which files are being generated + */ + public static void main(String[] args) { + + Generate.generate(args[0]); + + if (args.length > 1){ + Generate.generateSDO(args[0]); + } + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/DatabindingTestCase.java.vm b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/DatabindingTestCase.java.vm new file mode 100644 index 0000000000..b2346aa973 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/DatabindingTestCase.java.vm @@ -0,0 +1,112 @@ +/* + * 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 $template.getJavaPackage(); + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.osoa.sca.ComponentContext; +import org.osoa.sca.ServiceReference; + +import ${template.getJavaPackage()}.GreeterService; + +// Data types +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) +import $file.getJavaPackage().$typeInstance.getTypeName(); +import $file.getJavaPackage().$file.getFactory(); +#end +#end + +/** + * Automatically generated test case. Calls the greeter client for a number of + * bindings and a number of data types. + * + * @version $Rev: 511417 $ $Date: 2007-02-25 03:06:42 +0000 (Sun, 25 Feb 2007) $ + */ +public class DatabindingTestCase extends TestCase { + + private SCADomain domain; + private GreeterService greeterClient; + + /** + * Runs before each test method + */ + protected void setUp() throws Exception { + domain = SCADomain.newInstance("greeter.composite"); + super.setUp(); + } + + /** + * Runs after each test method + */ + protected void tearDown() { + domain.close(); + } + + /** + * Finds the SCA component that relates to the protocol being tested. This test + * always connects locally to the client component but the client component will + * connect to the back end component using the appropriate protocol + * + * @param ext the protcol required + */ + private void setUpClient(String ext) throws Exception { + greeterClient = domain.getService(GreeterService.class, ext + "GreeterServiceClient"); + } + + /** + * Invokes the SDO Greet service using web service bindings with SDO payload + */ + public void testWSGreet() throws Exception { + setUpClient("WS"); + greet(); + } + + /** + * Invokes the SDO Greet service using default bindings with SDO payload + */ + public void testDefaultGreet() throws Exception { + setUpClient("Default"); + greet(); + } + + /** + * A generic method which, regarless of which client is connected, sends out a + * series of requrests passing different data types. + */ + public void greet() { +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) + + // test $typeInstance.getTypeName() + { + $typeInstance.getTypeName() param = null; + $typeInstance.getCreateTypeCode() + $typeInstance.getTypeName() result = greeterClient.greet$typeInstance.getTypeName()(param); + $typeInstance.getResultComparison() + } +#end +#end + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/Greeter.wsdl.vm b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/Greeter.wsdl.vm new file mode 100644 index 0000000000..88616cc997 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/Greeter.wsdl.vm @@ -0,0 +1,103 @@ + + + + + + + +#foreach($file in $fileList) + +#end + +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) + + + + + + + +#end +#end + + +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) + + + + + + + +#end +#end + + +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) + + + + +#end +#end + + + + +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) + + + + + + + + + +#end +#end + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/GreeterService.java.vm b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/GreeterService.java.vm new file mode 100644 index 0000000000..b0e298b823 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/GreeterService.java.vm @@ -0,0 +1,53 @@ +/* + * 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 $template.getJavaPackage(); + +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) +import $file.getJavaPackage().$typeInstance.getTypeName(); +#end +#end + +import org.osoa.sca.annotations.Remotable; + +/** + * The automcatically generated interface to the service that reflects data objects + * that are sent to it + * + * @version $Rev: 511417 $ $Date: 2007-02-25 03:06:42 +0000 (Sun, 25 Feb 2007) $ + */ +@Remotable +public interface GreeterService { + +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) + /** + * Take the provided data object, change it slightly and return it + * + * @param param the data object to be changed and returned + * @return the change data object + */ + $typeInstance.getTypeName() greet$typeInstance.getTypeName()($typeInstance.getTypeName() param); +#end +#end + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/GreeterServiceClient.java.vm b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/GreeterServiceClient.java.vm new file mode 100644 index 0000000000..ee73db6152 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/GreeterServiceClient.java.vm @@ -0,0 +1,42 @@ +/* + * 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 $template.getJavaPackage(); + +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) +import $file.getJavaPackage().$typeInstance.getTypeName(); +#end +#end + +import org.osoa.sca.annotations.AllowsPassByReference; + +/** + * GreeterServiceClient + */ +@AllowsPassByReference +public interface GreeterServiceClient { +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) + $typeInstance.getTypeName() greet$typeInstance.getTypeName()($typeInstance.getTypeName() param); +#end +#end +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/GreeterServiceClientImpl.java.vm b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/GreeterServiceClientImpl.java.vm new file mode 100644 index 0000000000..57827d27b9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/GreeterServiceClientImpl.java.vm @@ -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 $template.getJavaPackage(); + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) +import $file.getJavaPackage().$typeInstance.getTypeName(); +#end +#end + +/** + * The automcatically generated service that simply forwards data objects on to + * the GreeterService and passes back the responses + * + * @version $Rev: 508831 $ $Date: 2007-02-18 00:12:31 +0000 (Sun, 18 Feb 2007) $ + */ +@Service(GreeterService.class) +public class GreeterServiceClientImpl implements GreeterService { + + /** + * the reference the the GreeterService that will + * change each data object slightly and return it + */ + private GreeterService service; + + @Reference + public void setGreeterService(GreeterService service) { + this.service = service; + } +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) + + /* + * (non-Javadoc) + * + * @see org.apache.tuscany.sca.itest.sdodatabinding.GreeterService#greet$typeInstance.getTypeName()($typeInstance.getTypeName() param) + */ + public $typeInstance.getTypeName() greet$typeInstance.getTypeName()($typeInstance.getTypeName() param) { + return service.greet$typeInstance.getTypeName()(param); + } +#end +#end +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/GreeterServiceImpl.java.vm b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/GreeterServiceImpl.java.vm new file mode 100644 index 0000000000..1fd7509667 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/GreeterServiceImpl.java.vm @@ -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 $template.getJavaPackage(); + +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) +import $file.getJavaPackage().$typeInstance.getTypeName(); +#end +#end + +import org.osoa.sca.annotations.Service; + +/** + * The automcatically generated service implementation that reflects data objects + * that are sent to it + * + * @version $Rev: 511417 $ $Date: 2007-02-25 03:06:42 +0000 (Sun, 25 Feb 2007) $ + */ +@Service(GreeterService.class) +public class GreeterServiceImpl implements GreeterService { +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) + + /** + * Take the provided data object, change it slightly and return it + * + * @param param the data object to be changed and returned + * @return the change data object + */ + public $typeInstance.getTypeName() greet$typeInstance.getTypeName()($typeInstance.getTypeName() param) { + $typeInstance.getModifyTypeCode() + return param; + } +#end +#end +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/generate.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/generate.xsd new file mode 100644 index 0000000000..1fabedf55f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/generate/generate.xsd @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/wsdl/Dummy.txt b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/wsdl/Dummy.txt new file mode 100644 index 0000000000..8927d725b6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/wsdl/Dummy.txt @@ -0,0 +1,4 @@ +A dummy file that causes the target/classes/wsdl dir to be created in the generated test project. This is +required because the test generator must run in the process-resource phase, after generate.xml has been copied +into target. The generator needs to write out target/classes/wsdl and will fail the directory isn't there. So +this file just gets unpacked and forces the directory to be created. diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Annotation.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Annotation.xml new file mode 100644 index 0000000000..f1f4346e58 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Annotation.xml @@ -0,0 +1,24 @@ + + + + SimpleTypeWithName + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Annotation.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Annotation.xsd new file mode 100644 index 0000000000..1fae43eb09 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Annotation.xsd @@ -0,0 +1,38 @@ + + + + + + SDO 2.0.1 + + A schema that tests the presence of annotations in schema read by SDO + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Attribute.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Attribute.xml new file mode 100644 index 0000000000..c20c80b658 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Attribute.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Attribute.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Attribute.xsd new file mode 100644 index 0000000000..bd3db2e030 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Attribute.xsd @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeReference.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeReference.xml new file mode 100644 index 0000000000..30e4979dca --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeReference.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeReference.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeReference.xsd new file mode 100644 index 0000000000..e7738dcff7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeReference.xsd @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithDefaultValue.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithDefaultValue.xml new file mode 100644 index 0000000000..9552421e2d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithDefaultValue.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithDefaultValue.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithDefaultValue.xsd new file mode 100644 index 0000000000..c7b9655749 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithDefaultValue.xsd @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithFixedValue.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithFixedValue.xml new file mode 100644 index 0000000000..5e5e7fbd55 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithFixedValue.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithFixedValue.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithFixedValue.xsd new file mode 100644 index 0000000000..5c455c2ab5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithFixedValue.xsd @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOAliasName.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOAliasName.xml new file mode 100644 index 0000000000..635e851632 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOAliasName.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOAliasName.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOAliasName.xsd new file mode 100644 index 0000000000..004dab4fbb --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOAliasName.xsd @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDODataType.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDODataType.xml new file mode 100644 index 0000000000..136092951b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDODataType.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDODataType.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDODataType.xsd new file mode 100644 index 0000000000..796f08e1cf --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDODataType.xsd @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOName.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOName.xml new file mode 100644 index 0000000000..927b94885c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOName.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOName.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOName.xsd new file mode 100644 index 0000000000..93f83cd0a1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOName.xsd @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOPropertySDOOppositePropertyType.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOPropertySDOOppositePropertyType.xml new file mode 100644 index 0000000000..ea7db70595 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOPropertySDOOppositePropertyType.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOPropertySDOOppositePropertyType.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOPropertySDOOppositePropertyType.xsd new file mode 100644 index 0000000000..c64323e7e1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOPropertySDOOppositePropertyType.xsd @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOPropertyType.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOPropertyType.xml new file mode 100644 index 0000000000..85c7d85fd4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOPropertyType.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOPropertyType.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOPropertyType.xsd new file mode 100644 index 0000000000..543f276c50 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOPropertyType.xsd @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOString.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOString.xml new file mode 100644 index 0000000000..fcd281539b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOString.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOString.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOString.xsd new file mode 100644 index 0000000000..1610c2b861 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/AttributeWithSDOString.xsd @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnySimpleType.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnySimpleType.xml new file mode 100644 index 0000000000..36a0760a61 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnySimpleType.xml @@ -0,0 +1,24 @@ + + + + anySimpleType + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnySimpleType.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnySimpleType.xsd new file mode 100644 index 0000000000..999b72bb35 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnySimpleType.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnyType.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnyType.xml new file mode 100644 index 0000000000..5849165fe0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnyType.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnyType.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnyType.xsd new file mode 100644 index 0000000000..71dad561ca --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnyType.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnyURI.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnyURI.xml new file mode 100644 index 0000000000..8acf9376d7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnyURI.xml @@ -0,0 +1,24 @@ + + + + http://tempuri.org + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnyURI.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnyURI.xsd new file mode 100644 index 0000000000..a49987c352 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInAnyURI.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInBase64Binary.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInBase64Binary.xml new file mode 100644 index 0000000000..a35b6e174a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInBase64Binary.xml @@ -0,0 +1,24 @@ + + + + ABCDEF + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInBase64Binary.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInBase64Binary.xsd new file mode 100644 index 0000000000..e1995890f9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInBase64Binary.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInBoolean.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInBoolean.xml new file mode 100644 index 0000000000..91cfce51b8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInBoolean.xml @@ -0,0 +1,27 @@ + + + + true + false + 1 + 0 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInBoolean.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInBoolean.xsd new file mode 100644 index 0000000000..a2f86ba8c5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInBoolean.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInByte.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInByte.xml new file mode 100644 index 0000000000..907474cd1b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInByte.xml @@ -0,0 +1,25 @@ + + + + 127 + -127 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInByte.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInByte.xsd new file mode 100644 index 0000000000..a2f6bcfa77 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInByte.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDate.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDate.xml new file mode 100644 index 0000000000..c5820e1a2e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDate.xml @@ -0,0 +1,24 @@ + + + + 2001-01-01 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDate.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDate.xsd new file mode 100644 index 0000000000..f4d596bfe3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDate.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDateTime.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDateTime.xml new file mode 100644 index 0000000000..0debe2fec5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDateTime.xml @@ -0,0 +1,24 @@ + + + + 2001-12-31T12:00:00 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDateTime.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDateTime.xsd new file mode 100644 index 0000000000..b5bcfdcfd4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDateTime.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDecimal.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDecimal.xml new file mode 100644 index 0000000000..7f001254cc --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDecimal.xml @@ -0,0 +1,23 @@ + + + + -1.23456789 + 1.23456789 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDecimal.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDecimal.xsd new file mode 100644 index 0000000000..8d4d106f59 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDecimal.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDouble.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDouble.xml new file mode 100644 index 0000000000..f875b9f94d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDouble.xml @@ -0,0 +1,25 @@ + + + + 0.0 + 12.3E-4 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDouble.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDouble.xsd new file mode 100644 index 0000000000..4c8a39b06c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDouble.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDuration.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDuration.xml new file mode 100644 index 0000000000..7d343d6dda --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDuration.xml @@ -0,0 +1,24 @@ + + + + P1D + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDuration.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDuration.xsd new file mode 100644 index 0000000000..bb12bc04a9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInDuration.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInFloat.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInFloat.xml new file mode 100644 index 0000000000..7a81f3b0dd --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInFloat.xml @@ -0,0 +1,24 @@ + + + + 0.0 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInFloat.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInFloat.xsd new file mode 100644 index 0000000000..f0e1c21233 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInFloat.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGDay.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGDay.xml new file mode 100644 index 0000000000..d35568b3c9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGDay.xml @@ -0,0 +1,24 @@ + + + + ---01 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGDay.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGDay.xsd new file mode 100644 index 0000000000..92bd9a4b66 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGDay.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGMonth.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGMonth.xml new file mode 100644 index 0000000000..52cdfa8c4e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGMonth.xml @@ -0,0 +1,24 @@ + + + + --01-- + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGMonth.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGMonth.xsd new file mode 100644 index 0000000000..78d001a585 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGMonth.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGMonthDay.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGMonthDay.xml new file mode 100644 index 0000000000..2609a858f7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGMonthDay.xml @@ -0,0 +1,24 @@ + + + + --01-01 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGMonthDay.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGMonthDay.xsd new file mode 100644 index 0000000000..38f6c55059 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGMonthDay.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGYear.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGYear.xml new file mode 100644 index 0000000000..7868a47ca3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGYear.xml @@ -0,0 +1,24 @@ + + + + 2001 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGYear.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGYear.xsd new file mode 100644 index 0000000000..0d65b124ff --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGYear.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGYearMonth.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGYearMonth.xml new file mode 100644 index 0000000000..3f5080d49f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGYearMonth.xml @@ -0,0 +1,24 @@ + + + + 2001-01 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGYearMonth.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGYearMonth.xsd new file mode 100644 index 0000000000..340555dc5f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInGYearMonth.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInHexBinary.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInHexBinary.xml new file mode 100644 index 0000000000..0deb7af980 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInHexBinary.xml @@ -0,0 +1,24 @@ + + + + 0F00 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInHexBinary.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInHexBinary.xsd new file mode 100644 index 0000000000..8059fe6da0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInHexBinary.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInID.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInID.xml new file mode 100644 index 0000000000..06c92ce19b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInID.xml @@ -0,0 +1,24 @@ + + + + idvalue0 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInID.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInID.xsd new file mode 100644 index 0000000000..7b1f02d1d4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInID.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInIDREF.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInIDREF.xml new file mode 100644 index 0000000000..9bc0cefd0f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInIDREF.xml @@ -0,0 +1,24 @@ + + + + idvalue0 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInIDREF.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInIDREF.xsd new file mode 100644 index 0000000000..0c207983bc --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInIDREF.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInIDREFS.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInIDREFS.xml new file mode 100644 index 0000000000..f91b602f99 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInIDREFS.xml @@ -0,0 +1,24 @@ + + + + idvalue0 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInIDREFS.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInIDREFS.xsd new file mode 100644 index 0000000000..b99bf01b73 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInIDREFS.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInInt.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInInt.xml new file mode 100644 index 0000000000..c99698e175 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInInt.xml @@ -0,0 +1,25 @@ + + + + -2147483648 + 2147483647 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInInt.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInInt.xsd new file mode 100644 index 0000000000..b5b9b0d1eb --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInInt.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInInteger.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInInteger.xml new file mode 100644 index 0000000000..80d22ce057 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInInteger.xml @@ -0,0 +1,25 @@ + + + + -2147483648 + 2147483647 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInInteger.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInInteger.xsd new file mode 100644 index 0000000000..4902935db5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInInteger.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInLanguage.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInLanguage.xml new file mode 100644 index 0000000000..664bf824b4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInLanguage.xml @@ -0,0 +1,24 @@ + + + + EN + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInLanguage.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInLanguage.xsd new file mode 100644 index 0000000000..5d3658d224 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInLanguage.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInLong.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInLong.xml new file mode 100644 index 0000000000..c5861fa92a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInLong.xml @@ -0,0 +1,25 @@ + + + + -9223372036854775808 + 9223372036854775807 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInLong.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInLong.xsd new file mode 100644 index 0000000000..0aa4710057 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInLong.xsd @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNCName.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNCName.xml new file mode 100644 index 0000000000..1f95950394 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNCName.xml @@ -0,0 +1,24 @@ + + + + NCName + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNCName.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNCName.xsd new file mode 100644 index 0000000000..6ee9c435db --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNCName.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNMTOKEN.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNMTOKEN.xml new file mode 100644 index 0000000000..0297f1aeb4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNMTOKEN.xml @@ -0,0 +1,24 @@ + + + + NMTOKEN + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNMTOKEN.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNMTOKEN.xsd new file mode 100644 index 0000000000..56d027bdbb --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNMTOKEN.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNMTOKENS.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNMTOKENS.xml new file mode 100644 index 0000000000..81ba1069bd --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNMTOKENS.xml @@ -0,0 +1,24 @@ + + + + NMTOKENS + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNMTOKENS.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNMTOKENS.xsd new file mode 100644 index 0000000000..866ab73024 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNMTOKENS.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNOTATION.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNOTATION.xml new file mode 100644 index 0000000000..8bb3a08b94 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNOTATION.xml @@ -0,0 +1,24 @@ + + + + tns:BuiltInNotationNotation + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNOTATION.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNOTATION.xsd new file mode 100644 index 0000000000..c7c62f812b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNOTATION.xsd @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInName.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInName.xml new file mode 100644 index 0000000000..8235718c5e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInName.xml @@ -0,0 +1,24 @@ + + + + Name + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInName.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInName.xsd new file mode 100644 index 0000000000..36caba2f16 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInName.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNegativeInteger.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNegativeInteger.xml new file mode 100644 index 0000000000..599c428a44 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNegativeInteger.xml @@ -0,0 +1,24 @@ + + + + -1 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNegativeInteger.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNegativeInteger.xsd new file mode 100644 index 0000000000..389d5a99f0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNegativeInteger.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNonNegativeInteger.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNonNegativeInteger.xml new file mode 100644 index 0000000000..919c4a20ee --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNonNegativeInteger.xml @@ -0,0 +1,24 @@ + + + + 0 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNonNegativeInteger.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNonNegativeInteger.xsd new file mode 100644 index 0000000000..59887078b5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNonNegativeInteger.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNonPositiveInteger.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNonPositiveInteger.xml new file mode 100644 index 0000000000..79011f26ab --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNonPositiveInteger.xml @@ -0,0 +1,24 @@ + + + + -1 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNonPositiveInteger.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNonPositiveInteger.xsd new file mode 100644 index 0000000000..5de7d64d7b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNonPositiveInteger.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNormalizedString.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNormalizedString.xml new file mode 100644 index 0000000000..c40be9e18b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNormalizedString.xml @@ -0,0 +1,24 @@ + + + + normalizedString + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNormalizedString.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNormalizedString.xsd new file mode 100644 index 0000000000..d4a78787b8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInNormalizedString.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInPositiveInteger.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInPositiveInteger.xml new file mode 100644 index 0000000000..c30434de66 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInPositiveInteger.xml @@ -0,0 +1,24 @@ + + + + 1 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInPositiveInteger.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInPositiveInteger.xsd new file mode 100644 index 0000000000..5381590cd1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInPositiveInteger.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInQName.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInQName.xml new file mode 100644 index 0000000000..4cd6ea7e72 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInQName.xml @@ -0,0 +1,24 @@ + + + + QName + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInQName.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInQName.xsd new file mode 100644 index 0000000000..e8faf6225b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInQName.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInShort.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInShort.xml new file mode 100644 index 0000000000..b4375467c4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInShort.xml @@ -0,0 +1,25 @@ + + + + -32768 + 32767 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInShort.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInShort.xsd new file mode 100644 index 0000000000..a4f564d9b7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInShort.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInString.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInString.xml new file mode 100644 index 0000000000..d30ab85530 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInString.xml @@ -0,0 +1,24 @@ + + + + string + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInString.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInString.xsd new file mode 100644 index 0000000000..8abb34b5a5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInString.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInTime.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInTime.xml new file mode 100644 index 0000000000..7fd9a061ae --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInTime.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInTime.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInTime.xsd new file mode 100644 index 0000000000..1615976813 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInTime.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInToken.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInToken.xml new file mode 100644 index 0000000000..cd567ba528 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInToken.xml @@ -0,0 +1,24 @@ + + + + token + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInToken.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInToken.xsd new file mode 100644 index 0000000000..0beaac571f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInToken.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedByte.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedByte.xml new file mode 100644 index 0000000000..025362defb --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedByte.xml @@ -0,0 +1,25 @@ + + + + 0 + 255 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedByte.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedByte.xsd new file mode 100644 index 0000000000..d6d951fe5d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedByte.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedInt.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedInt.xml new file mode 100644 index 0000000000..5736a8c121 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedInt.xml @@ -0,0 +1,25 @@ + + + + 0 + 4294967295 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedInt.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedInt.xsd new file mode 100644 index 0000000000..242be1d53b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedInt.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedLong.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedLong.xml new file mode 100644 index 0000000000..d728115a77 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedLong.xml @@ -0,0 +1,25 @@ + + + + 0 + 18446744073709551615 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedLong.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedLong.xsd new file mode 100644 index 0000000000..108e3a8619 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedLong.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedShort.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedShort.xml new file mode 100644 index 0000000000..d4ffae5e17 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedShort.xml @@ -0,0 +1,25 @@ + + + + 0 + 65535 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedShort.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedShort.xsd new file mode 100644 index 0000000000..5ee5e0229e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/BuiltInUnsignedShort.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeComplexContentRestrictingComplexType.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeComplexContentRestrictingComplexType.xml new file mode 100644 index 0000000000..3d5aed5aa8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeComplexContentRestrictingComplexType.xml @@ -0,0 +1,26 @@ + + + + + SimpleTypeWithName + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeComplexContentRestrictingComplexType.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeComplexContentRestrictingComplexType.xsd new file mode 100644 index 0000000000..e7b80ab11c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeComplexContentRestrictingComplexType.xsd @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeExtendingComplexType.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeExtendingComplexType.xml new file mode 100644 index 0000000000..2b4fe5594e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeExtendingComplexType.xml @@ -0,0 +1,27 @@ + + + + + SimpleTypeWithName + SimpleTypeWithNameExtended + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeExtendingComplexType.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeExtendingComplexType.xsd new file mode 100644 index 0000000000..fc4deb63c2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeExtendingComplexType.xsd @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeExtendingSimpleType.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeExtendingSimpleType.xml new file mode 100644 index 0000000000..03570f41d9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeExtendingSimpleType.xml @@ -0,0 +1,24 @@ + + + + ComplexTypeExtendingSimpeTypeElement + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeExtendingSimpleType.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeExtendingSimpleType.xsd new file mode 100644 index 0000000000..c754502645 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeExtendingSimpleType.xsd @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeSimpleContentRestrictingComplexType.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeSimpleContentRestrictingComplexType.xml new file mode 100644 index 0000000000..4603793bfc --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeSimpleContentRestrictingComplexType.xml @@ -0,0 +1,24 @@ + + + + ComplexTypeSimpleContentRestrictingComplexTypeElement + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeSimpleContentRestrictingComplexType.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeSimpleContentRestrictingComplexType.xsd new file mode 100644 index 0000000000..4bcd2f8c46 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeSimpleContentRestrictingComplexType.xsd @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithAbstract.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithAbstract.xml new file mode 100644 index 0000000000..a6861f803a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithAbstract.xml @@ -0,0 +1,27 @@ + + + + + BaseElement + ExtensionElement + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithAbstract.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithAbstract.xsd new file mode 100644 index 0000000000..8bb251cab2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithAbstract.xsd @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithCDATA.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithCDATA.xml new file mode 100644 index 0000000000..467ec007ed --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithCDATA.xml @@ -0,0 +1,30 @@ + + + + + Some + ]]> + Mixed + SimpleType]]>WithName + Content + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithCDATA.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithCDATA.xsd new file mode 100644 index 0000000000..8d00646678 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithCDATA.xsd @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithContent.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithContent.xml new file mode 100644 index 0000000000..7deafd798a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithContent.xml @@ -0,0 +1,26 @@ + + + + + SimpleTypeWithName + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithContent.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithContent.xsd new file mode 100644 index 0000000000..72ac75fee0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithContent.xsd @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithMixed.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithMixed.xml new file mode 100644 index 0000000000..f6208f81b3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithMixed.xml @@ -0,0 +1,29 @@ + + + + + Some + Mixed + SimpleTypeWithName + Content + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithMixed.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithMixed.xsd new file mode 100644 index 0000000000..1f26e13673 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithMixed.xsd @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOpenAttributes.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOpenAttributes.xml new file mode 100644 index 0000000000..97de7b98eb --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOpenAttributes.xml @@ -0,0 +1,24 @@ + + + + + SimpleTypeWithName + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOpenAttributes.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOpenAttributes.xsd new file mode 100644 index 0000000000..67716553d8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOpenAttributes.xsd @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOpenContent.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOpenContent.xml new file mode 100644 index 0000000000..5941348921 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOpenContent.xml @@ -0,0 +1,31 @@ + + + + + + + Some + Mixed + SimpleTypeWithName + Content + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOpenContent.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOpenContent.xsd new file mode 100644 index 0000000000..24d5d09054 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOpenContent.xsd @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOppositeProperty.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOppositeProperty.xml new file mode 100644 index 0000000000..f684d06a4d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOppositeProperty.xml @@ -0,0 +1,30 @@ + + + + + SomeData + + + idvalue2 + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOppositeProperty.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOppositeProperty.xsd new file mode 100644 index 0000000000..de4a8a666d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithOppositeProperty.xsd @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOAliasName.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOAliasName.xml new file mode 100644 index 0000000000..242908bd27 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOAliasName.xml @@ -0,0 +1,26 @@ + + + + + SimpleTypeWithName + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOAliasName.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOAliasName.xsd new file mode 100644 index 0000000000..4c00fbe295 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOAliasName.xsd @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOName.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOName.xml new file mode 100644 index 0000000000..925e8625d5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOName.xml @@ -0,0 +1,26 @@ + + + + + SimpleTypeWithName + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOName.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOName.xsd new file mode 100644 index 0000000000..b12bec040b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOName.xsd @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOSequence.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOSequence.xml new file mode 100644 index 0000000000..c73708ce46 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOSequence.xml @@ -0,0 +1,26 @@ + + + + + SimpleTypeWithName + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOSequence.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOSequence.xsd new file mode 100644 index 0000000000..795c3ea7d9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithSDOSequence.xsd @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithoutContent.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithoutContent.xml new file mode 100644 index 0000000000..3ebdc89ae0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithoutContent.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithoutContent.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithoutContent.xsd new file mode 100644 index 0000000000..21546d0f67 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithoutContent.xsd @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithoutName.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithoutName.xml new file mode 100644 index 0000000000..89657e42ca --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithoutName.xml @@ -0,0 +1,26 @@ + + + + + SimpleTypeWithName + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithoutName.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithoutName.xsd new file mode 100644 index 0000000000..d01b4172e4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ComplexTypeWithoutName.xsd @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/DefaultNamespace.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/DefaultNamespace.xml new file mode 100644 index 0000000000..82fd1eedaf --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/DefaultNamespace.xml @@ -0,0 +1,23 @@ + + + + SimpleTypeWithName + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/DefaultNamespace.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/DefaultNamespace.xsd new file mode 100644 index 0000000000..e1dcf06194 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/DefaultNamespace.xsd @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementInAll.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementInAll.xml new file mode 100644 index 0000000000..ebf03c9d5d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementInAll.xml @@ -0,0 +1,27 @@ + + + + + ElementInAllOne + ElementInAllTwo + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementInAll.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementInAll.xsd new file mode 100644 index 0000000000..8b9ba5b4b8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementInAll.xsd @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementInChoice.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementInChoice.xml new file mode 100644 index 0000000000..26466b1b39 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementInChoice.xml @@ -0,0 +1,25 @@ + + + + Element1InChoice + Element2InChoice + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementInChoice.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementInChoice.xsd new file mode 100644 index 0000000000..ff418c56ab --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementInChoice.xsd @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSDOChangeSummaryType.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSDOChangeSummaryType.xml new file mode 100644 index 0000000000..27bb1ce9cc --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSDOChangeSummaryType.xml @@ -0,0 +1,29 @@ + + + + + + ChangeSummaryText + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSDOChangeSummaryType.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSDOChangeSummaryType.xsd new file mode 100644 index 0000000000..2bf1df8c99 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSDOChangeSummaryType.xsd @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithDefault.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithDefault.xml new file mode 100644 index 0000000000..9b5561ed43 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithDefault.xml @@ -0,0 +1,24 @@ + + + + ElementOfSimpleTypeWithDefaultDefault + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithDefault.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithDefault.xsd new file mode 100644 index 0000000000..0b4e7bdf45 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithDefault.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithFixed.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithFixed.xml new file mode 100644 index 0000000000..f1b7cd264c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithFixed.xml @@ -0,0 +1,24 @@ + + + + ElementOfSimpleTypeWithFixedFixed + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithFixed.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithFixed.xsd new file mode 100644 index 0000000000..a2c8456257 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithFixed.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDODataType.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDODataType.xml new file mode 100644 index 0000000000..1f60b0423f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDODataType.xml @@ -0,0 +1,24 @@ + + + + ElementOfSimpleTypeWithSDODataTypeElement + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDODataType.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDODataType.xsd new file mode 100644 index 0000000000..21e55ab8c1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDODataType.xsd @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOOppositePropertyType.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOOppositePropertyType.xml new file mode 100644 index 0000000000..30762f4912 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOOppositePropertyType.xml @@ -0,0 +1,24 @@ + + + + idvalue0 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOOppositePropertyType.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOOppositePropertyType.xsd new file mode 100644 index 0000000000..5bf35d0d70 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOOppositePropertyType.xsd @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOPropertyType.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOPropertyType.xml new file mode 100644 index 0000000000..2dd01e4090 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOPropertyType.xml @@ -0,0 +1,24 @@ + + + + idvalue0 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOPropertyType.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOPropertyType.xsd new file mode 100644 index 0000000000..6920cd8dd0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOPropertyType.xsd @@ -0,0 +1,32 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOString.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOString.xml new file mode 100644 index 0000000000..6a526bdc47 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOString.xml @@ -0,0 +1,24 @@ + + + + ElementOfSimpleTypeWithSDOStringElement + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOString.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOString.xsd new file mode 100644 index 0000000000..1117a95eb8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementOfSimpleTypeWithSDOString.xsd @@ -0,0 +1,32 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementSubstitutionGroupBase.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementSubstitutionGroupBase.xml new file mode 100644 index 0000000000..ab91458bff --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementSubstitutionGroupBase.xml @@ -0,0 +1,40 @@ + + + + + + ElementInSubstitutionGroupBase + + + + Some Data + + + + ElementInSubstitutionGroupBase + + + ElementInSubstitutionGroupExtends + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementSubstitutionGroupBase.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementSubstitutionGroupBase.xsd new file mode 100644 index 0000000000..3e015843b5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementSubstitutionGroupBase.xsd @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithMaxOccurs.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithMaxOccurs.xml new file mode 100644 index 0000000000..b6d68fd08a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithMaxOccurs.xml @@ -0,0 +1,25 @@ + + + + ElementWithMaxOccursElement1 + ElementWithMaxOccursElement2 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithMaxOccurs.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithMaxOccurs.xsd new file mode 100644 index 0000000000..d4453a4477 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithMaxOccurs.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithNillable.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithNillable.xml new file mode 100644 index 0000000000..6de3adc937 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithNillable.xml @@ -0,0 +1,24 @@ + + + + ElementWithNillableElement + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithNillable.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithNillable.xsd new file mode 100644 index 0000000000..786ab226da --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithNillable.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithSDOAliasName.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithSDOAliasName.xml new file mode 100644 index 0000000000..64093aa803 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithSDOAliasName.xml @@ -0,0 +1,24 @@ + + + + ElementWithSDOAliasName + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithSDOAliasName.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithSDOAliasName.xsd new file mode 100644 index 0000000000..01f4c2b1ef --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithSDOAliasName.xsd @@ -0,0 +1,32 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithSDOName.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithSDOName.xml new file mode 100644 index 0000000000..774646f682 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithSDOName.xml @@ -0,0 +1,24 @@ + + + + ElementWithSDONameElement + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithSDOName.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithSDOName.xsd new file mode 100644 index 0000000000..34da37564c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ElementWithSDOName.xsd @@ -0,0 +1,32 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/GlobalElementComplexType.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/GlobalElementComplexType.xml new file mode 100644 index 0000000000..a1fb3aa803 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/GlobalElementComplexType.xml @@ -0,0 +1,24 @@ + + + + SimpleTypeWithName + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/GlobalElementComplexType.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/GlobalElementComplexType.xsd new file mode 100644 index 0000000000..8eb7a4fce4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/GlobalElementComplexType.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/GlobalElementSimpleType.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/GlobalElementSimpleType.xml new file mode 100644 index 0000000000..f68eb1939d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/GlobalElementSimpleType.xml @@ -0,0 +1,24 @@ + + + + GlobalElementSimpleType + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/GlobalElementSimpleType.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/GlobalElementSimpleType.xsd new file mode 100644 index 0000000000..b9f77e6658 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/GlobalElementSimpleType.xsd @@ -0,0 +1,26 @@ + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Import.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Import.xml new file mode 100644 index 0000000000..fd28850050 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Import.xml @@ -0,0 +1,30 @@ + + + + + SimpleTypeWithName + + SomeString + SomeString + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Import.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Import.xsd new file mode 100644 index 0000000000..eae93fd44a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Import.xsd @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ImportedSchema.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ImportedSchema.xsd new file mode 100644 index 0000000000..a7e568decf --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/ImportedSchema.xsd @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Include.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Include.xml new file mode 100644 index 0000000000..d4b9e24fa6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Include.xml @@ -0,0 +1,24 @@ + + + + SimpleTypeWithName + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Include.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Include.xsd new file mode 100644 index 0000000000..34ff314a19 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Include.xsd @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Interop.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Interop.xsd new file mode 100644 index 0000000000..ae22ab2c44 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Interop.xsd @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Notation.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Notation.xml new file mode 100644 index 0000000000..b75ac6500a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Notation.xml @@ -0,0 +1,24 @@ + + + +tns:Tuscany + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Notation.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Notation.xsd new file mode 100644 index 0000000000..6ad019cb81 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Notation.xsd @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Person.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Person.xsd new file mode 100644 index 0000000000..5f5021b15e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/Person.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SDOJavaPackage.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SDOJavaPackage.xml new file mode 100644 index 0000000000..6c5ad88ff4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SDOJavaPackage.xml @@ -0,0 +1,25 @@ + + + + SimpleTypeWithName + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SDOJavaPackage.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SDOJavaPackage.xsd new file mode 100644 index 0000000000..6b7e39b334 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SDOJavaPackage.xsd @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithAbstract.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithAbstract.xml new file mode 100644 index 0000000000..f9d4a24a49 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithAbstract.xml @@ -0,0 +1,24 @@ + + + + SimpleTypeWithAbstractExtensionElement + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithAbstract.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithAbstract.xsd new file mode 100644 index 0000000000..f649e2ba83 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithAbstract.xsd @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithExtendedInstanceClass.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithExtendedInstanceClass.xml new file mode 100644 index 0000000000..410df4b7e4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithExtendedInstanceClass.xml @@ -0,0 +1,24 @@ + + + + SimpleTypeWithExtendedInstanceClassElement + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithExtendedInstanceClass.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithExtendedInstanceClass.xsd new file mode 100644 index 0000000000..36629e8295 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithExtendedInstanceClass.xsd @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithInstanceClass.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithInstanceClass.xml new file mode 100644 index 0000000000..7b74867c03 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithInstanceClass.xml @@ -0,0 +1,24 @@ + + + + SimpleTypeWithInstanceClassElement + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithInstanceClass.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithInstanceClass.xsd new file mode 100644 index 0000000000..7a08de84be --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithInstanceClass.xsd @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithList.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithList.xml new file mode 100644 index 0000000000..708d526f44 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithList.xml @@ -0,0 +1,24 @@ + + + + listmember1 listmember2 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithList.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithList.xsd new file mode 100644 index 0000000000..681cf7d5af --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithList.xsd @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithName.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithName.xml new file mode 100644 index 0000000000..e404ac86b7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithName.xml @@ -0,0 +1,24 @@ + + + + SimpleTypeWithNameElement + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithName.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithName.xsd new file mode 100644 index 0000000000..af0431f048 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithName.xsd @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithSDOName.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithSDOName.xml new file mode 100644 index 0000000000..c86a0f6bcb --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithSDOName.xml @@ -0,0 +1,24 @@ + + + + SimpleTypeWithSDONameElement + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithSDOName.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithSDOName.xsd new file mode 100644 index 0000000000..89b00a36cc --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithSDOName.xsd @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithUnion.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithUnion.xml new file mode 100644 index 0000000000..399b0d8175 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithUnion.xml @@ -0,0 +1,25 @@ + + + + EN + 01:02:03 + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithUnion.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithUnion.xsd new file mode 100644 index 0000000000..fee04b9f24 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithUnion.xsd @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithoutName.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithoutName.xml new file mode 100644 index 0000000000..bc8cf35368 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithoutName.xml @@ -0,0 +1,26 @@ + + + + + SimpleTypeWithoutName + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithoutName.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithoutName.xsd new file mode 100644 index 0000000000..536aa822de --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/SimpleTypeWithoutName.xsd @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/TargetNamespace.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/TargetNamespace.xml new file mode 100644 index 0000000000..da2929776e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/TargetNamespace.xml @@ -0,0 +1,24 @@ + + + + SimpleTypeWithName + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/TargetNamespace.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/TargetNamespace.xsd new file mode 100644 index 0000000000..ace5427786 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/TargetNamespace.xsd @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/datagraph.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/datagraph.xsd new file mode 100644 index 0000000000..e6b9697a8d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/datagraph.xsd @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Expected type is emof:Package. + + + + + + + + + + + Expected type is xsd:schema. + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/sdoJava.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/sdoJava.xsd new file mode 100644 index 0000000000..7387568942 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/sdoJava.xsd @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/sdoModel.xsd b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/sdoModel.xsd new file mode 100644 index 0000000000..c5aabc9cc8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/main/resources/xsd/sdoModel.xsd @@ -0,0 +1,221 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/test/java/org/apache/tuscany/sca/itest/generate/GenerateTestCase.java b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/test/java/org/apache/tuscany/sca/itest/generate/GenerateTestCase.java new file mode 100644 index 0000000000..fa3f310d4d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/common/src/test/java/org/apache/tuscany/sca/itest/generate/GenerateTestCase.java @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.itest.generate; + +import junit.framework.TestCase; + + +/** + * + */ +public class GenerateTestCase extends TestCase { + + //private Generate generator = null; + + @Override + protected void setUp() throws Exception { + //generator = new Generate(); + } + + @Override + protected void tearDown() { + } + + /** + * Invokes the Generate class to generate databinding test classes and resources. + * + * @throws Exception + */ + public void testGenerate() throws Exception { + //generator.generate(); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/config.png b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/config.png new file mode 100644 index 0000000000..7912019e9d Binary files /dev/null and b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/config.png differ diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/config.svg b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/config.svg new file mode 100644 index 0000000000..aaf027e2df --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/config.svg @@ -0,0 +1,117 @@ + + + + + + + + + + + image/svg+xml + + + + + + <tns:Generate ...> <Template> <TemplateName>greeter.composite.vm</TemplateName> <TemplateTargetDir>classes</TemplateTargetDir> </Template> ... <InputFile> <FileName>Person.xsd</FileName> <FilePath>xsd</FilePath> <JavaPackage>org.apache.tuscany.sca.itest.databinding.types</JavaPackage> <Factory>TypesFactory</Factory> <Namespace>http://apache.org/tuscany/sca/itest/databinding/types</Namespace> <Prefix>p</Prefix> <Type> <TypeName>PersonType</TypeName> <CreateTypeCode> TypesFactory factory = TypesFactory.INSTANCE; param = factory.createPersonType(); param.setFirstName("George"); param.setLastName("Doors"); </CreateTypeCode> <ModifyTypeCode> param.setGreeting("Hello"); </ModifyTypeCode> <ResultComparison> assertNotSame("greetedPerson.getGreeting() not set", "", result.getGreeting()); </ResultComparison> </Type> </InputFile> ...</tns:Generate> + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/databinding.png b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/databinding.png new file mode 100644 index 0000000000..76a9c71b7d Binary files /dev/null and b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/databinding.png differ diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/databinding.svg b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/databinding.svg new file mode 100644 index 0000000000..d6850ccf7d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/databinding.svg @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + GreeterService + + DefaultGreeterServiceClient + + + GreeterServiceComponent + + WSGreeterServiceClient + + + + + WSReference WSService + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop.png b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop.png new file mode 100644 index 0000000000..005e0f24ea Binary files /dev/null and b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop.png differ diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop.svg b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop.svg new file mode 100644 index 0000000000..03897c6d09 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop.svg @@ -0,0 +1,352 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + InteropGreeterService + + SDODefaultGreeterServiceClient + + + SDOGreeterServiceComponent + + SDOWSGreeterServiceClient + + + + WSReference WSService + JAXBDefaultGreeterServiceClient + + + JAXBWSGreeterServiceClient + + + + WSReference WSService + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/pom.xml new file mode 100644 index 0000000000..f6685957cf --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/pom.xml @@ -0,0 +1,230 @@ + + + + + org.apache.tuscany.sca + itest-databindings + 1.2.1-incubating-SNAPSHOT + + + 4.0.0 + + itest-databindings-interop + 1.2.1-incubating-SNAPSHOT + jar + Apache Tuscany SCA DataBinding Interop Integration Tests + + + + + true + + java.net + java.net Maven 1.x Repository + http://download.java.net/maven/1 + legacy + + + java.net2 + java.net Maven 2.x Repository + http://download.java.net/maven/2 + + + + + + + true + + java.net + java.net Maven 1.x Repository + http://download.java.net/maven/1 + legacy + + + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${pom.version} + compile + + + org.apache.tuscany.sca + tuscany-databinding-jaxb + ${pom.version} + compile + + + org.apache.tuscany.sca + tuscany-databinding-sdo + ${pom.version} + compile + + + org.apache.tuscany.sca + tuscany-databinding-axiom + ${pom.version} + compile + + + javax.xml.bind + jaxb-api + 2.1 + compile + + + + com.sun.xml.ws + jaxws-rt + 2.1.3 + + + org.apache.tuscany.sca + itest-databindings-common + ${pom.version} + compile + + + org.apache.tuscany.sca + itest-databindings-sdo + ${pom.version} + compile + + + org.apache.tuscany.sca + itest-databindings-jaxb + ${pom.version} + compile + + + org.apache.tuscany.sca + tuscany-host-embedded + ${pom.version} + compile + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${pom.version} + compile + + + org.apache.tuscany.sca + tuscany-interface-java-xml + ${pom.version} + compile + + + org.apache.tuscany.sca + tuscany-host-jetty + 1.2.1-incubating-SNAPSHOT + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + -Djava.endorsed.dirs=target/endorsed + + + + org.apache.maven.plugins + maven-dependency-plugin + + + generate-sources + + unpack + + + + + org.apache.tuscany.sca + itest-databindings-common + ${project.version} + true + ${project.build.directory}/classes + + + + + + copy + generate-sources + + copy + + + + + javax.xml.ws + jaxws-api + 2.1-1 + jar + + + javax.xml.bind + jaxb-api + 2.1 + jar + + + ${project.build.directory}/endorsed + false + true + + + + + + org.codehaus.mojo + exec-maven-plugin + + + generate-test-source + process-resources + + java + + + + + org.apache.tuscany.sca.itest.generate.Generate + + ${project.build.directory} + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/src/main/resources/generate/InteropDatabindingTestCase.java.vm b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/src/main/resources/generate/InteropDatabindingTestCase.java.vm new file mode 100644 index 0000000000..7bdfc57924 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/src/main/resources/generate/InteropDatabindingTestCase.java.vm @@ -0,0 +1,113 @@ +/* + * 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 $template.getJavaPackage(); + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; +import ${template.getJavaPackage()}.GreeterService; + +// Data types +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) +import $file.getJavaPackage().$typeInstance.getTypeName(); +import $file.getJavaPackage().$file.getFactory(); +#end +#end + +/** + * Automatically generated test case. Calls the greeter client for a number of + * bindings and a number of data types. + * + * @version $Rev: 511417 $ $Date: 2007-02-25 03:06:42 +0000 (Sun, 25 Feb 2007) $ + */ +public class InteropDatabindingTestCase extends TestCase { + + private static boolean initalised = false; + private GreeterService greeterClient; + private static SCADomain domain; + + /** + * Runs before each test method + */ + protected void setUp() throws Exception { + if (!initalised) { + domain = SCADomain.newInstance("interopgreeter.composite"); + super.setUp(); + initalised = true; + } + } + + /** + * Runs after each test method + */ + protected void tearDown() { + + } + + /** + * Finds the SCA component that relates to the protocol being tested. This test + * always connects locally to the client component but the client component will + * connect to the back end component using the appropriate protocol + * + * @param ext the protcol required + */ + private void setUpClient(String ext) throws Exception { + greeterClient = domain.getService(GreeterService.class, "SDO" + ext + "GreeterServiceClient"); + } + + /** + * Invokes the SDO Greet service using web service bindings with SDO payload + */ + public void testWSGreet() throws Exception { + setUpClient("WS"); + greet(); + } + + /** + * Invokes the SDO Greet service using default bindings with SDO payload + */ + public void testDefaultGreet() throws Exception { + setUpClient("Default"); + greet(); + } + + /** + * A generic method which, regarless of which client is connected, sends out a + * series of requrests passing different data types. + */ + public void greet() { +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) + + // test $typeInstance.getTypeName() + { + $typeInstance.getTypeName() param = null; + $typeInstance.getCreateTypeCode() + $typeInstance.getTypeName() result = greeterClient.greet$typeInstance.getTypeName()(param); + $typeInstance.getResultComparison() + } +#end +#end + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/src/main/resources/generate/JAXBGreeter.wsdl.vm b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/src/main/resources/generate/JAXBGreeter.wsdl.vm new file mode 100644 index 0000000000..38bfccce0c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/src/main/resources/generate/JAXBGreeter.wsdl.vm @@ -0,0 +1,103 @@ + + + + + + + +#foreach($file in $fileList) + +#end + +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) + + + + + + + +#end +#end + + +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) + + + + + + + +#end +#end + + +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) + + + + +#end +#end + + + + +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) + + + + + + + + + +#end +#end + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/src/main/resources/generate/SDOGreeter.wsdl.vm b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/src/main/resources/generate/SDOGreeter.wsdl.vm new file mode 100644 index 0000000000..6f02af4c9d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/src/main/resources/generate/SDOGreeter.wsdl.vm @@ -0,0 +1,103 @@ + + + + + + + +#foreach($file in $fileList) + +#end + +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) + + + + + + + +#end +#end + + +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) + + + + + + + +#end +#end + + +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) + + + + +#end +#end + + + + +#foreach($file in $fileList) +#set($typeList = $file.getType_()) +#foreach($typeInstance in $typeList) + + + + + + + + + +#end +#end + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/src/main/resources/generate/generate.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/src/main/resources/generate/generate.xml new file mode 100644 index 0000000000..8453dd56b4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/src/main/resources/generate/generate.xml @@ -0,0 +1,159 @@ + + + + + + + + + + Person.xsd + xsd + org.apache.tuscany.sca.itest.databinding.types + TypesFactory + http://apache.org/tuscany/sca/itest/databinding/types + p + + PersonType + + TypesFactory factory = TypesFactory.INSTANCE; + param = factory.createPersonType(); + param.setFirstName("George"); + param.setLastName("Doors"); + + + param.setGreeting("Hello"); + + + assertNotSame("greetedPerson.getGreeting() not set", "", result.getGreeting()); + + + + + Interop.xsd + xsd + org.apache.tuscany.interop + InteropFactory + http://www.apache.org/tuscany/interop + i + + + AttributeComplexType + + InteropFactory factory = InteropFactory.INSTANCE; + org.apache.tuscany.interop.AttributeType attrib = factory.createAttributeType(); + attrib.setAttribute("SomeText"); + param = factory.createAttributeComplexType(); + param.setAttributeElement(attrib); + + + param.getAttributeElement().setAttribute("SomeChangedText");; + + + assertEquals("data not changed corretly", "SomeChangedText", result.getAttributeElement().getAttribute()); + + + + AttributeReferenceComplexType + + InteropFactory factory = InteropFactory.INSTANCE; + param = factory.createAttributeReferenceComplexType(); + + param.setReferencedAttribute("SomeText"); + + + param.setReferencedAttribute("SomeChangedText");; + + + assertEquals("data not changed corretly", "SomeChangedText", result.getReferencedAttribute()); + + + + SimpleTypeWithAbstractComplexType + + InteropFactory factory = InteropFactory.INSTANCE; + param = factory.createSimpleTypeWithAbstractComplexType(); + param.setSimpleTypeWithAbstractExtensionElement("SomeText"); + + + param.setSimpleTypeWithAbstractExtensionElement("SomeChangedText");; + + + assertEquals("data not changed corretly", "SomeChangedText", result.getSimpleTypeWithAbstractExtensionElement()); + + + + SimpleTypeWithNameComplexType + + InteropFactory factory = InteropFactory.INSTANCE; + param = factory.createSimpleTypeWithNameComplexType(); + param.setSimpleTypeWithNameElement("SomeText"); + + + param.setSimpleTypeWithNameElement("SomeChangedText");; + + + assertEquals("data not changed corretly", "SomeChangedText", result.getSimpleTypeWithNameElement()); + + + + ComplexTypeWithContentType + + InteropFactory factory = InteropFactory.INSTANCE; + param = factory.createComplexTypeWithContentType(); + param.setSimpleTypeWithName("SomeText"); + + + param.setSimpleTypeWithName("SomeChangedText");; + + + assertEquals("data not changed corretly", "SomeChangedText", result.getSimpleTypeWithName()); + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/src/main/resources/generate/interopgreeter.composite.vm b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/src/main/resources/generate/interopgreeter.composite.vm new file mode 100644 index 0000000000..36797fde57 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/interop/src/main/resources/generate/interopgreeter.composite.vm @@ -0,0 +1,78 @@ + + + + + + #foreach( $file in $fileList ) + + #end + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/jaxbgen/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/jaxbgen/pom.xml new file mode 100644 index 0000000000..0dc2ec329d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/jaxbgen/pom.xml @@ -0,0 +1,256 @@ + + + + + org.apache.tuscany.sca + itest-databindings + 1.2.1-incubating-SNAPSHOT + + + 4.0.0 + + itest-databindings-jaxb + 1.2.1-incubating-SNAPSHOT + jar + Apache Tuscany SCA JAXB Databinding Integration Tests + + + + + true + + java.net + java.net Maven 1.x Repository + http://download.java.net/maven/1 + legacy + + + java.net2 + java.net Maven 2.x Repository + http://download.java.net/maven/2 + + + + + + java.net2 + java.net Maven 2.x Repository + http://download.java.net/maven/2 + + + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${pom.version} + runtime + + + org.apache.tuscany.sca + tuscany-databinding-jaxb + ${pom.version} + runtime + + + org.apache.tuscany.sca + tuscany-databinding-sdo + ${pom.version} + compile + + + org.apache.tuscany.sca + tuscany-databinding-axiom + ${pom.version} + compile + + + org.apache.tuscany.sca + itest-databindings-common + ${pom.version} + compile + + + org.apache.tuscany.sca + tuscany-host-embedded + ${pom.version} + compile + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${pom.version} + compile + + + org.apache.tuscany.sca + tuscany-interface-java-xml + ${pom.version} + compile + + + org.apache.tuscany.sca + tuscany-host-jetty + 1.2.1-incubating-SNAPSHOT + runtime + + + javax.xml.bind + jaxb-api + 2.1 + compile + + + + com.sun.xml.ws + jaxws-rt + 2.1.3 + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + -Djava.endorsed.dirs=target/endorsed + + + + org.apache.maven.plugins + maven-dependency-plugin + + + generate-sources + + unpack + + + + + org.apache.tuscany.sca + itest-databindings-common + ${project.version} + true + ${project.build.directory}/classes + + + + + + copy + generate-sources + + copy + + + + + javax.xml.ws + jaxws-api + 2.1 + jar + + + javax.xml.bind + jaxb-api + 2.1 + jar + + + ${project.build.directory}/endorsed + false + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-test-source + generate-sources + + add-test-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + exec-maven-plugin + + + generate-test-source + process-resources + + java + + + + + org.apache.tuscany.sca.itest.generate.Generate + + ${project.build.directory} + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.9 + + + process-resources + + wsimport + + + + + org.apache.tuscany.sca.itest.jaxbdatabinding.generated + ${project.build.directory}/classes/wsdl + + Greeter.wsdl + + ${project.build.directory}/jaxws-source + false + true + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/jaxbgen/src/main/resources/generate/generate.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/jaxbgen/src/main/resources/generate/generate.xml new file mode 100644 index 0000000000..8381a164ea --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/jaxbgen/src/main/resources/generate/generate.xml @@ -0,0 +1,172 @@ + + + + + + + + + + + + + Person.xsd + xsd + org.apache.tuscany.sca.itest.jaxbdatabinding.generated + ObjectFactory + http://apache.org/tuscany/sca/itest/databinding/types + p + + PersonType + + ObjectFactory factory = new ObjectFactory(); + param = factory.createPersonType(); + param.setFirstName("George"); + param.setLastName("Doors"); + + + param.setGreeting("Hello"); + + + assertNotSame("greetedPerson.getGreeting() not set", "", result.getGreeting()); + + + + + Interop.xsd + xsd + org.apache.tuscany.sca.itest.jaxbdatabinding.generated + ObjectFactory + http://www.apache.org/tuscany/interop + i + + + AttributeComplexType + + ObjectFactory factory = new ObjectFactory(); + org.apache.tuscany.sca.itest.jaxbdatabinding.generated.AttributeType attrib = factory.createAttributeType(); + attrib.setAttribute("SomeText"); + param = factory.createAttributeComplexType(); + param.setAttributeElement(attrib); + + + param.getAttributeElement().setAttribute("SomeChangedText");; + + + assertEquals("data not changed corretly", "SomeChangedText", result.getAttributeElement().getAttribute()); + + + + AttributeReferenceComplexType + + ObjectFactory factory = new ObjectFactory(); + param = factory.createAttributeReferenceComplexType(); + + param.setReferencedAttribute("SomeText"); + + + param.setReferencedAttribute("SomeChangedText");; + + + assertEquals("data not changed corretly", "SomeChangedText", result.getReferencedAttribute()); + + + + SimpleTypeWithAbstractComplexType + + ObjectFactory factory = new ObjectFactory(); + param = factory.createSimpleTypeWithAbstractComplexType(); + param.setSimpleTypeWithAbstractExtensionElement("SomeText"); + + + param.setSimpleTypeWithAbstractExtensionElement("SomeChangedText");; + + + assertEquals("data not changed corretly", "SomeChangedText", result.getSimpleTypeWithAbstractExtensionElement()); + + + + SimpleTypeWithNameComplexType + + ObjectFactory factory = new ObjectFactory(); + param = factory.createSimpleTypeWithNameComplexType(); + param.setSimpleTypeWithNameElement("SomeText"); + + + param.setSimpleTypeWithNameElement("SomeChangedText");; + + + assertEquals("data not changed corretly", "SomeChangedText", result.getSimpleTypeWithNameElement()); + + + + ComplexTypeWithContentType + + ObjectFactory factory = new ObjectFactory(); + param = factory.createComplexTypeWithContentType(); + param.setSimpleTypeWithName("SomeText"); + + + param.setSimpleTypeWithName("SomeChangedText");; + + + assertEquals("data not changed corretly", "SomeChangedText", result.getSimpleTypeWithName()); + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/jaxbgen/src/main/resources/greeter.composite b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/jaxbgen/src/main/resources/greeter.composite new file mode 100644 index 0000000000..ae0740e6fe --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/jaxbgen/src/main/resources/greeter.composite @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/pom.xml b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/pom.xml new file mode 100644 index 0000000000..21638d0073 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/pom.xml @@ -0,0 +1,45 @@ + + + + + org.apache.tuscany.sca + tuscany-itest + 1.2.1-incubating-SNAPSHOT + ../pom.xml + + 4.0.0 + + org.apache.tuscany.sca + itest-databindings + Apache Tuscany SCA Databindings Integration Tests + 1.2.1-incubating-SNAPSHOT + + + pom + + install + + + common + sdogen + jaxbgen + interop + + diff --git a/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/readme.html b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/readme.html new file mode 100644 index 0000000000..24a44e4ed7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.2.1/itest/databindings/readme.html @@ -0,0 +1,157 @@ + + + + + + + + + Tuscany SCA Integration Test Databindings + + + + + +

Tuscany SCA Integation Test Databindings

+ +

Overview

+ +

+This integration test tests the Tuscany SCA databinding implementation by passing various data structures +across various bindings using the supported databindings. There are tests for the individual databindings +which exercise various bindings with the same databinding at client and server ends of each binding. There +is also an integration test which exercises the transformer chains by specifying different databindings at +client and server ends of the binding. +

+

+In doing this testing it is apparent that there is a lot of repetition in creating client, services, idl and +type for each of the data types for each of the bindings for each of the databindings. To reduce the amount +of effort required to maintain the tests as new types, bindings and databindings are added the test cases +themselves are generated from configuration files. +

+ +

Test Structure

+ +Databindings/Common - hold files common across all tests
+Databindings/Interop - test the transformer chains with combinations of databindings
+Databindings/sdogen and jaxbgen - test each databindings independently
+ +

Test Generation

+

+To reduce the amount of manual effort involved in building and maintaining tests cases the test cases +themselves are generated at run time using a set of velocity templates. Each test module has a generate.xml +file in the resources/generate directory which tells the generator what to do. The file looks like this. +

+ +

+Each