summaryrefslogtreecommitdiffstats
path: root/tags/java/sca/2.0-M3-RC3a/itest
diff options
context:
space:
mode:
Diffstat (limited to 'tags/java/sca/2.0-M3-RC3a/itest')
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/pom.xml112
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentDImpl.java43
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentDReferenceMultiplicityImpl.java48
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentEImpl.java36
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentFImpl.java36
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/Service3.java34
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/Service3a.java34
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario1/META-INF/sca-contribution.xml23
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario1/scenario1.composite45
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario1/scenario1a.composite47
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario10/META-INF/sca-contribution.xml24
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario10/scenario10.composite62
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario10/scenario10a.composite61
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario10/service3.wsdl63
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario11/META-INF/sca-contribution.xml24
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario11/scenario11.composite59
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario11/scenario11a.composite64
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario11/service3.wsdl63
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario12/META-INF/sca-contribution.xml24
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario12/scenario12.composite58
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario12/scenario12a.composite64
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario13/META-INF/sca-contribution.xml24
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario13/scenario13.composite58
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario13/scenario13a.composite64
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario2/META-INF/sca-contribution.xml24
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario2/scenario2.composite45
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario2/scenario2a.composite47
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario3/META-INF/sca-contribution.xml24
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario3/scenario3.composite44
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario3/scenario3a.composite48
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario4/META-INF/sca-contribution.xml24
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario4/scenario4.composite44
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario4/scenario4a.composite48
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario5/META-INF/sca-contribution.xml24
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario5/scenario5.composite46
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario5/scenario5a.composite47
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario5/scenarios.wsdl63
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario6/META-INF/sca-contribution.xml24
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario6/scenario6.composite47
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario6/scenario6a.composite47
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario6/scenarios.wsdl63
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario7/META-INF/sca-contribution.xml24
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario7/scenario7.composite45
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario7/scenario7a.composite49
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario7/scenarios.wsdl63
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario8/META-INF/sca-contribution.xml24
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario8/scenario8.composite44
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario8/scenario8a.composite50
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario8/scenarios.wsdl63
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario9/META-INF/sca-contribution.xml24
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario9/scenario9.composite60
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario9/scenario9a.composite61
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java875
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/CustomCompositeBuilder.java101
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/TestUtils.java276
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-api/pom.xml58
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java38
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java30
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java201
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java50
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java113
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/resources/CallBackApiTest.composite33
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/resources/META-INF/sca-contribution.xml23
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java70
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/pom.xml78
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java33
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java28
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java129
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java37
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java56
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/resources/CallBackBasicTest.composite40
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/resources/META-INF/sca-contribution.xml23
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java56
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-basic/pom.xml58
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java33
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java28
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java129
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java37
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java56
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/resources/CallBackBasicTest.composite33
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/resources/META-INF/sca-contribution.xml23
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java56
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/pom.xml53
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeCallBack.java33
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClient.java28
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClientImpl.java138
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeService.java37
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java59
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/resources/CallBackCTypeClient.composite33
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/resources/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.componentType28
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeTestCase.java54
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-id/pom.xml53
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdCallBack.java31
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClient.java28
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClientImpl.java145
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdService.java33
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdServiceImpl.java47
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/main/resources/CallBackIdClient.composite33
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/test/java/org/apache/tuscany/sca/test/CallBackIdTestCase.java51
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/pom.xml53
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClient.java27
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl1.java49
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl2.java49
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyService.java32
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceCallback.java27
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceImpl.java45
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite38
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/test/java/org/apache/tuscany/sca/test/callback/CallbackMultiWireTestCase.java64
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/pom.xml53
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClient.java34
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClientImpl.java186
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorCallBack.java37
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorService.java47
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorServiceImpl.java195
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite31
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/test/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadTestCase.java73
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/pom.xml53
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCalbackService.java34
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackBadCallback.java37
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallback.java31
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallbackImpl.java66
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClient.java28
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClientImpl.java188
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackObjectCallback.java44
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackServiceImpl.java73
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/resources/CallBackSetCallbackTest.composite37
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackTestCase.java54
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/pom.xml53
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java39
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java34
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java28
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java157
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java56
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java51
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java36
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java98
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/resources/CallBackSetCallbackConvTest.composite33
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvTestCase.java52
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/component-type/pom.xml53
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/AddService.java28
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/AddServiceImpl.java30
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/CalculatorClient.java49
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/CalculatorService.java34
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/CalculatorServiceImpl.java63
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/DivideService.java28
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/DivideServiceImpl.java30
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/MultiplyService.java28
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/MultiplyServiceImpl.java30
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/SubtractService.java28
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/SubtractServiceImpl.java30
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/Calculator.composite49
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/calculator/AddServiceImpl.componentType27
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/calculator/CalculatorServiceImpl.componentType43
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/calculator/DivideServiceImpl.componentType27
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/calculator/MultiplyServiceImpl.componentType27
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/calculator/SubtractServiceImpl.componentType27
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/component-type/src/test/java/calculator/CalculatorTestCase.java60
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/pom.xml46
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/java/calculator/CalculatorService.java31
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/java/test/ContributionFolderTestCase.java55
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/resources/repository/folderWithJars/Calculator.composite49
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/resources/repository/folderWithJars/META-INF/sca-contribution.xml23
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/resources/repository/folderWithJars/service.jarbin0 -> 2380 bytes
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/resources/repository/folderWithJars/serviceImpl.jarbin0 -> 4655 bytes
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/resources/repository3/contribution.zipbin0 -> 5478 bytes
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-composite/pom.xml67
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-composite/src/main/java/hello/Hello.java30
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-composite/src/main/java/hello/HelloImpl.java33
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-composite/src/main/resources/META-INF/sca-contribution.xml25
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-composite/src/main/resources/hello.composite31
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-composite/src/test/java/org/apache/tuscany/sca/test/contribution/HelloTestCase.java91
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-java/pom.xml67
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-java/src/main/java/helloworld/HelloWorldService.java30
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-java/src/main/resources/META-INF/sca-contribution.xml24
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-java/src/main/resources/helloworld/HelloWorldImpl.componentType30
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-resource/pom.xml31
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-resource/src/main/resources/META-INF/sca-contribution.xml24
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-resource/src/main/resources/ufservices/store.html27
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-wsdl/pom.xml31
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-wsdl/src/main/resources/META-INF/sca-contribution.xml24
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.wsdl76
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.xsd35
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/pom.xml73
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldImpl.java38
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldServer.java46
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldService.java30
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/resources/META-INF/sca-contribution.xml27
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/resources/helloworld.wsdl76
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/resources/helloworld.xsd35
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/resources/helloworldws.composite39
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/test/java/org/apache/tuscany/test/contribution/HelloWorldServerTestCase.java126
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-java/pom.xml73
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-java/src/main/java/helloworld/HelloWorldImpl.java33
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-java/src/main/resources/META-INF/sca-contribution.xml25
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-java/src/main/resources/helloworldws.composite29
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-java/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java127
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-resource/pom.xml102
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-resource/src/main/resources/META-INF/sca-contribution.xml25
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-resource/src/main/resources/store.composite33
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-resource/src/test/java/org/apache/tuscany/sca/test/contribution/StoreTestCase.java129
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/pom.xml73
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldImpl.java33
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldServer.java46
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldService.java30
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/src/main/resources/META-INF/sca-contribution.xml25
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/src/main/resources/helloworldws.composite33
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java137
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/pom.xml56
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-zip/pom.xml45
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-zip/src/test/java/calculator/CalculatorService.java31
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-zip/src/test/java/org/apache/tuscany/sca/contribution/zip/ContributionZIPTestCase.java56
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/contribution-zip/src/test/resources/repository/contribution.zipbin0 -> 6395 bytes
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/pom.xml53
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/Record.java29
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/TestResult.java37
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/AService.java56
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Alpha.java32
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/BService.java42
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Beta.java31
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/CService.java42
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Constants.java25
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationIdService.java30
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalCallback.java49
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalClient.java66
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalReferenceClient.java36
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalService.java61
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalServiceNonConversationalCallback.java61
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/DService.java46
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Gamma.java41
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallback.java45
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AServiceImpl.java108
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AlphaImpl.java69
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BServiceImpl.java72
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BetaImpl.java50
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/CServiceImpl.java84
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationAgeComponentImpl.java75
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationIdComponentImpl.java48
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationMaxIdleComponentImpl.java75
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulImpl.java325
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulNonConversationalCallbackImpl.java318
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatelessImpl.java322
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalReferenceClientImpl.java42
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceRequestImpl.java122
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulImpl.java114
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulNonConversationalCallbackImpl.java115
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessImpl.java122
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessScopeImpl.java93
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/DServiceImpl.java68
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/GammaImpl.java66
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/resources/ConversationAge.composite31
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/resources/ConversationUniqueId.composite53
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/resources/conversationId.composite27
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/resources/conversationLifetime.composite33
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/resources/conversational.composite99
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationIdTestCase.java56
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationLifetimeTestCase.java208
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationUniqueIdTestCase.java78
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalAgeTestCase.java107
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalJ2SETestCase.java88
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalTestCase.java702
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/distribution/bin-distro-unzip/build.xml24
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/distribution/bin-distro-unzip/pom.xml138
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/distribution/binding-ws-calculator/build.xml40
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/distribution/binding-ws-calculator/pom.xml82
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/distribution/calculator-rmi/build.xml51
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/distribution/calculator-rmi/pom.xml81
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/distribution/implementation-java-calculator/build.xml40
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/distribution/implementation-java-calculator/pom.xml82
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/distribution/legal-checks/pom.xml42
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/distribution/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java162
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/distribution/pom.xml48
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-bpel/pom.xml124
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-bpel/src/test/java/itest/HelloworldTestCase.java50
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-jsp/pom.xml124
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-jsp/src/test/java/itest/HelloworldTestCase.java50
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-stripes/pom.xml124
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-stripes/src/test/java/itest/HelloworldTestCase.java53
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld/pom.xml121
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/exceptions/pom.xml53
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/Checked.java57
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionHandler.java32
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionRemoteThrower.java30
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionThrower.java37
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/UnChecked.java57
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionHandlerImpl.java115
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionRemoteThrowerImpl.java44
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionThrowerImpl.java45
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java116
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/resources/ExceptionTest.composite41
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/test/java/org/apache/tuscany/sca/test/exceptions/ExceptionsTestCase.java85
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/pom.xml80
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteImpl.java38
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteService.java30
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/AddService.java28
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/AddServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/CalculatorService.java37
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/CalculatorServiceImpl.java79
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/DivideService.java28
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/DivideServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/MultiplyService.java28
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/MultiplyServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/SubtractService.java28
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/SubtractServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/security/CalculatorCallbackHandler.java50
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/security/JaasLoginModule.java178
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/security/UserPrincipal.java66
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/context/access/SCAApplicationContextProvider.java37
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/helloworld/HelloWorld.java35
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/helloworld/HelloWorldImpl.java38
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/helloworld/HelloWorldProxy.java42
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestBean.java31
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestBeanImpl.java42
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestHelloWorldBean.java39
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestReference.java27
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestReferenceBean.java57
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestSCAPropertyBean.java55
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/spring/annotations/CalculatorServiceImpl.java131
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/CalculatorService-context.xml39
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/SpringDelegationHelloWorld-context.xml39
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/SpringHelloWorld-context.xml31
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-access/CalculatorService-context.xml45
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-imports/CalculatorService-context.xml39
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-imports/SpringImport-context.xml29
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/SpringHelloWorld-context.xml31
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/StockQuoteService-context.xml36
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/beanRefContext.xml35
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/implementation-policies/CalculatorService-context.xml39
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/location-folder/META-INF/MANIFEST.MF3
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/location-folder/META-INF/spring/SpringSCAProperty-context.xml34
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/location-jar/spring-context.jarbin0 -> 1454 bytes
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/sca-references/SpringExplicitReference-context.xml33
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/sca-references/SpringImplicitReference-context.xml34
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/sca-services/SpringExplicitService-context.xml39
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/sca-services/SpringImplicitService-context.xml31
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/spring-annotation/CalculatorService-context.xml41
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/context/access/ContextAccess.composite49
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/context/imports/ContextImports.composite49
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/context/multiple/MultipleContext.composite35
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/implementation/policies/CalculatorJass.config3
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/implementation/policies/CalculatorLogMessages.properties18
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/implementation/policies/ImplementationPolicies.composite58
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/implementation/policies/definitions.xml40
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/location/folder/SpringFolderLocation.composite39
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/location/jar/SpringJarLocation.composite39
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorld.composite32
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringHelloWorld.composite32
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/sca/references/SpringExplicitReference.composite32
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/sca/references/SpringImplicitReference.composite39
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/sca/services/SpringExplicitService.composite33
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/sca/services/SpringImplicitService.composite32
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/spring/annotations/Calculator.composite60
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/access/CalculatorClient.java59
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/access/ContextAccessTestCase.java32
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/imports/CalculatorClient.java51
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/imports/ContextImportsTestCase.java32
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/multiple/MultipleContextTestCase.java32
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/multiple/StockQuoteServer.java53
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/implementation/policies/CalculatorClient.java74
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/implementation/policies/ImplementationPoliciesTestCase.java35
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/location/folder/SpringFolderLocationTestCase.java41
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/location/jar/SpringJarLocationTestCase.java41
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractHelloWorldTestCase.java40
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java57
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorld.java34
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorldProxy.java41
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorldTestCase.java31
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringHelloWorldTestCase.java32
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldBean.java36
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldDelegatorBean.java40
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/sca/references/SpringExplicitReferenceTestCase.java41
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/sca/references/SpringImplicitReferenceTestCase.java44
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/sca/services/SpringExplicitServiceTestCase.java36
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/sca/services/SpringImplicitServiceTestCase.java34
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/spring/annotations/CalculatorClient.java61
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/spring/annotations/SpringAnnotationsTestCase.java32
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/interfaces/pom.xml53
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalCallbackInterface.java30
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponent.java47
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java83
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponent.java37
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponentImpl.java49
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.java48
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteCallbackInterface.java33
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponent.java64
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponentImpl.java81
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponent.java38
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponentImpl.java54
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/resources/InterfacesTest.composite40
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InterfacesTestCase.java131
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-client/pom.xml44
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java33
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-client/src/main/resources/META-INF/sca-contribution.xml23
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-client/src/main/resources/helloworld-client.composite29
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-iface/pom.xml39
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java26
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-service/pom.xml49
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-service/src/main/java/itest/nodes/HelloworldImpl.java28
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-service/src/main/resources/META-INF/sca-contribution.xml23
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-service/src/main/resources/helloworld-service.composite28
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/nodes/one-node-test/pom.xml48
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java87
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/nodes/pom.xml44
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/nodes/two-nodes-test/pom.xml53
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java101
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/pom.xml53
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/OverloadASourceTarget.java61
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadASource.java113
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATarget.java99
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/src/main/resources/OperationOverload.composite34
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/src/test/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATestCase.java98
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/pom.xml166
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/pom.xml106
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/mysca/test/myservice/impl/MyService.java34
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/mysca/test/myservice/impl/MyServiceImpl.java88
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/mysca/test/myservice/impl/MyTotalServiceImpl.java46
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponent.java50
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponentImpl.java73
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponent.java75
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponentImpl.java131
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponent.java71
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponentImpl.java143
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java151
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideService.java27
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideServiceImpl.java28
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java135
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java188
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyService.java27
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Bar.java23
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo1.java39
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo2.java39
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo3.java44
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/test/jaxb/props/ObjectFactory.java75
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/test/jaxb/props/ReturnCodeProperties.java103
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/test/jaxb/props/package-info.java27
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/ConstructorPropertyInjection.composite39
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/Outer.composite43
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/OuterPropertyTest.composite42
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/PropertyTest.composite255
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/customer.xsd30
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/fileProperty.txt21
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/manyValuesFileProperty.txt23
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/mySimpleService.composite40
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/rcProps.txt22
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/rcprops.xsd55
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/test/java/org/apache/tuscany/sca/itest/MyTotalServiceTestCase.java104
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/test/java/org/apache/tuscany/sca/itest/OuterPropertyTestCase.java169
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java469
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/properties/src/test/java/org/apache/tuscany/sca/itest/cdi/ConstructorPropertyInjectionTestCase.java72
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/pom.xml61
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyService.java26
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyServiceImpl.java42
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalService.java26
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalServiceImpl.java39
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/resources/TotalService1Auto.composite52
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/resources/TotalService2Auto.composite49
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/resources/TotalService3Auto.composite52
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/test/java/test/sca/tests/MultiLevelTestCase.java90
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/references/pom.xml52
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponent.java40
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponentImpl.java125
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponent.java26
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentImpl.java39
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentWrongTargetImpl.java39
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponent.java24
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponentImpl.java27
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponent.java26
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponentImpl.java35
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/references/src/main/resources/AutoWiredReferencesTest.composite61
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/references/src/main/resources/InnerReferencesTest.composite51
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/references/src/main/resources/ManualWiredReferencesTest.composite60
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/AutoWiredReferenceTestCase.java114
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/InnerReferenceTestCase.java99
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/ManualWiredReferenceTestCase.java98
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/pom.xml46
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/src/main/java/itest/HelloworldService.java25
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/src/main/java/itest/HelloworldServiceImpl.java38
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/src/main/resources/Helloworld.composite29
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/src/main/resources/META-INF/sca-contribution.xml23
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java60
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/scopes/pom.xml54
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/CompositeScopeStateVerifierImpl.java46
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/RequestScopeStateVerifierImpl.java51
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/StateVerifier.java25
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/scopes/src/main/resources/scopes.composite33
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/scopes/src/test/java/org/apache/tuscany/sca/test/ScopeTestCase.java113
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/services/pom.xml53
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponent.java27
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponentImpl.java28
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponent.java25
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponentImpl.java31
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponent.java27
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponentImpl.java28
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/D1Component.java24
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponent.java24
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponentImpl.java34
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/services/src/main/resources/META-INF/sca-contribution.xml22
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/services/src/main/resources/ServicesTest.composite70
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/services/src/test/java/org/apache/tuscany/sca/itest/services/ServicesTestCase.java108
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/wires/pom.xml53
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClient.java34
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClientImpl.java51
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireService.java36
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireServiceImpl.java39
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/wires/src/main/resources/WireTest.composite39
-rw-r--r--tags/java/sca/2.0-M3-RC3a/itest/wires/src/test/java/org/apache/tuscany/sca/itest/WireTestCase.java78
505 files changed, 29717 insertions, 0 deletions
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/builder/pom.xml
new file mode 100644
index 0000000000..aa2f7c299a
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/pom.xml
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-builder</artifactId>
+ <name>Apache Tuscany SCA iTest Builder</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-monitor</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-sca-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core-databinding</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentDImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentDImpl.java
new file mode 100644
index 0000000000..a4c6e08844
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentDImpl.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.builder;
+
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * Implementation class for ComponentD.
+ *
+ * @version $Rev$ $Date$
+ */
+@Service(interfaces={Service3.class, Service3a.class})
+public class ComponentDImpl implements Service3, Service3a {
+
+ @Reference
+ protected Service3a reference3;
+
+ public String getGreetings(String name) {
+ return "Hello, " + name + "!";
+ }
+
+ public String getGreetings2(String name) {
+ return "Goodbye, " + name + "!";
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentDReferenceMultiplicityImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentDReferenceMultiplicityImpl.java
new file mode 100644
index 0000000000..bfc4e34644
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentDReferenceMultiplicityImpl.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.builder;
+
+import java.util.List;
+
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * Implementation class for ComponentD.
+ *
+ * @version $Rev$ $Date$
+ */
+@Service(interfaces={Service3.class, Service3a.class})
+public class ComponentDReferenceMultiplicityImpl implements Service3, Service3a {
+
+ @Reference
+ protected Service3a reference3;
+
+ @Reference
+ protected List<Service3> reference3a;
+
+ public String getGreetings(String name) {
+ return "Hello, " + name + "!";
+ }
+
+ public String getGreetings2(String name) {
+ return "Goodbye, " + name + "!";
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentEImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentEImpl.java
new file mode 100644
index 0000000000..eb5b5dd5c0
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentEImpl.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.builder;
+
+import org.oasisopen.sca.annotation.Service;
+
+
+/**
+ * Implementation class for ComponentD.
+ *
+ * @version $Rev$ $Date$
+ */
+@Service(interfaces={Service3.class})
+public class ComponentEImpl implements Service3 {
+
+
+ public String getGreetings(String name) {
+ return "Hello, " + name + " from ComponentE";
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentFImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentFImpl.java
new file mode 100644
index 0000000000..db1eac6787
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentFImpl.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.builder;
+
+import org.oasisopen.sca.annotation.Service;
+
+
+/**
+ * Implementation class for ComponentD.
+ *
+ * @version $Rev$ $Date$
+ */
+@Service(interfaces={Service3.class})
+public class ComponentFImpl implements Service3 {
+
+
+ public String getGreetings(String name) {
+ return "Hello, " + name + " from ComponentF";
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/Service3.java b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/Service3.java
new file mode 100644
index 0000000000..f4b8d2cf39
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/Service3.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.builder;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+
+/**
+ * Interface for Service3 in ComponentD.
+ *
+ * @version $Rev$ $Date$
+ */
+@Remotable
+public interface Service3 {
+
+ String getGreetings(String name);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/Service3a.java b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/Service3a.java
new file mode 100644
index 0000000000..299f7606e3
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/Service3a.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.builder;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+
+/**
+ * Interface for Service3a in ComponentD.
+ *
+ * @version $Rev$ $Date$
+ */
+@Remotable
+public interface Service3a {
+
+ String getGreetings2(String name);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario1/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario1/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..d8cb23bbd3
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario1/META-INF/sca-contribution.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:ns1="http://scenario1">
+ <deployable composite="ns1:CompositeA" />
+</contribution>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario1/scenario1.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario1/scenario1.composite
new file mode 100644
index 0000000000..4e58cdfa16
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario1/scenario1.composite
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://scenario1"
+ xmlns:tns="http://scenario1"
+ name="CompositeA">
+
+ <service name="Service1" promote="ComponentB/Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws />
+ </service>
+ <reference name="reference1" promote="ComponentB/reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentB">
+ <implementation.composite name="tns:CompositeC" />
+ <service name="Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario1/scenario1a.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario1/scenario1a.composite
new file mode 100644
index 0000000000..06b273c7a7
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario1/scenario1a.composite
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://scenario1"
+ xmlns:tns="http://scenario1"
+ name="CompositeC">
+
+ <service name="Service2" promote="ComponentD/Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a" promote="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2" promote="ComponentD/reference3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentD">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentDImpl"/>
+ <service name="Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario10/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario10/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..ac01b3c687
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario10/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario10"
+ xmlns:ns10="http://scenario10">
+ <deployable composite="ns10:CompositeA" />
+</contribution>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario10/scenario10.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario10/scenario10.composite
new file mode 100644
index 0000000000..2d127a7bec
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario10/scenario10.composite
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario10"
+ xmlns:tns="http://scenario10"
+ name="CompositeA">
+
+ <service name="Service1" promote="ComponentB/Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference1" promote="ComponentB/reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ <reference name="reference1a" promote="ComponentB/reference2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentB">
+ <implementation.composite name="tns:CompositeC" />
+ <service name="Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws uri="http://foo.com/bar" />
+ </service>
+ <reference name="reference2" target="ComponentB/Service2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws />
+ </reference>
+ <reference name="reference2a" target="ComponentF">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <interface.wsdl interface="http://scenarios#wsdl.interface(Service3)" />
+ <binding.ws />
+ </reference>
+ </component>
+
+ <component name="ComponentF">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentEImpl"/>
+ <service name="Service3">
+ <binding.sca />
+ <binding.ws />
+ </service>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario10/scenario10a.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario10/scenario10a.composite
new file mode 100644
index 0000000000..98103e360e
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario10/scenario10a.composite
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario10"
+ xmlns:tns="http://scenario10"
+ name="CompositeC">
+
+ <service name="Service2" promote="ComponentD/Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a" promote="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2" promote="ComponentD/reference3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ <reference name="reference2a" promote="ComponentD/reference3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentD">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentDReferenceMultiplicityImpl"/>
+ <service name="Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference3" target="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ <reference name="reference3a" target="ComponentE">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ </component>
+
+ <component name="ComponentE">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentEImpl"/>
+ <service name="Service3">
+ <binding.sca />
+ <binding.ws />
+ </service>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario10/service3.wsdl b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario10/service3.wsdl
new file mode 100644
index 0000000000..2477e23dc6
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario10/service3.wsdl
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions name="Service3Service"
+ targetNamespace="http://scenarios"
+ xmlns:tns="http://scenarios"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <wsdl:types>
+ <xs:schema attributeFormDefault="qualified"
+ elementFormDefault="unqualified"
+ targetNamespace="http://scenarios"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="getGreetings">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="arg0" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getGreetingsResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:schema>
+ </wsdl:types>
+
+ <wsdl:message name="getGreetings">
+ <wsdl:part name="getGreetings" element="tns:getGreetings" />
+ </wsdl:message>
+
+ <wsdl:message name="getGreetingsResponse">
+ <wsdl:part name="getGreetingsResponse" element="tns:getGreetingsResponse" />
+ </wsdl:message>
+
+ <wsdl:portType name="Service3">
+ <wsdl:operation name="getGreetings">
+ <wsdl:input message="tns:getGreetings" />
+ <wsdl:output message="tns:getGreetingsResponse" />
+ </wsdl:operation>
+ </wsdl:portType>
+
+</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario11/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario11/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..8b82b43c68
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario11/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario11"
+ xmlns:ns11="http://scenario11">
+ <deployable composite="ns11:CompositeA" />
+</contribution>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario11/scenario11.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario11/scenario11.composite
new file mode 100644
index 0000000000..2f5ca96d07
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario11/scenario11.composite
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario11"
+ xmlns:tns="http://scenario11"
+ name="CompositeA">
+
+ <service name="Service1" promote="ComponentB/Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference1" promote="ComponentB/reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ <reference name="reference1a" promote="ComponentB/reference2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentB">
+ <implementation.composite name="tns:CompositeC" />
+ <service name="Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws uri="http://foo.com/bar" />
+ </service>
+ <reference name="reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ <reference name="reference2a" target="ComponentF">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ </component>
+
+ <component name="ComponentF">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentEImpl"/>
+ <service name="Service3">
+ <binding.sca />
+ <binding.ws />
+ </service>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario11/scenario11a.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario11/scenario11a.composite
new file mode 100644
index 0000000000..381ccddcc3
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario11/scenario11a.composite
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario11"
+ xmlns:tns="http://scenario11"
+ name="CompositeC">
+
+ <service name="Service2" promote="ComponentD/Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a" promote="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2" promote="ComponentD/reference3" target="ComponentB/Service2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws />
+ </reference>
+ <reference name="reference2a" promote="ComponentD/reference3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <interface.wsdl interface="http://scenarios#wsdl.interface(Service3)" />
+ <binding.ws />
+ </reference>
+
+ <component name="ComponentD">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentDReferenceMultiplicityImpl"/>
+ <service name="Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference3" target="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ <reference name="reference3a" target="ComponentE">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ </component>
+
+ <component name="ComponentE">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentEImpl"/>
+ <service name="Service3">
+ <binding.sca />
+ <binding.ws />
+ </service>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario11/service3.wsdl b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario11/service3.wsdl
new file mode 100644
index 0000000000..2477e23dc6
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario11/service3.wsdl
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions name="Service3Service"
+ targetNamespace="http://scenarios"
+ xmlns:tns="http://scenarios"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <wsdl:types>
+ <xs:schema attributeFormDefault="qualified"
+ elementFormDefault="unqualified"
+ targetNamespace="http://scenarios"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="getGreetings">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="arg0" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getGreetingsResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:schema>
+ </wsdl:types>
+
+ <wsdl:message name="getGreetings">
+ <wsdl:part name="getGreetings" element="tns:getGreetings" />
+ </wsdl:message>
+
+ <wsdl:message name="getGreetingsResponse">
+ <wsdl:part name="getGreetingsResponse" element="tns:getGreetingsResponse" />
+ </wsdl:message>
+
+ <wsdl:portType name="Service3">
+ <wsdl:operation name="getGreetings">
+ <wsdl:input message="tns:getGreetings" />
+ <wsdl:output message="tns:getGreetingsResponse" />
+ </wsdl:operation>
+ </wsdl:portType>
+
+</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario12/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario12/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..4028098023
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario12/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario12"
+ xmlns:ns12="http://scenario12">
+ <deployable composite="ns12:CompositeA" />
+</contribution>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario12/scenario12.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario12/scenario12.composite
new file mode 100644
index 0000000000..23799f8487
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario12/scenario12.composite
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario12"
+ xmlns:tns="http://scenario12"
+ name="CompositeA">
+
+ <service name="Service1" promote="ComponentB/Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference1" promote="ComponentB/reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ <reference name="reference1a" promote="ComponentB/reference2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentB">
+ <implementation.composite name="tns:CompositeC" />
+ <service name="Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ <reference name="reference2a" target="ComponentF">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ </component>
+
+ <component name="ComponentF">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentEImpl"/>
+ <service name="Service3">
+ <binding.sca />
+ <binding.ws />
+ </service>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario12/scenario12a.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario12/scenario12a.composite
new file mode 100644
index 0000000000..a2b4f88dc3
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario12/scenario12a.composite
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario12"
+ xmlns:tns="http://scenario12"
+ name="CompositeC">
+
+ <service name="Service2" promote="ComponentD/Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a" promote="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2" promote="ComponentD/reference3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ <reference name="reference2a" promote="ComponentD/reference3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentD">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentDReferenceMultiplicityImpl"/>
+ <service name="Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws uri="http://foo.com/bar" />
+ </service>
+ <reference name="reference3" target="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws/>
+ </reference>
+ <reference name="reference3a" target="ComponentE">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws />
+ </reference>
+ </component>
+
+ <component name="ComponentE">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentEImpl"/>
+ <service name="Service3">
+ <binding.sca />
+ <binding.ws />
+ </service>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario13/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario13/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..1da59d5f04
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario13/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario13"
+ xmlns:ns13="http://scenario13">
+ <deployable composite="ns13:CompositeA" />
+</contribution>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario13/scenario13.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario13/scenario13.composite
new file mode 100644
index 0000000000..631e38855f
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario13/scenario13.composite
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario13"
+ xmlns:tns="http://scenario13"
+ name="CompositeA">
+
+ <service name="Service1" promote="ComponentB/Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference1" promote="ComponentB/reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ <reference name="reference1a" promote="ComponentB/reference2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentB">
+ <implementation.composite name="tns:CompositeC" />
+ <service name="Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ <reference name="reference2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ </component>
+
+ <component name="ComponentF">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentEImpl"/>
+ <service name="Service3">
+ <binding.sca />
+ <binding.ws />
+ </service>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario13/scenario13a.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario13/scenario13a.composite
new file mode 100644
index 0000000000..98976dc4e8
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario13/scenario13a.composite
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario13"
+ xmlns:tns="http://scenario13"
+ name="CompositeC">
+
+ <service name="Service2" promote="ComponentD/Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a" promote="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2" promote="ComponentD/reference3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ <reference name="reference2a" promote="ComponentD/reference3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentD">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentDReferenceMultiplicityImpl"/>
+ <service name="Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws uri="http://foo.com/bar" />
+ </service>
+ <reference name="reference3" target="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws/>
+ </reference>
+ <reference name="reference3a" target="ComponentE">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws />
+ </reference>
+ </component>
+
+ <component name="ComponentE">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentEImpl"/>
+ <service name="Service3">
+ <binding.sca />
+ <binding.ws />
+ </service>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario2/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario2/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..6f174a4504
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario2/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario2"
+ xmlns:ns2="http://scenario2">
+ <deployable composite="ns2:CompositeA" />
+</contribution>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario2/scenario2.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario2/scenario2.composite
new file mode 100644
index 0000000000..7c4eeda4bd
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario2/scenario2.composite
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario2"
+ xmlns:tns="http://scenario2"
+ name="CompositeA">
+
+ <service name="Service1" promote="ComponentB/Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference1" promote="ComponentB/reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentB">
+ <implementation.composite name="tns:CompositeC" />
+ <service name="Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws />
+ </service>
+ <service name="Service2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario2/scenario2a.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario2/scenario2a.composite
new file mode 100644
index 0000000000..5e97d7eea0
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario2/scenario2a.composite
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario2"
+ xmlns:tns="http://scenario2"
+ name="CompositeC">
+
+ <service name="Service2" promote="ComponentD/Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a" promote="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2" promote="ComponentD/reference3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentD">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentDImpl"/>
+ <service name="Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario3/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario3/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..22950dfe03
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario3/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario3"
+ xmlns:ns3="http://scenario3">
+ <deployable composite="ns3:CompositeA" />
+</contribution>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario3/scenario3.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario3/scenario3.composite
new file mode 100644
index 0000000000..84f42c60fc
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario3/scenario3.composite
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario3"
+ xmlns:tns="http://scenario3"
+ name="CompositeA">
+
+ <service name="Service1" promote="ComponentB/Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference1" promote="ComponentB/reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentB">
+ <implementation.composite name="tns:CompositeC" />
+ <service name="Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario3/scenario3a.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario3/scenario3a.composite
new file mode 100644
index 0000000000..18ed91142c
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario3/scenario3a.composite
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario3"
+ xmlns:tns="http://scenario3"
+ name="CompositeC">
+
+ <service name="Service2" promote="ComponentD/Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws />
+ </service>
+ <service name="Service2a" promote="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2" promote="ComponentD/reference3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentD">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentDImpl"/>
+ <service name="Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario4/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario4/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..a17e27c9d8
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario4/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario4"
+ xmlns:ns4="http://scenario4">
+ <deployable composite="ns4:CompositeA" />
+</contribution>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario4/scenario4.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario4/scenario4.composite
new file mode 100644
index 0000000000..a0bdb0197d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario4/scenario4.composite
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario4"
+ xmlns:tns="http://scenario4"
+ name="CompositeA">
+
+ <service name="Service1" promote="ComponentB/Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference1" promote="ComponentB/reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentB">
+ <implementation.composite name="tns:CompositeC" />
+ <service name="Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario4/scenario4a.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario4/scenario4a.composite
new file mode 100644
index 0000000000..1b4cf27c76
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario4/scenario4a.composite
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario4"
+ xmlns:tns="http://scenario4"
+ name="CompositeC">
+
+ <service name="Service2" promote="ComponentD/Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a" promote="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2" promote="ComponentD/reference3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentD">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentDImpl"/>
+ <service name="Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws />
+ </service>
+ <service name="Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario5/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario5/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..83a232db6e
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario5/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario5"
+ xmlns:ns5="http://scenario5">
+ <deployable composite="ns5:CompositeA" />
+</contribution>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario5/scenario5.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario5/scenario5.composite
new file mode 100644
index 0000000000..2326afd2f2
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario5/scenario5.composite
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario5"
+ xmlns:tns="http://scenario5"
+ name="CompositeA">
+
+ <service name="Service1" promote="ComponentB/Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference1" promote="ComponentB/reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <interface.wsdl interface="http://scenarios#wsdl.interface(Service3a)" />
+ <binding.ws uri="http://foo.com/bar" />
+ </reference>
+
+ <component name="ComponentB">
+ <implementation.composite name="tns:CompositeC" />
+ <service name="Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario5/scenario5a.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario5/scenario5a.composite
new file mode 100644
index 0000000000..fdf1423b66
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario5/scenario5a.composite
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario5"
+ xmlns:tns="http://scenario5"
+ name="CompositeC">
+
+ <service name="Service2" promote="ComponentD/Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a" promote="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2" promote="ComponentD/reference3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentD">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentDImpl"/>
+ <service name="Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario5/scenarios.wsdl b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario5/scenarios.wsdl
new file mode 100644
index 0000000000..5cda7327dd
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario5/scenarios.wsdl
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions name="Service3Service"
+ targetNamespace="http://scenarios"
+ xmlns:tns="http://scenarios"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <wsdl:types>
+ <xs:schema attributeFormDefault="qualified"
+ elementFormDefault="unqualified"
+ targetNamespace="http://scenarios"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="getGreetings2">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="arg0" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getGreetings2Response">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:schema>
+ </wsdl:types>
+
+ <wsdl:message name="getGreetings2">
+ <wsdl:part name="getGreetings2" element="tns:getGreetings2" />
+ </wsdl:message>
+
+ <wsdl:message name="getGreetings2Response">
+ <wsdl:part name="getGreetings2Response" element="tns:getGreetings2Response" />
+ </wsdl:message>
+
+ <wsdl:portType name="Service3a">
+ <wsdl:operation name="getGreetings2">
+ <wsdl:input message="tns:getGreetings2" />
+ <wsdl:output message="tns:getGreetings2Response" />
+ </wsdl:operation>
+ </wsdl:portType>
+
+</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario6/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario6/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..776dfe4d97
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario6/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://scenario6"
+ xmlns:ns6="http://scenario6">
+ <deployable composite="ns6:CompositeA" />
+</contribution>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario6/scenario6.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario6/scenario6.composite
new file mode 100644
index 0000000000..9575612d51
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario6/scenario6.composite
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://scenario6"
+ xmlns:tns="http://scenario6"
+ name="CompositeA">
+
+ <service name="Service1" promote="ComponentB/Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference1" promote="ComponentB/reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentB">
+ <implementation.composite name="tns:CompositeC" />
+ <service name="Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws uri="http://foo.com/bar" />
+ </service>
+ <reference name="reference2" target="ComponentB/Service2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <interface.wsdl interface="http://scenarios#wsdl.interface(Service3a)" />
+ <binding.ws />
+ </reference>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario6/scenario6a.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario6/scenario6a.composite
new file mode 100644
index 0000000000..9c7b58e2cb
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario6/scenario6a.composite
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://scenario6"
+ xmlns:tns="http://scenario6"
+ name="CompositeC">
+
+ <service name="Service2" promote="ComponentD/Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a" promote="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2" promote="ComponentD/reference3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentD">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentDImpl"/>
+ <service name="Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario6/scenarios.wsdl b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario6/scenarios.wsdl
new file mode 100644
index 0000000000..5cda7327dd
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario6/scenarios.wsdl
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions name="Service3Service"
+ targetNamespace="http://scenarios"
+ xmlns:tns="http://scenarios"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <wsdl:types>
+ <xs:schema attributeFormDefault="qualified"
+ elementFormDefault="unqualified"
+ targetNamespace="http://scenarios"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="getGreetings2">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="arg0" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getGreetings2Response">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:schema>
+ </wsdl:types>
+
+ <wsdl:message name="getGreetings2">
+ <wsdl:part name="getGreetings2" element="tns:getGreetings2" />
+ </wsdl:message>
+
+ <wsdl:message name="getGreetings2Response">
+ <wsdl:part name="getGreetings2Response" element="tns:getGreetings2Response" />
+ </wsdl:message>
+
+ <wsdl:portType name="Service3a">
+ <wsdl:operation name="getGreetings2">
+ <wsdl:input message="tns:getGreetings2" />
+ <wsdl:output message="tns:getGreetings2Response" />
+ </wsdl:operation>
+ </wsdl:portType>
+
+</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario7/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario7/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..ede31d6bee
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario7/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario7"
+ xmlns:ns7="http://scenario7">
+ <deployable composite="ns7:CompositeA" />
+</contribution>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario7/scenario7.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario7/scenario7.composite
new file mode 100644
index 0000000000..e1d2e0cefe
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario7/scenario7.composite
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario7"
+ xmlns:tns="http://scenario7"
+ name="CompositeA">
+
+ <service name="Service1" promote="ComponentB/Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference1" promote="ComponentB/reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentB">
+ <implementation.composite name="tns:CompositeC" />
+ <service name="Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws uri="http://foo.com/bar" />
+ </service>
+ <reference name="reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario7/scenario7a.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario7/scenario7a.composite
new file mode 100644
index 0000000000..ef16dc0785
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario7/scenario7a.composite
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario7"
+ xmlns:tns="http://scenario7"
+ name="CompositeC">
+
+ <service name="Service2" promote="ComponentD/Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a" promote="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2" promote="ComponentD/reference3" target="ComponentB/Service2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <interface.wsdl interface="http://scenarios#wsdl.interface(Service3a)" />
+ <binding.ws />
+ </reference>
+
+ <component name="ComponentD">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentDImpl"/>
+ <service name="Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario7/scenarios.wsdl b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario7/scenarios.wsdl
new file mode 100644
index 0000000000..5cda7327dd
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario7/scenarios.wsdl
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions name="Service3Service"
+ targetNamespace="http://scenarios"
+ xmlns:tns="http://scenarios"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <wsdl:types>
+ <xs:schema attributeFormDefault="qualified"
+ elementFormDefault="unqualified"
+ targetNamespace="http://scenarios"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="getGreetings2">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="arg0" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getGreetings2Response">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:schema>
+ </wsdl:types>
+
+ <wsdl:message name="getGreetings2">
+ <wsdl:part name="getGreetings2" element="tns:getGreetings2" />
+ </wsdl:message>
+
+ <wsdl:message name="getGreetings2Response">
+ <wsdl:part name="getGreetings2Response" element="tns:getGreetings2Response" />
+ </wsdl:message>
+
+ <wsdl:portType name="Service3a">
+ <wsdl:operation name="getGreetings2">
+ <wsdl:input message="tns:getGreetings2" />
+ <wsdl:output message="tns:getGreetings2Response" />
+ </wsdl:operation>
+ </wsdl:portType>
+
+</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario8/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario8/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..7bb9e694a3
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario8/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario8"
+ xmlns:ns8="http://scenario8">
+ <deployable composite="ns8:CompositeA" />
+</contribution>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario8/scenario8.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario8/scenario8.composite
new file mode 100644
index 0000000000..467b7f57fa
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario8/scenario8.composite
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario8"
+ xmlns:tns="http://scenario8"
+ name="CompositeA">
+
+ <service name="Service1" promote="ComponentB/Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference1" promote="ComponentB/reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentB">
+ <implementation.composite name="tns:CompositeC" />
+ <service name="Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario8/scenario8a.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario8/scenario8a.composite
new file mode 100644
index 0000000000..9d9b5ba945
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario8/scenario8a.composite
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario8"
+ xmlns:tns="http://scenario8"
+ name="CompositeC">
+
+ <service name="Service2" promote="ComponentD/Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a" promote="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2" promote="ComponentD/reference3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentD">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentDImpl"/>
+ <service name="Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws uri="http://foo.com/bar" />
+ </service>
+ <reference name="reference3" target="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <interface.wsdl interface="http://scenarios#wsdl.interface(Service3a)" />
+ <binding.ws />
+ </reference>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario8/scenarios.wsdl b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario8/scenarios.wsdl
new file mode 100644
index 0000000000..5cda7327dd
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario8/scenarios.wsdl
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions name="Service3Service"
+ targetNamespace="http://scenarios"
+ xmlns:tns="http://scenarios"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <wsdl:types>
+ <xs:schema attributeFormDefault="qualified"
+ elementFormDefault="unqualified"
+ targetNamespace="http://scenarios"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="getGreetings2">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="arg0" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getGreetings2Response">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:schema>
+ </wsdl:types>
+
+ <wsdl:message name="getGreetings2">
+ <wsdl:part name="getGreetings2" element="tns:getGreetings2" />
+ </wsdl:message>
+
+ <wsdl:message name="getGreetings2Response">
+ <wsdl:part name="getGreetings2Response" element="tns:getGreetings2Response" />
+ </wsdl:message>
+
+ <wsdl:portType name="Service3a">
+ <wsdl:operation name="getGreetings2">
+ <wsdl:input message="tns:getGreetings2" />
+ <wsdl:output message="tns:getGreetings2Response" />
+ </wsdl:operation>
+ </wsdl:portType>
+
+</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario9/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario9/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..b6ec160506
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario9/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario9"
+ xmlns:ns9="http://scenario9">
+ <deployable composite="ns9:CompositeA" />
+</contribution>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario9/scenario9.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario9/scenario9.composite
new file mode 100644
index 0000000000..83584ed482
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario9/scenario9.composite
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario9"
+ xmlns:tns="http://scenario9"
+ name="CompositeA">
+
+ <service name="Service1" promote="ComponentB/Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference1" promote="ComponentB/reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws uri="http://foo.com/bar"/>
+ </reference>
+ <reference name="reference1a" promote="ComponentB/reference2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws uri="http://foo.com/bar"/>
+ </reference>
+
+ <component name="ComponentB">
+ <implementation.composite name="tns:CompositeC" />
+ <service name="Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ <reference name="reference2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ </component>
+
+ <component name="ComponentF">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentEImpl"/>
+ <service name="Service3">
+ <binding.sca />
+ <binding.ws />
+ </service>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario9/scenario9a.composite b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario9/scenario9a.composite
new file mode 100644
index 0000000000..0021ec242b
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/main/resources/scenario9/scenario9a.composite
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario9"
+ xmlns:tns="http://scenario9"
+ name="CompositeC">
+
+ <service name="Service2" promote="ComponentD/Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a" promote="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference2" promote="ComponentD/reference3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ <reference name="reference2a" promote="ComponentD/reference3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+
+ <component name="ComponentD">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentDReferenceMultiplicityImpl"/>
+ <service name="Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <reference name="reference3" target="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ <reference name="reference3a" target="ComponentE">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </reference>
+ </component>
+
+ <component name="ComponentE">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentEImpl"/>
+ <service name="Service3">
+ <binding.sca />
+ <binding.ws />
+ </service>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java
new file mode 100644
index 0000000000..cdeb355f8b
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java
@@ -0,0 +1,875 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.builder;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Port;
+import javax.xml.namespace.QName;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.ComponentReference;
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.Reference;
+import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * Load and build some composites and inspect the results.
+ *
+ * @version $Rev$ $Date$
+ */
+public class BuilderTestCase {
+ private CustomCompositeBuilder customBuilder;
+
+ @Before
+ public void setUp() throws Exception {
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ // Scenario 1: <binding.ws> on outer composite service CompositeA/Service1
+ @Ignore
+ @Test
+ public void testScenario1() throws Exception {
+ System.out.println("====>Running testScenario1");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario1.composite", "TestContribution", "src/main/resources/scenario1/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario1Results(false);
+ }
+
+ @Ignore
+ @Test
+ public void testScenario1NonWiring() throws Exception {
+ System.out.println("====>Running testScenario1NonWiring");
+ customBuilder = new CustomCompositeBuilder(true);
+ customBuilder.loadContribution("scenario1.composite", "TestContribution", "src/main/resources/scenario1/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario1Results(true);
+ }
+
+ private void checkScenario1Results(boolean nonWiring) {
+ Composite domainComposite = customBuilder.getDomainComposite();
+
+ Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
+ if (!nonWiring) {
+ // Should create component service $promoted$Service1 on innermost component
+ // ComponentD, with <binding.ws> and uri="/Service1"
+ // No other services on ComponentD should have <binding.ws>
+ WebServiceBinding wsBinding = null;
+ for (ComponentService service : componentD.getServices()) {
+ WebServiceBinding wsb = service.getBinding(WebServiceBinding.class);
+ if ("$promoted$Service1".equals(service.getName())) {
+ wsBinding = wsb;
+ } else {
+ assert wsb == null;
+ }
+ }
+ assert "/Service1".equals(wsBinding.getURI());
+
+ // Should create WSDL document for ComponentD/$promoted$Service1 with endpoint uri="/Service1"
+ Definition def = wsBinding.getWSDLDocument();
+ javax.wsdl.Service svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service3Service"));
+ Port port = svc.getPort("Service3Port");
+ assert "/Service1".equals(TestUtils.getPortAddress(port));
+ } else {
+ // Should not create component service $promoted$Service1 on innermost component ComponentD
+ // No component services on ComponentD should have <binding.ws>
+ for (ComponentService service : componentD.getServices()) {
+ assert !"$promoted$Service1".equals(service.getName());
+ assert service.getBinding(WebServiceBinding.class) == null;
+ }
+ }
+
+ // No services on ComponentB should have <binding.ws>
+ Component componentB = TestUtils.getComponent(domainComposite, "ComponentB");
+ for (ComponentService service : componentB.getServices()) {
+ assert service.getBinding(WebServiceBinding.class) == null;
+ }
+
+ // No services on CompositeC should have <binding.ws>
+ Composite compositeC = TestUtils.getComposite(domainComposite, new QName("http://scenario1", "CompositeC"));
+ for (Service service : compositeC.getServices()) {
+ assert service.getBinding(WebServiceBinding.class) == null;
+ }
+
+ if (nonWiring) {
+ // Should not add a WSDL document to domain composite service Service1
+ WebServiceBinding wsBinding = null;
+ for (Service service : domainComposite.getServices()) {
+ if ("Service1".equals(service.getName())) {
+ wsBinding = service.getBinding(WebServiceBinding.class);
+ }
+ }
+ assert wsBinding.getWSDLDocument() == null;
+ }
+
+ String expectedEndpoints = "Component - ComponentB\n" +
+ "Service - Service2\n" +
+ "Endpoint - Service2\n" +
+ "Service - Service2a\n" +
+ "Endpoint - Service2a\n" +
+ "Reference - reference2\n" +
+ "Component - ComponentB has composite impl\n" +
+ " Component - ComponentD\n" +
+ " Service - Service3\n" +
+ " Endpoint - Service3\n" +
+ " Service - Service3a\n" +
+ " Endpoint - Service3a\n" +
+ " Reference - reference3";
+
+ String actualEndpoints = TestUtils.printEndpoints(domainComposite);
+ System.out.println(actualEndpoints);
+
+ Assert.assertEquals(expectedEndpoints, actualEndpoints);
+ }
+/*
+ // Scenario 2: <binding.ws> on outer component service ComponentB/Service2
+ public void testScenario2() throws Exception {
+ System.out.println("====>Running testScenario2");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario2.composite", "TestContribution", "src/main/resources/scenario2/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario2and3Results("http://scenario2", false);
+ }
+
+ public void testScenario2NonWiring() throws Exception {
+ System.out.println("====>Running testScenario2NonWiring");
+ customBuilder = new CustomCompositeBuilder(true);
+ customBuilder.loadContribution("scenario2.composite", "TestContribution", "src/main/resources/scenario2/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario2and3Results("http://scenario2", true);
+ }
+
+ private void checkScenario2and3Results(String namespace, boolean nonWiring) {
+ Composite domainComposite = customBuilder.getDomainComposite();
+
+ // Should create WSDL document for ComponentB/Service2 with endpoint uri="/ComponentB/Service2"
+ // No other services on ComponentB should have <binding.ws>
+ Component componentB = TestUtils.getComponent(domainComposite, "ComponentB");
+ WebServiceBinding wsBinding = null;
+ for (ComponentService service : componentB.getServices()) {
+ WebServiceBinding wsb = service.getBinding(WebServiceBinding.class);
+ if ("Service2".equals(service.getName())) {
+ wsBinding = wsb;
+ } else {
+ assert wsb == null;
+ }
+ }
+ Definition def = wsBinding.getWSDLDocument();
+ javax.wsdl.Service svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service3Service"));
+ Port port = svc.getPort("Service3Port");
+ assert "/ComponentB/Service2".equals(TestUtils.getPortAddress(port));
+
+ Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
+ if (!nonWiring) {
+ // Should create component service $promoted$ComponentB$slash$Service2 on innermost component
+ // ComponentD, with <binding.ws> and uri="/ComponentB/Service2"
+ wsBinding = null;
+ for (ComponentService service : componentD.getServices()) {
+ if ("$promoted$ComponentB$slash$Service2".equals(service.getName())) {
+ wsBinding = service.getBinding(WebServiceBinding.class);
+ }
+ }
+ assert "/ComponentB/Service2".equals(wsBinding.getURI());
+
+ // Should create WSDL document for ComponentD/$promoted$ComponentB$slash$Service2 with endpoint uri="/ComponentB/Service2"
+ def = wsBinding.getWSDLDocument();
+ svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service3Service"));
+ port = svc.getPort("Service3Port");
+ assert "/ComponentB/Service2".equals(TestUtils.getPortAddress(port));
+ } else {
+ // Should not create component service $promoted$ComponentB$slash$Service2 on innermost component ComponentD
+ for (ComponentService service : componentD.getServices()) {
+ assert !"$promoted$ComponentB$slash$Service2".equals(service.getName());
+ }
+ }
+
+ // Should add <binding.ws> to outer composite service CompositeA/Service1
+ wsBinding = null;
+ for (Service service : domainComposite.getServices()) {
+ if ("Service1".equals(service.getName())) {
+ wsBinding = service.getBinding(WebServiceBinding.class);
+ }
+ }
+ assert wsBinding != null;
+ if (nonWiring) {
+ // Should not add a WSDL document to domain composite service Service1
+ assert wsBinding.getWSDLDocument() == null;
+ }
+
+ if (!nonWiring) {
+ // Should create component service $promoted$Service1 on innermost component
+ // ComponentD, with <binding.ws> and uri="/Service1"
+ wsBinding = null;
+ for (ComponentService service : componentD.getServices()) {
+ if ("$promoted$Service1".equals(service.getName())) {
+ wsBinding = service.getBinding(WebServiceBinding.class);
+ }
+ }
+ assert "/Service1".equals(wsBinding.getURI());
+
+ // Should create WSDL document for ComponentD/$promoted$Service1 with endpoint uri="/Service1"
+ def = wsBinding.getWSDLDocument();
+ svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service3Service"));
+ port = svc.getPort("Service3Port");
+ assert "/Service1".equals(TestUtils.getPortAddress(port));
+ } else {
+ // Should not create component service $promoted$.Service1 on innermost component ComponentD
+ for (ComponentService service : componentD.getServices()) {
+ assert !"$promoted$Service1".equals(service.getName());
+ }
+ }
+
+ // No services on ComponentD should have <binding.ws>, except for $promoted$Service1
+ // and $promoted$ComponentB$slash$Service2
+ for (ComponentService service : componentD.getServices()) {
+ if (!"$promoted$Service1".equals(service.getName()) &&
+ !"$promoted$ComponentB$slash$Service2".equals(service.getName())) {
+ assert service.getBinding(WebServiceBinding.class) == null;
+ }
+ }
+
+ // No services on CompositeC should have <binding.ws>, except for Service2 in Scenario 3
+ Composite compositeC = TestUtils.getComposite(domainComposite, new QName(namespace, "CompositeC"));
+ for (Service service : compositeC.getServices()) {
+ if ("http://scenario3".equals(namespace) && "Service2".equals(service.getName())) {
+ assert service.getBinding(WebServiceBinding.class) != null;
+ } else {
+ assert service.getBinding(WebServiceBinding.class) == null;
+ }
+ }
+ }
+
+ // Scenario 3: <binding.ws> on inner composite service CompositeC/Service2
+ public void testScenario3() throws Exception {
+ System.out.println("====>Running testScenario3");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario3.composite", "TestContribution", "src/main/resources/scenario3/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario2and3Results("http://scenario3", false);
+ }
+
+ public void testScenario3NonWiring() throws Exception {
+ System.out.println("====>Running testScenario3NonWiring");
+ customBuilder = new CustomCompositeBuilder(true);
+ customBuilder.loadContribution("scenario3.composite", "TestContribution", "src/main/resources/scenario3/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario2and3Results("http://scenario3", true);
+ }
+
+ // Scenario 4: <binding.ws> on inner component service ComponentD/Service3
+ public void testScenario4() throws Exception {
+ System.out.println("====>Running testScenario4");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario4.composite", "TestContribution", "src/main/resources/scenario4/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario4Results(false);
+ }
+
+ public void testScenario4NonWiring() throws Exception {
+ System.out.println("====>Running testScenario4NonWiring");
+ customBuilder = new CustomCompositeBuilder(true);
+ customBuilder.loadContribution("scenario4.composite", "TestContribution", "src/main/resources/scenario4/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario4Results(true);
+ }
+
+ private void checkScenario4Results(boolean nonWiring) {
+ Composite domainComposite = customBuilder.getDomainComposite();
+
+ // Should create WSDL document for ComponentD/Service3 with endpoint uri="/ComponentD/Service3"
+ Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
+ WebServiceBinding wsBinding = null;
+ for (ComponentService service : componentD.getServices()) {
+ if ("Service3".equals(service.getName())) {
+ wsBinding = service.getBinding(WebServiceBinding.class);
+ }
+ }
+ Definition def = wsBinding.getWSDLDocument();
+ javax.wsdl.Service svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service3Service"));
+ Port port = svc.getPort("Service3Port");
+ assert "/ComponentB/ComponentD/Service3".equals(TestUtils.getPortAddress(port));
+
+ // Should add <binding.ws> to inner composite service CompositeC/Service2
+ // No other services on CompositeC should have <binding.ws>
+ Composite compositeC = TestUtils.getComposite(domainComposite, new QName("http://scenario4", "CompositeC"));
+ wsBinding = null;
+ for (Service service : compositeC.getServices()) {
+ WebServiceBinding wsb = service.getBinding(WebServiceBinding.class);
+ if ("Service2".equals(service.getName())) {
+ wsBinding = wsb;
+ } else {
+ assert wsb == null;
+ }
+ }
+ assert "/ComponentB/Service2".equals(wsBinding.getURI());
+
+ // Should add <binding.ws> to outer component service ComponentB/Service2
+ // Should create WSDL document for ComponentB/Service2 with endpoint uri="/ComponentB/Service2"
+ // No other services on ComponentB should have <binding.ws>
+ Component componentB = TestUtils.getComponent(domainComposite, "ComponentB");
+ wsBinding = null;
+ for (ComponentService service : componentB.getServices()) {
+ WebServiceBinding wsb = service.getBinding(WebServiceBinding.class);
+ if ("Service2".equals(service.getName())) {
+ wsBinding = wsb;
+ } else {
+ assert wsb == null;
+ }
+ }
+ assert "/ComponentB/Service2".equals(wsBinding.getURI());
+ def = wsBinding.getWSDLDocument();
+ svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service3Service"));
+ port = svc.getPort("Service3Port");
+ assert "/ComponentB/Service2".equals(TestUtils.getPortAddress(port));
+
+ if (!nonWiring) {
+ // Should create component service $promoted$ComponentB$slash$Service2 on innermost component
+ // ComponentD, with <binding.ws> and uri="/ComponentB/Service2"
+ wsBinding = null;
+ for (ComponentService service : componentD.getServices()) {
+ if ("$promoted$ComponentB$slash$Service2".equals(service.getName())) {
+ wsBinding = service.getBinding(WebServiceBinding.class);
+ }
+ }
+ assert "/ComponentB/Service2".equals(wsBinding.getURI());
+
+ // Should create WSDL document for ComponentD/$promoted$ComponentB$slash$Service2 with endpoint uri="/ComponentB/Service2"
+ def = wsBinding.getWSDLDocument();
+ svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service3Service"));
+ port = svc.getPort("Service3Port");
+ assert "/ComponentB/Service2".equals(TestUtils.getPortAddress(port));
+ } else {
+ // Should not create component service $promoted$ComponentB$slash$Service2 on innermost component ComponentD
+ for (ComponentService service : componentD.getServices()) {
+ assert !"$promoted$ComponentB$slash$Service2".equals(service.getName());
+ }
+ }
+
+ // Should add <binding.ws> to outer composite service CompositeA/Service1
+ wsBinding = null;
+ for (Service service : domainComposite.getServices()) {
+ if ("Service1".equals(service.getName())) {
+ wsBinding = service.getBinding(WebServiceBinding.class);
+ }
+ }
+ assert wsBinding != null;
+ if (nonWiring) {
+ // Should not add a WSDL document to domain composite service Service1
+ assert wsBinding.getWSDLDocument() == null;
+ }
+
+ if (!nonWiring) {
+ // Should create component service $promoted$Service1 on innermost component
+ // ComponentD, with <binding.ws> and uri="/Service1"
+ wsBinding = null;
+ for (ComponentService service : componentD.getServices()) {
+ if ("$promoted$Service1".equals(service.getName())) {
+ wsBinding = service.getBinding(WebServiceBinding.class);
+ }
+ }
+ assert "/Service1".equals(wsBinding.getURI());
+
+ // Should create WSDL document for ComponentD/$promoted$Service1 with endpoint uri="/Service1"
+ def = wsBinding.getWSDLDocument();
+ svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service3Service"));
+ port = svc.getPort("Service3Port");
+ assert "/Service1".equals(TestUtils.getPortAddress(port));
+ } else {
+ // Should not create component service $promoted$.Service1 on innermost component ComponentD
+ for (ComponentService service : componentD.getServices()) {
+ assert !"$promoted$Service1".equals(service.getName());
+ }
+ }
+
+ // No services on ComponentD should have <binding.ws>, except for Service3,
+ // $promoted$.Service1 and $promoted$.ComponentB.Service2
+ for (ComponentService service : componentD.getServices()) {
+ if (!"Service3".equals(service.getName()) &&
+ !"$promoted$Service1".equals(service.getName()) &&
+ !"$promoted$ComponentB$slash$Service2".equals(service.getName())) {
+ assert service.getBinding(WebServiceBinding.class) == null;
+ }
+ }
+ }
+
+ // Scenario 5: <binding.ws> and <interface.wsdl> on outer composite reference CompositeA/reference1
+ @Test
+ public void testScenario5() throws Exception {
+ System.out.println("====>Running testScenario5");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario5.composite", "TestContribution", "src/main/resources/scenario5/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario5Results(false);
+ }
+
+ @Test
+ public void testScenario5NonWiring() throws Exception {
+ System.out.println("====>Running testScenario5NonWiring");
+ customBuilder = new CustomCompositeBuilder(true);
+ customBuilder.loadContribution("scenario5.composite", "TestContribution", "src/main/resources/scenario5/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario5Results(true);
+ }
+
+ private void checkScenario5Results(boolean nonWiring) {
+ Composite domainComposite = customBuilder.getDomainComposite();
+
+ // Should not add <binding.ws> to any outer component references
+ Component componentB = TestUtils.getComponent(domainComposite, "ComponentB");
+ for (ComponentReference reference : componentB.getReferences()) {
+ assert reference.getBinding(WebServiceBinding.class) == null;
+ }
+
+ Definition def;
+ javax.wsdl.Service svc;
+ Port port;
+ WebServiceBinding wsBinding;
+ Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
+ if (!nonWiring) {
+ // Should add <binding.ws> to inner component reference ComponentD/reference3 with uri="http://foo.com/bar"
+ // Should set <interface.wsdl> on inner component reference ComponentD/reference3
+ wsBinding = null;
+ for (ComponentReference reference : componentD.getReferences()) {
+ if ("reference3".equals(reference.getName())) {
+ wsBinding = reference.getBinding(WebServiceBinding.class);
+ assert reference.getInterfaceContract(wsBinding) instanceof WSDLInterfaceContract;
+ }
+ }
+ assert "http://foo.com/bar".equals(wsBinding.getURI());
+
+ // Should create WSDL document for ComponentD/reference3 with endpoint uri="http://foo.com/bar"
+ def = wsBinding.getWSDLDocument();
+ svc = def.getService(new QName("http://scenarios/ComponentD/reference3", "Service3aService"));
+ port = svc.getPort("Service3aPort");
+ assert "http://foo.com/bar".equals(TestUtils.getPortAddress(port));
+ } else {
+ // Should not add <binding.ws> to any inner component references
+ for (ComponentReference reference : componentD.getReferences()) {
+ assert reference.getBinding(WebServiceBinding.class) == null;
+ }
+ }
+
+ // Should not add <binding.ws> or <interface.wsdl> to inner composite reference CompositeC/reference2
+ Composite compositeC = TestUtils.getComposite(domainComposite, new QName("http://scenario5", "CompositeC"));
+ for (Reference reference : compositeC.getReferences()) {
+ assert reference.getBinding(WebServiceBinding.class) == null;
+ assert reference.getInterfaceContract() instanceof JavaInterfaceContract;
+ }
+
+ String expectedEndpoints = "Component - ComponentB\n" +
+ "Service - Service2\n" +
+ "Endpoint - Service2\n" +
+ "Service - Service2a\n" +
+ "Endpoint - Service2a\n" +
+ "Reference - reference2\n" +
+ "Component - ComponentB has composite impl\n" +
+ " Component - ComponentD\n" +
+ " Service - Service3\n" +
+ " Endpoint - Service3\n" +
+ " Service - Service3a\n" +
+ " Endpoint - Service3a\n" +
+ " Reference - reference3";
+
+ String actualEndpoints = TestUtils.printEndpoints(domainComposite);
+ System.out.println(actualEndpoints);
+
+ Assert.assertEquals(expectedEndpoints, actualEndpoints);
+ }
+*/
+
+ // Scenario 6: <binding.ws> and <interface.wsdl> on outer component reference ComponentB/reference2
+ @Test
+ public void testScenario6() throws Exception {
+ System.out.println("====>Running testScenario6");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario6.composite", "TestContribution", "src/main/resources/scenario6/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario6and7Results("http://scenario6", false);
+ }
+
+ @Ignore
+ @Test
+ public void testScenario6NonWiring() throws Exception {
+ System.out.println("====>Running testScenario6NonWiring");
+ customBuilder = new CustomCompositeBuilder(true);
+ customBuilder.loadContribution("scenario6.composite", "TestContribution", "src/main/resources/scenario6/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario6and7Results("http://scenario6", true);
+ }
+
+ private void checkScenario6and7Results(String namespace, boolean nonWiring) {
+ Composite domainComposite = customBuilder.getDomainComposite();
+
+ // Should remove target= on ComponentB/reference2 (for Scenario 6) or
+ // CompositeC/reference2 (for Scenario 7), and add uri="http://foo.com/bar"
+ // to the <binding.ws> element on ComponentB/reference2
+ // For nonWiring, ComponentB/reference2 should have target=
+ // and no uri= should be added
+ Component componentB = TestUtils.getComponent(domainComposite, "ComponentB");
+ WebServiceBinding wsBinding = null;
+ for (ComponentReference reference : componentB.getReferences()) {
+ if ("reference2".equals(reference.getName())) {
+ if (!nonWiring) {
+ assert reference.getTargets().size() == 0;
+ } else {
+ assert reference.getTargets().size() == 1;
+ }
+ wsBinding = reference.getBinding(WebServiceBinding.class);
+ }
+ }
+ if (!nonWiring) {
+ assert "http://foo.com/bar".equals(wsBinding.getURI());
+ } else {
+ assert wsBinding.getURI() == null;
+ }
+
+ Definition def;
+ javax.wsdl.Service svc;
+ Port port;
+ if (!nonWiring) {
+ // Should create WSDL document for ComponentB/reference2 with endpoint uri="http://foo.com/bar"
+ def = wsBinding.getWSDLDocument();
+ svc = def.getService(new QName("http://scenarios/ComponentB/reference2", "Service3aService"));
+ port = svc.getPort("Service3aPort");
+ assert "http://foo.com/bar".equals(TestUtils.getPortAddress(port));
+ }
+
+ Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
+ if (!nonWiring) {
+ // Should add <binding.ws> to inner component reference ComponentD/reference3 with uri="http://foo.com/bar"
+ // Should set <interface.wsdl> on inner component reference ComponentD/reference3
+ wsBinding = null;
+ for (ComponentReference reference : componentD.getReferences()) {
+ if ("reference3".equals(reference.getName())) {
+ wsBinding = reference.getBinding(WebServiceBinding.class);
+ assert reference.getBindings().size() == 1;
+ assert reference.getInterfaceContract(wsBinding) instanceof WSDLInterfaceContract;
+ }
+ }
+ assert "http://foo.com/bar".equals(wsBinding.getURI());
+
+ // Should create WSDL document for ComponentD/reference3 with endpoint uri="http://foo.com/bar"
+ def = wsBinding.getWSDLDocument();
+ svc = def.getService(new QName("http://scenarios/ComponentB/reference2", "Service3aService"));
+ port = svc.getPort("Service3aPort");
+ assert "http://foo.com/bar".equals(TestUtils.getPortAddress(port));
+ } else {
+ // Should not add <binding.ws> to any inner component references
+ for (ComponentReference reference : componentD.getReferences()) {
+ assert reference.getBinding(WebServiceBinding.class) == null;
+ }
+ }
+
+ // No references on CompositeC should have <binding.ws> or <interface.wsdl>, except for
+ // reference2 in Scenario 7
+ Composite compositeC = TestUtils.getComposite(domainComposite, new QName(namespace, "CompositeC"));
+ for (Reference reference : compositeC.getReferences()) {
+ if ("http://scenario7".equals(namespace) && "reference2".equals(reference.getName())) {
+ assert reference.getBinding(WebServiceBinding.class)!= null;
+ assert reference.getInterfaceContract() instanceof WSDLInterfaceContract;
+ } else {
+ assert reference.getBinding(WebServiceBinding.class) == null;
+ assert reference.getInterfaceContract() instanceof JavaInterfaceContract;
+ }
+ }
+
+ // Should add <binding.ws> and <interface.wsdl> to outer composite reference CompositeA/reference1
+ wsBinding = null;
+ for (Reference reference : domainComposite.getReferences()) {
+ if ("reference1".equals(reference.getName())) {
+ wsBinding = reference.getBinding(WebServiceBinding.class);
+ assert reference.getInterfaceContract() instanceof WSDLInterfaceContract;
+ }
+ }
+ assert wsBinding.getURI() == null;
+
+ // Should not add a WSDL document to domain composite reference reference1
+ assert wsBinding.getWSDLDocument() == null;
+
+ String expectedEndpoints = "Component - ComponentB\n" +
+ "Service - Service2\n" +
+ "Endpoint - Service2\n" +
+ "Service - Service2a\n" +
+ "Endpoint - Service2a\n" +
+ "Reference - reference2\n" +
+ "Component - ComponentB has composite impl\n" +
+ " Component - ComponentD\n" +
+ " Service - Service3\n" +
+ " Endpoint - Service3\n" +
+ " Service - Service3a\n" +
+ " Endpoint - Service3a\n" +
+ " Reference - reference3";
+
+ String actualEndpoints = TestUtils.printEndpoints(domainComposite);
+ System.out.println(actualEndpoints);
+
+ Assert.assertEquals(expectedEndpoints, actualEndpoints);
+ }
+/*
+ // Scenario 7: <binding.ws> and <interface.wsdl> on inner composite reference CompositeC/reference2
+ public void testScenario7() throws Exception {
+ System.out.println("====>Running testScenario7");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario7.composite", "TestContribution", "src/main/resources/scenario7/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario6and7Results("http://scenario7", false);
+ }
+
+ public void testScenario7NonWiring() throws Exception {
+ System.out.println("====>Running testScenario7NonWiring");
+ customBuilder = new CustomCompositeBuilder(true);
+ customBuilder.loadContribution("scenario7.composite", "TestContribution", "src/main/resources/scenario7/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario6and7Results("http://scenario7", true);
+ }
+
+ // Scenario 8: <binding.ws> and <interface.wsdl> on inner component reference ComponentD/reference3
+ public void testScenario8() throws Exception {
+ System.out.println("====>Running testScenario8");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario8.composite", "TestContribution", "src/main/resources/scenario8/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario8Results(false);
+ }
+
+ public void testScenario8NonWiring() throws Exception {
+ System.out.println("====>Running testScenario8NonWiring");
+ customBuilder = new CustomCompositeBuilder(true);
+ customBuilder.loadContribution("scenario8.composite", "TestContribution", "src/main/resources/scenario8/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario8Results(true);
+ }
+
+ private void checkScenario8Results(boolean nonWiring) {
+ Composite domainComposite = customBuilder.getDomainComposite();
+
+ // Should replace target= on ComponentD/reference3 by uri="http://foo.com/bar" on <binding.ws>
+ // For nonWiring, the original target= is preserved and there is no uri=
+ Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
+ WebServiceBinding wsBinding = null;
+ for (ComponentReference reference : componentD.getReferences()) {
+ if ("reference3".equals(reference.getName())) {
+ if (!nonWiring) {
+ assert reference.getTargets().size() == 0;
+ } else {
+ assert reference.getTargets().size() == 1;
+ }
+ wsBinding = reference.getBinding(WebServiceBinding.class);
+ }
+ }
+ if (!nonWiring) {
+ assert "http://foo.com/bar".equals(wsBinding.getURI());
+ } else {
+ assert wsBinding.getURI() == null;
+ }
+
+ Definition def;
+ javax.wsdl.Service svc;
+ Port port;
+ if (!nonWiring) {
+ // Should create WSDL document for ComponentD/reference3 with endpoint uri="http://foo.com/bar"
+ def = wsBinding.getWSDLDocument();
+ svc = def.getService(new QName("http://scenarios/ComponentD/reference3", "Service3aService"));
+ port = svc.getPort("Service3aPort");
+ assert "http://foo.com/bar".equals(TestUtils.getPortAddress(port));
+ }
+
+ // Should add <binding.ws> and <interface.wsdl> to inner composite reference CompositeC/reference2
+ Composite compositeC = TestUtils.getComposite(domainComposite, new QName("http://scenario8", "CompositeC"));
+ wsBinding = null;
+ for (Reference reference : compositeC.getReferences()) {
+ if ("reference2".equals(reference.getName())) {
+ wsBinding = reference.getBinding(WebServiceBinding.class);
+ assert reference.getInterfaceContract() instanceof WSDLInterfaceContract;
+ }
+ }
+ assert wsBinding.getURI() == null;
+
+ // Should add <binding.ws> and <interface.wsdl> to outer component reference ComponentB/reference2
+ Component componentB = TestUtils.getComponent(domainComposite, "ComponentB");
+ wsBinding = null;
+ for (ComponentReference reference : componentB.getReferences()) {
+ if ("reference2".equals(reference.getName())) {
+ wsBinding = reference.getBinding(WebServiceBinding.class);
+ assert reference.getInterfaceContract() instanceof WSDLInterfaceContract;
+ }
+ }
+ assert wsBinding.getURI() == null;
+
+ // Should add <binding.ws> and <interface.wsdl> to outer composite reference CompositeA/reference1
+ wsBinding = null;
+ for (Reference reference : domainComposite.getReferences()) {
+ if ("reference1".equals(reference.getName())) {
+ wsBinding = reference.getBinding(WebServiceBinding.class);
+ assert reference.getInterfaceContract() instanceof WSDLInterfaceContract;
+ }
+ }
+ assert wsBinding.getURI() == null;
+
+ // Should not add a WSDL document to domain composite reference reference1
+ assert wsBinding.getWSDLDocument() == null;
+ }
+
+ // Scenario 9: target in reference CDR3A and binding.ws uri= at CAR1A
+ public void testScenario9() throws Exception {
+ System.out.println("====>Running testScenario9");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario9.composite", "TestContribution", "src/main/resources/scenario9/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario9Results();
+ }
+
+ private void checkScenario9Results() {
+ Composite domainComposite = customBuilder.getDomainComposite();
+
+ Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
+ ComponentReference componentRef = null;
+ for (ComponentReference reference : componentD.getReferences()) {
+ if ("reference3a".equals(reference.getName())) {
+ componentRef = reference;
+ assertTrue(reference.getBindings().size() == 2);
+ assertTrue(reference.getBindings().get(0) instanceof SCABinding);
+ assertTrue(reference.getBindings().get(1) instanceof WebServiceBinding);
+ }
+ }
+ assertTrue(componentRef != null);
+ }
+
+ // Scenario 10: targets in references CBR2A and CDR3A and binding.ws at CBR2A
+ public void testScenario10() throws Exception {
+ System.out.println("====>Running testScenario10");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario10.composite", "TestContribution", "src/main/resources/scenario10/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario10And11Results();
+ }
+
+ // Scenario 11: targets in references CBR2A and CDR3A and binding.ws at CCR2A
+ public void testScenario11() throws Exception {
+ System.out.println("====>Running testScenario11");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario11.composite", "TestContribution", "src/main/resources/scenario11/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario10And11Results();
+ }
+
+ private void checkScenario10And11Results() {
+ Composite domainComposite = customBuilder.getDomainComposite();
+
+ Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
+ ComponentReference componentRef = null;
+ for (ComponentReference reference : componentD.getReferences()) {
+ if ("reference3a".equals(reference.getName())) {
+ componentRef = reference;
+ assertTrue(reference.getBindings().size() == 2);
+ Binding binding1 = reference.getBindings().get(0);
+ assertTrue(binding1 instanceof SCABinding);
+ assertTrue(reference.getInterfaceContract(binding1) instanceof JavaInterfaceContract);
+ Binding binding2 = reference.getBindings().get(1);
+ assertTrue(binding2 instanceof WebServiceBinding);
+ assertTrue(reference.getInterfaceContract(binding2) instanceof WSDLInterfaceContract);
+ }
+ }
+ assertTrue(componentRef != null);
+ }
+
+ // Scenario 12: targets in references CBR2A and CDR3A and binding.ws at CDR3A
+ public void testScenario12() throws Exception {
+ System.out.println("====>Running testScenario12");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario12.composite", "TestContribution", "src/main/resources/scenario12/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario12Results();
+ }
+
+ private void checkScenario12Results() {
+ Composite domainComposite = customBuilder.getDomainComposite();
+
+ Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
+ ComponentReference componentRef = null;
+ for (ComponentReference reference : componentD.getReferences()) {
+ if ("reference3a".equals(reference.getName())) {
+ componentRef = reference;
+ assertTrue(reference.getBindings().size() == 2);
+ assertTrue(reference.getBindings().get(0) instanceof WebServiceBinding);
+ assertTrue(reference.getBindings().get(1) instanceof WebServiceBinding);
+ }
+ }
+ assertTrue(componentRef != null);
+ }
+
+ // Scenario 13: target in reference CDR3A
+ public void testScenario13() throws Exception {
+ System.out.println("====>Running testScenario13");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario13.composite", "TestContribution", "src/main/resources/scenario13/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario13Results();
+ }
+
+ private void checkScenario13Results() {
+ Composite domainComposite = customBuilder.getDomainComposite();
+
+ Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
+ ComponentReference componentRef = null;
+ for (ComponentReference reference : componentD.getReferences()) {
+ if ("reference3a".equals(reference.getName())) {
+ componentRef = reference;
+ assertTrue(reference.getBindings().size() == 1);
+ assertTrue(reference.getBindings().get(0) instanceof WebServiceBinding);
+ }
+ }
+ assertTrue(componentRef != null);
+ }
+*/
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/CustomCompositeBuilder.java b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/CustomCompositeBuilder.java
new file mode 100644
index 0000000000..da8a46067a
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/CustomCompositeBuilder.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.builder;
+
+import javax.xml.stream.XMLOutputFactory;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.core.assembly.CompositeActivator;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+
+public class CustomCompositeBuilder {
+
+ private boolean nonWiring;
+ private Node node;
+ private ExtensionPointRegistry extensionPoints;
+ private Monitor monitor;
+ private StAXArtifactProcessor<Composite> compositeProcessor;
+ private Composite domainComposite;
+
+ public CustomCompositeBuilder(boolean nonWiring) {
+ this.nonWiring = nonWiring;
+ }
+
+ public void loadContribution(String compositeURL, String sourceURI, String sourceURL) throws Exception {
+ node = NodeFactory.newInstance().createNode(compositeURL, new Contribution(sourceURI, sourceURL));
+ node.start();
+
+ // get some things out of the extension registry
+ extensionPoints = ((NodeImpl)node).getExtensionPoints();
+
+ UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ monitor = monitorFactory.createMonitor();
+
+ StAXArtifactProcessorExtensionPoint xmlProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
+ compositeProcessor = xmlProcessors.getProcessor(Composite.class);
+
+ CompositeActivator compositeActivator = utilities.getUtility(CompositeActivator.class);
+ domainComposite = compositeActivator.getDomainComposite();
+ }
+
+ /**
+ * Returns the delegating model processor.
+ * @return the delegating model processor
+ */
+ public StAXArtifactProcessor<Object> getModelProcessor() {
+ return null;//compositeProcessor;
+ }
+
+ /**
+ * Returns the XML output factory.
+ * @return the XML output factory
+ */
+ public XMLOutputFactory getOutputFactory() {
+ return null; //outputFactory;
+ }
+
+ /**
+ * Returns the domain composite.
+ * @return the domain composite model object
+ */
+ public Composite getDomainComposite() {
+ return (Composite) domainComposite.getIncludes().get(0);
+ }
+
+ /**
+ * Returns the monitor.
+ * @return the monitor instance
+ */
+ public Monitor getMonitor() {
+ return monitor;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/TestUtils.java b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/TestUtils.java
new file mode 100644
index 0000000000..f4d8b094c7
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/TestUtils.java
@@ -0,0 +1,276 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.builder;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import javax.wsdl.Definition;
+import javax.wsdl.Port;
+import javax.wsdl.WSDLException;
+import javax.wsdl.extensions.soap.SOAPAddress;
+import javax.wsdl.extensions.soap12.SOAP12Address;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLWriter;
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.stream.XMLStreamWriter;
+import junit.framework.TestCase;
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.ComponentReference;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.Contract;
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.assembly.EndpointReference;
+import org.apache.tuscany.sca.assembly.Implementation;
+import org.apache.tuscany.sca.assembly.Reference;
+import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.xml.serialize.OutputFormat;
+import org.apache.xml.serialize.XMLSerializer;
+import org.w3c.dom.Document;
+
+/**
+ * Static utility methods for use by test cases.
+ *
+ * @version $Rev$ $Date$
+ */
+public class TestUtils {
+
+ protected static void checkProblems(CustomCompositeBuilder customBuilder) throws Exception {
+ boolean problems = false;
+ for (Problem problem : customBuilder.getMonitor().getProblems()) {
+ if (problem.getCause() != null) {
+ problem.getCause().printStackTrace();
+ }
+ problems = true;
+ }
+ assert !problems;
+ }
+
+ protected static String getPortAddress(Port port) {
+ Object ext = port.getExtensibilityElements().get(0);
+ if (ext instanceof SOAPAddress) {
+ return ((SOAPAddress)ext).getLocationURI();
+ }
+ if (ext instanceof SOAP12Address) {
+ return ((SOAP12Address)ext).getLocationURI();
+ }
+ return null;
+ }
+
+ protected static Component getComponent(Composite composite, String name) {
+ for (Component component : composite.getComponents()) {
+ if (name.equals(component.getName())) {
+ return component;
+ }
+ // process implementation composites recursively
+ Implementation impl = component.getImplementation();
+ if (impl instanceof Composite) {
+ Component comp = getComponent((Composite)impl, name);
+ if (comp != null) {
+ return comp;
+ }
+ }
+ }
+ return null;
+ }
+
+ protected static Composite getComposite(Composite composite, QName name) {
+ if (name.equals(composite.getName())) {
+ return composite;
+ }
+ for (Component component : composite.getComponents()) {
+ // process implementation composites recursively
+ Implementation impl = component.getImplementation();
+ if (impl instanceof Composite) {
+ Composite comp = getComposite((Composite)impl, name);
+ if (comp != null) {
+ return comp;
+ }
+ }
+ }
+ return null;
+ }
+
+ protected static void printResults(CustomCompositeBuilder customBuilder) throws Exception {
+ for (Problem problem : customBuilder.getMonitor().getProblems()) {
+ if (problem.getCause() != null) {
+ problem.getCause().printStackTrace();
+ }
+ }
+ Composite domainComposite = customBuilder.getDomainComposite();
+ printComposite(domainComposite, customBuilder);
+ }
+
+ private static void printComposite(Composite composite, CustomCompositeBuilder customBuilder) throws Exception {
+ // process implementation composites recursively
+ for (Component component : composite.getComponents()) {
+ Implementation implementation = component.getImplementation();
+ if (implementation instanceof Composite) {
+ printComposite((Composite)implementation, customBuilder);
+ }
+ }
+
+ // write out the SCDL
+ writeSCDL(composite, customBuilder);
+
+ // find all the component service and reference bindings
+ for (Component component : composite.getComponents()) {
+ for (ComponentService componentService : component.getServices()) {
+ for (Binding binding : componentService.getBindings()) {
+ if (binding instanceof WebServiceBinding) {
+ writeWSDL(component, componentService, ((WebServiceBinding)binding).getWSDLDocument());
+ }
+ }
+ }
+ for (ComponentReference componentReference : component.getReferences()) {
+ for (Binding binding : componentReference.getBindings()) {
+ if (binding instanceof WebServiceBinding) {
+ writeWSDL(component, componentReference, ((WebServiceBinding)binding).getWSDLDocument());
+ }
+ }
+ }
+ }
+
+ // find all the composite service and reference bindings
+ for (Service service : composite.getServices()) {
+ for (Binding binding : service.getBindings()) {
+ if (binding instanceof WebServiceBinding) {
+ writeWSDL(null, service, ((WebServiceBinding)binding).getWSDLDocument());
+ }
+ }
+ }
+ for (Reference reference : composite.getReferences()) {
+ for (Binding binding : reference.getBindings()) {
+ if (binding instanceof WebServiceBinding) {
+ writeWSDL(null, reference, ((WebServiceBinding)binding).getWSDLDocument());
+ }
+ }
+ }
+ }
+
+ private static void writeSCDL(Composite composite, CustomCompositeBuilder customBuilder) throws Exception {
+ // Print out a composite
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ XMLStreamWriter writer = customBuilder.getOutputFactory().createXMLStreamWriter(bos);
+ customBuilder.getModelProcessor().write(composite, writer);
+
+ // Parse and write again to pretty format it
+ DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ Document document = documentBuilder.parse(new ByteArrayInputStream(bos.toByteArray()));
+ OutputFormat format = new OutputFormat();
+ format.setIndenting(true);
+ format.setIndent(2);
+ XMLSerializer serializer = new XMLSerializer(System.out, format);
+ System.out.println("-->Runtime SCDL model for composite " + composite.getName());
+ serializer.serialize(document);
+ }
+
+ private static void writeWSDL(Component component, Contract contract, Definition definition) {
+ if (definition == null) {
+ System.out.println("-->No generated WSDL for " + (component != null ? component.getName() : "") + "/" + contract.getName());
+ } else {
+ try {
+ System.out.println("-->Generated WSDL for " + (component != null ? component.getName() : "") + "/" + contract.getName());
+ WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter();
+ writer.writeWSDL(definition, System.out);
+ } catch (WSDLException e) {
+ // ignore
+ }
+ }
+ }
+
+ protected static String printEndpoints(Composite composite){
+ return printEndpoints(composite, "");
+ }
+
+ protected static String printEndpoints(Composite composite, String indent){
+
+ String buffer = "";
+
+ for (Component component : composite.getComponents()) {
+ buffer += indent + "Component - " + component.getName() + "\n";
+
+ // print component service endpoints
+ for (ComponentService componentService : component.getServices()) {
+ buffer += indent + "Service - " + componentService.getName() + "\n";
+ for (Endpoint endpoint : componentService.getEndpoints()) {
+ if (endpoint.getBinding() != null){
+ buffer += printEndpoint(endpoint, indent);
+ }
+ }
+ }
+
+ for (ComponentReference componentReference : component.getReferences()) {
+ buffer += indent + "Reference - " + componentReference.getName() + "\n";
+ for (EndpointReference endpointReference : componentReference.getEndpointReferences()) {
+ buffer += printEndpointReference(endpointReference, indent);
+ }
+ }
+
+ // process implementation composites recursively
+ Implementation implementation = component.getImplementation();
+ if (implementation instanceof Composite) {
+ buffer += indent + "Component - " + component.getName() + " has composite impl" + "\n";
+ buffer += printEndpoints((Composite)implementation, indent + " ");
+ }
+ }
+
+ return buffer;
+ }
+
+ protected static String printEndpoint(Endpoint endpoint, String indent){
+ String buffer = "";
+
+ buffer += indent + " Endpoint - Component: " + endpoint.getComponent().getName() +"\n";
+ buffer += indent + " Service: " + endpoint.getService().getName() +"\n";
+ buffer += indent + " Binding: " + endpoint.getBinding().getName() +"\n";
+
+ return buffer;
+ }
+
+ protected static String printEndpointReference(EndpointReference endpointReference, String indent){
+ String buffer = "";
+
+ buffer += indent + " EndpointReference - Component: " + endpointReference.getComponent().getName() +"\n";
+ buffer += indent + " Reference: " + endpointReference.getReference().getName() +"\n";
+ if (endpointReference.getTargetEndpoint() != null){
+ buffer += indent + " Wired: " +"\n";
+ buffer += indent + " Target: " + endpointReference.getTargetEndpoint().getComponent().getName()+"\n";
+ if (endpointReference.getTargetEndpoint() != null &&
+ endpointReference.getTargetEndpoint().isUnresolved() == false){
+ buffer += indent + " Binding: " + endpointReference.getBinding().getName() +"\n";
+ buffer += indent + " TargetEndpoint: " + endpointReference.getTargetEndpoint().getBinding().getName()+"\n";
+ } else {
+ buffer += indent + " Unresolved: " +"\n";
+ }
+ } else {
+ buffer += indent + " NonWired: " +"\n";
+ }
+
+ return buffer;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-api/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/callback-api/pom.xml
new file mode 100644
index 0000000000..6ec7074d6a
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-api/pom.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-callback-api</artifactId>
+ <name>Apache Tuscany SCA iTest Callback API</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <properties>
+ <was.ant.script>${basedir}/../build-was-integration.xml</was.ant.script>
+ <was.python.script>${basedir}/../wasAdmin.py</was.python.script>
+ </properties>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java
new file mode 100644
index 0000000000..b013462f9f
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+/**
+ *
+ */
+public interface CallBackApiCallBack {
+ /**
+ * This function is defined in CallBackApiClientImpl
+ */
+ void callBackMessage(String aString);
+
+ /**
+ * This function is defined in CallBackApiClientImpl
+ */
+ void callBackIncrement(String aString);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java
new file mode 100644
index 0000000000..252e4dc45f
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface CallBackApiClient {
+ /**
+ * This function is defined in CallBackApiClientImpl
+ */
+ void run();
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java
new file mode 100644
index 0000000000..d883dc2d6f
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.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;
+
+import org.junit.Assert;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.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();
+ }
+
+ /**
+ * 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 can't 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 can't 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);
+ }
+
+ /**
+ * 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 can't 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());
+ }
+
+ /**
+ * 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/tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java
new file mode 100644
index 0000000000..afb7c45e2c
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+@Callback(CallBackApiCallBack.class)
+/**
+ *
+ */
+public interface CallBackApiService {
+ /**
+ * This function is defined in CallBackApiServiceImpl
+ */
+ void knockKnock(String aString);
+
+ /**
+ * This function is defined in CallBackApiServiceImpl
+ */
+ void knockKnockByRef(String aString);
+
+ /**
+ * This function is defined in CallBackApiServiceImpl
+ */
+ void noCallBack(String aString);
+
+ /**
+ * This function is defined in CallBackApiServiceImpl
+ */
+ void multiCallBack(String aString);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java
new file mode 100644
index 0000000000..bdac56d222
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java
@@ -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 org.apache.tuscany.sca.test;
+
+import org.oasisopen.sca.CallableReference;
+import org.oasisopen.sca.ComponentContext;
+import org.oasisopen.sca.RequestContext;
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Context;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(CallBackApiService.class)
+public class CallBackApiServiceImpl implements CallBackApiService {
+
+ @Context
+ protected ComponentContext componentContext;
+ /**
+ * Object of CallBackApiCallBack class
+ */
+ private CallBackApiCallBack callback;
+
+ @Callback
+ protected CallableReference<CallBackApiCallBack> 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");
+ }
+
+ /**
+ * This function calls the callBackMessage function. <br>
+ * The reference to this function is received 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");
+ }
+
+ /**
+ * This function get an object of CallBackApiServiceImpl by calling getCallBackInterface function. <br>
+ * 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");
+ }
+
+ /**
+ * 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);
+ }
+
+ /**
+ * 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/tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/resources/CallBackApiTest.composite b/tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/resources/CallBackApiTest.composite
new file mode 100644
index 0000000000..309311e258
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/resources/CallBackApiTest.composite
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://callback"
+ name="CallBackApiTest">
+
+ <component name="CallBackApiClient">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackApiClientImpl"/>
+ <reference name="aCallBackService" target="CallBackApiService"/>
+ </component>
+
+ <component name="CallBackApiService">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackApiServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..6e049d603e
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" targetNamespace="http://callback"
+ xmlns:t="http://callback">
+ <deployable composite="t:CallBackApiTest" />
+</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java
new file mode 100644
index 0000000000..75fab95efb
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.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 org.apache.tuscany.sca.test;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class CallBackApiTestCase {
+
+ private static Node node;
+ private CallBackApiClient aCallBackClient;
+
+ /**
+ * This function uses the Instance of CallBackApiClient.class <br>
+ * This function calls the run function defined in the CallBackApiClinet Interface <br>
+ * which in turn executes the following test cases. <br>
+ * 1. Basic callback patterns <br>
+ * 2. Test in which the target does not call back to the client <br>
+ * 3. Test in which the target calls back multiple times to the client.
+ */
+ @Test
+ public void testCallBackBasic() {
+ aCallBackClient = node.getService(CallBackApiClient.class, "CallBackApiClient");
+ aCallBackClient.run();
+ }
+
+ /**
+ * This function creates the Node instance and gets an Instance of CallBackApiClient.class
+ */
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ if (node == null) {
+ String location = ContributionLocationHelper.getContributionLocation("CallBackApiTest.composite");
+ node = NodeFactory.newInstance().createNode("CallBackApiTest.composite", new Contribution("c1", location));
+ node.start();
+ }
+ }
+
+ /**
+ * This function destroys the Node instance that was created in setUp()
+ */
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ node.stop();
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/pom.xml
new file mode 100644
index 0000000000..15b5795a20
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/pom.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-callback-basic-ws</artifactId>
+ <name>Apache Tuscany SCA iTest Callback Basic WebServices</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-http</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ <was.ant.script>${basedir}/../build-was-integration.xml</was.ant.script>
+ <was.python.script>${basedir}/../wasAdmin.py</was.python.script>
+ </properties>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java
new file mode 100644
index 0000000000..291a72b9d6
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/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.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+/**
+ *
+ */
+public interface CallBackBasicCallBack {
+
+ void callBackMessage(String aString);
+
+ void callBackIncrement(String aString);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java
new file mode 100644
index 0000000000..19f366c423
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/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.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface CallBackBasicClient {
+
+ void run();
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java
new file mode 100644
index 0000000000..4bb6b29a8d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.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;
+
+import org.junit.Assert;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.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();
+ }
+
+ private void test1a() {
+ aCallBackService.knockKnock("Knock Knock");
+ int count = 0;
+
+ //
+ // If we can't 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);
+ }
+
+ private void test1c() {
+ aCallBackService.multiCallBack("Call me back 3 times");
+ int count = 0;
+
+ //
+ // If we can't 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());
+ }
+
+ 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/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java
new file mode 100644
index 0000000000..5396879e83
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/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.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+@Callback(CallBackBasicCallBack.class)
+/**
+ *
+ */
+public interface CallBackBasicService {
+
+ void knockKnock(String aString);
+
+ void noCallBack(String aString);
+
+ void multiCallBack(String aString);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java
new file mode 100644
index 0000000000..07010f61e1
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.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.test;
+
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.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");
+
+ }
+
+ 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");
+
+ }
+
+ public void noCallBack(String aString) {
+
+ System.out.println("CallBackBasicServiceImpl message received: " + aString);
+ // System.out.println("CallBackBasicServiceImpl No response desired");
+
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/resources/CallBackBasicTest.composite b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/resources/CallBackBasicTest.composite
new file mode 100644
index 0000000000..db1a2fbf6a
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/resources/CallBackBasicTest.composite
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://callback"
+ name="CallBackBasicTest">
+
+ <component name="CallBackBasicClient">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackBasicClientImpl"/>
+ <reference name="aCallBackService" target="CallBackBasicService">
+ <callback>
+ <binding.ws uri="http://localhost:8084/aCallBackService"/>
+ </callback>
+ </reference>
+ </component>
+
+ <component name="CallBackBasicService">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackBasicServiceImpl"/>
+ <service name="CallBackBasicService">
+ <binding.ws uri="http://localhost:8085/CallBackBasicService"/>
+ </service>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..b58fabcd79
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:t="http://callback">
+ <deployable composite="t:CallBackBasicTest" />
+</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java
new file mode 100644
index 0000000000..43b812faed
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic-ws/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.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.test;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class CallBackBasicTestCase {
+
+ private static Node node;
+ private CallBackBasicClient aCallBackClient;
+
+ @Test
+ public void testCallBackBasic() {
+ aCallBackClient.run();
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ if (node == null) {
+ String location = ContributionLocationHelper.getContributionLocation("CallBackBasicTest.composite");
+ node = NodeFactory.newInstance().createNode("CallBackBasicTest.composite", new Contribution("c1", location));
+ node.start();
+ }
+
+ aCallBackClient = node.getService(CallBackBasicClient.class, "CallBackBasicClient");
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/pom.xml
new file mode 100644
index 0000000000..529c79089d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/pom.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-callback-basic</artifactId>
+ <name>Apache Tuscany SCA iTest Callback Basic</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <properties>
+ <was.ant.script>${basedir}/../build-was-integration.xml</was.ant.script>
+ <was.python.script>${basedir}/../wasAdmin.py</was.python.script>
+ </properties>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java
new file mode 100644
index 0000000000..291a72b9d6
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+/**
+ *
+ */
+public interface CallBackBasicCallBack {
+
+ void callBackMessage(String aString);
+
+ void callBackIncrement(String aString);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java
new file mode 100644
index 0000000000..19f366c423
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface CallBackBasicClient {
+
+ void run();
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java
new file mode 100644
index 0000000000..4bb6b29a8d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.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;
+
+import org.junit.Assert;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.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();
+ }
+
+ private void test1a() {
+ aCallBackService.knockKnock("Knock Knock");
+ int count = 0;
+
+ //
+ // If we can't 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);
+ }
+
+ private void test1c() {
+ aCallBackService.multiCallBack("Call me back 3 times");
+ int count = 0;
+
+ //
+ // If we can't 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());
+ }
+
+ 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/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java
new file mode 100644
index 0000000000..5396879e83
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+@Callback(CallBackBasicCallBack.class)
+/**
+ *
+ */
+public interface CallBackBasicService {
+
+ void knockKnock(String aString);
+
+ void noCallBack(String aString);
+
+ void multiCallBack(String aString);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java
new file mode 100644
index 0000000000..07010f61e1
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.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.test;
+
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.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");
+
+ }
+
+ 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");
+
+ }
+
+ public void noCallBack(String aString) {
+
+ System.out.println("CallBackBasicServiceImpl message received: " + aString);
+ // System.out.println("CallBackBasicServiceImpl No response desired");
+
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/resources/CallBackBasicTest.composite b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/resources/CallBackBasicTest.composite
new file mode 100644
index 0000000000..87cde940e1
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/resources/CallBackBasicTest.composite
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://callback"
+ name="CallBackBasicTest">
+
+ <component name="CallBackBasicClient">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackBasicClientImpl"/>
+ <reference name="aCallBackService" target="CallBackBasicService"/>
+ </component>
+
+ <component name="CallBackBasicService">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackBasicServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..b58fabcd79
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:t="http://callback">
+ <deployable composite="t:CallBackBasicTest" />
+</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java
new file mode 100644
index 0000000000..43b812faed
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-basic/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.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.test;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class CallBackBasicTestCase {
+
+ private static Node node;
+ private CallBackBasicClient aCallBackClient;
+
+ @Test
+ public void testCallBackBasic() {
+ aCallBackClient.run();
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ if (node == null) {
+ String location = ContributionLocationHelper.getContributionLocation("CallBackBasicTest.composite");
+ node = NodeFactory.newInstance().createNode("CallBackBasicTest.composite", new Contribution("c1", location));
+ node.start();
+ }
+
+ aCallBackClient = node.getService(CallBackBasicClient.class, "CallBackBasicClient");
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/pom.xml
new file mode 100644
index 0000000000..66f2b7d9ec
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-callback-complex-type</artifactId>
+ <name>Apache Tuscany SCA iTest Callback Complex Type</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeCallBack.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeCallBack.java
new file mode 100644
index 0000000000..627d37e27d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+/**
+ *
+ */
+public interface CallBackCTypeCallBack {
+
+ void callBackMessage(String aString);
+
+ void callBackIncrement(String aString);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClient.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClient.java
new file mode 100644
index 0000000000..966ad17b9a
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface CallBackCTypeClient {
+
+ void run();
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClientImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClientImpl.java
new file mode 100644
index 0000000000..d2dc0add75
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClientImpl.java
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.junit.Assert;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.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();
+
+ }
+
+ private void test12a() {
+ aCallBackService.knockKnock("Knock Knock");
+ int count = 0;
+
+ //
+ // If we can't 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);
+ }
+
+ private void test12c() {
+ aCallBackService.multiCallBack("Call me back 3 times");
+ int count = 0;
+
+ //
+ // If we can't 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());
+ }
+
+ 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/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeService.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeService.java
new file mode 100644
index 0000000000..32ab1bdd3e
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeService.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.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+@Callback(CallBackCTypeCallBack.class)
+/**
+ *
+ */
+public interface CallBackCTypeService {
+
+ void knockKnock(String aString);
+
+ void noCallBack(String aString);
+
+ void multiCallBack(String aString);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java
new file mode 100644
index 0000000000..f7a1a195ed
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.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.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.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");
+
+ }
+
+ 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");
+
+ }
+
+ public void noCallBack(String aString) {
+
+ System.out.println("CallBackCTypeServiceImpl message received: " + aString);
+ System.out.println("CallBackCTypeServiceImpl No response desired");
+
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/resources/CallBackCTypeClient.composite b/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/resources/CallBackCTypeClient.composite
new file mode 100644
index 0000000000..2eea567fff
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/resources/CallBackCTypeClient.composite
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://callback"
+ name="CallBackCTypeTest">
+
+ <component name="CallBackCTypeClient">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackCTypeClientImpl"/>
+ <reference name="aCallBackService" target="CallBackCTypeService"/>
+ </component>
+
+ <component name="CallBackCTypeService">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackCTypeServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/resources/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.componentType b/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/resources/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.componentType
new file mode 100644
index 0000000000..af0b373472
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/main/resources/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.componentType
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" >
+
+ <service name="CallBackCTypeService">
+ <interface.java interface="org.apache.tuscany.sca.test.CallBackCTypeService"
+ callbackInterface="org.apache.tuscany.sca.test.CallBackCTypeCallBack"/>
+ </service>
+
+</componentType>
+ \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeTestCase.java
new file mode 100644
index 0000000000..dde489d766
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-complex-type/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeTestCase.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;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class CallBackCTypeTestCase {
+
+ private Node node;
+ private CallBackCTypeClient aCallBackClient;
+
+ @Test
+ public void testCallBackBasic() {
+ aCallBackClient.run();
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("CallBackCTypeClient.composite");
+ node =
+ NodeFactory.newInstance().createNode("CallBackCTypeClient.composite", new Contribution("c1", location))
+ .start();
+
+ aCallBackClient = node.getService(CallBackCTypeClient.class, "CallBackCTypeClient");
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-id/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/callback-id/pom.xml
new file mode 100644
index 0000000000..9907a1beb5
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-id/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-callback-id</artifactId>
+ <name>Apache Tuscany SCA iTest Callback ID</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdCallBack.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdCallBack.java
new file mode 100644
index 0000000000..643cb3beb8
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+/**
+ *
+ */
+public interface CallBackIdCallBack {
+
+ void callBackMessage(String aString);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClient.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClient.java
new file mode 100644
index 0000000000..6e5a0c7654
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface CallBackIdClient {
+
+ void run();
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClientImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClientImpl.java
new file mode 100644
index 0000000000..aaf99a534b
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClientImpl.java
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.junit.Assert;
+import org.oasisopen.sca.ComponentContext;
+import org.oasisopen.sca.RequestContext;
+import org.oasisopen.sca.ServiceReference;
+import org.oasisopen.sca.annotation.Context;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(CallBackIdClient.class)
+public class CallBackIdClientImpl implements CallBackIdClient, CallBackIdCallBack {
+
+ @Context
+ protected ComponentContext componentContext;
+
+ @Reference
+ protected ServiceReference<CallBackIdService> 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();
+
+ }
+
+ 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 can't 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/tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdService.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdService.java
new file mode 100644
index 0000000000..cc7907f6ae
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+@Callback(CallBackIdCallBack.class)
+/**
+ *
+ */
+public interface CallBackIdService {
+
+ void knockKnock(String aString);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdServiceImpl.java
new file mode 100644
index 0000000000..4f04959b9d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdServiceImpl.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.test;
+
+import org.oasisopen.sca.ComponentContext;
+import org.oasisopen.sca.RequestContext;
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Context;
+import org.oasisopen.sca.annotation.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");
+
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/main/resources/CallBackIdClient.composite b/tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/main/resources/CallBackIdClient.composite
new file mode 100644
index 0000000000..a2b69afe69
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/main/resources/CallBackIdClient.composite
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://callback"
+ name="CallBackIdTest">
+
+ <component name="CallBackIdClient">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackIdClientImpl"/>
+ <reference name="aCallBackService" target="CallBackIdService"/>
+ </component>
+
+ <component name="CallBackIdService">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackIdServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/test/java/org/apache/tuscany/sca/test/CallBackIdTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/test/java/org/apache/tuscany/sca/test/CallBackIdTestCase.java
new file mode 100644
index 0000000000..56fd46d1b0
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-id/src/test/java/org/apache/tuscany/sca/test/CallBackIdTestCase.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.test;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class CallBackIdTestCase {
+
+ private Node node;
+ private CallBackIdClient aCallBackClient;
+
+ @Test
+ public void testCallBackBasic() {
+ aCallBackClient.run();
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("CallBackIdClient.composite");
+ node = NodeFactory.newInstance().createNode("CallBackIdClient.composite", new Contribution("c1", location));
+ node.start();
+ aCallBackClient = node.getService(CallBackIdClient.class, "CallBackIdClient");
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/pom.xml
new file mode 100644
index 0000000000..f17263214f
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-callback-multiple-wires</artifactId>
+ <name>Apache Tuscany SCA iTest Callback With Mutiple Wires</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClient.java b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl1.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl1.java
new file mode 100644
index 0000000000..c3ea6c3032
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.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 in client1: " + result);
+ MyClientImpl1.result = result;
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl2.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl2.java
new file mode 100644
index 0000000000..84ca158c97
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.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 in client2: " + result);
+ MyClientImpl2.result = result;
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyService.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyService.java
new file mode 100644
index 0000000000..66758a1e73
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.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/tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceCallback.java b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceImpl.java
new file mode 100644
index 0000000000..49df5aa17a
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.RequestContext;
+import org.oasisopen.sca.annotation.Context;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.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/tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite b/tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite
new file mode 100644
index 0000000000..ddf25b2578
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://callback"
+ name="CallbackMultiWireTest">
+
+ <component name="MyClientComponent1">
+ <implementation.java class="org.apache.tuscany.sca.test.callback.MyClientImpl1"/>
+ <reference name="myService" target="MyServiceComponent"/>
+ </component>
+
+ <component name="MyClientComponent2">
+ <implementation.java class="org.apache.tuscany.sca.test.callback.MyClientImpl2"/>
+ <reference name="myService" target="MyServiceComponent"/>
+ </component>
+
+ <component name="MyServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.test.callback.MyServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/test/java/org/apache/tuscany/sca/test/callback/CallbackMultiWireTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/test/java/org/apache/tuscany/sca/test/callback/CallbackMultiWireTestCase.java
new file mode 100644
index 0000000000..bd3cce74b4
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-multiple-wires/src/test/java/org/apache/tuscany/sca/test/callback/CallbackMultiWireTestCase.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.test.callback;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * A TestCase that demonstrates resolving the client service and initiating the callback sequence
+ */
+public class CallbackMultiWireTestCase {
+
+ private Node node;
+ private MyClient myClient1;
+ private MyClient myClient2;
+
+ @Before
+ public void setUp() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("CallbackMultiWireTest.composite");
+ node = NodeFactory.newInstance().createNode("CallbackMultiWireTest.composite", new Contribution("c1", location));
+ node.start();
+ myClient1 = node.getService(MyClient.class, "MyClientComponent1");
+ myClient2 = node.getService(MyClient.class, "MyClientComponent2");
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ 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/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/pom.xml
new file mode 100644
index 0000000000..bef92719d2
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-callback-separatethread</artifactId>
+ <name>Apache Tuscany SCA iTest Callback Using Separate Thread</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClient.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClient.java
new file mode 100644
index 0000000000..dc66003604
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.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/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClientImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClientImpl.java
new file mode 100644
index 0000000000..f03144db8a
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClientImpl.java
@@ -0,0 +1,186 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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 org.junit.Assert;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * This is the client implementation for the call backs in a separate thread tests
+ */
+@Service(CallBackSeparateThreadClient.class)
+public class CallBackSeparateThreadClientImpl implements CallBackSeparateThreadClient, EventProcessorCallBack {
+ /**
+ * Max time to wait to receive events. If not all the events are received then timeout.
+ */
+ private static final int TIMEOUT = 30 * 1000;
+
+ /**
+ * Counts the number of fast call backs.
+ */
+ private static final AtomicInteger FAST_CALLBACK_COUNT = new AtomicInteger();
+
+ /**
+ * Counts the number of slow call backs.
+ */
+ private static final AtomicInteger SLOW_CALLBACK_COUNT = 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() {
+ try {
+ // Register for fast call back
+ registerForFastCallback();
+
+ // Wait for a few fast call backs
+ System.out.println("Waiting for some fast call backs");
+ waitForSomeFastCallbacks();
+
+ try {
+ // Register for slow call back
+ registerForSlowCallback();
+
+ // Wait for a few fast call backs
+ System.out.println("Waiting for some fast calls");
+ waitForSomeFastCallbacks();
+
+ // Wait for a few slow call backs
+ System.out.println("Waiting for some slow calls");
+ waitForSomeSlowCallbacks();
+ } finally {
+ unregisterForSlowCallback();
+ }
+
+ System.out.println("Done");
+ } finally {
+ unregisterForFastCallback();
+ }
+ }
+
+ /**
+ * Waits for some fast call backs to be fired
+ */
+ private void waitForSomeFastCallbacks() {
+ // Reset the fast call back count
+ FAST_CALLBACK_COUNT.set(0);
+
+ // Wait until we have 10 fast call backs or timeout occurs
+ final long start = System.currentTimeMillis();
+ do {
+ if (FAST_CALLBACK_COUNT.get() >= 10) {
+ System.out.println("Received enough fast notifications");
+ return;
+ }
+
+ try {
+ Thread.sleep(5);
+ } catch (InterruptedException e) {
+ Assert.fail("Unexpeceted exception " + e);
+ }
+ } while (System.currentTimeMillis() - start < TIMEOUT);
+
+ // If we get to here then we did not receive enough events
+ Assert.fail("Did not receive enough fast events");
+ }
+
+ /**
+ * Waits for some slow call backs to be fired
+ */
+ private void waitForSomeSlowCallbacks() {
+ // Reset the slow call back count
+ SLOW_CALLBACK_COUNT.set(0);
+
+ // Wait until we have 4 slow call backs or timeout
+ final long start = System.currentTimeMillis();
+ do {
+ if (SLOW_CALLBACK_COUNT.get() >= 4) {
+ System.out.println("Received enough slow notifications");
+ return;
+ }
+
+ try {
+ Thread.sleep(5);
+ } catch (InterruptedException e) {
+ Assert.fail("Unexpeceted exception " + e);
+ }
+ } while (System.currentTimeMillis() - start < TIMEOUT);
+
+ // If we get to here then we did not receive enough events
+ Assert.fail("Did not receive enough slow events");
+ }
+
+ /**
+ * Register to receive fast call backs
+ */
+ private void registerForFastCallback() {
+ aCallBackService.registerForEvent("FAST");
+ }
+
+ /**
+ * Register to receive slow call backs
+ */
+ private void registerForSlowCallback() {
+ aCallBackService.registerForEvent("SLOW");
+ }
+
+ /**
+ * Unregister to receive fast call backs
+ */
+ private void unregisterForFastCallback() {
+ aCallBackService.unregisterForEvent("FAST");
+ }
+
+ /**
+ * Unregister to receive slow call backs
+ */
+ private void unregisterForSlowCallback() {
+ aCallBackService.unregisterForEvent("SLOW");
+ }
+
+ /**
+ * 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("FAST")) {
+ final int newValue = FAST_CALLBACK_COUNT.incrementAndGet();
+ //System.out.println("Received total of " + newValue + " fast call backs");
+ } else if (aEventName.equals("SLOW")) {
+ final int newValue = SLOW_CALLBACK_COUNT.incrementAndGet();
+ //System.out.println("Received total of " + newValue + " slow call backs");
+ } else {
+ System.out.println("Unknown event type of " + aEventName);
+ }
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorCallBack.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorCallBack.java
new file mode 100644
index 0000000000..137ea6a658
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorCallBack.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.itest;
+
+import org.oasisopen.sca.annotation.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/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorService.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorService.java
new file mode 100644
index 0000000000..a00578427c
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorService.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;
+
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Conversational;
+import org.oasisopen.sca.annotation.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/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorServiceImpl.java
new file mode 100644
index 0000000000..692ffbe8dd
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorServiceImpl.java
@@ -0,0 +1,195 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.oasisopen.sca.CallableReference;
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Destroy;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * Sample Event Processor Service Implementation
+ */
+@Service(EventProcessorService.class)
+@Scope("CONVERSATION")
+public class EventProcessorServiceImpl implements EventProcessorService {
+
+ /**
+ * Reference to the call back
+ */
+ @Callback
+ protected CallableReference<EventProcessorCallBack> clientCallback;
+
+ /**
+ * This map contains the call backs for each of the registered Event names
+ */
+ private final Map<String, CallableReference<EventProcessorCallBack>> eventListeners;
+
+ /**
+ * The list of all Event Generators we create
+ */
+ private final EventGenerator[] allEventGenerators;
+
+ /**
+ * Constructor. Starts the Event Generators
+ */
+ public EventProcessorServiceImpl() {
+ eventListeners = new ConcurrentHashMap<String, CallableReference<EventProcessorCallBack>>();
+
+ // We will simulate an Event generator
+ allEventGenerators = new EventGenerator[2];
+ allEventGenerators[0] = new EventGenerator("FAST", 10); // Generate the FAST event every 10ms
+ allEventGenerators[1] = new EventGenerator("SLOW", 50); // Generate the SLOW event every 50ms
+ }
+
+ /**
+ * 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<EventProcessorCallBack> 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
+ public 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 final class EventGenerator {
+ /**
+ * The Timer we are using to generate the events
+ */
+ private final Timer timer = new Timer();
+
+ /**
+ * Lock object to ensure that we can cancel the timer cleanly.
+ */
+ private final Object lock = new Object();
+
+ /**
+ * Constructor
+ *
+ * @param aEventName The name of the Event to generate
+ * @param frequencyInMilliseconds How frequently we should generate the Events
+ */
+ private EventGenerator(String aEventName, int frequencyInMilliseconds) {
+ timer.schedule(new EventGeneratorTimerTask(aEventName),
+ frequencyInMilliseconds,
+ frequencyInMilliseconds);
+ }
+
+ /**
+ * Stop this Event Generator
+ */
+ private void stop() {
+ synchronized (lock) {
+ timer.cancel();
+ }
+ }
+
+ /**
+ * The TimerTask that is invoked by the Timer for the EventGenerator
+ */
+ private final 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
+ */
+
+ public void run() {
+ synchronized(lock) {
+ // System.out.println("Generating new event " + eventName);
+ receiveEvent(eventName, "Separate Thread Notification: " + UUID.randomUUID().toString());
+ }
+ }
+ }
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite b/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite
new file mode 100644
index 0000000000..a6e2c35761
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" targetNamespace="http://callback" name="CallBackSeparateThreadTest">
+
+ <component name="CallBackSeparateThreadClient">
+ <implementation.java class="org.apache.tuscany.sca.itest.CallBackSeparateThreadClientImpl"/>
+ <reference name="aCallBackService" target="EventProcessorService"/>
+ </component>
+
+ <component name="EventProcessorService">
+ <implementation.java class="org.apache.tuscany.sca.itest.EventProcessorServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/test/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/test/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadTestCase.java
new file mode 100644
index 0000000000..c216cab1be
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-separatethread/src/test/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadTestCase.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;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * This test case will attempt to trigger a call back using a separate thread
+ */
+public class CallBackSeparateThreadTestCase {
+
+ /**
+ * The Node we are using
+ */
+ private Node node;
+
+ /**
+ * The client the tests should use
+ */
+ private CallBackSeparateThreadClient aCallBackClient;
+
+ /**
+ * Run the call back in separate thread tests
+ */
+ @Test
+ public void testCallBackSeparateThread() {
+ aCallBackClient.runTests();
+ }
+
+ /**
+ * Load the Call back in separate thread composite and look up the client.
+ */
+
+ @Before
+ public void setUp() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("CallBackSeparateThreadTest.composite");
+ node = NodeFactory.newInstance().createNode("CallBackSeparateThreadTest.composite", new Contribution("c1", location));
+ node.start();
+ aCallBackClient = node.getService(CallBackSeparateThreadClient.class, "CallBackSeparateThreadClient");
+ }
+
+ /**
+ * Shutdown the SCA node
+ */
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/pom.xml
new file mode 100644
index 0000000000..5c552f1d81
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-callback-set-callback</artifactId>
+ <name>Apache Tuscany SCA iTest Set Callback</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCalbackService.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCalbackService.java
new file mode 100644
index 0000000000..e54b9b4004
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.Callback;
+
+// @Remotable
+@Callback(CallBackSetCallbackCallback.class)
+/**
+ *
+ */
+public interface CallBackSetCalbackService {
+
+ void knockKnock(String aString);
+
+ boolean setCallbackIllegally(String aString);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackBadCallback.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackBadCallback.java
new file mode 100644
index 0000000000..f80401836e
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackBadCallback.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.junit.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");
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallback.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallback.java
new file mode 100644
index 0000000000..a15bcd90ae
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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 {
+
+ void callBackMessage(String aString);
+
+ void callBackIncrement(String aString);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallbackImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallbackImpl.java
new file mode 100644
index 0000000000..3e72b7ef3c
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.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/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClient.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClient.java
new file mode 100644
index 0000000000..6fd13eec5f
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface CallBackSetCallbackClient {
+
+ void run();
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClientImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClientImpl.java
new file mode 100644
index 0000000000..08c8b94a2f
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClientImpl.java
@@ -0,0 +1,188 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.junit.Assert;
+import org.oasisopen.sca.NoRegisteredCallbackException;
+import org.oasisopen.sca.ServiceReference;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(CallBackSetCallbackClient.class)
+public class CallBackSetCallbackClientImpl implements CallBackSetCallbackClient {
+
+ @Reference
+ protected ServiceReference<CallBackSetCalbackService> aCallBackService;
+ @Reference
+ protected ServiceReference<CallBackSetCallbackCallback> 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 execution.
+ */
+
+ 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 exception occurs.
+ */
+
+ test10();
+ }
+
+ 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/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackObjectCallback.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackObjectCallback.java
new file mode 100644
index 0000000000..afedcdf7f1
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackServiceImpl.java
new file mode 100644
index 0000000000..78bc793c81
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackServiceImpl.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.test;
+
+import org.oasisopen.sca.ComponentContext;
+import org.oasisopen.sca.RequestContext;
+import org.oasisopen.sca.ServiceReference;
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Context;
+import org.oasisopen.sca.annotation.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/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/resources/CallBackSetCallbackTest.composite b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/resources/CallBackSetCallbackTest.composite
new file mode 100644
index 0000000000..274337fabc
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/main/resources/CallBackSetCallbackTest.composite
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://callback"
+ name="CallBackSetCallbackTest">
+
+ <component name="CallBackSetCallbackClient">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackSetCallbackClientImpl"/>
+ <reference name="aCallBackService" target="CallBackSetCallbackService"/>
+ <reference name="callBack" target="CallBackSetCallbackCallback"/>
+ </component>
+
+ <component name="CallBackSetCallbackCallback">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackSetCallbackCallbackImpl"/>
+ </component>
+
+ <component name="CallBackSetCallbackService">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackSetCallbackServiceImpl"/>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackTestCase.java
new file mode 100644
index 0000000000..5aaf596d85
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-callback/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackTestCase.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;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.After;
+import org.junit.Before;
+
+//FIXME Fix this test case
+public class CallBackSetCallbackTestCase extends TestCase {
+
+ private Node node;
+ private CallBackSetCallbackClient aCallBackClient;
+
+ public void testCallBackSetCallback() {
+ aCallBackClient.run();
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("CallBackSetCallbackTest.composite");
+ node =
+ NodeFactory.newInstance().createNode("CallBackSetCallbackTest.composite", new Contribution("c1", location));
+ node.start();
+ aCallBackClient = node.getService(CallBackSetCallbackClient.class, "CallBackSetCallbackClient");
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/pom.xml
new file mode 100644
index 0000000000..f803c390be
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-callback-set-conversation</artifactId>
+ <name>Apache Tuscany SCA iTest Callback Set Conversation</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java
new file mode 100644
index 0000000000..77837fdb77
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.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.test;
+
+import java.io.Serializable;
+
+import org.junit.Assert;
+
+public class CallBackSetCallbackConvBadCallback implements Serializable {
+
+ 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");
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java
new file mode 100644
index 0000000000..825d1d6486
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.Conversational;
+
+// @Remotable
+@Conversational
+/**
+ *
+ */
+public interface CallBackSetCallbackConvCallback {
+
+ void callBackMessage(String aString);
+
+ void callBackIncrement(String aString);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java
new file mode 100644
index 0000000000..b5c3e6e8b8
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface CallBackSetCallbackConvClient {
+
+ void run();
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java
new file mode 100644
index 0000000000..12a206affa
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java
@@ -0,0 +1,157 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.junit.Assert;
+import org.oasisopen.sca.ComponentContext;
+import org.oasisopen.sca.ServiceReference;
+import org.oasisopen.sca.annotation.Context;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(CallBackSetCallbackConvClient.class)
+@Scope("CONVERSATION")
+public class CallBackSetCallbackConvClientImpl implements CallBackSetCallbackConvClient {
+
+ @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();
+ }
+
+ private void test7() {
+
+ //
+ // This test is to specify an Object that is not a service reference
+ // that does implement
+ // the callback interface and is Serializable. Verify successful
+ // execution.
+ //
+
+ aCallbackObject = new CallBackSetCallbackConvObjectCallback();
+ aCallbackObject.incrementCallBackCount();
+
+ ServiceReference<CallBackSetCallbackConvService> aCallBackServiceRef = componentContext.cast(aCallBackService);
+ aCallBackServiceRef.setCallback(aCallbackObject);
+ aCallBackService.knockKnock("Knock Knock 7");
+
+ 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<CallBackSetCallbackConvService> aCallBackServiceRef =
+ componentContext.cast(aCallBackService);
+ aCallBackServiceRef.setCallback(new CallBackSetCallbackConvBadCallback());
+ aCallBackService.knockKnock("Knock Knock 8");
+ }
+
+ //
+ // 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 Serializable. Verify
+ // an appropriate exception
+ // is thrown.
+ //
+
+ try {
+ ServiceReference<CallBackSetCallbackConvService> aCallBackServiceRef =
+ componentContext.cast(aCallBackService);
+ aCallBackServiceRef.setCallback(new CallBackSetCallbackConvNonSerCallback());
+ aCallBackService.knockKnock("Knock Knock 9");
+ }
+ //
+ // 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);
+
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java
new file mode 100644
index 0000000000..bd17731fa1
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.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.test;
+
+import org.junit.Assert;
+
+public class CallBackSetCallbackConvNonSerCallback implements CallBackSetCallbackConvCallback {
+
+ private int callBackCount = 0;
+
+ public CallBackSetCallbackConvNonSerCallback() {
+ super();
+ }
+
+ public synchronized void incrementCallBackCount() {
+ callBackCount++;
+ }
+
+ public synchronized int getCount() {
+ return callBackCount;
+ }
+
+ public void callBackMessage(String aString) {
+ //
+ // This callback method should never be called.
+ //
+ System.out.println("Entering CallBackSetCallbackConvNonSerCallback callBackMessage: " + aString);
+ Assert.fail("CallBackSetCallbackConvNonSerCallback: callbackMessage called");
+ }
+
+ public void callBackIncrement(String aString) {
+ //
+ // This callback method should never be called.
+ //
+ System.out.println("Entering callbackIncrement: " + aString);
+ this.incrementCallBackCount();
+ Assert.fail("CallBackSetCallbackConvNonSerCallback: callbackIncrement called");
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java
new file mode 100644
index 0000000000..f7c718adab
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.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.test;
+
+import java.io.Serializable;
+
+public class CallBackSetCallbackConvObjectCallback implements CallBackSetCallbackConvCallback, Serializable {
+ 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/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java
new file mode 100644
index 0000000000..74c19961ba
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Conversational;
+
+// @Remotable
+@Conversational
+@Callback(CallBackSetCallbackConvCallback.class)
+/**
+ *
+ */
+public interface CallBackSetCallbackConvService {
+
+ void knockKnock(String aString);
+
+ void setCallbackIllegally(String aString);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java
new file mode 100644
index 0000000000..d79b9278e2
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.ComponentContext;
+import org.oasisopen.sca.RequestContext;
+import org.oasisopen.sca.ServiceReference;
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Context;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.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/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/resources/CallBackSetCallbackConvTest.composite b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/resources/CallBackSetCallbackConvTest.composite
new file mode 100644
index 0000000000..831e488f1b
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/main/resources/CallBackSetCallbackConvTest.composite
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://callback"
+ name="CallBackSetCallbackConvTest">
+
+ <component name="CallBackSetCallbackConvClient">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackSetCallbackConvClientImpl"/>
+ <reference name="aCallBackService" target="CallBackSetCallbackConvService"/>
+ </component>
+
+
+ <component name="CallBackSetCallbackConvService">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackSetCallbackConvServiceImpl"/>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvTestCase.java
new file mode 100644
index 0000000000..a61682da06
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/callback-set-conversation/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvTestCase.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 org.apache.tuscany.sca.test;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class CallBackSetCallbackConvTestCase {
+
+ private Node node;
+ private CallBackSetCallbackConvClient aCallBackClient;
+
+ @Test
+ public void testCallBackSetCallback() {
+ aCallBackClient.run();
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("CallBackSetCallbackConvTest.composite");
+ node = NodeFactory.newInstance().createNode("CallBackSetCallbackConvTest.composite", new Contribution("c1", location));
+ node.start();
+ aCallBackClient = node.getService(CallBackSetCallbackConvClient.class, "CallBackSetCallbackConvClient");
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/component-type/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/component-type/pom.xml
new file mode 100644
index 0000000000..4905a77f58
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/component-type/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-component-type</artifactId>
+ <name>Apache Tuscany SCA iTest Component Type</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+</project>
+
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/AddService.java b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/AddService.java
new file mode 100644
index 0000000000..188451ebac
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/AddServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/AddServiceImpl.java
new file mode 100644
index 0000000000..8b6fe066a6
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/CalculatorClient.java b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/CalculatorClient.java
new file mode 100644
index 0000000000..6f978bd9be
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/CalculatorClient.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 calculator;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+/**
+ * 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 {
+
+ String location = ContributionLocationHelper.getContributionLocation("Calculator.composite");
+ Node node = NodeFactory.newInstance().createNode("Calculator.composite", new Contribution("c1", location));
+ node.start();
+
+ CalculatorService calculatorService =
+ node.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));
+
+ node.stop();
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/CalculatorService.java b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/CalculatorService.java
new file mode 100644
index 0000000000..c89043276e
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/CalculatorService.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 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/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/CalculatorServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/CalculatorServiceImpl.java
new file mode 100644
index 0000000000..1209ac128a
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/CalculatorServiceImpl.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 calculator;
+
+/**
+ * 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/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/DivideService.java b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/DivideService.java
new file mode 100644
index 0000000000..30d248208b
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/DivideServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/DivideServiceImpl.java
new file mode 100644
index 0000000000..f7ac0b7287
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/MultiplyService.java b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/MultiplyService.java
new file mode 100644
index 0000000000..5290605938
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/MultiplyServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/MultiplyServiceImpl.java
new file mode 100644
index 0000000000..b7dca792b2
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/SubtractService.java b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/SubtractService.java
new file mode 100644
index 0000000000..bf0d1882b6
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/SubtractServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/java/calculator/SubtractServiceImpl.java
new file mode 100644
index 0000000000..77b128ab8d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/Calculator.composite b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/Calculator.composite
new file mode 100644
index 0000000000..1245792edb
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/Calculator.composite
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="Calculator">
+
+ <component name="CalculatorServiceComponent">
+ <implementation.java class="calculator.CalculatorServiceImpl"/>
+ <reference name="addService" target="AddServiceComponent/AddService"/>
+ <reference name="subtractService" target="SubtractServiceComponent/SubtractService"/>
+ <reference name="multiplyService" target="MultiplyServiceComponent/MultiplyService"/>
+ <reference name="divideService" target="DivideServiceComponent/DivideService"/>
+ </component>
+
+ <component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl"/>
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <implementation.java class="calculator.SubtractServiceImpl"/>
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl"/>
+ </component>
+
+ <component name="DivideServiceComponent">
+ <implementation.java class="calculator.DivideServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/calculator/AddServiceImpl.componentType b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/calculator/AddServiceImpl.componentType
new file mode 100644
index 0000000000..78e169deb4
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/calculator/AddServiceImpl.componentType
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903">
+
+ <service name="AddService">
+ <interface.java interface="calculator.AddService"/>
+ </service>
+
+</componentType>
+ \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/calculator/CalculatorServiceImpl.componentType b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/calculator/CalculatorServiceImpl.componentType
new file mode 100644
index 0000000000..5d66becedf
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/calculator/CalculatorServiceImpl.componentType
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903">
+
+ <service name="CalculatorService">
+ <interface.java interface="calculator.CalculatorService"/>
+ </service>
+
+ <reference name="addService">
+ <interface.java interface="calculator.AddService"/>
+ </reference>
+
+ <reference name="subtractService">
+ <interface.java interface="calculator.SubtractService"/>
+ </reference>
+
+ <reference name="multiplyService">
+ <interface.java interface="calculator.MultiplyService"/>
+ </reference>
+
+ <reference name="divideService">
+ <interface.java interface="calculator.DivideService"/>
+ </reference>
+
+</componentType>
+ \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/calculator/DivideServiceImpl.componentType b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/calculator/DivideServiceImpl.componentType
new file mode 100644
index 0000000000..22236ae0d0
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/calculator/DivideServiceImpl.componentType
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903">
+
+ <service name="DivideService">
+ <interface.java interface="calculator.DivideService"/>
+ </service>
+
+</componentType>
+ \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/calculator/MultiplyServiceImpl.componentType b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/calculator/MultiplyServiceImpl.componentType
new file mode 100644
index 0000000000..2035d617e5
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/calculator/MultiplyServiceImpl.componentType
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903">
+
+ <service name="MultiplyService">
+ <interface.java interface="calculator.MultiplyService"/>
+ </service>
+
+</componentType>
+ \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/calculator/SubtractServiceImpl.componentType b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/calculator/SubtractServiceImpl.componentType
new file mode 100644
index 0000000000..fe76f553be
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/main/resources/calculator/SubtractServiceImpl.componentType
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903">
+
+ <service name="SubtractService">
+ <interface.java interface="calculator.SubtractService"/>
+ </service>
+
+</componentType>
+ \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/test/java/calculator/CalculatorTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/test/java/calculator/CalculatorTestCase.java
new file mode 100644
index 0000000000..ac3ccc3d08
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/component-type/src/test/java/calculator/CalculatorTestCase.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 calculator;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class CalculatorTestCase {
+
+ private CalculatorService calculatorService;
+ private Node node;
+
+ @Before
+ public void setUp() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("Calculator.composite");
+ node = NodeFactory.newInstance().createNode("Calculator.composite", new Contribution("c1", location));
+ node.start();
+ calculatorService = node.getService(CalculatorService.class, "CalculatorServiceComponent/CalculatorService");
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void testCalculator() throws Exception {
+ // Calculate
+ /*
+ assertEquals(calculatorService.add(3, 2), 5.0, 0.0);
+ assertEquals(calculatorService.subtract(3, 2), 1.0, 0.0);
+ assertEquals(calculatorService.multiply(3, 2), 6.0, 0.0);
+ assertEquals(calculatorService.divide(3, 2), 1.5, 0.0);
+ */
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/pom.xml
new file mode 100644
index 0000000000..7a924199dd
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/pom.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-contribution-folder</artifactId>
+ <name>Apache Tuscany SCA iTest Contribution Folder</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/java/calculator/CalculatorService.java b/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/java/calculator/CalculatorService.java
new file mode 100644
index 0000000000..a318cf50d9
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/java/calculator/CalculatorService.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 calculator;
+
+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/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/java/test/ContributionFolderTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/java/test/ContributionFolderTestCase.java
new file mode 100644
index 0000000000..0c8f84d7cc
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/java/test/ContributionFolderTestCase.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 test;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+import calculator.CalculatorService;
+
+/**
+ * Test SCADomain.newInstance and invocation of a service.
+ *
+ * @version $Rev: 608205 $ $Date: 2008-01-02 20:29:05 +0000 (Wed, 02 Jan 2008) $
+ */
+public class ContributionFolderTestCase extends TestCase {
+
+ private Node node;
+
+ @Override
+ protected void setUp() throws Exception {
+ node = NodeFactory.newInstance().createNode(new Contribution("foo", "src/test/resources/repository"));
+ node.start();
+ }
+
+ public void testInvoke() throws Exception {
+ CalculatorService service = node.getService(CalculatorService.class, "CalculatorServiceComponent");
+ assertEquals(3.0, service.add(1, 2));
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/resources/repository/folderWithJars/Calculator.composite b/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/resources/repository/folderWithJars/Calculator.composite
new file mode 100644
index 0000000000..e11d44fe58
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/resources/repository/folderWithJars/Calculator.composite
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="Calculator">
+
+ <component name="CalculatorServiceComponent">
+ <implementation.java class="calculator.CalculatorServiceImpl"/>
+ <reference name="addService" target="AddServiceComponent" />
+ <reference name="subtractService" target="SubtractServiceComponent" />
+ <reference name="multiplyService" target="MultiplyServiceComponent" />
+ <reference name="divideService" target="DivideServiceComponent" />
+ </component>
+
+ <component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl"/>
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <implementation.java class="calculator.SubtractServiceImpl"/>
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl"/>
+ </component>
+
+ <component name="DivideServiceComponent">
+ <implementation.java class="calculator.DivideServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/resources/repository/folderWithJars/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/resources/repository/folderWithJars/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..10140b7bc1
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/resources/repository/folderWithJars/META-INF/sca-contribution.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:Calculator"/>
+</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/resources/repository/folderWithJars/service.jar b/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/resources/repository/folderWithJars/service.jar
new file mode 100644
index 0000000000..fe264693fe
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/resources/repository/folderWithJars/service.jar
Binary files differ
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/resources/repository/folderWithJars/serviceImpl.jar b/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/resources/repository/folderWithJars/serviceImpl.jar
new file mode 100644
index 0000000000..d5dfb647d3
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/resources/repository/folderWithJars/serviceImpl.jar
Binary files differ
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/resources/repository3/contribution.zip b/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/resources/repository3/contribution.zip
new file mode 100644
index 0000000000..b293aa4bcc
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-folder/src/test/resources/repository3/contribution.zip
Binary files differ
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-composite/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-composite/pom.xml
new file mode 100644
index 0000000000..38e37a7080
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-composite/pom.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-contribution-export-composite</artifactId>
+ <name>Apache Tuscany SCA iTest Contribution Export</name>
+
+<dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-tomcat</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-composite/src/main/java/hello/Hello.java b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-composite/src/main/java/hello/Hello.java
new file mode 100644
index 0000000000..e65422136f
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-composite/src/main/java/hello/HelloImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-composite/src/main/java/hello/HelloImpl.java
new file mode 100644
index 0000000000..5369c18497
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-composite/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-composite/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..3c14560a56
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-composite/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://hello"
+ xmlns:hello="http://hello">
+ <deployable composite="hello:hello"/>
+ <export namespace="http://hello"/>
+</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-composite/src/main/resources/hello.composite b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-composite/src/main/resources/hello.composite
new file mode 100644
index 0000000000..636b7111d9
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-composite/src/main/resources/hello.composite
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://hello"
+ xmlns:hello="http://hello"
+ name="hello">
+
+ <service name="HelloService" promote="HelloServiceComponent"/>
+
+ <component name="HelloServiceComponent">
+ <implementation.java class="hello.HelloImpl" />
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-composite/src/test/java/org/apache/tuscany/sca/test/contribution/HelloTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-composite/src/test/java/org/apache/tuscany/sca/test/contribution/HelloTestCase.java
new file mode 100644
index 0000000000..72b77564d2
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-java/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-java/pom.xml
new file mode 100644
index 0000000000..4f361a12f5
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-java/pom.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-contribution-export-java</artifactId>
+ <name>Apache Tuscany SCA iTest Contribution Java Export</name>
+
+<dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-tomcat</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-java/src/main/java/helloworld/HelloWorldService.java b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-java/src/main/java/helloworld/HelloWorldService.java
new file mode 100644
index 0000000000..74d22ed830
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-java/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-java/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..dc33dfa560
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-java/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://helloworld"
+ xmlns:helloworld="http://helloworld">
+ <export.java package="helloworld"/>
+</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-java/src/main/resources/helloworld/HelloWorldImpl.componentType b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-java/src/main/resources/helloworld/HelloWorldImpl.componentType
new file mode 100644
index 0000000000..5a14b41650
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-java/src/main/resources/helloworld/HelloWorldImpl.componentType
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <service name="HelloWorldService">
+ <interface.java interface="helloworld.HelloWorldService" />
+ </service>
+
+</componentType>
+ \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-resource/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-resource/pom.xml
new file mode 100644
index 0000000000..d8133c4acc
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-resource/pom.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-contribution-export-resource</artifactId>
+ <name>Apache Tuscany SCA iTest Contribution Resource Export</name>
+
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-resource/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-resource/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..f11eacb416
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-resource/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://store"
+ xmlns:helloworld="http://store">
+ <export.resource uri="ufservices/store.html"/>
+</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-resource/src/main/resources/ufservices/store.html b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-resource/src/main/resources/ufservices/store.html
new file mode 100644
index 0000000000..1ff281373a
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-resource/src/main/resources/ufservices/store.html
@@ -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.
+-->
+<html>
+<head>
+<title>Store</TITLE>
+</head>
+
+<body>
+<h1>Sample Store Page</h1>
+</body>
+</html>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-wsdl/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-wsdl/pom.xml
new file mode 100644
index 0000000000..9f81cd92ca
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-wsdl/pom.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-contribution-export-wsdl</artifactId>
+ <name>Apache Tuscany SCA iTest Contribution WSDL Export</name>
+
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-wsdl/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-wsdl/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..b7394ec14b
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-wsdl/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://helloworld"
+ xmlns:helloworld="http://helloworld">
+ <export namespace="http://helloworld"/>
+</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.wsdl b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.wsdl
new file mode 100644
index 0000000000..9b31363e1a
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.wsdl
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<wsdl:definitions targetNamespace="http://helloworld"
+ xmlns:tns="http://helloworld"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ name="helloworld">
+
+ <wsdl:types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns2="http://helloworld2"
+ targetNamespace="http://helloworld"
+ elementFormDefault="qualified">
+
+ <xsd:import namespace="http://helloworld2" schemaLocation="helloworld.xsd" />
+
+ <element name="getGreetings" type="tns2:getGreetingsType"/>
+ <element name="getGreetingsResponse" type="tns2:getGreetingsResponseType"/>
+
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="getGreetingsRequest">
+ <wsdl:part element="tns:getGreetings" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:message name="getGreetingsResponse">
+ <wsdl:part element="tns:getGreetingsResponse" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:portType name="HelloWorld">
+ <wsdl:operation name="getGreetings">
+ <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest"/>
+ <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="getGreetings">
+ <wsdlsoap:operation soapAction=""/>
+ <wsdl:input name="getGreetingsRequest">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="getGreetingsResponse">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="HelloWorldService">
+ <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
+ <wsdlsoap:address location="http://localhost:8085/HelloWorldServiceComponent"/>
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.xsd b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.xsd
new file mode 100644
index 0000000000..d3c83b08c6
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.xsd
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<schema targetNamespace="http://helloworld2"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ns="http://helloworld2">
+
+ <complexType name="getGreetingsType">
+ <sequence>
+ <element name="name" type="string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="getGreetingsResponseType">
+ <sequence>
+ <element name="getGreetingsReturn" type="string"/>
+ </sequence>
+ </complexType>
+</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/pom.xml
new file mode 100644
index 0000000000..d13f2e2a87
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/pom.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-contribution-import-composite</artifactId>
+ <name>Apache Tuscany SCA iTest Contribution Import</name>
+
+<dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-contribution-export-composite</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-tomcat</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldImpl.java
new file mode 100644
index 0000000000..966f56d7d5
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldServer.java b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldServer.java
new file mode 100644
index 0000000000..3d43290380
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldService.java b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldService.java
new file mode 100644
index 0000000000..74d22ed830
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..9f3f5be452
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://helloworld"
+ xmlns:helloworld="http://helloworld"
+ xmlns:hello="http://hello">
+ <deployable composite="helloworld:helloworldws"/>
+ <import namespace="http://hello"/>
+ <!-- import namespace="http://hello" location="http://import-export/contrib-composite"/ -->
+</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/resources/helloworld.wsdl b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/resources/helloworld.wsdl
new file mode 100644
index 0000000000..9b31363e1a
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/resources/helloworld.wsdl
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<wsdl:definitions targetNamespace="http://helloworld"
+ xmlns:tns="http://helloworld"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ name="helloworld">
+
+ <wsdl:types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns2="http://helloworld2"
+ targetNamespace="http://helloworld"
+ elementFormDefault="qualified">
+
+ <xsd:import namespace="http://helloworld2" schemaLocation="helloworld.xsd" />
+
+ <element name="getGreetings" type="tns2:getGreetingsType"/>
+ <element name="getGreetingsResponse" type="tns2:getGreetingsResponseType"/>
+
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="getGreetingsRequest">
+ <wsdl:part element="tns:getGreetings" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:message name="getGreetingsResponse">
+ <wsdl:part element="tns:getGreetingsResponse" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:portType name="HelloWorld">
+ <wsdl:operation name="getGreetings">
+ <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest"/>
+ <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="getGreetings">
+ <wsdlsoap:operation soapAction=""/>
+ <wsdl:input name="getGreetingsRequest">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="getGreetingsResponse">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="HelloWorldService">
+ <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
+ <wsdlsoap:address location="http://localhost:8085/HelloWorldServiceComponent"/>
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/resources/helloworld.xsd b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/resources/helloworld.xsd
new file mode 100644
index 0000000000..d3c83b08c6
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/resources/helloworld.xsd
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<schema targetNamespace="http://helloworld2"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ns="http://helloworld2">
+
+ <complexType name="getGreetingsType">
+ <sequence>
+ <element name="name" type="string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="getGreetingsResponseType">
+ <sequence>
+ <element name="getGreetingsReturn" type="string"/>
+ </sequence>
+ </complexType>
+</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/resources/helloworldws.composite b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/resources/helloworldws.composite
new file mode 100644
index 0000000000..e2f852ff7e
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/main/resources/helloworldws.composite
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://helloworld"
+ xmlns:helloworld="http://helloworld"
+ xmlns:hello="http://hello"
+ name="helloworldws">
+
+ <component name="SourceHelloServiceComponent">
+ <implementation.composite name="hello:hello"/>
+ </component>
+
+ <component name="HelloWorldServiceComponent">
+ <service name="HelloWorldService">
+ <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" />
+ <binding.ws uri="http://localhost:8085/HelloWorldService"/>
+ </service>
+ <implementation.java class="helloworld.HelloWorldImpl" />
+ <reference name="helloServiceRef" target="SourceHelloServiceComponent/HelloService"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/test/java/org/apache/tuscany/test/contribution/HelloWorldServerTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-composite/src/test/java/org/apache/tuscany/test/contribution/HelloWorldServerTestCase.java
new file mode 100644
index 0000000000..1176a89143
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-java/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-java/pom.xml
new file mode 100644
index 0000000000..f05c62f8ca
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-java/pom.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-contribution-import-java</artifactId>
+ <name>Apache Tuscany SCA iTest Contribution Java Import</name>
+
+<dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-contribution-export-java</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-tomcat</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-java/src/main/java/helloworld/HelloWorldImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-java/src/main/java/helloworld/HelloWorldImpl.java
new file mode 100644
index 0000000000..4cdcc1fd0b
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-java/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-java/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..224e2c4d79
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-java/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://helloworld"
+ xmlns:helloworld="http://helloworld">
+ <deployable composite="helloworld:helloworldws"/>
+ <import.java package="helloworld"/>
+</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-java/src/main/resources/helloworldws.composite b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-java/src/main/resources/helloworldws.composite
new file mode 100644
index 0000000000..9b650e4acc
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-java/src/main/resources/helloworldws.composite
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://helloworld"
+ xmlns:helloworld="http://helloworld"
+ name="helloworldws">
+
+ <component name="HelloWorldServiceComponent">
+ <implementation.java class="helloworld.HelloWorldImpl" />
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-java/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-java/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java
new file mode 100644
index 0000000000..431988cc04
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-resource/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-resource/pom.xml
new file mode 100644
index 0000000000..0696df1951
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-resource/pom.xml
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-contribution-import-resource</artifactId>
+ <name>Apache Tuscany SCA iTest Contribution Resource Import</name>
+
+<dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-contribution-export-resource</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-http</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-http-runtime</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-resource-runtime</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution-resource</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-tomcat</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-resource/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-resource/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..ac6d7becb3
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-resource/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://store"
+ xmlns:store="http://store">
+ <deployable composite="store:store"/>
+ <import.resource uri="ufservices/store.html"/>
+</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-resource/src/main/resources/store.composite b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-resource/src/main/resources/store.composite
new file mode 100644
index 0000000000..bb5a7b764f
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-resource/src/main/resources/store.composite
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ targetNamespace="http://store"
+ xmlns:helloworld="http://store"
+ name="store">
+
+ <component name="store">
+ <tuscany:implementation.resource location="ufservices/store.html"/>
+ <service name="Resource">
+ <tuscany:binding.http uri="http://127.0.0.1:8085"/>
+ </service>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-resource/src/test/java/org/apache/tuscany/sca/test/contribution/StoreTestCase.java b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/pom.xml
new file mode 100644
index 0000000000..59bee4125e
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/pom.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-contribution-import-wsdl</artifactId>
+ <name>Apache Tuscany SCA iTest Contribution WSDL Import</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-contribution-export-wsdl</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-tomcat</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldImpl.java
new file mode 100644
index 0000000000..4cdcc1fd0b
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldServer.java b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldServer.java
new file mode 100644
index 0000000000..3d43290380
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldService.java b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldService.java
new file mode 100644
index 0000000000..74d22ed830
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..d46fe0b57c
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://helloworld"
+ xmlns:helloworld="http://helloworld">
+ <deployable composite="helloworld:helloworldws"/>
+ <import namespace="http://helloworld" location="http://import-export/export-wsdl"/>
+</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/src/main/resources/helloworldws.composite b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/src/main/resources/helloworldws.composite
new file mode 100644
index 0000000000..5008a2ea5b
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/src/main/resources/helloworldws.composite
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://helloworld"
+ xmlns:hw="http://helloworld"
+ name="helloworldws">
+
+ <component name="HelloWorldServiceComponent">
+ <service name="HelloWorldService">
+ <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" />
+ <binding.ws uri="http://localhost:8085/HelloWorldService"/>
+ </service>
+ <implementation.java class="helloworld.HelloWorldImpl" />
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/import-wsdl/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java
new file mode 100644
index 0000000000..5c40606e50
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/pom.xml
new file mode 100644
index 0000000000..ff6a4bbf12
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-import-export/pom.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-contribution-import-export</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Contribution Import/Export Integration Tests</name>
+
+ <modules>
+ <module>export-composite</module>
+ <module>export-java</module>
+ <module>export-resource</module>
+ <module>export-wsdl</module>
+ <module>import-composite</module>
+ <module>import-java</module>
+ <module>import-resource</module>
+ <module>import-wsdl</module>
+ </modules>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution-impl</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-zip/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/contribution-zip/pom.xml
new file mode 100644
index 0000000000..1bacaabbb2
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-zip/pom.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-contribution-zip</artifactId>
+ <name>Apache Tuscany SCA iTest Contribution ZIP</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-zip/src/test/java/calculator/CalculatorService.java b/tags/java/sca/2.0-M3-RC3a/itest/contribution-zip/src/test/java/calculator/CalculatorService.java
new file mode 100644
index 0000000000..a318cf50d9
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-zip/src/test/java/calculator/CalculatorService.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 calculator;
+
+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/tags/java/sca/2.0-M3-RC3a/itest/contribution-zip/src/test/java/org/apache/tuscany/sca/contribution/zip/ContributionZIPTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/contribution-zip/src/test/java/org/apache/tuscany/sca/contribution/zip/ContributionZIPTestCase.java
new file mode 100644
index 0000000000..303e2a6d9a
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-zip/src/test/java/org/apache/tuscany/sca/contribution/zip/ContributionZIPTestCase.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.contribution.zip;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+import calculator.CalculatorService;
+
+/**
+ * Test SCADomain.newInstance and invocation of a service.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ContributionZIPTestCase extends TestCase {
+
+ private Node node;
+
+ @Override
+ protected void setUp() throws Exception {
+ node =
+ NodeFactory.newInstance().createNode(new Contribution("foo",
+ "src/test/resources/repository/contribution.zip"));
+ node.start();
+ }
+
+ public void testInvoke() throws Exception {
+ CalculatorService service = node.getService(CalculatorService.class, "CalculatorServiceComponent");
+ assertEquals(3.0, service.add(1, 2));
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/contribution-zip/src/test/resources/repository/contribution.zip b/tags/java/sca/2.0-M3-RC3a/itest/contribution-zip/src/test/resources/repository/contribution.zip
new file mode 100644
index 0000000000..3239ae1242
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/contribution-zip/src/test/resources/repository/contribution.zip
Binary files differ
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/conversations/pom.xml
new file mode 100644
index 0000000000..c635d99d4c
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-conversations</artifactId>
+ <name>Apache Tuscany SCA iTest Conversations</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/Record.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/Record.java
new file mode 100644
index 0000000000..a3b83dfc14
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/Record.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;
+
+import java.io.Serializable;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class Record implements Serializable {
+ public String id;
+ public String conversationId;
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/TestResult.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/TestResult.java
new file mode 100644
index 0000000000..946ad93d7d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/TestResult.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.itest;
+
+import java.util.Hashtable;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class TestResult {
+ public static Hashtable<Object, Boolean> results = new Hashtable<Object, Boolean>();
+ private static int completed = 0;
+
+ public static synchronized void updateCompleted() {
+ ++completed;
+ }
+
+ public static synchronized int getCompleted() {
+ return completed;
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/AService.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/AService.java
new file mode 100644
index 0000000000..27939e3996
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Alpha.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Alpha.java
new file mode 100644
index 0000000000..7887417e55
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Alpha.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.itest.conversational;
+
+import org.oasisopen.sca.annotation.OneWay;
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * @version $Rev$ $Date$
+ */
+
+@Remotable
+public interface Alpha {
+ @OneWay
+ void run(int param);
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/BService.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/BService.java
new file mode 100644
index 0000000000..735bcee176
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Beta.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Beta.java
new file mode 100644
index 0000000000..1c5d2cdbb8
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Beta.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.itest.conversational;
+
+import org.oasisopen.sca.CallableReference;
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * @version $Rev$ $Date$
+ */
+
+@Remotable
+public interface Beta {
+ CallableReference<Gamma> getRef(int param);
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/CService.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/CService.java
new file mode 100644
index 0000000000..cebbea0701
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Constants.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Constants.java
new file mode 100644
index 0000000000..3f04e9f09e
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationIdService.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationIdService.java
new file mode 100644
index 0000000000..9ca4abb9d3
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationIdService.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.conversational;
+
+import org.oasisopen.sca.annotation.Conversational;
+
+@Conversational
+public interface ConversationIdService {
+
+ String getCIDField();
+
+ String getCIDSetter();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalCallback.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalCallback.java
new file mode 100644
index 0000000000..734fb9fe7b
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalCallback.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.conversational;
+
+import org.oasisopen.sca.annotation.Conversational;
+import org.oasisopen.sca.annotation.EndsConversation;
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The callback interface used when testing conversational callbacks
+ *
+ * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $
+ */
+@Remotable
+@Conversational
+public interface ConversationalCallback {
+
+ void init();
+
+ void destroy();
+
+ void initializeCount(int count);
+
+ void incrementCount();
+
+ int retrieveCount();
+
+ void businessException() throws Exception;
+
+ @EndsConversation
+ String endConversation();
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalClient.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalClient.java
new file mode 100644
index 0000000000..99f4c85d8f
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalClient.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.itest.conversational;
+
+import org.oasisopen.sca.annotation.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 {
+
+ int runConversationFromInjectedReference();
+
+ int runConversationFromInjectedReference2();
+
+ int runConversationFromServiceReference();
+
+ int runConversationWithUserDefinedConversationId();
+
+ String runConversationCheckUserDefinedConversationId();
+
+ int runConversationCheckingScope();
+
+ int runConversationWithCallback();
+
+ int runConversationHavingPassedReference();
+
+ String runConversationBusinessException();
+
+ String runConversationBusinessExceptionCallback();
+
+ int runConversationCallingEndedConversation();
+
+ int runConversationCallingEndedConversationCallback();
+
+ String runConversationCallingEndedConversationCheckConversationId();
+
+ String runConversationCallingEndedConversationCallbackCheckConversationId();
+
+ int runConversationAgeTimeout();
+
+ int runConversationIdleTimeout();
+
+ int runConversationPrincipleError();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalReferenceClient.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalReferenceClient.java
new file mode 100644
index 0000000000..fb4ecb56e7
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.CallableReference;
+import org.oasisopen.sca.annotation.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 {
+
+ void incrementCount(CallableReference<ConversationalService> conversationalService);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalService.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalService.java
new file mode 100644
index 0000000000..21a4db737e
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalService.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 org.apache.tuscany.sca.itest.conversational;
+
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Conversational;
+import org.oasisopen.sca.annotation.EndsConversation;
+import org.oasisopen.sca.annotation.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 {
+
+ void init();
+
+ void destroy();
+
+ void initializeCount(int count);
+
+ void incrementCount();
+
+ int retrieveCount();
+
+ void businessException() throws Exception;
+
+ void initializeCountCallback(int count);
+
+ void incrementCountCallback();
+
+ int retrieveCountCallback();
+
+ void businessExceptionCallback() throws Exception;
+
+ @EndsConversation
+ String endConversation();
+
+ String endConversationCallback();
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalServiceNonConversationalCallback.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalServiceNonConversationalCallback.java
new file mode 100644
index 0000000000..48c1644b87
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalServiceNonConversationalCallback.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 org.apache.tuscany.sca.itest.conversational;
+
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Conversational;
+import org.oasisopen.sca.annotation.EndsConversation;
+import org.oasisopen.sca.annotation.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 {
+
+ void init();
+
+ void destroy();
+
+ void initializeCount(int count);
+
+ void incrementCount();
+
+ int retrieveCount();
+
+ void businessException() throws Exception;
+
+ void initializeCountCallback(int count);
+
+ void incrementCountCallback();
+
+ int retrieveCountCallback();
+
+ void businessExceptionCallback() throws Exception;
+
+ @EndsConversation
+ String endConversation();
+
+ String endConversationCallback();
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/DService.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/DService.java
new file mode 100644
index 0000000000..2c205c2cae
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.Conversational;
+import org.oasisopen.sca.annotation.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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Gamma.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Gamma.java
new file mode 100644
index 0000000000..48c203ab35
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Gamma.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;
+
+import org.apache.tuscany.sca.itest.Record;
+import org.oasisopen.sca.annotation.Conversational;
+import org.oasisopen.sca.annotation.EndsConversation;
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * @version $Rev$ $Date$
+ */
+
+@Remotable
+@Conversational
+public interface Gamma {
+ void start(int param);
+
+ boolean hasNext();
+
+ Record next();
+
+ @EndsConversation
+ void stop();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallback.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallback.java
new file mode 100644
index 0000000000..614c0a96b5
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallback.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.itest.conversational;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The callback interface used when testing conversational callbacks
+ *
+ * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $
+ */
+@Remotable
+public interface NonConversationalCallback {
+
+ void init();
+
+ void destroy();
+
+ void initializeCount(int count);
+
+ void incrementCount();
+
+ int retrieveCount();
+
+ void businessException() throws Exception;
+
+ String endConversation();
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AServiceImpl.java
new file mode 100644
index 0000000000..86a96aaa75
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AServiceImpl.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.AService;
+import org.apache.tuscany.sca.itest.conversational.BService;
+import org.apache.tuscany.sca.itest.conversational.Constants;
+import org.oasisopen.sca.annotation.ConversationID;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AlphaImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AlphaImpl.java
new file mode 100644
index 0000000000..b56186ea88
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AlphaImpl.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.Record;
+import org.apache.tuscany.sca.itest.TestResult;
+import org.apache.tuscany.sca.itest.conversational.Alpha;
+import org.apache.tuscany.sca.itest.conversational.Beta;
+import org.apache.tuscany.sca.itest.conversational.Gamma;
+import org.oasisopen.sca.CallableReference;
+import org.oasisopen.sca.ComponentContext;
+import org.oasisopen.sca.annotation.Context;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * @version $Rev$ $Date$
+ */
+
+@Service(Alpha.class)
+@Scope("COMPOSITE")
+public class AlphaImpl implements Alpha {
+ @Reference
+ public Beta beta;
+
+ @Context
+ protected ComponentContext componentContext;
+
+ public void run(int param) {
+ CallableReference<Gamma> gammaRef = null;
+ boolean testPassed = true;
+ try {
+ gammaRef = beta.getRef(param);
+ while (gammaRef.getService().hasNext()) {
+ Record record = gammaRef.getService().next();
+ if (!record.conversationId.equals(gammaRef.getConversation().getConversationID())) {
+ // Record returned is not from this conversation.
+ testPassed = false;
+ }
+ }
+ } catch (Exception ex) {
+ testPassed = false;
+ ex.printStackTrace();
+ } finally {
+ TestResult.updateCompleted();
+ if (gammaRef != null) {
+ TestResult.results.put(gammaRef.getConversation().getConversationID(), testPassed);
+ gammaRef.getService().stop();
+ }
+ }
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BServiceImpl.java
new file mode 100644
index 0000000000..f394770ffc
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BServiceImpl.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.oasisopen.sca.annotation.ConversationID;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BetaImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BetaImpl.java
new file mode 100644
index 0000000000..b94e8a6452
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BetaImpl.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.impl;
+
+import org.apache.tuscany.sca.itest.conversational.Beta;
+import org.apache.tuscany.sca.itest.conversational.Gamma;
+import org.oasisopen.sca.CallableReference;
+import org.oasisopen.sca.ComponentContext;
+import org.oasisopen.sca.ServiceReference;
+import org.oasisopen.sca.annotation.Context;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * @version $Rev$ $Date$
+ */
+
+@Service(Beta.class)
+@Scope("COMPOSITE")
+public class BetaImpl implements Beta {
+ @Context
+ protected ComponentContext componentContext;
+
+ @Reference
+ public Gamma gamma;
+
+ public CallableReference<Gamma> getRef(int param) {
+ ServiceReference<Gamma> gammaRef = componentContext.getServiceReference(Gamma.class, "gamma");
+ Gamma g = gammaRef.getService();
+ g.start(param);
+ return gammaRef;
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/CServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/CServiceImpl.java
new file mode 100644
index 0000000000..737c2940dd
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/CServiceImpl.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.impl;
+
+import org.apache.tuscany.sca.itest.conversational.CService;
+import org.apache.tuscany.sca.itest.conversational.DService;
+import org.oasisopen.sca.ServiceReference;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * Simple conversational Service that uses another Conversational Service
+ */
+@Service(CService.class)
+@Scope("CONVERSATION")
+public class CServiceImpl implements CService {
+
+ private ServiceReference<DService> dServiceRef;
+
+ @Reference(name = "d")
+ public void setD(ServiceReference<DService> 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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationAgeComponentImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationAgeComponentImpl.java
new file mode 100644
index 0000000000..8f2736ad2d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.ConversationAttributes;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationIdComponentImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationIdComponentImpl.java
new file mode 100644
index 0000000000..8b3a8663d8
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.ConversationID;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationMaxIdleComponentImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationMaxIdleComponentImpl.java
new file mode 100644
index 0000000000..ae8bee8040
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.ConversationAttributes;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulImpl.java
new file mode 100644
index 0000000000..3784dfd53e
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulImpl.java
@@ -0,0 +1,325 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.oasisopen.sca.ComponentContext;
+import org.oasisopen.sca.ServiceReference;
+import org.oasisopen.sca.annotation.Context;
+import org.oasisopen.sca.annotation.ConversationAttributes;
+import org.oasisopen.sca.annotation.Destroy;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.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<ConversationalService> 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<ConversationalService> 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<ConversationalService> 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<ConversationalService> 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<ConversationalService> 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<ConversationalService> 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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulNonConversationalCallbackImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulNonConversationalCallbackImpl.java
new file mode 100644
index 0000000000..5823b7d050
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulNonConversationalCallbackImpl.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.ConversationalClient;
+import org.apache.tuscany.sca.itest.conversational.ConversationalReferenceClient;
+import org.apache.tuscany.sca.itest.conversational.ConversationalService;
+import org.apache.tuscany.sca.itest.conversational.ConversationalServiceNonConversationalCallback;
+import org.apache.tuscany.sca.itest.conversational.NonConversationalCallback;
+import org.oasisopen.sca.ComponentContext;
+import org.oasisopen.sca.ServiceReference;
+import org.oasisopen.sca.annotation.Context;
+import org.oasisopen.sca.annotation.ConversationAttributes;
+import org.oasisopen.sca.annotation.Destroy;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.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 ConversationalServiceNonConversationalCallback conversationalService;
+
+ @Reference
+ protected ConversationalServiceNonConversationalCallback 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<ConversationalService> 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<ConversationalService> 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<ConversationalService> 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<ConversationalService> 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<ConversationalService> 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<ConversationalService> 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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatelessImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatelessImpl.java
new file mode 100644
index 0000000000..c9c5138515
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatelessImpl.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.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.oasisopen.sca.ComponentContext;
+import org.oasisopen.sca.ServiceReference;
+import org.oasisopen.sca.annotation.Context;
+import org.oasisopen.sca.annotation.Destroy;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.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<ConversationalService> 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<ConversationalService> 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<ConversationalService> 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<ConversationalService> 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<ConversationalService> 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<ConversationalService> 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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalReferenceClientImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalReferenceClientImpl.java
new file mode 100644
index 0000000000..134ffda75d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalReferenceClientImpl.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.impl;
+
+import org.apache.tuscany.sca.itest.conversational.ConversationalReferenceClient;
+import org.apache.tuscany.sca.itest.conversational.ConversationalService;
+import org.oasisopen.sca.CallableReference;
+import org.oasisopen.sca.annotation.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) {
+ ConversationalService callableReference = conversationalService.getService();
+
+ callableReference.incrementCount();
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceRequestImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceRequestImpl.java
new file mode 100644
index 0000000000..73a6d7d27e
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceRequestImpl.java
@@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.ConversationID;
+import org.oasisopen.sca.annotation.Destroy;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.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<String, Integer> conversationalState = new HashMap<String, Integer>();
+
+ // 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 = Integer.valueOf(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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulImpl.java
new file mode 100644
index 0000000000..5bafa5e075
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulImpl.java
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.ConversationAttributes;
+import org.oasisopen.sca.annotation.ConversationID;
+import org.oasisopen.sca.annotation.Destroy;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulNonConversationalCallbackImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulNonConversationalCallbackImpl.java
new file mode 100644
index 0000000000..8d63ebbbef
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulNonConversationalCallbackImpl.java
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package 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.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.ConversationAttributes;
+import org.oasisopen.sca.annotation.ConversationID;
+import org.oasisopen.sca.annotation.Destroy;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessImpl.java
new file mode 100644
index 0000000000..ecf108c656
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessImpl.java
@@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.ConversationID;
+import org.oasisopen.sca.annotation.Destroy;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.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<String, Integer> conversationalState = new HashMap<String, Integer>();
+
+ // 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 = Integer.valueOf(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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessScopeImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessScopeImpl.java
new file mode 100644
index 0000000000..ee09e99f1b
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/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.oasisopen.sca.annotation.ConversationID;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(ConversationalService.class)
+public class ConversationalServiceStatelessScopeImpl implements ConversationalService {
+
+ @ConversationID
+ protected String cid;
+
+ static Map<String, Integer> state = new HashMap<String, Integer>();
+
+ 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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/DServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/DServiceImpl.java
new file mode 100644
index 0000000000..ad0c1fb7da
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/DServiceImpl.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.itest.conversational.impl;
+
+import org.apache.tuscany.sca.itest.conversational.DService;
+import org.oasisopen.sca.annotation.ConversationID;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/GammaImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/GammaImpl.java
new file mode 100644
index 0000000000..55390189cf
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/GammaImpl.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.itest.conversational.impl;
+
+import java.util.ArrayList;
+
+import org.apache.tuscany.sca.itest.Record;
+import org.apache.tuscany.sca.itest.conversational.Gamma;
+import org.oasisopen.sca.annotation.ConversationID;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * @version $Rev$ $Date$
+ */
+
+@Service(Gamma.class)
+@Scope("CONVERSATION")
+public class GammaImpl implements Gamma {
+ @ConversationID
+ public String conversationId;
+
+ private ArrayList<Record> list;
+
+ public void start(int param) {
+ list = new ArrayList<Record>();
+ fillList(param, conversationId);
+ }
+
+ public boolean hasNext() {
+ return !list.isEmpty();
+ }
+
+ public Record next() {
+ return list.remove(0);
+ }
+
+ public void stop() {
+ list = null;
+ }
+
+ private void fillList(int param, String cid) {
+ for (int i = 0; i < param; i++) {
+ Record record = new Record();
+ record.id = "id_" + i;
+ record.conversationId = cid;
+ list.add(record);
+ }
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/resources/ConversationAge.composite b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/resources/ConversationAge.composite
new file mode 100644
index 0000000000..12746650c7
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/resources/ConversationAge.composite
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ name="ConversationAgeTest">
+
+ <component name="ConversationAgeComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationAgeComponentImpl"/>
+ </component>
+
+ <component name="ConversationIdleComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationMaxIdleComponentImpl"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/resources/ConversationUniqueId.composite b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/resources/ConversationUniqueId.composite
new file mode 100644
index 0000000000..3fbffdc660
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/resources/ConversationUniqueId.composite
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://conversations"
+ name="ConversationUniqueIdTest">
+
+ <component name="Alpha">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.AlphaImpl"/>
+ <service name="Alpha">
+ <binding.sca />
+ </service>
+ <reference name="beta" target="Beta">
+ <binding.sca/>
+ </reference>
+ </component>
+
+ <component name="Beta">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.BetaImpl"/>
+ <service name="Beta">
+ <binding.sca />
+ </service>
+ <reference name="gamma" target="Gamma">
+ <binding.sca />
+ </reference>
+ </component>
+
+ <component name="Gamma">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.GammaImpl"/>
+ <service name="Gamma">
+ <binding.sca/>
+ </service>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/resources/conversationId.composite b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/resources/conversationId.composite
new file mode 100644
index 0000000000..50ffdea701
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/resources/conversationId.composite
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ name="ConversationalIdTest">
+
+ <component name="ConversationIdComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationIdComponentImpl"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/resources/conversationLifetime.composite b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/resources/conversationLifetime.composite
new file mode 100644
index 0000000000..538e2f63fd
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/resources/conversationLifetime.composite
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://conversations"
+ name="conversationLifetimeTest">
+
+ <component name="ConversationalCComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.CServiceImpl"/>
+ <reference name="d" target="ConversationalDComponent" />
+ </component>
+
+ <component name="ConversationalDComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.DServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/resources/conversational.composite b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/resources/conversational.composite
new file mode 100644
index 0000000000..dba9cec03f
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/main/resources/conversational.composite
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://conversations"
+ name="ConversationalITest">
+
+ <component name="ConversationalStatelessClientStatelessService">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatelessImpl"/>
+ <reference name="conversationalReferenceClient" target="ConversationalReferenceClient"/>
+ <reference name="conversationalService" target="ConversationalServiceStatelessSL"/>
+ <reference name="conversationalService2" target="ConversationalServiceStatelessSL"/>
+ </component>
+
+ <component name="ConversationalStatelessClientStatefulService">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatelessImpl"/>
+ <reference name="conversationalReferenceClient" target="ConversationalReferenceClient"/>
+ <reference name="conversationalService" target="ConversationalServiceStateful"/>
+ <reference name="conversationalService2" target="ConversationalServiceStateful"/>
+ </component>
+
+ <component name="ConversationalStatefulClientStatelessService">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulImpl"/>
+ <reference name="conversationalReferenceClient" target="ConversationalReferenceClient"/>
+ <reference name="conversationalService" target="ConversationalServiceStatelessSL"/>
+ <reference name="conversationalService2" target="ConversationalServiceStatelessSL"/>
+ </component>
+
+ <component name="ConversationalStatefulClientStatefulService">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulImpl"/>
+ <reference name="conversationalReferenceClient" target="ConversationalReferenceClient"/>
+ <reference name="conversationalService" target="ConversationalServiceStateful"/>
+ <reference name="conversationalService2" target="ConversationalServiceStateful"/>
+ </component>
+
+ <component name="ConversationalStatelessClientRequestService">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatelessImpl"/>
+ <reference name="conversationalReferenceClient" target="ConversationalReferenceClient"/>
+ <reference name="conversationalService" target="ConversationalServiceRequest"/>
+ <reference name="conversationalService2" target="ConversationalServiceRequest"/>
+ </component>
+
+ <component name="ConversationalStatefulClientNonConversationalCallbackStatefulService">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulNonConversationalCallbackImpl"/>
+ <reference name="conversationalReferenceClient" target="ConversationalReferenceClient"/>
+ <reference name="conversationalService" target="ConversationalServiceStatefulNonConversationalCallback"/>
+ <reference name="conversationalService2" target="ConversationalServiceStatefulNonConversationalCallback"/>
+ </component>
+
+ <component name="ConversationalReferenceClient">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalReferenceClientImpl"/>
+ </component>
+
+ <component name="ConversationalServiceStateful">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulImpl"/>
+ </component>
+
+ <component name="ConversationalServiceStateless">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatelessScopeImpl"/>
+ </component>
+
+ <component name="ConversationalServiceStatelessSL">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatelessImpl"/>
+ </component>
+
+ <component name="ConversationalServiceRequest">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceRequestImpl"/>
+ </component>
+
+ <component name="ConversationalServiceStatefulNonConversationalCallback">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulNonConversationalCallbackImpl"/>
+ </component>
+
+ <component name="ConversationalAComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.AServiceImpl"/>
+ <reference name="b" target="ConversationalBComponent" />
+ </component>
+
+ <component name="ConversationalBComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.BServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationIdTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationIdTestCase.java
new file mode 100644
index 0000000000..e64a9acbe2
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationIdTestCase.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.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ConversationIdTestCase {
+
+ private Node node;
+
+ @Before
+ public void setUp() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("conversationId.composite");
+ node = NodeFactory.newInstance().createNode("conversationId.composite", new Contribution("c1", location));
+ node.start();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ if (node != null) {
+ node.stop();
+ }
+ }
+
+ @Test
+ public void testConversationId() {
+ ConversationIdService service = node.getService(ConversationIdService.class, "ConversationIdComponent");
+ Assert.assertNotNull(service.getCIDField());
+ Assert.assertNotNull(service.getCIDSetter());
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationLifetimeTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationLifetimeTestCase.java
new file mode 100644
index 0000000000..2b1aea3ff3
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationLifetimeTestCase.java
@@ -0,0 +1,208 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class ConversationLifetimeTestCase {
+
+ private static Node node;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("conversationLifetime.composite");
+ node = NodeFactory.newInstance().createNode("conversationLifetime.composite", new Contribution("c1", location));
+ node.start();
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ if (node != null) {
+ node.stop();
+ }
+ }
+
+ /**
+ * 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 = node.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 = node.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 3";
+ CService service = node.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 = node.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 = node.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 Specification 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 = node.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 = node.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 = node.getService(CService.class, "ConversationalCComponent");
+ service.setConversationID("User provided ID");
+ 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
+ * "@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 = node.getService(CService.class, "ConversationalCComponent");
+ service.getState();
+ service.endConversation();
+ Assert.assertNull(service.getConversationObjectConversationId());
+ }
+
+ /**
+ * Java Common Annotations and APIs 1.00 Specification 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 = node.getService(CService.class, "ConversationalCComponent");
+ service.setConversationID("User provided ID");
+ service.getState();
+ service.endConversation();
+ Assert.assertNull(service.getConversationObjectConversationId());
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationUniqueIdTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationUniqueIdTestCase.java
new file mode 100644
index 0000000000..f9bb69aa30
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationUniqueIdTestCase.java
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.itest.conversational;
+
+import org.apache.tuscany.sca.itest.TestResult;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ConversationUniqueIdTestCase {
+
+ private Node node;
+
+ @Before
+ public void setUp() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("ConversationUniqueId.composite");
+ node = NodeFactory.newInstance().createNode("ConversationUniqueId.composite", new Contribution("c1", location));
+ node.start();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ if (node != null) {
+ node.stop();
+ }
+ }
+
+ @Ignore("I'm seeing NPE in GammaImpl.hasNext()")
+ @Test
+ public void testConversationUniqueId() {
+ Alpha alpha = node.getService(Alpha.class, "Alpha");
+ int numConversations = 3;
+
+ for (int i = 0; i < numConversations; ++i) {
+ alpha.run(5);
+ }
+
+ // Wait for the conversations to complete
+ while (TestResult.getCompleted() < numConversations) {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ }
+ }
+
+ Assert.assertEquals(TestResult.results.size(), numConversations);
+ for (Boolean value : TestResult.results.values()) {
+ Assert.assertTrue(value);
+ }
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalAgeTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalAgeTestCase.java
new file mode 100644
index 0000000000..a686754d3a
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalAgeTestCase.java
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.oasisopen.sca.ConversationEndedException;
+
+public class ConversationalAgeTestCase {
+
+ private static Node node;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ System.setProperty("org.apache.tuscany.sca.core.conversation.ConversationManager.ReaperInterval", "2");
+ String location = ContributionLocationHelper.getContributionLocation("ConversationAge.composite");
+ node = NodeFactory.newInstance().createNode("ConversationAge.composite", new Contribution("c1", location));
+ node.start();
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ System.clearProperty("org.apache.tuscany.sca.core.conversation.ConversationManager.ReaperInterval");
+ if (node != null) {
+ node.stop();
+ }
+ }
+
+ @Test
+ public void testMaxAge() throws InterruptedException {
+
+ ConversationalService conversationalService =
+ node.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 =
+ node.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 =
+ node.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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalJ2SETestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalJ2SETestCase.java
new file mode 100644
index 0000000000..ee1bf84fc4
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalJ2SETestCase.java
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.itest.conversational;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ConversationalJ2SETestCase {
+
+ private Node node;
+
+ @Before
+ public void setUp() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("conversational.composite");
+ node = NodeFactory.newInstance().createNode("conversational.composite", new Contribution("c1", location));
+ node.start();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ if (node != null) {
+ node.stop();
+ }
+ }
+
+ @Test
+ public void testStatefulConversation() {
+ ConversationalService conversationalService =
+ node.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 =
+ node.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/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalTestCase.java
new file mode 100644
index 0000000000..56bca7ac78
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalTestCase.java
@@ -0,0 +1,702 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.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.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class ConversationalTestCase {
+
+ private static Node 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 {
+ String location = ContributionLocationHelper.getContributionLocation("conversational.composite");
+ node = NodeFactory.newInstance().createNode("conversational.composite", new Contribution("c1", location));
+ node.start();
+
+ conversationalStatelessClientStatelessService =
+ node.getService(ConversationalClient.class, "ConversationalStatelessClientStatelessService");
+
+ conversationalStatelessClientStatefulService =
+ node.getService(ConversationalClient.class, "ConversationalStatelessClientStatefulService");
+
+ conversationalStatefulClientStatelessService =
+ node.getService(ConversationalClient.class, "ConversationalStatefulClientStatelessService");
+
+ conversationalStatefulClientStatefulService =
+ node.getService(ConversationalClient.class, "ConversationalStatefulClientStatefulService");
+ conversationalStatelessClientRequestService =
+ node.getService(ConversationalClient.class, "ConversationalStatelessClientRequestService");
+ conversationalStatefulClientNonConversationalCallbackStatelessService =
+ node.getService(ConversationalClient.class,
+ "ConversationalStatefulClientNonConversationalCallbackStatefulService");
+
+ } catch (Exception ex) {
+ System.err.println(ex.toString());
+ }
+
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ node.stop();
+ }
+
+ 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 = node.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 = node.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/tags/java/sca/2.0-M3-RC3a/itest/distribution/bin-distro-unzip/build.xml b/tags/java/sca/2.0-M3-RC3a/itest/distribution/bin-distro-unzip/build.xml
new file mode 100644
index 0000000000..7542fc23dd
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/distribution/bin-distro-unzip/build.xml
@@ -0,0 +1,24 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project name="itest-unzip" default="unzip">
+ <target name="unzip">
+ <unzip src="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.zip"
+ dest="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}-dir"/>
+ </target>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/distribution/bin-distro-unzip/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/distribution/bin-distro-unzip/pom.xml
new file mode 100644
index 0000000000..9fa5f913ff
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/distribution/bin-distro-unzip/pom.xml
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-bin-distro-unzip</artifactId>
+ <name>Apache Tuscany SCA iTest Bin Distro Unzip</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-distribution-all</artifactId>
+ <type>pom</type>
+ <version>2.0-M3</version>
+ </dependency>
+ </dependencies>
+
+ <!-- HACK: use profile to control if we need to add tools.jar -->
+ <!-- Mac OS doesn't have tools.jar -->
+ <profiles>
+ <profile>
+ <id>not-sun-jdk</id>
+ <activation>
+ <file>
+ <missing>${java.home}/../lib/tools.jar</missing>
+ </file>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.3</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-trax</artifactId>
+ <version>1.6.5</version>
+ </dependency>
+ </dependencies>
+
+ <executions>
+ <execution>
+ <id>run-samples</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="java.home" value="${java.home}"/>
+ <property name="tuscany.version" value="${version}" />
+ <ant antfile="./build.xml" />
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>sun-jdk</id>
+ <activation>
+ <file>
+ <exists>${java.home}/../lib/tools.jar</exists>
+ </file>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.3</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-trax</artifactId>
+ <version>1.6.5</version>
+ </dependency>
+ <!-- this JDk dependency is a workaround for Maven bug - http://jira.codehaus.org/browse/MNG-1323 -->
+ <dependency>
+ <groupId>sun.jdk</groupId>
+ <artifactId>tools</artifactId>
+ <version>1.6</version>
+ <scope>system</scope>
+ <systemPath>${java.home}/../lib/tools.jar</systemPath>
+ </dependency>
+ </dependencies>
+
+ <executions>
+ <execution>
+ <id>run-samples</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="java.home" value="${java.home}"/>
+ <property name="tuscany.version" value="${version}" />
+ <ant antfile="./build.xml" />
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/distribution/binding-ws-calculator/build.xml b/tags/java/sca/2.0-M3-RC3a/itest/distribution/binding-ws-calculator/build.xml
new file mode 100644
index 0000000000..f222a3ac0c
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/distribution/binding-ws-calculator/build.xml
@@ -0,0 +1,40 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project name="itest-samples" default="run">
+
+ <echo>${java.home}</echo>
+ <!--
+ compile and run each sample as though the user were running
+ samples from the binary distribution. Here we use ant targets
+ in the first instance but for some tests we may want to run
+ jars directly or fire up webapp containers and deploy wars. In other cases
+ we may need to run two samples together to provide reference and
+ service sides of the sample.
+ -->
+
+ <property name="distro.root" value="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}-dir/tuscany-sca-${tuscany.version}" />
+
+ <target name="run">
+
+ <ant antfile="build.xml"
+ dir="${distro.root}/samples/binding-ws-calculator"/>
+
+ </target>
+
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/distribution/binding-ws-calculator/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/distribution/binding-ws-calculator/pom.xml
new file mode 100644
index 0000000000..e40d5541fb
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/distribution/binding-ws-calculator/pom.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-distribution-binding-ws-calculator</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution binding-ws-calculator</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-bin-distro-unzip</artifactId>
+ <type>pom</type>
+ <version>2.0-M3</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.3</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-trax</artifactId>
+ <version>1.6.5</version>
+ </dependency>
+ <!-- this JDk dependency is a workaround for Maven bug - http://jira.codehaus.org/browse/MNG-1323 -->
+ <dependency>
+ <groupId>sun.jdk</groupId>
+ <artifactId>tools</artifactId>
+ <version>1.6</version>
+ <scope>system</scope>
+ <systemPath>${java.home}/../lib/tools.jar</systemPath>
+ </dependency>
+ </dependencies>
+
+ <executions>
+ <execution>
+ <id>run-samples</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="java.home" value="${java.home}"/>
+ <property name="tuscany.version" value="${version}" />
+ <ant antfile="./build.xml" target="run"/>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/distribution/calculator-rmi/build.xml b/tags/java/sca/2.0-M3-RC3a/itest/distribution/calculator-rmi/build.xml
new file mode 100644
index 0000000000..ac3bcf05d3
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/distribution/calculator-rmi/build.xml
@@ -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.
+-->
+<project name="itest-samples" default="run">
+
+ <!--
+ compile and run each sample as though the user were running
+ samples from the binary distribution. Here we use ant targets
+ in the first instance but for some tests we may want to run
+ jars directly or fire up webapp containers and deploy wars. In other cases
+ we may need to run two samples together to provide reference and
+ service sides of the sample.
+ -->
+
+ <property name="distro.root" value="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}-dir/tuscany-sca-${tuscany.version}" />
+
+ <target name="run">
+
+ <parallel>
+
+ <daemons>
+ <ant antfile="build.xml"
+ dir="${distro.root}/samples/calculator-rmi-service"/>
+ </daemons>
+
+ <sequential>
+ <sleep seconds="4"/>
+ <ant antfile="build.xml"
+ dir="${distro.root}/samples/calculator-rmi-reference"/>
+ </sequential>
+
+ </parallel>
+
+ </target>
+
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/distribution/calculator-rmi/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/distribution/calculator-rmi/pom.xml
new file mode 100644
index 0000000000..1959cd4333
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/distribution/calculator-rmi/pom.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-distribution-calculator-rmi</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution calculator-rmi</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-bin-distro-unzip</artifactId>
+ <type>pom</type>
+ <version>2.0-M3</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.3</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-trax</artifactId>
+ <version>1.6.5</version>
+ </dependency>
+ <!-- this JDk dependency is a workaround for Maven bug - http://jira.codehaus.org/browse/MNG-1323 -->
+ <dependency>
+ <groupId>sun.jdk</groupId>
+ <artifactId>tools</artifactId>
+ <version>1.6</version>
+ <scope>system</scope>
+ <systemPath>${java.home}/../lib/tools.jar</systemPath>
+ </dependency>
+ </dependencies>
+
+ <executions>
+ <execution>
+ <id>run-samples</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="tuscany.version" value="${version}" />
+ <ant antfile="./build.xml" target="run"/>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/distribution/implementation-java-calculator/build.xml b/tags/java/sca/2.0-M3-RC3a/itest/distribution/implementation-java-calculator/build.xml
new file mode 100644
index 0000000000..3ac1900c3f
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/distribution/implementation-java-calculator/build.xml
@@ -0,0 +1,40 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project name="itest-samples" default="run">
+
+ <echo>${java.home}</echo>
+ <!--
+ compile and run each sample as though the user were running
+ samples from the binary distribution. Here we use ant targets
+ in the first instance but for some tests we may want to run
+ jars directly or fire up webapp containers and deploy wars. In other cases
+ we may need to run two samples together to provide reference and
+ service sides of the sample.
+ -->
+
+ <property name="distro.root" value="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}-dir/tuscany-sca-${tuscany.version}" />
+
+ <target name="run">
+
+ <ant antfile="build.xml"
+ dir="${distro.root}/samples/implementation-java-calculator"/>
+
+ </target>
+
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/distribution/implementation-java-calculator/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/distribution/implementation-java-calculator/pom.xml
new file mode 100644
index 0000000000..a34796400c
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/distribution/implementation-java-calculator/pom.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-distribution-implementation-java-calculator</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution implementation-java-calculator</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-bin-distro-unzip</artifactId>
+ <type>pom</type>
+ <version>2.0-M3</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.3</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-trax</artifactId>
+ <version>1.6.5</version>
+ </dependency>
+ <!-- this JDk dependency is a workaround for Maven bug - http://jira.codehaus.org/browse/MNG-1323 -->
+ <dependency>
+ <groupId>sun.jdk</groupId>
+ <artifactId>tools</artifactId>
+ <version>1.6</version>
+ <scope>system</scope>
+ <systemPath>${java.home}/../lib/tools.jar</systemPath>
+ </dependency>
+ </dependencies>
+
+ <executions>
+ <execution>
+ <id>run-samples</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="tuscany.version" value="${version}" />
+ <property name="java.home" value="${java.home}"/>
+ <ant antfile="./build.xml" target="run"/>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/distribution/legal-checks/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/distribution/legal-checks/pom.xml
new file mode 100644
index 0000000000..f3b4356710
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/distribution/legal-checks/pom.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-distribution-legal-checks</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution Legal Checks</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-bin-distro-unzip</artifactId>
+ <type>pom</type>
+ <version>2.0-M3</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ </build>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/distribution/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/distribution/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java
new file mode 100644
index 0000000000..d17fb283a9
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/distribution/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java
@@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package itest;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.junit.Test;
+
+/**
+ * Checks that all jar files included in the distribution are mentioned in the LICENSE file
+ * and that all jars mentioned in the LICENSE are in the distribution.
+ */
+public class JarsInLICENSETestCase {
+
+ @Test
+ public void testJars() throws Exception {
+ File distroRoot = getUnzipedDistroRoot();
+
+ File licenseFile = new File(distroRoot, "LICENSE");
+ if (!licenseFile.exists()) {
+ throw new IllegalStateException("can't find LICENSE file at: " + licenseFile.getAbsoluteFile().toString());
+ }
+
+ File libDirectory = new File(distroRoot, "modules");
+ if (!libDirectory.exists()) {
+ throw new IllegalStateException("can't find modules folder at: " + libDirectory.getAbsoluteFile().toString());
+ }
+
+ List<String> jars = getJarsInDistro(libDirectory);
+
+ List<String> bad2 = getLICENSEJarsNotInDistro(licenseFile, jars);
+ if (bad2.size() > 0) {
+ System.err.println("Jars in LICENSE but not in Distribution: " + bad2);
+ }
+
+ List<String> bad1 = getJarsNotInLICENSE(jars, licenseFile);
+ if (bad1.size() > 0) {
+ System.err.println("Jars not in distribution but not in LICENSE: " + bad1);
+ }
+
+ if (bad1.size() > 0 || bad2.size() > 0) {
+ throw new IllegalStateException("LICENSE problems, check log");
+ }
+ }
+
+ private List<String> getLICENSEJarsNotInDistro(File licenseFile, List<String> jars) throws IOException {
+ List<String> badJars = new ArrayList<String>();
+ BufferedReader reader = new BufferedReader(new FileReader(licenseFile));
+ String line = null;
+ while ((line = reader.readLine()) != null) {
+ line = line.trim();
+ if (line.contains(".jar")) {
+ StringTokenizer st = new StringTokenizer(line);
+ while (st.hasMoreTokens()) {
+ String s = st.nextToken();
+ if (s.contains(".jar")) {
+ if (s.startsWith("(")) {
+ s = s.substring(1);
+ }
+ if (s.endsWith(",") || s.endsWith(":")) {
+ s = s.substring(0, s.length()-1);
+ }
+ if (s.endsWith(")")) {
+ s = s.substring(0, s.length()-1);
+ }
+ if (!jars.contains(s) && !s.startsWith("tuscany-")) {
+ badJars.add(s);
+ }
+ }
+ }
+ }
+ }
+ return badJars;
+ }
+
+ private List<String> getJarsNotInLICENSE(List<String> jars, File licenseFile) throws IOException {
+ List<String> badJars = new ArrayList<String>();
+ String licenseText = readLICENSE(licenseFile);
+ for (String jar : jars) {
+ if (!licenseText.contains(jar)) {
+ if (jar.startsWith("tuscany-")) {
+ // ignore tuscany jars as they're not mentioned in the LICENSE file
+ } else {
+ badJars.add(jar);
+ }
+ }
+ }
+ return badJars;
+ }
+
+ private List<String> getJarsInDistro(File directory) {
+ List<String> jars = new ArrayList<String>();
+ for (String fn : directory.list()){
+ if (fn.endsWith(".jar")) {
+ jars.add(fn);
+ } else {
+ File f = new File(directory, fn);
+ if (f.isDirectory()) {
+ jars.addAll(getJarsInDistro(f));
+ }
+ }
+ }
+ return jars;
+ }
+
+ private File getUnzipedDistroRoot() {
+ File distroTarget = new File("../../../distribution/all/target");
+ File root = null;
+ for (String f : distroTarget.list()) {
+ if (f.endsWith("-dir")) {
+ root = new File(distroTarget, f);
+ break;
+ }
+ }
+ if (root == null) {
+ throw new IllegalStateException("can't find distro root");
+ }
+ if (root.list().length != 1) {
+ throw new IllegalStateException("expecting one directory in distro root");
+ }
+ root = new File(root, root.list()[0]);
+ return root;
+ }
+
+ private static String readLICENSE(File licenseFile) throws java.io.IOException {
+ StringBuffer fileData = new StringBuffer();
+ BufferedReader reader = new BufferedReader(new FileReader(licenseFile));
+ char[] buf = new char[1024];
+ int numRead = 0;
+ while ((numRead = reader.read(buf)) != -1) {
+ String readData = String.valueOf(buf, 0, numRead);
+ fileData.append(readData);
+ buf = new char[1024];
+ }
+ reader.close();
+ return fileData.toString();
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/distribution/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/distribution/pom.xml
new file mode 100644
index 0000000000..5335bbe7d9
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/distribution/pom.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <packaging>pom</packaging>
+ <artifactId>itest-distribution</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution</name>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ </build>
+
+ <modules>
+ <module>bin-distro-unzip</module>
+ <module>binding-ws-calculator</module>
+ <module>calculator-rmi</module>
+ <module>implementation-java-calculator</module>
+ <module>legal-checks</module>
+ <module>webapp-helloworld</module>
+ <module>webapp-helloworld-bpel</module>
+ <module>webapp-helloworld-jsp</module>
+ <module>webapp-helloworld-stripes</module>
+ </modules>
+
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-bpel/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-bpel/pom.xml
new file mode 100644
index 0000000000..0ea66bcde0
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-bpel/pom.xml
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-distribution-webapp-helloworld-bpel</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution Webapp helloworld-bpel</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-bin-distro-unzip</artifactId>
+ <type>pom</type>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>helloworld-bpel</artifactId>
+ <type>war</type>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <version>1.9</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <wait>false</wait>
+ <container>
+ <containerId>jetty6x</containerId>
+ <type>embedded</type>
+ <systemProperties>
+ <org.apache.commons.logging.Log>org.apache.commons.logging.impl.SimpleLog</org.apache.commons.logging.Log>
+ </systemProperties>
+ </container>
+ <!-- container>
+ <containerId>tomcat6x</containerId>
+ <home>/Tomcat/apache-tomcat-6.0.18</home>
+ </container -->
+ <configuration>
+ <home>${project.build.directory}/cargo-jetty</home>
+ <properties>
+ <!-- NOTE: remote debugging doesn't work with the embedded Jetty container. To remote debug
+ uncomment/comment the container above to be the Tomcat container and set home to point
+ to your local Tomcat installation -->
+ <cargo.jvmargs><![CDATA[-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y]]></cargo.jvmargs>
+ <cargo.servlet.port>8085</cargo.servlet.port>
+ <context>helloworld-bpel</context>
+ </properties>
+ <deployables>
+ <deployable>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>helloworld-bpel</artifactId>
+ <type>war</type>
+ <properties>
+ <context>helloworld-bpel</context>
+ </properties>
+ </deployable>
+ </deployables>
+ </configuration>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-bpel/src/test/java/itest/HelloworldTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-bpel/src/test/java/itest/HelloworldTestCase.java
new file mode 100644
index 0000000000..5305695987
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-bpel/src/test/java/itest/HelloworldTestCase.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 itest;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.Iterator;
+
+import org.junit.Test;
+
+import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlParagraph;
+
+/**
+ */
+public class HelloworldTestCase {
+
+ @Test
+ public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException {
+ HtmlPage page = (HtmlPage)new WebClient().getPage("http://localhost:8085/helloworld-bpel");
+ Iterator<?> ss = page.getAllHtmlChildElements();
+ ss.next();
+ ss.next();
+ ss.next();
+ HtmlParagraph p = (HtmlParagraph)ss.next();
+ assertEquals("Hello world", p.asText());
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-jsp/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-jsp/pom.xml
new file mode 100644
index 0000000000..a373eec844
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-jsp/pom.xml
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-distribution-webapp-helloworld-jsp</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution Webapp helloworld-jsp</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-bin-distro-unzip</artifactId>
+ <type>pom</type>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>sample-helloworld-jsp</artifactId>
+ <type>war</type>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <version>1.9</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <wait>false</wait>
+ <container>
+ <containerId>jetty6x</containerId>
+ <type>embedded</type>
+ <systemProperties>
+ <org.apache.commons.logging.Log>org.apache.commons.logging.impl.SimpleLog</org.apache.commons.logging.Log>
+ </systemProperties>
+ </container>
+ <!-- container>
+ <containerId>tomcat6x</containerId>
+ <home>/Tomcat/apache-tomcat-6.0.18</home>
+ </container -->
+ <configuration>
+ <home>${project.build.directory}/cargo-jetty</home>
+ <properties>
+ <!-- NOTE: remote debugging doesn't work with the embedded Jetty container. To remote debug
+ uncomment/comment the container above to be the Tomcat container and set home to point
+ to your local Tomcat installation -->
+ <cargo.jvmargs><![CDATA[-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y]]></cargo.jvmargs>
+ <cargo.servlet.port>8085</cargo.servlet.port>
+ <context>helloworld-jsp</context>
+ </properties>
+ <deployables>
+ <deployable>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>sample-helloworld-jsp</artifactId>
+ <type>war</type>
+ <properties>
+ <context>helloworld-jsp</context>
+ </properties>
+ </deployable>
+ </deployables>
+ </configuration>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-jsp/src/test/java/itest/HelloworldTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-jsp/src/test/java/itest/HelloworldTestCase.java
new file mode 100644
index 0000000000..7bcd590cf0
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-jsp/src/test/java/itest/HelloworldTestCase.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 itest;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.Iterator;
+
+import org.junit.Test;
+
+import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlParagraph;
+
+/**
+ */
+public class HelloworldTestCase {
+
+ @Test
+ public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException {
+ HtmlPage page = (HtmlPage)new WebClient().getPage("http://localhost:8085/helloworld-jsp");
+ Iterator<?> ss = page.getAllHtmlChildElements();
+ ss.next();
+ ss.next();
+ ss.next();
+ HtmlParagraph p = (HtmlParagraph)ss.next();
+ assertEquals("Hello world", p.asText());
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-stripes/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-stripes/pom.xml
new file mode 100644
index 0000000000..1d884241c0
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-stripes/pom.xml
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-distribution-webapp-helloworld-stripes</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution Webapp helloworld-stripes</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-bin-distro-unzip</artifactId>
+ <type>pom</type>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>sample-helloworld-stripes</artifactId>
+ <type>war</type>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <version>1.9</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <wait>false</wait>
+ <container>
+ <containerId>jetty6x</containerId>
+ <type>embedded</type>
+ <systemProperties>
+ <org.apache.commons.logging.Log>org.apache.commons.logging.impl.SimpleLog</org.apache.commons.logging.Log>
+ </systemProperties>
+ </container>
+ <!-- container>
+ <containerId>tomcat6x</containerId>
+ <home>/Tomcat/apache-tomcat-6.0.18</home>
+ </container -->
+ <configuration>
+ <home>${project.build.directory}/cargo-jetty</home>
+ <properties>
+ <!-- NOTE: remote debugging doesn't work with the embedded Jetty container. To remote debug
+ uncomment/comment the container above to be the Tomcat container and set home to point
+ to your local Tomcat installation -->
+ <cargo.jvmargs><![CDATA[-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y]]></cargo.jvmargs>
+ <cargo.servlet.port>8085</cargo.servlet.port>
+ <context>helloworld-stripes</context>
+ </properties>
+ <deployables>
+ <deployable>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>sample-helloworld-stripes</artifactId>
+ <type>war</type>
+ <properties>
+ <context>helloworld-stripes</context>
+ </properties>
+ </deployable>
+ </deployables>
+ </configuration>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-stripes/src/test/java/itest/HelloworldTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-stripes/src/test/java/itest/HelloworldTestCase.java
new file mode 100644
index 0000000000..4c75e312b5
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld-stripes/src/test/java/itest/HelloworldTestCase.java
@@ -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 itest;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.Iterator;
+
+import org.junit.Test;
+
+import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlParagraph;
+
+/**
+ */
+public class HelloworldTestCase {
+
+ @Test
+ public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException {
+ HtmlPage page = (HtmlPage)new WebClient().getPage("http://localhost:8085/helloworld-stripes");
+ Iterator<?> ss = page.getAllHtmlChildElements();
+ Object o1= ss.next();
+ Object o2= ss.next();
+ Object o3= ss.next();
+ Object o4= ss.next();
+ Object o5= ss.next();
+ Object o6= ss.next();
+ HtmlParagraph p = (HtmlParagraph)ss.next();
+ assertEquals("sayHello returns: Hello world", p.asText());
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld/pom.xml
new file mode 100644
index 0000000000..8c1fe33383
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/distribution/webapp-helloworld/pom.xml
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-distribution-webapp-helloworld</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution Webapp helloworld</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-bin-distro-unzip</artifactId>
+ <type>pom</type>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>sample-helloworld</artifactId>
+ <type>war</type>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>httpunit</groupId>
+ <artifactId>httpunit</artifactId>
+ <version>1.6.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <wait>false</wait>
+ <container>
+ <containerId>jetty6x</containerId>
+ <type>embedded</type>
+ <systemProperties>
+ <org.apache.commons.logging.Log>org.apache.commons.logging.impl.SimpleLog</org.apache.commons.logging.Log>
+ </systemProperties>
+ </container>
+ <!-- container>
+ <containerId>tomcat6x</containerId>
+ <home>/Tomcat/apache-tomcat-6.0.18</home>
+ </container -->
+ <configuration>
+ <home>${project.build.directory}/cargo-jetty</home>
+ <properties>
+ <!-- NOTE: remote debugging doesn't work with the embedded Jetty container. To remote debug
+ uncomment/comment the container above to be the Tomcat container and set home to point
+ to your local Tomcat installation -->
+ <cargo.jvmargs><![CDATA[-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y]]></cargo.jvmargs>
+ <cargo.servlet.port>8085</cargo.servlet.port>
+ </properties>
+ <deployables>
+ <deployable>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>sample-helloworld</artifactId>
+ <type>war</type>
+ <pingURL>http://localhost:8085/helloworld</pingURL>
+ </deployable>
+ </deployables>
+ </configuration>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/exceptions/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/pom.xml
new file mode 100644
index 0000000000..3fd1855672
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-exceptions</artifactId>
+ <name>Apache Tuscany SCA iTest Exceptions</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/Checked.java b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/Checked.java
new file mode 100644
index 0000000000..1f57116bac
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/Checked.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.test.exceptions;
+
+public class Checked extends Exception {
+ private static final long serialVersionUID = -129752837478357452L;
+
+ /**
+ *
+ */
+ public Checked() {
+
+ }
+
+ /**
+ * @param message
+ */
+ public Checked(String message) {
+ super(message);
+
+ }
+
+ /**
+ * @param cause
+ */
+ public Checked(Throwable cause) {
+ super(cause);
+
+ }
+
+ /**
+ * @param message
+ * @param cause
+ */
+ public Checked(String message, Throwable cause) {
+ super(message, cause);
+
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionHandler.java b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionHandler.java
new file mode 100644
index 0000000000..112aefc747
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionHandler.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.exceptions;
+
+public interface ExceptionHandler {
+
+ void testing();
+
+ Checked getTheBad();
+
+ String getTheGood();
+
+ UnChecked getTheUgly();
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionRemoteThrower.java b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionRemoteThrower.java
new file mode 100644
index 0000000000..53a6c70b57
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionRemoteThrower.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.exceptions;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * Remote exception thrower
+ * @version $Rev$ $Date$
+ */
+@Remotable
+public interface ExceptionRemoteThrower extends ExceptionThrower {
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionThrower.java b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionThrower.java
new file mode 100644
index 0000000000..ace219991b
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionThrower.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.exceptions;
+
+/**
+ * Local exception thrower
+ * @version $Rev$ $Date$
+ */
+public interface ExceptionThrower {
+ Checked BAD = new Checked("theBad");
+ UnChecked UGLY = new UnChecked("theUgly");
+ String SO_THEY_SAY = "All is good that ends good.";
+
+ String theGood() throws Checked;
+
+ String theBad() throws Checked;
+
+ String theUgly() throws Checked;
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/UnChecked.java b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/UnChecked.java
new file mode 100644
index 0000000000..453528444d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/UnChecked.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.test.exceptions;
+
+public class UnChecked extends RuntimeException {
+ private static final long serialVersionUID = -1318118082838092244L;
+
+ /**
+ *
+ */
+ public UnChecked() {
+
+ }
+
+ /**
+ * @param message
+ */
+ public UnChecked(String message) {
+ super(message);
+
+ }
+
+ /**
+ * @param cause
+ */
+ public UnChecked(Throwable cause) {
+ super(cause);
+
+ }
+
+ /**
+ * @param message
+ * @param cause
+ */
+ public UnChecked(String message, Throwable cause) {
+ super(message, cause);
+
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionHandlerImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionHandlerImpl.java
new file mode 100644
index 0000000000..26b9f0a383
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionHandlerImpl.java
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.test.exceptions.impl;
+
+import org.apache.tuscany.sca.test.exceptions.Checked;
+import org.apache.tuscany.sca.test.exceptions.ExceptionHandler;
+import org.apache.tuscany.sca.test.exceptions.ExceptionThrower;
+import org.apache.tuscany.sca.test.exceptions.UnChecked;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Scope;
+
+@Scope("COMPOSITE")
+public class ExceptionHandlerImpl implements ExceptionHandler {
+ static final String INIT = "INIT";
+
+ private ExceptionThrower exceptionThrower;
+
+ private String theGood;
+
+ private Checked theBad;
+
+ private UnChecked theUgly;
+
+ public void testing() {
+
+ assert exceptionThrower != null : "'exceptionThrower' never wired";
+ String result = INIT;
+ try {
+ theGood = result = exceptionThrower.theGood();
+ assert result == ExceptionThrower.SO_THEY_SAY;
+ } catch (Throwable e) {
+ assert result == INIT;
+ assert false;
+ e.printStackTrace();
+ }
+
+ result = INIT;
+ try {
+ result = exceptionThrower.theBad();
+ // incredible
+ assert false : "Expected 'Check' Exception";
+
+ } catch (Checked e) {
+ // This is good...
+ assert result == INIT;
+ theBad = e;
+ } catch (Throwable t) {
+ // This is not so good.
+ t.printStackTrace();
+ assert result == INIT;
+ assert false : "Got wrong exception '" + t.getClass().getName();
+ }
+
+ result = INIT;
+ try {
+ result = exceptionThrower.theUgly();
+ // incredible
+ assert false : "Expected 'UnCheck' Exception";
+
+ } catch (Checked e) {
+ // This is not so good...
+ assert false : "Got wrong exception '" + e.getClass().getName();
+ assert result == INIT;
+ } catch (UnChecked e) {
+ theUgly = e;
+
+ } catch (Throwable t) {
+ // This is not good.
+ assert false;
+ assert result == INIT;
+
+ System.out.println(ExceptionThrower.SO_THEY_SAY + " " + INIT);
+ }
+
+ }
+
+ @Reference
+ public void setExceptionThrower(ExceptionThrower exceptionThrower) {
+ this.exceptionThrower = exceptionThrower;
+ }
+
+ public String getTheGood() {
+ return theGood;
+ }
+
+ public Checked getTheBad() {
+ return theBad;
+ }
+
+ public UnChecked getTheUgly() {
+ return theUgly;
+ }
+
+ public ExceptionThrower getExceptionThrower() {
+ return exceptionThrower;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionRemoteThrowerImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionRemoteThrowerImpl.java
new file mode 100644
index 0000000000..cd62338841
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionRemoteThrowerImpl.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.exceptions.impl;
+
+import org.apache.tuscany.sca.test.exceptions.Checked;
+import org.apache.tuscany.sca.test.exceptions.ExceptionRemoteThrower;
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ *
+ * @version $Rev$ $Date$
+ */
+@Service(ExceptionRemoteThrower.class)
+public class ExceptionRemoteThrowerImpl implements ExceptionRemoteThrower {
+ public String theBad() throws Checked {
+ throw BAD;
+ }
+
+ public String theGood() throws Checked {
+ return SO_THEY_SAY;
+ }
+
+ public String theUgly() throws Checked {
+ throw UGLY;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionThrowerImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionThrowerImpl.java
new file mode 100644
index 0000000000..56b9fc6f5b
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionThrowerImpl.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.exceptions.impl;
+
+import org.apache.tuscany.sca.test.exceptions.Checked;
+import org.apache.tuscany.sca.test.exceptions.ExceptionThrower;
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ *
+ * @version $Rev$ $Date$
+ */
+@Service(ExceptionThrower.class)
+public class ExceptionThrowerImpl implements ExceptionThrower {
+
+ public String theBad() throws Checked {
+ throw BAD;
+ }
+
+ public String theGood() throws Checked {
+ return SO_THEY_SAY;
+ }
+
+ public String theUgly() throws Checked {
+ throw UGLY;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java
new file mode 100644
index 0000000000..c5b54ff902
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.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.test.exceptions.impl;
+
+import org.apache.tuscany.sca.test.exceptions.Checked;
+import org.apache.tuscany.sca.test.exceptions.ExceptionHandler;
+import org.apache.tuscany.sca.test.exceptions.ExceptionRemoteThrower;
+import org.apache.tuscany.sca.test.exceptions.ExceptionThrower;
+import org.apache.tuscany.sca.test.exceptions.UnChecked;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Scope;
+
+@Scope("COMPOSITE")
+public class RemoteExceptionHandlerImpl implements ExceptionHandler {
+ static final String INIT = "INIT";
+
+ private ExceptionRemoteThrower exceptionThrower;
+
+ private String theGood;
+
+ private Checked theBad;
+
+ private UnChecked theUgly;
+
+ public void testing() {
+
+ assert exceptionThrower != null : "'exceptionThrower' never wired";
+ String result = INIT;
+ try {
+ theGood = result = exceptionThrower.theGood();
+ assert result == ExceptionThrower.SO_THEY_SAY;
+ } catch (Throwable e) {
+ assert result == INIT;
+ assert false;
+ e.printStackTrace();
+ }
+
+ result = INIT;
+ try {
+ result = exceptionThrower.theBad();
+ // incredible
+ assert false : "Expected 'Check' Exception";
+
+ } catch (Checked e) {
+ // This is good...
+ assert result == INIT;
+ theBad = e;
+ } catch (Throwable t) {
+ // This is not so good.
+ t.printStackTrace();
+ assert result == INIT;
+ assert false : "Got wrong exception '" + t.getClass().getName();
+ }
+
+ result = INIT;
+ try {
+ result = exceptionThrower.theUgly();
+ // incredible
+ assert false : "Expected 'UnCheck' Exception";
+
+ } catch (Checked e) {
+ // This is not so good...
+ assert false : "Got wrong exception '" + e.getClass().getName();
+ assert result == INIT;
+ } catch (UnChecked e) {
+ theUgly = e;
+
+ } catch (Throwable t) {
+ // This is not good.
+ assert false;
+ assert result == INIT;
+
+ System.out.println(ExceptionThrower.SO_THEY_SAY + " " + INIT);
+ }
+
+ }
+
+ @Reference
+ public void setExceptionThrower(ExceptionRemoteThrower exceptionThrower) {
+ this.exceptionThrower = exceptionThrower;
+ }
+
+ public String getTheGood() {
+ return theGood;
+ }
+
+ public Checked getTheBad() {
+ return theBad;
+ }
+
+ public UnChecked getTheUgly() {
+ return theUgly;
+ }
+
+ public ExceptionRemoteThrower getExceptionThrower() {
+ return exceptionThrower;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/resources/ExceptionTest.composite b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/resources/ExceptionTest.composite
new file mode 100644
index 0000000000..d42866303e
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/main/resources/ExceptionTest.composite
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:foo="http://foo" targetNamespace="http://foo"
+ name="ExceptionTest">
+ <component name="main">
+ <implementation.java class="org.apache.tuscany.sca.test.exceptions.impl.ExceptionHandlerImpl" />
+ <reference name="exceptionThrower" target="exceptionThrower" />
+ </component>
+
+ <component name="exceptionThrower">
+ <implementation.java class="org.apache.tuscany.sca.test.exceptions.impl.ExceptionThrowerImpl" />
+ </component>
+
+ <component name="mainRemote">
+ <implementation.java class="org.apache.tuscany.sca.test.exceptions.impl.RemoteExceptionHandlerImpl" />
+ <reference name="exceptionThrower" target="exceptionThrowerRemote" />
+ </component>
+
+ <component name="exceptionThrowerRemote">
+ <implementation.java class="org.apache.tuscany.sca.test.exceptions.impl.ExceptionRemoteThrowerImpl" />
+ </component>
+
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/test/java/org/apache/tuscany/sca/test/exceptions/ExceptionsTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/test/java/org/apache/tuscany/sca/test/exceptions/ExceptionsTestCase.java
new file mode 100644
index 0000000000..7794348476
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/exceptions/src/test/java/org/apache/tuscany/sca/test/exceptions/ExceptionsTestCase.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.test.exceptions;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertSame;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class ExceptionsTestCase {
+
+ private static Node node;
+
+ /**
+ * Test exception handling over a local interface
+ */
+ @Test
+ public void testLocal() {
+ ExceptionHandler exceptionHandler = node.getService(ExceptionHandler.class, "main");
+ exceptionHandler.testing();
+ assertEquals(ExceptionThrower.SO_THEY_SAY, exceptionHandler.getTheGood());
+ assertNotNull(exceptionHandler.getTheBad());
+ assertEquals(Checked.class, exceptionHandler.getTheBad().getClass());
+ assertSame(ExceptionThrower.BAD, exceptionHandler.getTheBad());
+ assertNotNull(exceptionHandler.getTheUgly());
+ assertEquals(UnChecked.class, exceptionHandler.getTheUgly().getClass());
+ assertSame(ExceptionThrower.UGLY, exceptionHandler.getTheUgly());
+ }
+
+ /**
+ * Test exception handling over a remotable interface
+ */
+ @Test
+ public void testRemote() {
+ ExceptionHandler exceptionHandler = node.getService(ExceptionHandler.class, "mainRemote");
+ exceptionHandler.testing();
+ assertEquals(ExceptionThrower.SO_THEY_SAY, exceptionHandler.getTheGood());
+ assertNotNull(exceptionHandler.getTheBad());
+ assertEquals(Checked.class, exceptionHandler.getTheBad().getClass());
+ assertNotSame(ExceptionThrower.BAD, exceptionHandler.getTheBad());
+ assertNotNull(exceptionHandler.getTheUgly());
+ assertEquals(UnChecked.class, exceptionHandler.getTheUgly().getClass());
+
+ // [rfeng] We're not in a position to copy non business exceptions
+ // assertNotSame(ExceptionThrower.UGLY, exceptionHandler.getTheUgly());
+
+ }
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("ExceptionTest.composite");
+ node = NodeFactory.newInstance().createNode("ExceptionTest.composite", new Contribution("c1", location));
+ node.start();
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ node.stop();
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/pom.xml
new file mode 100644
index 0000000000..d277051514
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/pom.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-implementation-spring</artifactId>
+ <name>Apache Tuscany SCA iTest Spring Implementation</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-spring</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-spring-sca</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <!-- Spring dependencies... -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>2.5.5</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>2.5.5</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>2.5.5</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteImpl.java
new file mode 100644
index 0000000000..833cc50f71
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteImpl.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 bigbank.stockquote;
+
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * This class implements the StockQuote service.
+ */
+@Service(StockQuoteService.class)
+public class StockQuoteImpl implements StockQuoteService {
+
+ public double getQuote(String symbol) {
+ double price = 104.0 + Math.random();
+ price = ((int)(price * 100)) / 100.0;
+
+ System.out.println("Getting stock quote for: " + symbol + ", value: "+ price);
+
+ return price;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteService.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteService.java
new file mode 100644
index 0000000000..d6db2bd182
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteService.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 bigbank.stockquote;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * This is the business interface of the StockQuote service.
+ */
+@Remotable
+public interface StockQuoteService {
+
+ public double getQuote(String symbol);
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/AddService.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/AddService.java
new file mode 100644
index 0000000000..5a1e7a638a
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/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/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/AddServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/AddServiceImpl.java
new file mode 100644
index 0000000000..a597691905
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/AddServiceImpl.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;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * An implementation of the Add service
+ */
+public class AddServiceImpl implements AddService {
+
+ public double add(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Adding " + n1 + " and " + n2);
+ return n1 + n2;
+ }
+
+} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/CalculatorService.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/CalculatorService.java
new file mode 100644
index 0000000000..78eea39c71
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/CalculatorService.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 calculator;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The Calculator service interface.
+ */
+@Remotable
+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/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/CalculatorServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/CalculatorServiceImpl.java
new file mode 100644
index 0000000000..4363650e52
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/CalculatorServiceImpl.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+/**
+ * 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 AddService getAddService() {
+ return addService;
+ }
+
+ public void setSubtractService(SubtractService subtractService) {
+ this.subtractService = subtractService;
+ }
+
+ public SubtractService getSubtractService() {
+ return subtractService;
+ }
+
+ public void setDivideService(DivideService divideService) {
+ this.divideService = divideService;
+ }
+
+ public DivideService getDivideService() {
+ return divideService;
+ }
+
+ public void setMultiplyService(MultiplyService multiplyService) {
+ this.multiplyService = multiplyService;
+ }
+
+ public MultiplyService getMultiplyService() {
+ return 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/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/DivideService.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/DivideService.java
new file mode 100644
index 0000000000..ef6a8b375b
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/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/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/DivideServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/DivideServiceImpl.java
new file mode 100644
index 0000000000..cd91935f08
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/DivideServiceImpl.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;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * An implementation of the Divide service.
+ */
+public class DivideServiceImpl implements DivideService {
+
+ public double divide(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2);
+ return n1 / n2;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/MultiplyService.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/MultiplyService.java
new file mode 100644
index 0000000000..db568cc762
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/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/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/MultiplyServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/MultiplyServiceImpl.java
new file mode 100644
index 0000000000..c85357fcd8
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/MultiplyServiceImpl.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;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * An implementation of the Multiply service.
+ */
+public class MultiplyServiceImpl implements MultiplyService {
+
+ public double multiply(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2);
+ return n1 * n2;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/SubtractService.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/SubtractService.java
new file mode 100644
index 0000000000..56ee372fc4
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/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/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/SubtractServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/SubtractServiceImpl.java
new file mode 100644
index 0000000000..1b669084d9
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/SubtractServiceImpl.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;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * An implementation of the subtract service.
+ */
+public class SubtractServiceImpl implements SubtractService {
+
+ public double subtract(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2);
+ return n1 - n2;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/security/CalculatorCallbackHandler.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/security/CalculatorCallbackHandler.java
new file mode 100644
index 0000000000..b48fb90148
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/security/CalculatorCallbackHandler.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 calculator.security;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class CalculatorCallbackHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ if (callbacks[i] instanceof NameCallback) {
+ NameCallback nc = (NameCallback)callbacks[i];
+ nc.setName("CalculatorUser");
+ } else if (callbacks[i] instanceof PasswordCallback) {
+ PasswordCallback pc = (PasswordCallback)callbacks[i];
+ pc.setPassword("CalculatorUserPasswd".toCharArray());
+ } else {
+ throw new UnsupportedCallbackException
+ (callbacks[i], "Unsupported Callback!");
+ }
+ }
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/security/JaasLoginModule.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/security/JaasLoginModule.java
new file mode 100644
index 0000000000..fe4097640b
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/security/JaasLoginModule.java
@@ -0,0 +1,178 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.security;
+
+import java.security.Principal;
+import java.util.Map;
+
+import javax.security.auth.Subject;
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.auth.login.LoginException;
+import javax.security.auth.spi.LoginModule;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class JaasLoginModule implements LoginModule {
+
+ private CallbackHandler callbackHandler;
+ private Subject subject;
+ private Principal userPrincipal;
+ private String userId;
+ private String password;
+ private boolean succeeded;
+ private boolean commitSucceeded;
+
+ public void initialize(Subject subject,
+ CallbackHandler callbackHandler,
+ Map<String, ?> sharedState,
+ Map<String, ?> options) {
+ this.callbackHandler = callbackHandler;
+ this.subject = subject;
+ }
+
+ public boolean login() throws LoginException {
+ Callback[] callbacks = new Callback[2];
+ callbacks[0] = new NameCallback("UserId:");
+ callbacks[1] = new PasswordCallback("Password:", false);
+
+ try {
+ callbackHandler.handle(callbacks);
+ userId = ((NameCallback)callbacks[0]).getName();
+ password = new String(((PasswordCallback)callbacks[1]).getPassword());
+
+ if (userId.equals("CalculatorUser") && password.equals("CalculatorUserPasswd")) {
+ System.out.println("Successfully AUTHENTICATED!!");
+ succeeded = true;
+ return true;
+ } else {
+ System.out.println("Incorrect userId / password! AUTHENTICATION FAILED!!");
+ return false;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ /**
+ * <p> This method is called if the LoginContext's
+ * overall authentication succeeded
+ * (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules
+ * succeeded).
+ *
+ * <p> If this LoginModule's own authentication attempt
+ * succeeded (checked by retrieving the private state saved by the
+ * <code>login</code> method), then this method associates a
+ * <code>UserPrincipal</code>
+ * with the <code>Subject</code> located in the
+ * <code>LoginModule</code>. If this LoginModule's own
+ * authentication attempted failed, then this method removes
+ * any state that was originally saved.
+ *
+ * <p>
+ *
+ * @exception LoginException if the commit fails.
+ *
+ * @return true if this LoginModule's own login and commit
+ * attempts succeeded, or false otherwise.
+ */
+ public boolean commit() throws LoginException {
+ if (succeeded == false) {
+ return false;
+ } else {
+ // add a Principal (authenticated identity) to the Subject
+
+ // assume the user we authenticated is the UserPrincipal
+ userPrincipal = new UserPrincipal(userId);
+ if (!subject.getPrincipals().contains(userPrincipal))
+ subject.getPrincipals().add(userPrincipal);
+
+ // in any case, clean out state
+ userId = null;
+ password = null;
+ commitSucceeded = true;
+ return true;
+ }
+ }
+
+ /**
+ * <p> This method is called if the LoginContext's
+ * overall authentication failed.
+ * (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules
+ * did not succeed).
+ *
+ * <p> If this LoginModule's own authentication attempt
+ * succeeded (checked by retrieving the private state saved by the
+ * <code>login</code> and <code>commit</code> methods),
+ * then this method cleans up any state that was originally saved.
+ *
+ * <p>
+ *
+ * @exception LoginException if the abort fails.
+ *
+ * @return false if this LoginModule's own login and/or commit attempts
+ * failed, and true otherwise.
+ */
+ public boolean abort() throws LoginException {
+ if (succeeded == false) {
+ return false;
+ } else if (succeeded == true && commitSucceeded == false) {
+ // login succeeded but overall authentication failed
+ succeeded = false;
+ userId = null;
+ password = null;
+ userPrincipal = null;
+ } else {
+ // overall authentication succeeded and commit succeeded,
+ // but someone else's commit failed
+ logout();
+ }
+ return true;
+ }
+
+ /**
+ * Logout the user.
+ *
+ * <p> This method removes the <code>SimplePrincipal</code>
+ * that was added by the <code>commit</code> method.
+ *
+ * <p>
+ *
+ * @exception LoginException if the logout fails.
+ *
+ * @return true in all cases since this <code>LoginModule</code>
+ * should not be ignored.
+ */
+ public boolean logout() throws LoginException {
+ subject.getPrincipals().remove(userPrincipal);
+ succeeded = false;
+ succeeded = commitSucceeded;
+ userId = null;
+ if (password != null)
+ password = null;
+ userPrincipal = null;
+ return true;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/security/UserPrincipal.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/security/UserPrincipal.java
new file mode 100644
index 0000000000..09024197db
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/calculator/security/UserPrincipal.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 calculator.security;
+
+import java.security.Principal;
+
+/**
+ * @version $Rev: 637276 $ $Date: 2008-03-15 03:05:34 +0530 (Sat, 15 Mar 2008) $
+ */
+public class UserPrincipal implements Principal {
+
+ private final String name;
+
+ public UserPrincipal(String name) {
+ if (name == null)
+ throw new IllegalArgumentException("name cannot be null");
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String toString() {
+ return name;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ final UserPrincipal other = (UserPrincipal)obj;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ return true;
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/context/access/SCAApplicationContextProvider.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/context/access/SCAApplicationContextProvider.java
new file mode 100644
index 0000000000..77d98d50aa
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/context/access/SCAApplicationContextProvider.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 context.access;
+
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+
+public class SCAApplicationContextProvider implements ApplicationContextAware {
+
+ private static ApplicationContext ctx;
+
+ public void setApplicationContext(ApplicationContext appContext) throws BeansException {
+ // Wiring the ApplicationContext into a static method
+ ctx = appContext;
+ }
+
+ public static ApplicationContext getApplicationContext() {
+ return ctx;
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/helloworld/HelloWorld.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/helloworld/HelloWorld.java
new file mode 100644
index 0000000000..830052ae19
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/helloworld/HelloWorld.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 helloworld;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * Interface for the "hello world" service - predictably simple with a single operation
+ * "sayHello"
+ *
+ * @version $Rev$ $Date$
+ */
+@Remotable
+public interface HelloWorld {
+
+ String sayHello(String s);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/helloworld/HelloWorldImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/helloworld/HelloWorldImpl.java
new file mode 100644
index 0000000000..73939693a4
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/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;
+
+/**
+ * A simple proxy Java class which implements the HelloWorld interface but which uses
+ * a reference "delegate" to actually provide the HelloWorld service
+ *
+ * @version $Rev$ $Date$
+ */
+public class HelloWorldImpl implements HelloWorld {
+
+ static String hello = "Hello ";
+
+ public String sayHello(String s) {
+ // Simply call the reference to satisfy the service request...
+ System.out.println("HelloWorldImpl - sayHello called");
+ return (hello + s);
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/helloworld/HelloWorldProxy.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/helloworld/HelloWorldProxy.java
new file mode 100644
index 0000000000..0e2374d599
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/helloworld/HelloWorldProxy.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 helloworld;
+
+import org.oasisopen.sca.annotation.Reference;
+
+/**
+ * A simple proxy Java class which implements the HelloWorld interface but which uses
+ * a reference "delegate" to actually provide the HelloWorld service
+ *
+ * @version $Rev$ $Date$
+ */
+public class HelloWorldProxy implements HelloWorld {
+
+ // Here is the reference "delegate" - it implements the HelloWorld interface...
+ @Reference
+ public HelloWorld delegate;
+
+ public String sayHello(String s) {
+ // Simply call the reference to satisfy the service request...
+ System.out.println("HelloWorldProxy - calling sayHello");
+ return delegate.sayHello(s);
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestBean.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestBean.java
new file mode 100644
index 0000000000..96df81fc0c
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestBean.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 mock;
+
+/**
+ * @version $Rev: 430937 $ $Date: 2006-08-12 02:17:56 +0100 (Sat, 12 Aug 2006) $
+ */
+public interface TestBean {
+ String echo(String msg);
+
+ TestBean getBean();
+
+ void setBean(TestBean bean);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestBeanImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestBeanImpl.java
new file mode 100644
index 0000000000..538d3547f4
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestBeanImpl.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 mock;
+
+/**
+ * @version $Rev: 441406 $ $Date: 2006-09-08 08:20:10 +0100 (Fri, 08 Sep 2006) $
+ */
+public class TestBeanImpl implements TestBean {
+
+ private TestBean bean;
+
+ public TestBeanImpl() {
+ }
+
+ public String echo(String msg) {
+ return msg;
+ }
+
+ public TestBean getBean() {
+ return bean;
+ }
+
+ public void setBean(TestBean bean) {
+ this.bean = bean;
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestHelloWorldBean.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestHelloWorldBean.java
new file mode 100644
index 0000000000..5c9dede7ec
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestHelloWorldBean.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 mock;
+
+/**
+ * A simple test Spring bean which provides the HelloWorld service
+ *
+ * @version $Rev$ $Date$
+ */
+
+import helloworld.HelloWorld;
+
+public class TestHelloWorldBean implements HelloWorld {
+
+ static String hello = "Hello ";
+
+ // Classic "Hello xxx" response to any input message
+ public String sayHello(String message) {
+ System.out.println("TestHelloWorldBean - sayHello called");
+ return (hello + message);
+ }
+
+} // end class TestHelloWorldBean
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestReference.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestReference.java
new file mode 100644
index 0000000000..0a8742d242
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestReference.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 mock;
+
+/**
+ * @version $Rev: 536115 $ $Date: 2007-05-08 09:04:20 +0100 (Tue, 08 May 2007) $
+ */
+public interface TestReference {
+ String echo(String msg);
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestReferenceBean.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestReferenceBean.java
new file mode 100644
index 0000000000..27ccdbdd77
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestReferenceBean.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package mock;
+
+/**
+ * A test Spring bean which provides the HelloWorld service by calling a reference
+ * to provide the content of the response
+ *
+ * @version $Rev$ $Date$
+ */
+
+import helloworld.HelloWorld;
+
+public class TestReferenceBean implements HelloWorld {
+
+ // The reference
+ private HelloWorld bean;
+
+ // Classic "Hello xxx" response to any input message
+ public String sayHello(String message) {
+ System.out.println("TestReferenceBean - sayHello called");
+ return (bean.sayHello(message));
+ }
+
+ /**
+ * Setter for the bean reference
+ * @param theBean
+ */
+ public void setBean(HelloWorld theBean) {
+ this.bean = theBean;
+ }
+
+ /**
+ * Getter for the reference
+ * @return
+ */
+ public HelloWorld getBean() {
+ return this.bean;
+ }
+
+} // end class TestReferenceBean
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestSCAPropertyBean.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestSCAPropertyBean.java
new file mode 100644
index 0000000000..881ca8bb7d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/mock/TestSCAPropertyBean.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 mock;
+
+/**
+ * A test Spring bean which provides the HelloWorld service.
+ * This bean has a single String property called "hello" which must be set through
+ * external configuration to give the correct response message, otherwise an (incorrect)
+ * default message is generated
+ *
+ * @version $Rev$ $Date$
+ */
+
+import helloworld.HelloWorld;
+
+public class TestSCAPropertyBean implements HelloWorld {
+
+ private String hello = "Go away";
+
+ /**
+ * Provides the operation of the "HelloWorld" interface - a simple string response
+ * to a string input message, where the response is a greeting followed by the original
+ * input message.
+ */
+ public String sayHello(String message) {
+ System.out.println("TestHelloWorldBean - sayHello called");
+ return (hello + " " + message);
+ }
+
+ /**
+ * Public setter for the (unannotated) field "hello" which constitutes an SCA
+ * property
+ * @param message - the message to use for the response to "sayHello"
+ */
+ public void setHello(String message) {
+ hello = message;
+ }
+
+} // end class TestSCAPropertyBean
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/spring/annotations/CalculatorServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/spring/annotations/CalculatorServiceImpl.java
new file mode 100644
index 0000000000..000b135f01
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/java/spring/annotations/CalculatorServiceImpl.java
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package spring.annotations;
+
+import org.oasisopen.sca.annotation.Destroy;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Service;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Property;
+import org.oasisopen.sca.annotation.ComponentName;
+
+import calculator.AddService;
+import calculator.CalculatorService;
+import calculator.DivideService;
+import calculator.MultiplyService;
+import calculator.SubtractService;
+
+/**
+ * An implementation of the Calculator service.
+ */
+@Service(CalculatorService.class)
+public class CalculatorServiceImpl implements AddService, SubtractService, MultiplyService, DivideService {
+
+ public AddService addService; // setter injection
+
+ @Reference
+ public SubtractService subtractService; // field injection
+
+ @Reference(name="multiplyService", required=false)
+ public MultiplyService multiply; // field injection (different reference and field name)
+
+ public DivideService divide; // setter injection (different reference and field name)
+
+ public String message; // setter injection
+
+ @Property(name="message", required=false)
+ public String message2; // field injection
+
+ public String componentName;
+
+ @Init
+ public void initMethod () {
+ System.out.println("Init method is sucessfully called.....");
+ // Property value should be null here.
+ System.out.println("Property Value message is...." + message);
+ }
+
+ @Destroy
+ public void destroyMethod () {
+ System.out.println("Component Name is...." + componentName);
+ System.out.println("Property Value message is...." + message);
+ System.out.println("Property Value message2 is...." + message2);
+ System.out.println("Destroy method is sucessfully called.....");
+ }
+
+ @Reference
+ public void setAddService(AddService addService) {
+ this.addService = addService;
+ }
+
+ public AddService getAddService() {
+ return addService;
+ }
+
+ /*public void setSubtractService(SubtractService subtractService) {
+ this.subtractService = subtractService;
+ }
+
+ public SubtractService getSubtractService() {
+ return subtractService;
+ }*/
+
+ @Reference(name="divideService", required=false)
+ public void setDivideService(DivideService divide) {
+ this.divide = divide;
+ }
+
+ public DivideService getDivideService() {
+ return divide;
+ }
+
+ /*public void setMultiplyService(MultiplyService multiplyService) {
+ this.multiplyService = multiplyService;
+ }
+
+ public MultiplyService getMultiplyService() {
+ return multiplyService;
+ }*/
+
+ @ComponentName
+ public void setComponentName(String componentName) {
+ this.componentName = componentName;
+ }
+
+ @Property
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ 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 multiply.multiply(n1, n2);
+ }
+
+ public double divide(double n1, double n2) {
+ return divide.divide(n1, n2);
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/CalculatorService-context.xml b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/CalculatorService-context.xml
new file mode 100644
index 0000000000..7c84965629
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/CalculatorService-context.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="CalculatorServiceBean" class="calculator.CalculatorServiceImpl">
+ <property name="addService" ref="addService"/>
+ <property name="subtractService" ref="subtractService"/>
+ <property name="multiplyService" ref="multiplyService"/>
+ <property name="divideService" ref="divideService"/>
+ </bean>
+
+ <sca:reference name="addService" type="calculator.AddService"/>
+ <sca:reference name="subtractService" type="calculator.SubtractService"/>
+ <sca:reference name="multiplyService" type="calculator.MultiplyService"/>
+ <sca:reference name="divideService" type="calculator.DivideService"/>
+
+</beans>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/SpringDelegationHelloWorld-context.xml b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/SpringDelegationHelloWorld-context.xml
new file mode 100644
index 0000000000..910771b34d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/SpringDelegationHelloWorld-context.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- Application context for the SpringHelloWorld testcase -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <sca:service name="HelloWorld" type="helloworld.HelloWorld" target="testBean"/>
+
+ <bean id="delegateBean"
+ class="org.apache.tuscany.sca.itest.spring.TestHelloWorldBean" lazy-init="true">
+ </bean>
+
+ <bean id="testBean"
+ class="org.apache.tuscany.sca.itest.spring.TestHelloWorldDelegatorBean" lazy-init="true">
+ <property name="delegate"><ref bean="delegateBean"/></property>
+ </bean>
+
+</beans> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/SpringHelloWorld-context.xml b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/SpringHelloWorld-context.xml
new file mode 100644
index 0000000000..c20679241f
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/SpringHelloWorld-context.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- Application context for the SpringHelloWorld testcase -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="testBean" class="org.apache.tuscany.sca.itest.spring.TestHelloWorldBean" lazy-init="true">
+ </bean>
+
+</beans> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-access/CalculatorService-context.xml b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-access/CalculatorService-context.xml
new file mode 100644
index 0000000000..87458b99a3
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-access/CalculatorService-context.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <sca:service name="CalculatorService"
+ type="calculator.CalculatorService" target="CalculatorServiceBean"/>
+
+ <bean id="CalculatorServiceBean" class="calculator.CalculatorServiceImpl">
+ <property name="addService" ref="addService"/>
+ <property name="subtractService" ref="subtractService"/>
+ <property name="multiplyService" ref="multiplyService"/>
+ <property name="divideService" ref="divideService"/>
+ </bean>
+
+ <bean id="contextAccess" class="context.access.SCAApplicationContextProvider">
+ </bean>
+
+ <sca:reference name="addService" type="calculator.AddService"/>
+ <sca:reference name="subtractService" type="calculator.SubtractService"/>
+ <sca:reference name="multiplyService" type="calculator.MultiplyService"/>
+ <sca:reference name="divideService" type="calculator.DivideService"/>
+
+</beans> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-imports/CalculatorService-context.xml b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-imports/CalculatorService-context.xml
new file mode 100644
index 0000000000..7c84965629
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-imports/CalculatorService-context.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="CalculatorServiceBean" class="calculator.CalculatorServiceImpl">
+ <property name="addService" ref="addService"/>
+ <property name="subtractService" ref="subtractService"/>
+ <property name="multiplyService" ref="multiplyService"/>
+ <property name="divideService" ref="divideService"/>
+ </bean>
+
+ <sca:reference name="addService" type="calculator.AddService"/>
+ <sca:reference name="subtractService" type="calculator.SubtractService"/>
+ <sca:reference name="multiplyService" type="calculator.MultiplyService"/>
+ <sca:reference name="divideService" type="calculator.DivideService"/>
+
+</beans>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-imports/SpringImport-context.xml b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-imports/SpringImport-context.xml
new file mode 100644
index 0000000000..3faed92fd2
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-imports/SpringImport-context.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <import resource="CalculatorService-context.xml"/>
+
+</beans> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/SpringHelloWorld-context.xml b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/SpringHelloWorld-context.xml
new file mode 100644
index 0000000000..c20679241f
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/SpringHelloWorld-context.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- Application context for the SpringHelloWorld testcase -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="testBean" class="org.apache.tuscany.sca.itest.spring.TestHelloWorldBean" lazy-init="true">
+ </bean>
+
+</beans> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/StockQuoteService-context.xml b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/StockQuoteService-context.xml
new file mode 100644
index 0000000000..74473073ea
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/StockQuoteService-context.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <sca:service name="StockQuoteService"
+ type="bigbank.stockquote.StockQuoteService" target="StockQuoteServiceBean"/>
+
+ <bean id="StockQuoteServiceBean" class="bigbank.stockquote.StockQuoteImpl">
+ </bean>
+
+ <bean id="applicationContextProvider" class="context.access.SCAApplicationContextProvider">
+ </bean>
+
+</beans> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/beanRefContext.xml b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/beanRefContext.xml
new file mode 100644
index 0000000000..930b92f4be
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/beanRefContext.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="beanRefFactory" class="org.springframework.context.support.ClassPathXmlApplicationContext">
+ <constructor-arg>
+ <list>
+ <value>META-INF/sca/context-multiple/StockQuoteService-context.xml</value>
+ <value>META-INF/sca/context-multiple/SpringHelloWorld-context.xml</value>
+ </list>
+ </constructor-arg>
+ </bean>
+</beans> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/implementation-policies/CalculatorService-context.xml b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/implementation-policies/CalculatorService-context.xml
new file mode 100644
index 0000000000..7c84965629
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/implementation-policies/CalculatorService-context.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="CalculatorServiceBean" class="calculator.CalculatorServiceImpl">
+ <property name="addService" ref="addService"/>
+ <property name="subtractService" ref="subtractService"/>
+ <property name="multiplyService" ref="multiplyService"/>
+ <property name="divideService" ref="divideService"/>
+ </bean>
+
+ <sca:reference name="addService" type="calculator.AddService"/>
+ <sca:reference name="subtractService" type="calculator.SubtractService"/>
+ <sca:reference name="multiplyService" type="calculator.MultiplyService"/>
+ <sca:reference name="divideService" type="calculator.DivideService"/>
+
+</beans>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/location-folder/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/location-folder/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..950dbeba4c
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/location-folder/META-INF/MANIFEST.MF
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Spring-Context: META-INF/spring/SpringSCAProperty-context.xml
+
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/location-folder/META-INF/spring/SpringSCAProperty-context.xml b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/location-folder/META-INF/spring/SpringSCAProperty-context.xml
new file mode 100644
index 0000000000..8613e6c82a
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/location-folder/META-INF/spring/SpringSCAProperty-context.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- Application context for the SpringHelloWorld testcase -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="testBean" class="mock.TestSCAPropertyBean" lazy-init="true">
+ <property name="hello" ref="TestProperty"/>
+ </bean>
+
+ <sca:property id="foo" name="TestProperty" type="java.lang.String"/>
+
+</beans> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/location-jar/spring-context.jar b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/location-jar/spring-context.jar
new file mode 100644
index 0000000000..504d59e5ff
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/location-jar/spring-context.jar
Binary files differ
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/sca-references/SpringExplicitReference-context.xml b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/sca-references/SpringExplicitReference-context.xml
new file mode 100644
index 0000000000..d18d8312e3
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/sca-references/SpringExplicitReference-context.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="testBean" class="mock.TestReferenceBean">
+ <property name="bean" ref="testReference"/>
+ </bean>
+
+ <sca:reference name="testReference" type="helloworld.HelloWorld"/>
+
+</beans>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/sca-references/SpringImplicitReference-context.xml b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/sca-references/SpringImplicitReference-context.xml
new file mode 100644
index 0000000000..df4b9b28cf
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/sca-references/SpringImplicitReference-context.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="testBean" class="mock.TestReferenceBean">
+ <!-- Here is the implicit reference - a property with a ref not satisifed within the
+ * Spring application context.
+ -->
+ <property name="bean" ref="testReference"/>
+ </bean>
+
+</beans>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/sca-services/SpringExplicitService-context.xml b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/sca-services/SpringExplicitService-context.xml
new file mode 100644
index 0000000000..194bc4bcc9
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/sca-services/SpringExplicitService-context.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- Application context for the SpringExplicitHelloWorld testcase
+In this case, the service offered by the Spring application is specified
+explicitly using an sca:service element -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <sca:service name="fooService"
+ type="helloworld.HelloWorld"
+ target="testBean"/>
+
+ <bean id="testBean"
+ class="mock.TestHelloWorldBean"
+ lazy-init="true">
+ </bean>
+
+</beans> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/sca-services/SpringImplicitService-context.xml b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/sca-services/SpringImplicitService-context.xml
new file mode 100644
index 0000000000..1c63311367
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/sca-services/SpringImplicitService-context.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- Application context for the SpringHelloWorld testcase -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="testBean" class="mock.TestHelloWorldBean" lazy-init="true">
+ </bean>
+
+</beans> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/spring-annotation/CalculatorService-context.xml b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/spring-annotation/CalculatorService-context.xml
new file mode 100644
index 0000000000..4110a9a7b7
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/META-INF/sca/spring-annotation/CalculatorService-context.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="CalculatorServiceBean" class="spring.annotations.CalculatorServiceImpl">
+ <property name="addService" ref="addService"/>
+ <!-- <property name="subtractService" ref="subtractService"/>
+ <property name="multiplyService" ref="multiplyService"/> -->
+ <property name="divideService" ref="divideService"/>
+ </bean>
+
+ <sca:reference name="addService" type="calculator.AddService"/>
+ <sca:reference name="subtractService" type="calculator.SubtractService"/>
+ <sca:reference name="multiplyService" type="calculator.MultiplyService"/>
+ <sca:reference name="divideService" type="calculator.DivideService"/>
+
+ <sca:property id="msg" name="message" type="java.lang.String"/>
+
+</beans>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/context/access/ContextAccess.composite b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/context/access/ContextAccess.composite
new file mode 100644
index 0000000000..8863553419
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/context/access/ContextAccess.composite
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://contextaccess"
+ xmlns:sample="http://contextaccess"
+ name="ContextAccess"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
+
+ <component name="CalculatorServiceComponent">
+ <implementation.spring location="META-INF/sca/context-access/CalculatorService-context.xml"/>
+ <reference name="addService" target="AddServiceComponent" />
+ <reference name="subtractService" target="SubtractServiceComponent" />
+ <reference name="multiplyService" target="MultiplyServiceComponent" />
+ <reference name="divideService" target="DivideServiceComponent" />
+ </component>
+
+ <component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl"/>
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <implementation.java class="calculator.SubtractServiceImpl"/>
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl"/>
+ </component>
+
+ <component name="DivideServiceComponent">
+ <implementation.java class="calculator.DivideServiceImpl"/>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/context/imports/ContextImports.composite b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/context/imports/ContextImports.composite
new file mode 100644
index 0000000000..2d6705ce56
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/context/imports/ContextImports.composite
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://contextimports"
+ xmlns:sample="http://contextimports"
+ name="ContextImports"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
+
+ <component name="CalculatorServiceComponent">
+ <implementation.spring location="META-INF/sca/context-imports/SpringImport-context.xml"/>
+ <reference name="addService" target="AddServiceComponent" />
+ <reference name="subtractService" target="SubtractServiceComponent" />
+ <reference name="multiplyService" target="MultiplyServiceComponent" />
+ <reference name="divideService" target="DivideServiceComponent" />
+ </component>
+
+ <component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl"/>
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <implementation.java class="calculator.SubtractServiceImpl"/>
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl"/>
+ </component>
+
+ <component name="DivideServiceComponent">
+ <implementation.java class="calculator.DivideServiceImpl"/>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/context/multiple/MultipleContext.composite b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/context/multiple/MultipleContext.composite
new file mode 100644
index 0000000000..15c0c39f51
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/context/multiple/MultipleContext.composite
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://stockquote"
+ xmlns:hw="http://stockquote"
+ name="MultipleContext">
+
+ <service name="StockQuoteService" promote="StockQuoteServiceComponent">
+ <interface.java interface="bigbank.stockquote.StockQuoteService"/>
+ <binding.ws uri="http://localhost:8081/services/StockQuoteWebService"/>
+ </service>
+
+ <component name="StockQuoteServiceComponent">
+ <implementation.spring location="META-INF/sca/context-multiple/beanRefContext.xml"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/implementation/policies/CalculatorJass.config b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/implementation/policies/CalculatorJass.config
new file mode 100644
index 0000000000..0e7cb86633
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/implementation/policies/CalculatorJass.config
@@ -0,0 +1,3 @@
+Calculator {
+ calculator.security.JaasLoginModule required debug=true;
+};
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/implementation/policies/CalculatorLogMessages.properties b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/implementation/policies/CalculatorLogMessages.properties
new file mode 100644
index 0000000000..f62125eaa9
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/implementation/policies/CalculatorLogMessages.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+CALLING_OPERATION=Inovoking operation {0} with arguments {1}
+OPERATION_RETURNED=Returning from operation {0} with return value {1} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/implementation/policies/ImplementationPolicies.composite b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/implementation/policies/ImplementationPolicies.composite
new file mode 100644
index 0000000000..28b62dfeb9
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/implementation/policies/ImplementationPolicies.composite
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="Calculator"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
+
+ <component name="CalculatorServiceComponent">
+ <implementation.spring location="META-INF/sca/implementation-policies/CalculatorService-context.xml"/>
+ <reference name="addService" target="AddServiceComponent" />
+ <reference name="subtractService" target="SubtractServiceComponent" />
+ <reference name="multiplyService" target="MultiplyServiceComponent" />
+ <reference name="divideService" target="DivideServiceComponent" />
+ </component>
+
+ <component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl"/>
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <implementation.java class="calculator.SubtractServiceImpl"/>
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl" requires="tuscany:jaasAuthentication"/>
+ </component>
+
+ <component name="DivideServiceComponent">
+ <implementation.java class="calculator.DivideServiceImpl"/>
+ </component>
+
+ <component name="AnotherCalculatorServiceComponent">
+ <implementation.spring location="META-INF/sca/implementation-policies/CalculatorService-context.xml" requires="tuscany:logging"/>
+ <reference name="addService" target="AddServiceComponent" />
+ <reference name="subtractService" target="SubtractServiceComponent" />
+ <reference name="multiplyService" target="MultiplyServiceComponent" />
+ <reference name="divideService" target="DivideServiceComponent" />
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/implementation/policies/definitions.xml b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/implementation/policies/definitions.xml
new file mode 100644
index 0000000000..94e4997734
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/implementation/policies/definitions.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:calc="http://calculator">
+
+ <!-- PolicySets -->
+ <policySet name="JaasPolicy" provides="tuscany:jaasAuthentication" appliesTo="sca:implementation.java"
+ xmlns="http://www.osoa.org/xmlns/sca/1.0">
+ <tuscany:jaasAuthentication>
+ <tuscany:configurationName>Calculator</tuscany:configurationName>
+ <tuscany:callbackHandler>calculator.security.CalculatorCallbackHandler</tuscany:callbackHandler>
+ </tuscany:jaasAuthentication>
+ </policySet>
+
+ <!-- PolicySets -->
+ <policySet name="JDKLoggingPolicy" provides="tuscany:logging" appliesTo="sca:implementation.spring"
+ xmlns="http://www.osoa.org/xmlns/sca/1.0">
+ <tuscany:jdkLogger name="calculator">
+ <logLevel>FINER</logLevel>
+ </tuscany:jdkLogger>
+ </policySet>
+</definitions> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/location/folder/SpringFolderLocation.composite b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/location/folder/SpringFolderLocation.composite
new file mode 100644
index 0000000000..d33ae8ca4b
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/location/folder/SpringFolderLocation.composite
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- Composite for the SpringSCAPropertyTestCase
+ * This composite has the HelloWorldComponent implemented with a Spring implementation where
+ * the Spring application context uses an explicit SCA property. The value of the property
+ * is set in this composite and is used to compute the response to a service invocation from
+ * the ClientComponent.
+ -->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ name="SpringFolderLocation">
+
+ <component name="ClientComponent">
+ <implementation.java class="helloworld.HelloWorldProxy"/>
+ <reference name="delegate" target="HelloWorldComponent"/>
+ </component>
+
+ <component name="HelloWorldComponent">
+ <implementation.spring location="META-INF/sca/location-folder"/>
+ <property name="TestProperty">Hello</property>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/location/jar/SpringJarLocation.composite b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/location/jar/SpringJarLocation.composite
new file mode 100644
index 0000000000..e47b6526ff
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/location/jar/SpringJarLocation.composite
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- Composite for the SpringSCAPropertyTestCase
+ * This composite has the HelloWorldComponent implemented with a Spring implementation where
+ * the Spring application context uses an explicit SCA property. The value of the property
+ * is set in this composite and is used to compute the response to a service invocation from
+ * the ClientComponent.
+ -->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ name="SpringJarLocation">
+
+ <component name="ClientComponent">
+ <implementation.java class="helloworld.HelloWorldProxy"/>
+ <reference name="delegate" target="HelloWorldComponent"/>
+ </component>
+
+ <component name="HelloWorldComponent">
+ <implementation.spring location="META-INF/sca/location-jar/spring-context.jar"/>
+ <property name="TestProperty">Hello</property>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorld.composite b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorld.composite
new file mode 100644
index 0000000000..9099abdbeb
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorld.composite
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ name="SpringDelegationHelloWorld">
+
+ <component name="ClientComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.spring.HelloWorldProxy"/>
+ <reference name="delegate" target="HelloWorldComponent"/>
+ </component>
+
+ <component name="HelloWorldComponent">
+ <implementation.spring location="META-INF/sca/SpringDelegationHelloWorld-context.xml"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringHelloWorld.composite b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringHelloWorld.composite
new file mode 100644
index 0000000000..42c67ffa39
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringHelloWorld.composite
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ name="SpringHelloWorld">
+
+ <component name="ClientComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.spring.HelloWorldProxy"/>
+ <reference name="delegate" target="HelloWorldComponent"/>
+ </component>
+
+ <component name="HelloWorldComponent">
+ <implementation.spring location="META-INF/sca/SpringHelloWorld-context.xml"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/sca/references/SpringExplicitReference.composite b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/sca/references/SpringExplicitReference.composite
new file mode 100644
index 0000000000..4aa9b7a56d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/sca/references/SpringExplicitReference.composite
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ name="SpringExplicitReference">
+
+ <component name="ClientComponent">
+ <implementation.spring location="META-INF/sca/sca-references/SpringExplicitReference-context.xml"/>
+ <reference name="testReference" target="ExplicitReferenceComponent"/>
+ </component>
+
+ <component name="ExplicitReferenceComponent">
+ <implementation.java class="helloworld.HelloWorldImpl"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/sca/references/SpringImplicitReference.composite b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/sca/references/SpringImplicitReference.composite
new file mode 100644
index 0000000000..ae972f8647
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/sca/references/SpringImplicitReference.composite
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- Composite for the SpringImplicitReferenceTestCase
+ * This composite has a ClientComponent implemented with a Spring implementation where
+ * Spring application context uses an implicit reference definition through a Bean with
+ * a property with an unsatisfied ref attribute, which forms the reference.
+ * The reference is satisified by a wire to a ReferenceComponent which is implemented
+ * by a plain Java POJO.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ name="SpringImplicitReference">
+
+ <component name="ClientComponent">
+ <implementation.spring location="META-INF/sca/sca-references/SpringImplicitReference-context.xml"/>
+ <reference name="testReference" target="ImplicitReferenceComponent"/>
+ </component>
+
+ <component name="ImplicitReferenceComponent">
+ <implementation.java class="helloworld.HelloWorldImpl"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/sca/services/SpringExplicitService.composite b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/sca/services/SpringExplicitService.composite
new file mode 100644
index 0000000000..b259b9d657
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/sca/services/SpringExplicitService.composite
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ name="SpringExplicitService">
+
+ <component name="ClientComponent">
+ <implementation.java class="helloworld.HelloWorldProxy"/>
+ <reference name="delegate" target="ExplicitServiceComponent"/>
+ </component>
+
+ <component name="ExplicitServiceComponent">
+ <implementation.spring location="META-INF/sca/sca-services/SpringExplicitService-context.xml"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/sca/services/SpringImplicitService.composite b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/sca/services/SpringImplicitService.composite
new file mode 100644
index 0000000000..8ab04edc63
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/sca/services/SpringImplicitService.composite
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ name="SpringImplicitService">
+
+ <component name="ClientComponent">
+ <implementation.java class="helloworld.HelloWorldProxy"/>
+ <reference name="delegate" target="ImplicitServiceComponent"/>
+ </component>
+
+ <component name="ImplicitServiceComponent">
+ <implementation.spring location="META-INF/sca/sca-services/SpringImplicitService-context.xml"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/spring/annotations/Calculator.composite b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/spring/annotations/Calculator.composite
new file mode 100644
index 0000000000..21f89e6a1c
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/main/resources/spring/annotations/Calculator.composite
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite targetNamespace="http://sample"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:sample="http://sample"
+ name="Calculator"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
+
+ <component name="CalculatorServiceComponent">
+ <implementation.spring location="META-INF/sca/spring-annotation/CalculatorService-context.xml"/>
+ <property name="message">HelloWorld</property>
+ <reference name="addService" target="AddServiceComponent" />
+ <reference name="subtractService" target="SubtractServiceComponent" />
+ <reference name="multiplyService" target="MultiplyServiceComponent" />
+ <reference name="divideService" target="DivideServiceComponent" />
+ </component>
+
+ <component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl"/>
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <implementation.java class="calculator.SubtractServiceImpl"/>
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl"/>
+ </component>
+
+ <component name="DivideServiceComponent">
+ <implementation.java class="calculator.DivideServiceImpl"/>
+ </component>
+
+ <!--<component name="AnotherCalculatorServiceComponent">
+ <implementation.spring location="META-INF/sca/spring-annotation/CalculatorService-context.xml"/>
+ <property name="message">HelloWorld</property>
+ <reference name="addService" target="AddServiceComponent" />
+ <reference name="subtractService" target="SubtractServiceComponent" />
+ <reference name="multiplyService" target="MultiplyServiceComponent" />
+ <reference name="divideService" target="DivideServiceComponent" />
+ </component>
+
+--></composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/access/CalculatorClient.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/access/CalculatorClient.java
new file mode 100644
index 0000000000..828e94ff65
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/access/CalculatorClient.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 context.access;
+
+import org.apache.tuscany.sca.node.Client;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.node.Contribution;
+import org.springframework.context.ApplicationContext;
+
+import context.access.SCAApplicationContextProvider;
+import calculator.CalculatorService;
+
+/**
+ * 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 {
+
+ String location = ContributionLocationHelper.getContributionLocation("context/access/ContextAccess.composite");
+ Node node = NodeFactory.newInstance().createNode("context/access/ContextAccess.composite", new Contribution("c1", location));
+ node.start();
+
+ // Code: To access the Spring Application Context instance
+ ApplicationContext ctx = SCAApplicationContextProvider.getApplicationContext();
+ if (ctx.containsBean("CalculatorServiceBean"))
+ System.out.println("CalculatorServiceBean is now available for use...");
+
+ CalculatorService calculatorService =
+ ((Client)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ 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));
+
+ node.stop();
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/access/ContextAccessTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/access/ContextAccessTestCase.java
new file mode 100644
index 0000000000..5feb293bc8
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/access/ContextAccessTestCase.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 context.access;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests out the big bank service
+ *
+ */
+public class ContextAccessTestCase extends TestCase {
+
+ public void testServer() throws Exception {
+ CalculatorClient.main(new String[] {""});
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/imports/CalculatorClient.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/imports/CalculatorClient.java
new file mode 100644
index 0000000000..e9bfaa0a1d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/imports/CalculatorClient.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 context.imports;
+
+import org.apache.tuscany.sca.node.Client;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.node.Contribution;
+import calculator.CalculatorService;
+
+/**
+ * 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 {
+
+ String location = ContributionLocationHelper.getContributionLocation("context/imports/ContextImports.composite");
+ Node node = NodeFactory.newInstance().createNode("context/imports/ContextImports.composite", new Contribution("c1", location));
+ node.start();
+
+ CalculatorService calculatorService =
+ ((Client)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ 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));
+
+ node.stop();
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/imports/ContextImportsTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/imports/ContextImportsTestCase.java
new file mode 100644
index 0000000000..3940bf65fa
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/imports/ContextImportsTestCase.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 context.imports;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests out the big bank service
+ *
+ */
+public class ContextImportsTestCase extends TestCase {
+
+ public void testServer() throws Exception {
+ CalculatorClient.main(new String[] {""});
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/multiple/MultipleContextTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/multiple/MultipleContextTestCase.java
new file mode 100644
index 0000000000..75b296bf32
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/multiple/MultipleContextTestCase.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 context.multiple;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests out the big bank service
+ *
+ */
+public class MultipleContextTestCase extends TestCase {
+
+ public void testServer() throws Exception {
+ StockQuoteServer.main(new String[] {"1000"});
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/multiple/StockQuoteServer.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/multiple/StockQuoteServer.java
new file mode 100644
index 0000000000..d8ecae99bd
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/context/multiple/StockQuoteServer.java
@@ -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 context.multiple;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.springframework.context.ApplicationContext;
+import context.access.SCAApplicationContextProvider;
+
+/**
+ * This server program shows how to bootstrap SCA from a simple J2SE program
+ * and start it which activates the StockQuote Web service endpoint.
+ */
+public class StockQuoteServer {
+
+ public static void main(String[] args) throws Exception {
+
+ System.out.println("Starting the Sample SCA StockQuote Service...");
+
+ String location = ContributionLocationHelper.getContributionLocation("context/multiple/MultipleContext.composite");
+ Node node = NodeFactory.newInstance().createNode("context/multiple/MultipleContext.composite", new Contribution("c1", location));
+ node.start();
+
+ // Method 1: To access the Spring Application Context instance
+ ApplicationContext ctx = SCAApplicationContextProvider.getApplicationContext();
+ if (ctx.containsBean("StockQuoteServiceBean"))
+ System.out.println("StockQuoteServiceBean is now available for use...");
+
+ System.out.println("Press Enter to Exit...");
+ Thread.sleep(1000);
+
+ node.stop();
+ System.out.println("Bye");
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/implementation/policies/CalculatorClient.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/implementation/policies/CalculatorClient.java
new file mode 100644
index 0000000000..3f26b8c6db
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/implementation/policies/CalculatorClient.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 implementation.policies;
+
+import javax.security.auth.login.Configuration;
+import org.apache.tuscany.sca.node.Client;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import calculator.CalculatorService;
+
+
+/**
+ * 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 {
+ try {
+ Configuration secConf = Configuration.getConfiguration();
+ } catch (java.lang.SecurityException e) {
+ System.setProperty("java.security.auth.login.config", CalculatorClient.class.getClassLoader()
+ .getResource("implementation/policies/CalculatorJass.config").toString());
+ }
+
+ String location = ContributionLocationHelper.getContributionLocation("implementation/policies/ImplementationPolicies.composite");
+ Node node = NodeFactory.newInstance().createNode("implementation/policies/ImplementationPolicies.composite", new Contribution("c1", location));
+ node.start();
+
+ CalculatorService calculatorService =
+ ((Client)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ // Calculate
+ System.out.println("Calling CalculatorServiceComponent configured with 'logging' " +
+ "policy for subtract and divide operations...");
+ 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));
+
+ calculatorService =
+ ((Client)node).getService(CalculatorService.class, "AnotherCalculatorServiceComponent");
+
+ // Calculate
+ System.out.println("Calling CalculatorServiceComponent configured with 'logging' " +
+ "for all operations in the implementation...");
+ 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));
+
+ node.stop();
+ System.out.println("Bye");
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/implementation/policies/ImplementationPoliciesTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/implementation/policies/ImplementationPoliciesTestCase.java
new file mode 100644
index 0000000000..efd5fd22df
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/implementation/policies/ImplementationPoliciesTestCase.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 implementation.policies;
+
+import junit.framework.TestCase;
+
+import org.junit.Ignore;
+
+/**
+ * Tests out the big bank service
+ *
+ */
+@Ignore("TUSCANY-3027")
+public class ImplementationPoliciesTestCase extends TestCase {
+
+ public void testServer() throws Exception {
+ CalculatorClient.main(new String[] {""});
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/location/folder/SpringFolderLocationTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/location/folder/SpringFolderLocationTestCase.java
new file mode 100644
index 0000000000..88ac2e8cb5
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/location/folder/SpringFolderLocationTestCase.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 location.folder;
+
+import org.apache.tuscany.sca.itest.spring.AbstractHelloWorldTestCase;
+
+/**
+ * A test case designed to test the implementation of Properties from a Spring application
+ * context, where the properties are explicit, through the presence of an sca:property
+ * element within the Spring application context
+ *
+ * The artifacts involved in this test are:
+ *
+ * 1) A composite containing a component with a Spring implementation
+ * 2) The <implementation.spring.../> element references an application context that
+ * uses an explicit sca:property element which is used to compute the response to an invocation
+ * of the service of the implementation
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringFolderLocationTestCase extends AbstractHelloWorldTestCase {
+ // super class does it all getting composite based on this class name
+}
+
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/location/jar/SpringJarLocationTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/location/jar/SpringJarLocationTestCase.java
new file mode 100644
index 0000000000..e3600a355c
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/location/jar/SpringJarLocationTestCase.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 location.jar;
+
+import org.apache.tuscany.sca.itest.spring.AbstractHelloWorldTestCase;
+
+/**
+ * A test case designed to test the implementation of Properties from a Spring application
+ * context, where the properties are explicit, through the presence of an sca:property
+ * element within the Spring application context
+ *
+ * The artifacts involved in this test are:
+ *
+ * 1) A composite containing a component with a Spring implementation
+ * 2) The <implementation.spring.../> element references an application context that
+ * uses an explicit sca:property element which is used to compute the response to an invocation
+ * of the service of the implementation
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringJarLocationTestCase extends AbstractHelloWorldTestCase {
+ // super class does it all getting composite based on this class name
+}
+
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractHelloWorldTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractHelloWorldTestCase.java
new file mode 100644
index 0000000000..f93095e3c9
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractHelloWorldTestCase.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.spring;
+
+
+/**
+ * Basic "hello world" style test case for testing Spring component implementation
+ *
+ */
+public abstract class AbstractHelloWorldTestCase extends AbstractSCATestCase<HelloWorld> {
+
+ /**
+ * Calls the hello world service and checks that it gives the right response...
+ */
+ public void testHello() throws Exception {
+ assertEquals("Hello petra", service.sayHello("petra"));
+ }
+
+ @Override
+ protected Class<HelloWorld> getServiceClass() {
+ return HelloWorld.class;
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java
new file mode 100644
index 0000000000..605a0079fb
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.itest.spring;
+
+import junit.framework.TestCase;
+import org.apache.tuscany.sca.node.Client;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+public abstract class AbstractSCATestCase<T> extends TestCase {
+
+ protected Node node;
+ protected T service;
+
+ @Override
+ protected void setUp() throws Exception {
+ NodeFactory factory = NodeFactory.newInstance();
+ String location = ContributionLocationHelper.getContributionLocation(getCompositeName());
+ node = factory.createNode(getCompositeName(), new Contribution("c1", location));
+ node.start();
+ service = ((Client)node).getService(getServiceClass(), "ClientComponent");
+ }
+
+ abstract protected Class<T> getServiceClass();
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+ protected String getCompositeName() {
+ String className = this.getClass().getName();
+ String compositeName = className.substring(0, className.length() - 8).replace('.', '/') + ".composite";
+ System.out.println("Using composite: " + compositeName);
+ return compositeName;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorld.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorld.java
new file mode 100644
index 0000000000..e712593fe3
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorld.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.spring;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * Interface for the "hello world" service - predictably simple with a single operation
+ * "sayHello"
+ *
+ */
+@Remotable
+public interface HelloWorld {
+
+ public String sayHello(String s);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorldProxy.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorldProxy.java
new file mode 100644
index 0000000000..f75df2c75d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorldProxy.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.spring;
+
+import org.oasisopen.sca.annotation.Reference;
+
+/**
+ * A simple proxy Java class which implements the HelloWorld interface but which uses
+ * a reference "delegate" to actually provide the HelloWorld service
+ *
+ */
+public class HelloWorldProxy implements HelloWorld {
+
+ // Here is the reference "delegate" - it implements the HelloWorld interface...
+ @Reference
+ public HelloWorld delegate;
+
+ public String sayHello(String s) {
+ // Simply call the reference to satisfy the service request...
+ System.out.println("HelloWorldProxy - calling sayHello");
+ return delegate.sayHello(s);
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorldTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorldTestCase.java
new file mode 100644
index 0000000000..32cb26979e
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorldTestCase.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.itest.spring;
+
+/**
+ * A basic test case of:
+ * 1) A composite containing a component with a Spring implementation
+ * 2) The composite has a component with a Java POJO implementation which uses the
+ * Spring implementation to satisfy a reference
+ *
+ */
+public class SpringDelegationHelloWorldTestCase extends AbstractHelloWorldTestCase {
+ // super class does it all getting composite based on this class name
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringHelloWorldTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringHelloWorldTestCase.java
new file mode 100644
index 0000000000..f8f8886f9f
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringHelloWorldTestCase.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.itest.spring;
+
+/**
+ * A basic test case of:
+ * 1) A composite containing a component with a Spring implementation
+ * 2) The composite has a component with a Java POJO implementation which uses the
+ * Spring implementation to satisfy a reference
+ * 3) The Spring component delegates function to a second spring bean
+ *
+ */
+public class SpringHelloWorldTestCase extends AbstractHelloWorldTestCase {
+ // super class does it all getting composite based on this class name
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldBean.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldBean.java
new file mode 100644
index 0000000000..d9522e12a0
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldBean.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.spring;
+
+/**
+ * A simple test Spring bean which provides the HelloWorld service
+ *
+ */
+
+public class TestHelloWorldBean implements HelloWorld {
+
+ static String hello = "Hello ";
+
+ // Classic "Hello xxx" response to any input message
+ public String sayHello(String message) {
+ System.out.println("TestHelloWorldBean - sayHello called");
+ return (hello + message);
+ }
+
+} // end class TestHelloWorldBean
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldDelegatorBean.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldDelegatorBean.java
new file mode 100644
index 0000000000..1ad1779ee2
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldDelegatorBean.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.spring;
+
+/**
+ * A simple test Spring bean which delgates to another bean
+ *
+ */
+
+public class TestHelloWorldDelegatorBean implements HelloWorld {
+
+ HelloWorld delegate;
+
+ public void setDelegate(HelloWorld delegate) {
+ this.delegate = delegate;
+ }
+
+ // Classic "Hello xxx" response to any input message
+ public String sayHello(String message) {
+ System.out.println("TestHelloWorldDelegatorBean - sayHello called");
+ return delegate.sayHello(message);
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/sca/references/SpringExplicitReferenceTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/sca/references/SpringExplicitReferenceTestCase.java
new file mode 100644
index 0000000000..9bc12c3e7b
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/sca/references/SpringExplicitReferenceTestCase.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 sca.references;
+
+import org.apache.tuscany.sca.itest.spring.AbstractHelloWorldTestCase;
+
+/**
+ * A test case designed to test the implementation of References from a Spring application
+ * context, where the references are explicit, through the presence of an sca:reference
+ * element within the Spring application context
+ *
+ * The artifacts involved in this test are:
+ *
+ * 1) A composite containing a component with a Spring implementation which makes
+ * a reference to a second component
+ * 2) The composite has a component with a Java POJO implementation which satisfies the reference
+ * 3) The <implementation.spring.../> element references an application context that
+ * uses an explicit sca:reference element to identify the reference made by the Spring application
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringExplicitReferenceTestCase extends AbstractHelloWorldTestCase {
+ // super class does it all getting composite based on this class name
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/sca/references/SpringImplicitReferenceTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/sca/references/SpringImplicitReferenceTestCase.java
new file mode 100644
index 0000000000..52ea64a3ed
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/sca/references/SpringImplicitReferenceTestCase.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 sca.references;
+
+import org.apache.tuscany.sca.itest.spring.AbstractHelloWorldTestCase;
+
+/**
+ * A test case designed to test the implementation of References from a Spring application
+ * context, where the references are implicit, through the presence of Bean properties with a
+ * ref attribute which is not satisfied by a Bean within the application context.
+ *
+ * The artifacts involved in this test are:
+ *
+ * 1) A composite containing a component with a Spring implementation which makes
+ * a reference to a second component
+ * 2) The composite has a component with a Java POJO implementation which satisfies the reference
+ * 3) The <implementation.spring.../> element references an application context that
+ * does not use an explicit sca:reference element to identify the reference made by the
+ * Spring application, but relies on an unsatisfied Bean property with a ref attribute.
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringImplicitReferenceTestCase extends AbstractHelloWorldTestCase {
+ // super class does it all getting composite based on this class name
+}
+
+
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/sca/services/SpringExplicitServiceTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/sca/services/SpringExplicitServiceTestCase.java
new file mode 100644
index 0000000000..35f44b2af7
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/sca/services/SpringExplicitServiceTestCase.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 sca.services;
+
+import org.apache.tuscany.sca.itest.spring.AbstractHelloWorldTestCase;
+
+/**
+ * A basic test case of:
+ * 1) A composite containing a component with a Spring implementation
+ * 2) The composite has a component with a Java POJO implementation which uses the
+ * Spring implementation to satisfy a reference
+ * 3) The <implementation.spring.../> element references an application context that
+ * uses an explicit sca: element to identify the service offered by the Spring application
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringExplicitServiceTestCase extends AbstractHelloWorldTestCase {
+ // super class does it all getting composite based on this class name
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/sca/services/SpringImplicitServiceTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/sca/services/SpringImplicitServiceTestCase.java
new file mode 100644
index 0000000000..488bdcb202
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/sca/services/SpringImplicitServiceTestCase.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 sca.services;
+
+import org.apache.tuscany.sca.itest.spring.AbstractHelloWorldTestCase;
+
+/**
+ * A basic test case of:
+ * 1) A composite containing a component with a Spring implementation
+ * 2) The composite has a component with a Java POJO implementation which uses the
+ * Spring implementation to satisfy a reference
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringImplicitServiceTestCase extends AbstractHelloWorldTestCase {
+ // super class does it all getting composite based on this class name
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/spring/annotations/CalculatorClient.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/spring/annotations/CalculatorClient.java
new file mode 100644
index 0000000000..5a5056d91e
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/spring/annotations/CalculatorClient.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 spring.annotations;
+
+import org.apache.tuscany.sca.node.Client;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import calculator.CalculatorService;
+
+
+/**
+ * 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 {
+
+ String location = ContributionLocationHelper.getContributionLocation("spring/annotations/Calculator.composite");
+ Node node = NodeFactory.newInstance().createNode("spring/annotations/Calculator.composite", new Contribution("c1", location));
+ node.start();
+
+ CalculatorService calculatorService =
+ ((Client)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ 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));
+
+ /*calculatorService =
+ ((SCAClient)node).getService(CalculatorService.class, "AnotherCalculatorServiceComponent");
+
+ 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));*/
+
+ node.stop();
+ System.out.println("Bye");
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/spring/annotations/SpringAnnotationsTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/spring/annotations/SpringAnnotationsTestCase.java
new file mode 100644
index 0000000000..3a9ec4bbb2
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/implementation-spring/src/test/java/spring/annotations/SpringAnnotationsTestCase.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 spring.annotations;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests out the big bank service
+ *
+ */
+public class SpringAnnotationsTestCase extends TestCase {
+
+ public void testServer() throws Exception {
+ CalculatorClient.main(new String[] {""});
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/interfaces/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/pom.xml
new file mode 100644
index 0000000000..99817cb3cf
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-interfaces</artifactId>
+ <name>Apache Tuscany SCA iTest Interface</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalCallbackInterface.java b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalCallbackInterface.java
new file mode 100644
index 0000000000..f4131593d5
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalCallbackInterface.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.interfaces;
+
+/**
+ * only for callBack
+ */
+public interface LocalCallbackInterface {
+
+ void callbackMethod(String str);
+
+ void modifyParameter(ParameterObject po);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponent.java b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponent.java
new file mode 100644
index 0000000000..5fc9ed51b3
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponent.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.interfaces;
+
+import org.oasisopen.sca.annotation.OneWay;
+
+/*
+ * itest for interface: local,method-overloading
+ */
+public interface LocalClientComponent {
+
+ String foo1(ParameterObject po);
+
+ String foo1(String str) throws Exception;
+
+ String foo2(String str, int i);
+
+ String foo2(int i, String str) throws Exception;
+
+ void callback(String str);
+
+ void callModifyParameter();
+
+ @OneWay
+ void onewayMethod(String str);
+
+ String getCallbackValue();
+
+ String getOnewayValue();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java
new file mode 100644
index 0000000000..6cd937af12
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.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.interfaces;
+
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(LocalClientComponent.class)
+public class LocalClientComponentImpl implements LocalClientComponent, LocalCallbackInterface {
+
+ @Reference
+ protected LocalServiceComponent aCallBackService;
+ private static String callbackValue;
+ private static String onewayValue;
+
+ public String foo1(ParameterObject po) {
+ po.field1 = "AComponent";
+ return "AComponent";
+ }
+
+ public String foo1(String str) throws Exception {
+ return str + "AComponent";
+ }
+
+ public String foo2(String str, int i) {
+ return str + "AComponent" + i;
+ }
+
+ public String foo2(int i, String str) throws Exception {
+ return str + "AComponent" + i;
+ }
+
+ public void callback(String str) {
+ aCallBackService.callback(str);
+ }
+
+ public void callbackMethod(String str) {
+ callbackValue = str;
+ }
+
+ public void callModifyParameter() {
+ this.aCallBackService.modifyParameter();
+ }
+
+ public String getCallbackValue() {
+ return callbackValue;
+ }
+
+ public void onewayMethod(String str) {
+ onewayValue = str;
+ try {
+ Thread.sleep(200);
+ } catch (Exception e) {
+ //do nothing
+ }
+ }
+
+ public String getOnewayValue() {
+ return onewayValue;
+ }
+
+ public void modifyParameter(ParameterObject po) {
+ po.field1 = "AComponent";
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponent.java b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponent.java
new file mode 100644
index 0000000000..05a9d09bdd
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponent.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.itest.interfaces;
+
+import org.oasisopen.sca.annotation.Callback;
+
+/**
+ * Local be-directional callBackService
+ */
+@Callback(LocalCallbackInterface.class)
+public interface LocalServiceComponent {
+
+ String foo(String str);
+
+ void callback(String str);
+
+ void modifyParameter();
+
+ ParameterObject getPO();
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponentImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponentImpl.java
new file mode 100644
index 0000000000..ab0b18191c
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponentImpl.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.interfaces;
+
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(LocalServiceComponent.class)
+public class LocalServiceComponentImpl implements LocalServiceComponent {
+
+ @Callback
+ protected LocalCallbackInterface callback;
+
+ private static ParameterObject po;
+
+ public void callback(String str) {
+ callback.callbackMethod(str);
+ }
+
+ public void modifyParameter() {
+ po = new ParameterObject("CallBack");
+ callback.modifyParameter(po);
+ }
+
+ public String foo(String str) {
+ return str;
+ }
+
+ public ParameterObject getPO() {
+ return po;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.java b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.java
new file mode 100644
index 0000000000..724d94dffb
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.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.interfaces;
+
+import java.io.Serializable;
+
+public class ParameterObject implements Serializable {
+ private static final long serialVersionUID = 1L;
+ public String field1;
+
+ public ParameterObject() {
+ this.field1 = null;
+ }
+
+ public ParameterObject(String field1) {
+ this.field1 = field1;
+ }
+
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (o instanceof ParameterObject) {
+ ParameterObject other = (ParameterObject)o;
+ if (field1 != null) {
+ return field1.equals(other.field1);
+ }
+ }
+ return false;
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteCallbackInterface.java b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteCallbackInterface.java
new file mode 100644
index 0000000000..be3fa4c15a
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteCallbackInterface.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.itest.interfaces;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * only for callBack
+ */
+@Remotable
+public interface RemoteCallbackInterface {
+
+ void callbackMethod(String str);
+
+ void modifyParameter(ParameterObject po);
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponent.java b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponent.java
new file mode 100644
index 0000000000..9f34dfd274
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponent.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.
+ */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.interfaces;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/*
+ * different signatures
+ */
+
+@Remotable
+public interface RemoteClientComponent {
+
+ String foo1(ParameterObject po);
+
+ String foo3(ParameterObject po);
+
+ String foo2(int i, String str1) throws Exception;
+
+ void callback(String str);
+
+ void callModifyParameter();
+
+ String getCallbackValue();
+
+ void onewayMethod(String str);
+
+ String getOnewayValue();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponentImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponentImpl.java
new file mode 100644
index 0000000000..541b1f1508
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponentImpl.java
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.itest.interfaces;
+
+import org.oasisopen.sca.annotation.AllowsPassByReference;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(RemoteClientComponent.class)
+public class RemoteClientComponentImpl implements RemoteClientComponent, RemoteCallbackInterface {
+
+ @Reference
+ protected RemoteServiceComponent aCallBackService;
+ private static String callbackValue;
+ private static String onewayValue;
+
+ public String foo1(ParameterObject po) {
+ po.field1 = "BComponent";
+ return "BComponent";
+ }
+
+ @AllowsPassByReference
+ public String foo3(ParameterObject po) {
+ po.field1 = "BComponent";
+ return "BComponent";
+ }
+
+ public String foo2(int i, String str) throws Exception {
+ return str + "BComponent" + i;
+ }
+
+ public void callback(String str) {
+ aCallBackService.callback(str);
+ }
+
+ public void callModifyParameter() {
+ this.aCallBackService.modifyParameter();
+ }
+
+ public void callbackMethod(String str) {
+ callbackValue = str;
+ }
+
+ public String getCallbackValue() {
+ return callbackValue;
+ }
+
+ public void onewayMethod(String str) {
+ onewayValue = str;
+ try {
+ Thread.sleep(200);
+ } catch (Exception e) {
+ //do nothing
+ }
+ }
+
+ public String getOnewayValue() {
+ return onewayValue;
+ }
+
+ public void modifyParameter(ParameterObject po) {
+ po.field1 = "BComponent";
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponent.java b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponent.java
new file mode 100644
index 0000000000..b29b298ab6
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponent.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.interfaces;
+
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+@Callback(RemoteCallbackInterface.class)
+public interface RemoteServiceComponent {
+
+ String foo(String str);
+
+ void callback(String str);
+
+ void modifyParameter();
+
+ ParameterObject getPO();
+
+ String[] bar(int[][] intArray);
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponentImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponentImpl.java
new file mode 100644
index 0000000000..00a0f5645b
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponentImpl.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.interfaces;
+
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(RemoteServiceComponent.class)
+public class RemoteServiceComponentImpl implements RemoteServiceComponent {
+
+ @Callback
+ protected RemoteCallbackInterface callback;
+
+ private static ParameterObject po;
+
+ public void callback(String str) {
+ callback.callbackMethod(str);
+ }
+
+ public void modifyParameter() {
+ po = new ParameterObject("CallBack");
+ callback.modifyParameter(po);
+ }
+
+ public String foo(String str) {
+ return str;
+ }
+
+ public ParameterObject getPO() {
+ return po;
+ }
+
+ public String[] bar(int[][] intArray) {
+ return new String[] {"int"};
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/resources/InterfacesTest.composite b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/resources/InterfacesTest.composite
new file mode 100644
index 0000000000..8b3d0e8f63
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/main/resources/InterfacesTest.composite
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:foo="http://foo" targetNamespace="http://foo"
+ name="InterfacesTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <component name="LocalClientComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.interfaces.LocalClientComponentImpl" />
+ <reference name="aCallBackService" target="LocalServiceComponent" />
+ </component>
+
+ <component name="RemoteClientComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.interfaces.RemoteClientComponentImpl" />
+ <reference name="aCallBackService" target="RemoteServiceComponent" />
+ </component>
+
+ <component name="LocalServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.interfaces.LocalServiceComponentImpl" />
+ </component>
+
+ <component name="RemoteServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.interfaces.RemoteServiceComponentImpl" />
+ </component>
+
+</composite> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InterfacesTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InterfacesTestCase.java
new file mode 100644
index 0000000000..57ba18d0d6
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InterfacesTestCase.java
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.interfaces;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class InterfacesTestCase {
+ private static Node node;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("InterfacesTest.composite");
+ node = NodeFactory.newInstance().createNode("InterfacesTest.composite", new Contribution("c1", location));
+ node.start();
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void testLocalClient() {
+ LocalServiceComponent service = node.getService(LocalServiceComponent.class, "LocalServiceComponent");
+ LocalClientComponent local = node.getService(LocalClientComponent.class, "LocalClientComponent");
+
+ try {
+ ParameterObject po = new ParameterObject();
+ assertEquals("AComponent", local.foo1(po));
+ assertEquals("AComponent", po.field1);
+
+ assertEquals("AAComponent", local.foo1("A"));
+
+ assertEquals("AAComponent1", local.foo2("A", 1));
+ assertEquals("AAComponent1", local.foo2(1, "A"));
+ } catch (Exception e) {
+ fail();
+ }
+
+ try {
+ // test local callback
+ local.callback("CallBack");
+ Thread.sleep(100);
+ assertEquals("CallBack", local.getCallbackValue());
+
+ local.callModifyParameter();
+ Thread.sleep(100);
+ assertEquals("AComponent", service.getPO().field1);
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("CallBack failed");
+ }
+
+ try {
+ local.onewayMethod("OneWay");
+ Thread.sleep(100);
+ assertEquals("OneWay", local.getOnewayValue());
+ } catch (Exception e) {
+ fail("OneWay failed");
+ }
+ }
+
+ @Test
+ public void testRemoteClient() {
+ RemoteServiceComponent service = node.getService(RemoteServiceComponent.class, "RemoteServiceComponent");
+ RemoteClientComponent remote = node.getService(RemoteClientComponent.class, "RemoteClientComponent");
+
+ try {
+ // Test Pass By Value
+ ParameterObject po = new ParameterObject("NotBComponent");
+ assertEquals("BComponent", remote.foo1(po));
+ assertEquals("NotBComponent", po.field1);
+
+ assertEquals("BBComponent1", remote.foo2(1, "B"));
+
+ // Test allowsPassByReference
+ assertEquals("BComponent", remote.foo3(po));
+ assertEquals("BComponent", po.field1);
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail();
+ }
+
+ try {
+ remote.callback("CallBack");
+ Thread.sleep(100);
+ assertEquals("CallBack", remote.getCallbackValue());
+
+ remote.callModifyParameter();
+ Thread.sleep(100);
+ assertEquals("CallBack", service.getPO().field1);
+ } catch (Exception e) {
+ fail("CallBack failed");
+ }
+
+ try {
+ remote.onewayMethod("OneWay");
+ Thread.sleep(100);
+ assertEquals("OneWay", remote.getOnewayValue());
+ } catch (Exception e) {
+ fail("OneWay failed");
+ }
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-client/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-client/pom.xml
new file mode 100644
index 0000000000..ec124f23f7
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-client/pom.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-helloworld-client</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes Helloworld Client</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-nodes-helloworld-iface</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-M3</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java
new file mode 100644
index 0000000000..a8e74be096
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-client/src/main/java/itest/nodes/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 itest.nodes;
+
+import org.oasisopen.sca.annotation.Reference;
+
+public class HelloworldImpl implements Helloworld {
+
+ @Reference
+ public Helloworld service;
+
+ public String sayHello(String name) {
+ return "Hi " + service.sayHello(name);
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-client/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-client/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..d55aa7ba9c
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-client/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:itest="http://itest">
+ <deployable composite="itest:HelloworldClient"/>
+</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-client/src/main/resources/helloworld-client.composite b/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-client/src/main/resources/helloworld-client.composite
new file mode 100644
index 0000000000..81a3fa1f2d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-client/src/main/resources/helloworld-client.composite
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://itest"
+ name="HelloworldClient">
+
+ <component name="HelloworldClient">
+ <implementation.java class="itest.nodes.HelloworldImpl"/>
+ <reference name="service" target="HelloworldService"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-iface/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-iface/pom.xml
new file mode 100644
index 0000000000..7ee22a320d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-iface/pom.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-helloworld-iface</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes Helloworld IFaces</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-M3</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java b/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java
new file mode 100644
index 0000000000..d49ebc2cef
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.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 itest.nodes;
+
+public interface Helloworld {
+
+ String sayHello(String name);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-service/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-service/pom.xml
new file mode 100644
index 0000000000..24c4299f35
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-service/pom.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-helloworld-service</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes Helloworld Service</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-nodes-helloworld-iface</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-M3</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-service/src/main/java/itest/nodes/HelloworldImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-service/src/main/java/itest/nodes/HelloworldImpl.java
new file mode 100644
index 0000000000..20233b0397
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-service/src/main/java/itest/nodes/HelloworldImpl.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 itest.nodes;
+
+public class HelloworldImpl implements Helloworld {
+
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-service/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-service/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..9c68ffd043
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-service/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:itest="http://itest">
+ <deployable composite="itest:HelloworldService"/>
+</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-service/src/main/resources/helloworld-service.composite b/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-service/src/main/resources/helloworld-service.composite
new file mode 100644
index 0000000000..95d78b1983
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/nodes/helloworld-service/src/main/resources/helloworld-service.composite
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://itest"
+ name="HelloworldService">
+
+ <component name="HelloworldService">
+ <implementation.java class="itest.nodes.HelloworldImpl"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/nodes/one-node-test/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/nodes/one-node-test/pom.xml
new file mode 100644
index 0000000000..2b73398afe
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/nodes/one-node-test/pom.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-one-nodes-test</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes One Nodes Test</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-nodes-helloworld-iface</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java
new file mode 100644
index 0000000000..63ddc789db
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.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 itest;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.File;
+
+import itest.nodes.Helloworld;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class OneNodeTestCase{
+
+ private static Node node;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled", "false");
+ NodeFactory factory = NodeFactory.newInstance();
+ node = factory.createNode(
+ new Contribution("service", getJar("../helloworld-service/target")),
+ new Contribution("client", getJar("../helloworld-client/target")));
+ node.start();
+ }
+
+ /**
+ * Get the jar in the target folder without being dependent on the version name to
+ * make tuscany releases easier
+ */
+ private static String getJar(String targetDirectory) {
+ File f = new File(targetDirectory);
+ for (File file : f.listFiles()) {
+ if (file.getName().endsWith(".jar")) {
+ return file.toURI().toString();
+ }
+ }
+ throw new IllegalStateException("Can't find jar in: " + targetDirectory);
+ }
+
+ @Test
+ public void testCalculator() throws Exception {
+
+ // Ideally this would use the SCAClient API but leaving that tillwe have the basics working
+
+ Helloworld service = node.getService(Helloworld.class, "HelloworldService");
+ assertNotNull(service);
+ assertEquals("Hello Petra", service.sayHello("Petra"));
+
+ Helloworld client = node.getService(Helloworld.class, "HelloworldClient");
+ assertNotNull(client);
+ assertEquals("Hi Hello Petra", client.sayHello("Petra"));
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (node != null) {
+ node.stop();
+ }
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/nodes/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/nodes/pom.xml
new file mode 100644
index 0000000000..9d153681ed
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/nodes/pom.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <packaging>pom</packaging>
+ <artifactId>itest-nodes</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes</name>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ </build>
+
+ <modules>
+ <module>helloworld-iface</module>
+ <module>helloworld-service</module>
+ <module>helloworld-client</module>
+ <module>one-node-test</module>
+ <module>two-nodes-test</module>
+ </modules>
+
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/nodes/two-nodes-test/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/nodes/two-nodes-test/pom.xml
new file mode 100644
index 0000000000..6436ea09dc
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/nodes/two-nodes-test/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-two-nodes-test</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes Two Nodes Test</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-nodes-helloworld-iface</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-client-impl</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java
new file mode 100644
index 0000000000..8352f70e17
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package itest;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import itest.nodes.Helloworld;
+
+import java.io.File;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.oasisopen.sca.client.SCAClient;
+import org.oasisopen.sca.client.SCAClientFactory;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class TwoNodesTestCase{
+
+ private static Node serviceNode;
+ private static Node clientNode;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled", "false");
+ NodeFactory factory = NodeFactory.newInstance();
+ serviceNode = factory.createNode(new Contribution("service", getJar("../helloworld-service/target")));
+ serviceNode.start();
+ clientNode = factory.createNode(new Contribution("client", getJar("../helloworld-client/target")));
+ clientNode.start();
+ }
+
+ /**
+ * Get the jar in the target folder without being dependent on the version name to
+ * make tuscany releases easier
+ */
+ private static String getJar(String targetDirectory) {
+ File f = new File(targetDirectory);
+ for (File file : f.listFiles()) {
+ if (file.getName().endsWith(".jar")) {
+ return file.toURI().toString();
+ }
+ }
+ throw new IllegalStateException("Can't find jar in: " + targetDirectory);
+ }
+
+ @Test
+ public void testCalculator() throws Exception {
+ Helloworld service = serviceNode.getService(Helloworld.class, "HelloworldService");
+ assertNotNull(service);
+ assertEquals("Hello Petra", service.sayHello("Petra"));
+
+ Helloworld client = clientNode.getService(Helloworld.class, "HelloworldClient");
+ assertNotNull(client);
+ assertEquals("Hi Hello Petra", client.sayHello("Petra"));
+ }
+
+ @Test
+ public void testCalculatorClientAPI() throws Exception {
+ SCAClient scaClient = SCAClientFactory.newInstance();
+ Helloworld service = scaClient.getService(Helloworld.class, "HelloworldService", null);
+ assertNotNull(service);
+ assertEquals("Hello Petra", service.sayHello("Petra"));
+
+ Helloworld client = scaClient.getService(Helloworld.class, "HelloworldClient", null);
+ assertNotNull(client);
+ assertEquals("Hi Hello Petra", client.sayHello("Petra"));
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (serviceNode != null) {
+ serviceNode.stop();
+ }
+ if (clientNode != null) {
+ clientNode.stop();
+ }
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/pom.xml
new file mode 100644
index 0000000000..c72ca0ee2e
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-operation-overloading</artifactId>
+ <name>Apache Tuscany SCA iTest Operation Overloading</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/OverloadASourceTarget.java b/tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/OverloadASourceTarget.java
new file mode 100644
index 0000000000..1f589b44f4
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/OverloadASourceTarget.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 org.apache.tuscany.sca.test.opoverload;
+
+/**
+ * This is an Interface which has methods declared but not implemented, These methods will be implemented in
+ * OverloadATarget Class and OverloadASource This class has methods with overloaded parameters.
+ */
+
+//@AllowsPassByReference
+public interface OverloadASourceTarget {
+ String opName = "operationA:";
+
+ /**
+ * Method with no parameters
+ */
+ String operationA();
+
+ /**
+ * Method with one integer parameter
+ */
+ String operationA(int parm1);
+
+ /**
+ * Method with one integer parameter and one string parameter
+ */
+ String operationA(int parm1, String parm2);
+
+ /**
+ * Method with one one string parameter and one integer parameter
+ */
+ String operationA(String parm1, int parm2);
+
+ /**
+ * Method with one string parameter
+ */
+ String operationA(String string);
+
+ /**
+ * Method which throws an illegal argument exception in case of any exceptions.
+ */
+ String[] operationAall();
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadASource.java b/tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadASource.java
new file mode 100644
index 0000000000..a30d3611fb
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadASource.java
@@ -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 org.apache.tuscany.sca.test.opoverload.impl;
+
+import java.util.ArrayList;
+
+import org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * This class Implements the interface OverloadASourceTarget, and gives implementation for all methods which are
+ * declared in the OverloadASourceTarget interface.
+ */
+@Service(OverloadASourceTarget.class)
+public class OverloadASource implements OverloadASourceTarget {
+ public OverloadASourceTarget overloadASourceTarget;
+
+ /**
+ * This is a default constructor
+ */
+ public OverloadASource() {
+
+ }
+
+ /**
+ * @return
+ * @see org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget#operationA()
+ */
+ public String[] operationAall() {
+ assert overloadASourceTarget != null : "reference overloadASourceTarget is null";
+ ArrayList<String> ret = new ArrayList<String>();
+ ret.add(overloadASourceTarget.operationA());
+ ret.add(overloadASourceTarget.operationA(11));
+ ret.add(overloadASourceTarget.operationA("eleven"));
+ ret.add(overloadASourceTarget.operationA(3, "three"));
+ ret.add(overloadASourceTarget.operationA("four", 4));
+ return (String[])ret.toArray(new String[ret.size()]);
+ }
+
+ /**
+ * @return
+ * @see org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget#operationA()
+ */
+ public String operationA() {
+ assert overloadASourceTarget != null : "reference overloadASourceTarget is null";
+ return overloadASourceTarget.operationA();
+ }
+
+ /**
+ * @param parm1
+ * @return
+ * @see org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget#operationA(int)
+ */
+ public String operationA(int parm1) {
+ assert overloadASourceTarget != null : "reference overloadASourceTarget is null";
+ return overloadASourceTarget.operationA(parm1);
+ }
+
+ /**
+ * @param parm1
+ * @param parm2
+ * @return
+ * @see org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget#operationA(int, java.lang.String)
+ */
+ public String operationA(int parm1, String parm2) {
+ assert overloadASourceTarget != null : "reference overloadASourceTarget is null";
+ return overloadASourceTarget.operationA(parm1, parm2);
+ }
+
+ public String operationA(String string) {
+ assert overloadASourceTarget != null : "reference overloadASourceTarget is null";
+ return overloadASourceTarget.operationA(string);
+ }
+
+ /**
+ * @param parm1
+ * @param parm2
+ * @return
+ * @see org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget#operationA(java.lang.String, int)
+ */
+ public String operationA(String parm1, int parm2) {
+ assert overloadASourceTarget != null : "reference overloadASourceTarget is null";
+ return overloadASourceTarget.operationA(parm1, parm2);
+ }
+
+ /**
+ * This method which is used by all the overloaded functions to set the source target
+ */
+ @Reference
+ public void setOverloadASourceTarget(OverloadASourceTarget overloadASourceTarget) {
+ assert overloadASourceTarget != null : "reference overloadASourceTarget is set tonull";
+ this.overloadASourceTarget = overloadASourceTarget;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATarget.java b/tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATarget.java
new file mode 100644
index 0000000000..9ec60eb78f
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATarget.java
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.opoverload.impl;
+
+import org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget;
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * This class Implements the interface OverloadASourceTarget, and gives implementation for all methods which are
+ * declared in the OverloadASourceTarget interface.
+ */
+@Service(OverloadASourceTarget.class)
+public class OverloadATarget implements OverloadASourceTarget {
+
+ /**
+ * This is a default Constructor
+ */
+ public OverloadATarget() {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget#operationA(int)
+ */
+ public String operationA(int parm1) {
+ final String ret = opName + parm1;
+ out(ret);
+ return ret;
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget#operationA(int, java.lang.String)
+ */
+ public String operationA(int parm1, String parm2) {
+ final String ret = opName + parm1 + parm2;
+ out(ret);
+ return ret;
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget#operationA()
+ */
+ public String operationA() {
+ out(opName);
+ return opName;
+
+ }
+
+ public String operationA(String parm1, int parm2) {
+ final String ret = opName + parm1 + parm2;
+ out(ret);
+ return ret;
+ }
+
+ public String operationA(String parm1) {
+ final String ret = opName + parm1;
+ out(ret);
+ return ret;
+ }
+
+ /**
+ * This method is used to print the message returned by all the overloaded functions
+ */
+ private void out(String msg) {
+
+ java.lang.System.out.println(msg);
+ }
+
+ public String[] operationAall() {
+ throw new IllegalArgumentException("not supported");
+
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/src/main/resources/OperationOverload.composite b/tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/src/main/resources/OperationOverload.composite
new file mode 100644
index 0000000000..cbf5aa2078
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/src/main/resources/OperationOverload.composite
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://foo"
+ xmlns:foo="http://foo"
+ name="OperationOverload">
+
+ <component name="OverloadASourceComponent">
+ <implementation.java class="org.apache.tuscany.sca.test.opoverload.impl.OverloadASource" />
+ <reference name="overloadASourceTarget" target="OverloadATargetComponent"/>
+ </component>
+
+ <component name="OverloadATargetComponent">
+ <implementation.java class="org.apache.tuscany.sca.test.opoverload.impl.OverloadATarget" />
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/src/test/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/src/test/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATestCase.java
new file mode 100644
index 0000000000..62e5c14ce2
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/operation-overloading/src/test/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATestCase.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.opoverload.impl;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+public class OverloadATestCase {
+
+ private static Node node;
+ private static OverloadASourceTarget overloadA;
+
+ /**
+ * Method prefixed with 'test' is a test method where testing logic is written using various assert methods. This
+ * test verifies the values compared are same as the values retrieved from the SCA runtime.
+ */
+ @Test
+ public void testOperationAall() {
+ String[] result = overloadA.operationAall();
+ assertEquals(5, result.length);
+ assertEquals(OverloadASourceTarget.opName, result[0]);
+ assertEquals(OverloadASourceTarget.opName + 11, result[1]);
+ assertEquals(OverloadASourceTarget.opName + "eleven", result[2]);
+ assertEquals(OverloadASourceTarget.opName + 3 + "three", result[3]);
+ assertEquals(OverloadASourceTarget.opName + "four" + 4, result[4]);
+ }
+
+ @Test
+ public void testOperationAInt() {
+ String result = overloadA.operationA(29);
+ assertEquals(OverloadASourceTarget.opName + 29, result);
+ }
+
+ @Test
+ public void testOperationAString() {
+ String result = overloadA.operationA("rick:-)");
+ assertEquals(OverloadASourceTarget.opName + "rick:-)", result);
+ }
+
+ @Test
+ public void testOperationAIntString() {
+ String result = overloadA.operationA(123, "Tuscany");
+ assertEquals(OverloadASourceTarget.opName + 123 + "Tuscany", result);
+ }
+
+ @Test
+ public void testOperationStringInt() {
+ String result = overloadA.operationA("StringInt", 77);
+ assertEquals(OverloadASourceTarget.opName + "StringInt" + 77, result);
+ }
+
+ /**
+ * 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 node, to start the SCA node and
+ * to get a reference to the contribution service
+ */
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("OperationOverload.composite");
+ node = NodeFactory.newInstance().createNode("OperationOverload.composite", new Contribution("c1", location));
+ node.start();
+ overloadA = node.getService(OverloadASourceTarget.class, "OverloadASourceComponent");
+ }
+
+ /**
+ * tearDown() is a method in JUnit Frame Work which is executed after all other methods in the class extending
+ * unit.framework.TestCase. So this method is used to close the SCA node.
+ */
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ node.stop();
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/pom.xml
new file mode 100644
index 0000000000..89fbb2b4c6
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/pom.xml
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-itest</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Integration Tests</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <!--module>builder</module-->
+ <module>callback-api</module>
+ <module>callback-basic</module>
+ <module>callback-basic-ws</module>
+ <module>callback-complex-type</module>
+ <module>callback-multiple-wires</module>
+ <module>callback-separatethread</module>
+
+ <!-- not supported in OASIS
+ <module>callback-id</module>
+ <module>callback-set-callback</module>
+ <module>callback-set-conversation</module>
+ <module>conversations</module>
+ -->
+ <module>component-type</module>
+ <module>contribution-folder</module>
+ <module>contribution-zip</module>
+
+ <!--module>definitions-multiple</module-->
+ <module>distribution</module>
+ <module>exceptions</module>
+ <module>implementation-spring</module>
+ <module>interfaces</module>
+ <module>nodes</module>
+<!--
+ <module>operation-overloading</module>
+-->
+ <!-- wait until databinding-sdo is in
+ <module>properties</module>
+ -->
+ <module>recursive-multi-level</module>
+ <module>references</module>
+ <module>scaclient-api</module>
+ <module>scopes</module>
+ <module>services</module>
+ <module>wires</module>
+ </modules>
+ </profile>
+
+ <profile>
+ <id>old</id>
+ <modules>
+ <module>bpel</module>
+ <module>builder</module>
+ <module>callablereferences</module>
+ <module>callablereferences-ws</module>
+ <module>callback-api</module>
+ <module>callback-basic</module>
+ <module>callback-complex-type</module>
+ <module>callback-id</module>
+ <module>callback-multiple-wires</module>
+ <module>callback-separatethread</module>
+ <module>callback-set-callback</module>
+ <module>callback-set-conversation</module>
+ <module>component-type</module>
+ <module>contribution</module>
+ <!--
+ <module>contribution-classloader</module>
+ -->
+ <module>contribution-import-export</module>
+ <module>conversations</module>
+ <module>conversations-ws</module>
+ <module>corba</module>
+ <module>databindings</module>
+ <module>exceptions</module>
+ <module>exceptions-cross-binding</module>
+ <module>exceptions-cross-binding-ws</module>
+ <module>exceptions-simple-ws</module>
+ <module>extended-api</module>
+ <module>interfaces</module>
+ <!--
+ <module>interop-soap-client</module>
+ <module>interop-soap-round2-client</module>
+ <module>interop-soap-service</module>
+ -->
+ <module>jms</module>
+ <module>jms-args</module>
+ <module>jms-callbacks</module>
+ <module>jms-definitions</module>
+ <module>jms-format</module>
+ <module>jms-selectors</module>
+ <module>large-sdo-ws</module>
+ <module>late-reference-resolution</module>
+ <module>oneway</module>
+ <module>operation-overloading</module>
+ <!--
+ <module>osgi-implementation</module>
+ <module>osgi-contribution</module>
+ -->
+ <module>policy</module>
+ <module>policy-security</module>
+ <module>policy-security-basicauth</module>
+ <module>policy-security-jsr250</module>
+ <module>policy-security-token</module>
+ <!--
+ <module>promotion-interface-missmatch</module>
+ -->
+ <module>properties</module>
+ <module>recursive</module>
+ <module>recursive-multi-level</module>
+ <module>recursive-ws</module>
+ <module>references</module>
+ <module>scopes</module>
+ <module>serialization</module>
+ <module>services</module>
+ <module>spring</module>
+ <module>transaction</module>
+ <module>validation</module>
+ <module>wires</module>
+ <module>wsdl</module>
+ <module>wsdl2java</module>
+ <module>wsdlless</module>
+ <module>wsdl-multiple</module>
+ <module>ws-void-args-return</module>
+ </modules>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/properties/pom.xml
new file mode 100644
index 0000000000..1ba7bc62aa
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/pom.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-properties</artifactId>
+ <name>Apache Tuscany SCA iTest Properties</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- XPathFactory -->
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.7.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core-databinding</artifactId>
+ <version>2.0-M3</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-sdo</artifactId>
+ <version>2.0-M3</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-jaxb</artifactId>
+ <version>2.0-M3</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-plugin</artifactId>
+ <version>1.1.1</version>
+ <executions>
+ <execution>
+ <id>generate-customer-sdo</id>
+ <phase>generate-sources</phase>
+ <configuration>
+ <schemaFile>${basedir}/src/main/resources/customer.xsd</schemaFile>
+ <javaPackage>com.example.customer.sdo</javaPackage>
+ <noNotification>true</noNotification>
+ <noContainer>true</noContainer>
+ <noUnsettable>true</noUnsettable>
+ </configuration>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/mysca/test/myservice/impl/MyService.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/mysca/test/myservice/impl/MyService.java
new file mode 100644
index 0000000000..b0fd64c9da
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/mysca/test/myservice/impl/MyService.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 mysca.test.myservice.impl;
+
+public interface MyService {
+ /**
+ * This is a method to get the location property value from the sca runtime environment. It is implemented in the
+ * class MyServiceImpl
+ */
+ String getLocation();
+
+ /**
+ * This is a method to get the year property value from the sca runtime environment. It is implemented in the class
+ * MyServiceImpl
+ */
+ String getYear();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/mysca/test/myservice/impl/MyServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/mysca/test/myservice/impl/MyServiceImpl.java
new file mode 100644
index 0000000000..7b44ef02e4
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/mysca/test/myservice/impl/MyServiceImpl.java
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package mysca.test.myservice.impl;
+
+import java.util.logging.Logger;
+
+import org.oasisopen.sca.annotation.ComponentName;
+import org.oasisopen.sca.annotation.Destroy;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Property;
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * This class Implements the interface MyService and gives implementation for all methods which are declared in that
+ * interface. scope is specified as Composite using
+ *
+ * @scope annotation.
+ */
+
+@Service(MyService.class)
+public class MyServiceImpl implements MyService {
+
+ @Property(name = "location")
+ protected String location = "RTP";
+
+ @Property(name = "year")
+ protected String year = "2006";
+
+ @ComponentName
+ protected String componentName;
+
+ private Logger logger;
+
+ /**
+ * @ to print the message in the log
+ */
+ public MyServiceImpl() {
+ logger = Logger.getAnonymousLogger();
+ logger.info("creating service instance...");
+ }
+
+ /**
+ * @Init annotation to Start the service. Which is executed all the time
+ */
+ @Init
+ public void start() {
+ logger.info("Start service..");
+ }
+
+ /**
+ * @Destroy annotation to stop the service. Which is executed in the end
+ */
+ @Destroy
+ public void stop() {
+ logger.info("Stop service..");
+
+ }
+
+ public String getComponentName() {
+ return componentName;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public String getYear() {
+ return year;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/mysca/test/myservice/impl/MyTotalServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/mysca/test/myservice/impl/MyTotalServiceImpl.java
new file mode 100644
index 0000000000..e8c4341cf2
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/mysca/test/myservice/impl/MyTotalServiceImpl.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 mysca.test.myservice.impl;
+
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * This class Implements the interface MyService and gives implementation for all methods which are declared in that
+ * interface. scope is specified as Composite using
+ *
+ * @scope annotation.
+ */
+
+@Service(MyService.class)
+public class MyTotalServiceImpl implements MyService {
+
+ // default required==true so it is 1:1
+ @Reference
+ public MyService myService;
+
+ public String getLocation() {
+ return myService.getLocation();
+ }
+
+ public String getYear() {
+ return myService.getYear();
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponent.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponent.java
new file mode 100644
index 0000000000..68ce5a3cb6
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponent.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;
+
+/**
+ * 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 ABCDComponentImpl Class
+ */
+public interface ABCDComponent {
+
+ /**
+ * This is a method to get a string property value from the SCA runtime environment. It is implemented in the class
+ * ABCDComponentImpl
+ */
+ String getA();
+
+ /**
+ * This is a method to get a string property value from the SCA runtime environment. It is implemented in the class
+ * ABCDComponentImpl
+ */
+ String getB();
+
+ /**
+ * This is a method to get a string property value from the SCA runtime environment. It is implemented in the class
+ * ABCDComponentImpl
+ */
+ String getC();
+
+ /**
+ * This is a method to get a string property value from the SCA runtime environment. It is implemented in the class
+ * ABCDComponentImpl
+ */
+ String getD();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponentImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponentImpl.java
new file mode 100644
index 0000000000..c8d0d4cae4
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponentImpl.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;
+
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Scope;
+
+/**
+ * This class Implements the interface ABCDComponent and gives implementation for all methods which are declared in that
+ * interface. scope is specified as Composite using
+ *
+ * @scope annotation.
+ */
+@Scope("COMPOSITE")
+public class ABCDComponentImpl implements ABCDComponent {
+ private ABComponent abComponent;
+ private CDComponent cdComponent;
+
+ /**
+ * It is a method which injects the property value to the variable 'abComponent' from the SCA runtime environment
+ * using
+ *
+ * @Property Annotations.
+ */
+ @Reference
+ public void setAb(ABComponent component) {
+ this.abComponent = component;
+ }
+
+ /**
+ * It is a method which injects the property value to the variable 'cdComponent' from the SCA runtime environment
+ * using
+ *
+ * @Property Annotations.
+ */
+ @Reference
+ public void setCd(CDComponent component) {
+ this.cdComponent = component;
+ }
+
+ public String getA() {
+ return this.abComponent.getA();
+ }
+
+ public String getB() {
+ return this.abComponent.getB();
+ }
+
+ public String getC() {
+ return this.cdComponent.getC();
+ }
+
+ public String getD() {
+ return this.cdComponent.getD();
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponent.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponent.java
new file mode 100644
index 0000000000..b727935bc1
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponent.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;
+
+import java.util.Collection;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * 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 ABComponentImpl Class
+ */
+@Remotable
+public interface ABComponent {
+
+ /**
+ * This is a method to get a string property value from the SCA runtime environment. It is implemented in the class
+ * ABComponentImpl
+ */
+
+ String getA();
+
+ /**
+ * This is a method to get a string property value from the SCA runtime environment. It is implemented in the class
+ * ABComponentImpl
+ */
+ String getB();
+
+ /**
+ * This is a method to get a string property value from the SCA runtime environment. It is implemented in the class
+ * ABComponentImpl
+ */
+ String getZ();
+
+ /**
+ * This is a method to get an integer property value from the SCA runtime environment. It is implemented in the
+ * class ABComponentImpl
+ */
+ int getIntValue();
+
+ /**
+ * This is a method to get a string property value from the SCA runtime environment. It is implemented in the class
+ * ABComponentImpl
+ */
+ String getF();
+
+ /**
+ * This is a method to get collection of property values from the SCA runtime environment. It is implemented in the
+ * class ABComponentImpl
+ */
+ Collection<String> getManyStringValues();
+
+ /**
+ * This is a method to get collection of property value from the SCA runtime environment. It is implemented in the
+ * class ABComponentImpl
+ */
+ Collection<Integer> getManyIntegers();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponentImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponentImpl.java
new file mode 100644
index 0000000000..e402131ce2
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponentImpl.java
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection;
+
+import org.oasisopen.sca.annotation.Property;
+
+/**
+ * This class Implements the interface ABComponent and gives implementation for all methods which are declared in that
+ * interface.
+ */
+
+public class ABComponentImpl implements ABComponent {
+
+ private String aProperty;
+ private String bProperty;
+ private int intValue;
+ private Collection<String> manyStringValues;
+ private Collection<Integer> manyIntegerValues;
+ private String zProperty;
+ private String fProperty;
+
+ /**
+ * It is a method which injects the property value to the variable 'zProperty' from the SCA runtime environment
+ * using Annotations.
+ */
+ @Property(name = "xpath")
+ public void setZProperty(final String value) {
+ this.zProperty = value;
+ }
+
+ /**
+ * It is a method which injects collection of property values to the variable 'manyStringValues' from the SCA
+ * runtime environment using Annotations.
+ */
+ @Property(name = "foobar")
+ public void setManyStringValues(final Collection<String> value) {
+ this.manyStringValues = value;
+ }
+
+ /**
+ * It is a method which injects collection of integer property values to the variable 'manyIntegerValues' from the
+ * SCA runtime environment using Annotations.
+ */
+ @Property(name = "fooInts")
+ public void setManyIntegers(final Collection<Integer> value) {
+ this.manyIntegerValues = value;
+ }
+
+ /**
+ * It is a method which injects the property value to the variable 'aProperty' from the SCA runtime environment
+ * using Annotations.
+ */
+ @Property
+ public void setA(final String A) {
+ this.aProperty = A;
+ }
+
+ /**
+ * It is a method which injects the property value to the variable 'bProperty' from the SCA runtime environment
+ * using Annotations.
+ */
+ @Property
+ public void setB(final String B) {
+ this.bProperty = B;
+ }
+
+ /**
+ * It is a method which injects the property value to the variable 'fProperty' from the SCA runtime environment
+ * using Annotations.
+ */
+ @Property
+ public void setF(final String F) {
+ this.fProperty = F;
+ }
+
+ /**
+ * It is a method which injects integer property value to the variable 'intValue' from the SCA runtime environment
+ * using Annotations.
+ */
+ @Property
+ public void setOne(final int value) {
+ this.intValue = value;
+ }
+
+ public String getA() {
+ return this.aProperty;
+ }
+
+ public String getB() {
+ return this.bProperty;
+ }
+
+ public int getIntValue() {
+ return this.intValue;
+ }
+
+ public String getZ() {
+ return this.zProperty;
+ }
+
+ public String getF() {
+ return this.fProperty;
+ }
+
+ public Collection<String> getManyStringValues() {
+ return manyStringValues;
+ }
+
+ public Collection<Integer> getManyIntegers() {
+ return manyIntegerValues;
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponent.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponent.java
new file mode 100644
index 0000000000..52f9871d1b
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponent.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;
+
+import java.util.Collection;
+
+/**
+ * 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 CDComponentImpl Class
+ */
+public interface CDComponent {
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * CDComponentImpl Class
+ */
+ String getC();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * CDComponentImpl Class
+ */
+ String getC2();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * CDComponentImpl Class
+ */
+ String getD();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * CDComponentImpl Class
+ */
+ String getNoSource();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * CDComponentImpl Class
+ */
+ String getFileProperty();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * CDComponentImpl Class
+ */
+ Collection<String> getManyValuesFileProperty();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * CDComponentImpl Class
+ */
+ int getOverrideValue();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponentImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponentImpl.java
new file mode 100644
index 0000000000..fceda9d9ae
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponentImpl.java
@@ -0,0 +1,143 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection;
+
+import org.oasisopen.sca.annotation.Property;
+
+/**
+ * This class Implements the interface CDComponent and gives implementation for all methods which are declared in that
+ * interface.
+ */
+public class CDComponentImpl implements CDComponent {
+
+ private String cProperty;
+ private String dProperty;
+ private String nosource;
+ private String fileProperty;
+ private Collection<String> manyValuesFileProperty;
+ private int overrideNumber;
+ private String cProperty2;
+
+ /**
+ * It is a method which injects the property value to the variable 'cProperty2' from the SCA runtime environment
+ * using
+ *
+ * @Property Annotations.
+ */
+ @Property(name = "nonFileProperty")
+ public void setC2(final String value) {
+ this.cProperty2 = value;
+ }
+
+ /**
+ * It is a method which injects the property value to the variable 'overrideNumber' from the SCA runtime environment
+ * using
+ *
+ * @Property Annotations.
+ */
+ @Property(name = "two")
+ public void setOverrideNumber(final int value) {
+ this.overrideNumber = value;
+ }
+
+ /**
+ * It is a method which injects the property value to the variable 'fileProperty' from the SCA runtime environment
+ * using
+ *
+ * @Property Annotations.
+ */
+ @Property(name = "fileProperty")
+ public void setFileProp(final String value) {
+ this.fileProperty = value;
+ }
+
+ /**
+ * It is a method which injects the property value to the variable 'manyValuesFileProperty' from the SCA runtime
+ * environment using
+ *
+ * @Property Annotations.
+ */
+ @Property(name = "manyValuesFileProperty")
+ public void setFileManyValueProp(final Collection<String> values) {
+ this.manyValuesFileProperty = values;
+ }
+
+ /**
+ * It is a method which injects the property value to the variable 'cProperty' from the SCA runtime environment
+ * using
+ *
+ * @Property Annotations.
+ */
+ @Property
+ public void setC(final String C) {
+ this.cProperty = C;
+ }
+
+ /**
+ * It is a method which injects the property value to the variable 'dProperty' from the SCA runtime environment
+ * using
+ *
+ * @Property Annotations.
+ */
+ @Property
+ public void setD(final String D) {
+ this.dProperty = D;
+ }
+
+ /**
+ * It is a method which injects the property value to the variable 'nosource' from the SCA runtime environment using
+ *
+ * @Property Annotations.
+ */
+ @Property
+ public void setNosource(final String value) {
+ this.nosource = value;
+ }
+
+ public String getFileProperty() {
+ return this.fileProperty;
+ }
+
+ public String getC() {
+ return this.cProperty;
+ }
+
+ public String getC2() {
+ return this.cProperty2;
+ }
+
+ public String getD() {
+ return this.dProperty;
+ }
+
+ public String getNoSource() {
+ return this.nosource;
+ }
+
+ public int getOverrideValue() {
+ return this.overrideNumber;
+ }
+
+ public Collection<String> getManyValuesFileProperty() {
+ return this.manyValuesFileProperty;
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java
new file mode 100644
index 0000000000..87f87d6c22
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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;
+
+/**
+ * This is a Java Bean which has setter and getter methods for for the variables used in the property tests.
+ */
+public class ComplexPropertyBean {
+
+ /**
+ * Variable declarations
+ */
+ protected int integerNumber = 25;
+ protected float floatNumber = 50;
+ protected double doubleNumber = 75;
+ protected int[] intArray = null;
+ protected double[] doubleArray = null;
+ protected String[] stringArray = null;
+
+ ComplexPropertyBean numberSet;
+ protected ComplexPropertyBean[] numberSetArray = null;
+
+ public ComplexPropertyBean() {
+
+ }
+
+ public double getDoubleNumber() {
+ return doubleNumber;
+ }
+
+ /**
+ * It is a setter method to set a value for the variable doubleNumber
+ */
+ public void setDoubleNumber(double doubleNumber) {
+ this.doubleNumber = doubleNumber;
+ }
+
+ /**
+ * It is a getter method to get a value for the variable floatNumber
+ */
+ public float getFloatNumber() {
+ return floatNumber;
+ }
+
+ /**
+ * It is a setter method to set a value for the variable floatNumber
+ */
+ public void setFloatNumber(float floatNumber) {
+ this.floatNumber = floatNumber;
+ }
+
+ /**
+ * It is a getter method to get a value for the variable floatNumber
+ */
+ public int getIntegerNumber() {
+ return integerNumber;
+ }
+
+ /**
+ * It is a getter method to get a value for the variable integerNumber
+ */
+ public void setIntegerNumber(int integerNumber) {
+ this.integerNumber = integerNumber;
+ }
+
+ /**
+ * It is a getter method to set a value for the variable numberSet
+ */
+ public ComplexPropertyBean getNumberSet() {
+ return numberSet;
+ }
+
+ /**
+ * It is a setter method to set a value for the variable numberSet
+ */
+ public void setNumberSet(ComplexPropertyBean numberSet) {
+ this.numberSet = numberSet;
+ }
+
+ /**
+ * It is a method which implements toString() function
+ */
+
+ public String toString() {
+ return Double.toString(integerNumber) + " - "
+ + Double.toString(floatNumber)
+ + " - "
+ + Double.toString(doubleNumber)
+ + " \n"
+ + ((intArray == null) ? "" : intArray[0] + " - " + intArray[1] + " \n ")
+ + ((doubleArray == null) ? "" : doubleArray[0] + " - " + doubleArray[1] + " \n ")
+ + ((stringArray == null) ? "" : stringArray[0] + " - " + stringArray[1] + " \n ")
+ + ((numberSetArray == null) ? "" : numberSetArray[0] + " - " + numberSetArray[1] + " \n ")
+ + ((numberSet == null) ? "" : numberSet.toString());
+ }
+
+ /**
+ * It is a setter method to set values for the variable stringArray
+ */
+ public String[] getStringArray() {
+ return stringArray;
+ }
+
+ /**
+ * It is a setter method to set values for the variable stringArray
+ */
+ public void setStringArray(String[] stringArray) {
+ this.stringArray = stringArray;
+ }
+
+ public int[] getIntArray() {
+ return intArray;
+ }
+
+ public void setIntArray(int[] intArray) {
+ this.intArray = intArray;
+ }
+
+ public double[] getDoubleArray() {
+ return doubleArray;
+ }
+
+ public void setDoubleArray(double[] doubleArray) {
+ this.doubleArray = doubleArray;
+ }
+
+ public ComplexPropertyBean[] getNumberSetArray() {
+ return numberSetArray;
+ }
+
+ public void setNumberSetArray(ComplexPropertyBean[] numberSetArray) {
+ this.numberSetArray = numberSetArray;
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideService.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideService.java
new file mode 100644
index 0000000000..acd1f26670
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideService.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;
+
+/**
+ * This is an Interface for the services
+ */
+public interface OverrideService {
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideServiceImpl.java
new file mode 100644
index 0000000000..71dce41efc
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideServiceImpl.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;
+
+/**
+ * An implementation for the interface OverrideService.
+ */
+
+public class OverrideServiceImpl implements OverrideService {
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java
new file mode 100644
index 0000000000..5217ede572
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.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.itest;
+
+import java.util.Collection;
+
+import test.jaxb.props.ReturnCodeProperties;
+
+import commonj.sdo.DataObject;
+
+/**
+ * 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 PropertyComponentImpl Class
+ */
+public interface PropertyComponent {
+
+ /**
+ * This is a method to get a value for a property name 'location' from the SCA runtime environment. It is
+ * implemented in the class PropertyComponentImpl
+ */
+ public String getLocation();
+
+ /**
+ * This is a method to get a value for a property name 'year' from the SCA runtime environment. It is implemented in
+ * the class PropertyComponentImpl
+ */
+ public String getYear();
+
+ /**
+ * This method is used to test injecting a primitive String Array
+ *
+ * @return The injected array
+ */
+ public String[] getDaysOfTheWeek();
+
+ /**
+ * This method is used to test injecting an Object Integer Array
+ *
+ * @return The injected array
+ */
+ public Integer[] getIntegerNumbers();
+
+ /**
+ * This method is used to test injecting an int Array
+ *
+ * @return The injected array
+ */
+ public int[] getIntNumbers();
+
+ /**
+ * This method is used to test injecting an Object Array
+ *
+ * @return The injected array
+ */
+ public DataObject[] getSdoArrayProperty();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+
+ public ComplexPropertyBean getComplexPropertyOne();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+ public ComplexPropertyBean getComplexPropertyTwo();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+ public ComplexPropertyBean getComplexPropertyThree();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+ public Collection<ComplexPropertyBean> getComplexPropertyFour();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+
+ public ComplexPropertyBean getComplexPropertyFive();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+ public DataObject getSdoProperty();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+ public DataObject getCustomerSdo();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+ public ReturnCodeProperties getComplexJAXBPropertyOne();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+ public ReturnCodeProperties getComplexJAXBPropertyTwo();
+
+ /**
+ * @return
+ */
+ public String getLocationFromComponentContext();
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java
new file mode 100644
index 0000000000..5f8f28e46a
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java
@@ -0,0 +1,188 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection;
+
+import org.oasisopen.sca.ComponentContext;
+import org.oasisopen.sca.annotation.Context;
+import org.oasisopen.sca.annotation.Property;
+
+import test.jaxb.props.ReturnCodeProperties;
+
+import com.example.customer.sdo.impl.CustomerImpl;
+import commonj.sdo.DataObject;
+
+/**
+ * This class Implements the interface PropertyComponent and gives implementation for all methods which are declared in
+ * that interface.
+ */
+public class PropertyComponentImpl implements PropertyComponent {
+ @Context
+ protected ComponentContext context;
+
+ @Property
+ protected CustomerImpl customerSdo;
+
+ @Property
+ protected DataObject sdoProperty;
+
+ @Property
+ protected ComplexPropertyBean complexPropertyOne;
+
+ @Property
+ protected ComplexPropertyBean complexPropertyTwo;
+
+ @Property
+ protected ComplexPropertyBean complexPropertyThree;
+
+ @Property
+ protected Collection<ComplexPropertyBean> complexPropertyFour;
+
+ @Property
+ protected ComplexPropertyBean complexPropertyFive;
+
+ @Property(name = "location")
+ protected String location;
+
+ @Property(name = "year")
+ protected String year;
+
+ @Property(name = "daysOfTheWeek")
+ protected String[] daysOfTheWeek;
+
+ @Property(name = "integerNumbers")
+ protected Integer[] integerNumbers;
+
+ @Property(name = "intNumbers")
+ protected int[] intNumbers;
+
+ @Property(name = "sdoArray")
+ protected DataObject[] sdoArray;
+
+ @Property
+ protected ReturnCodeProperties complexJAXBPropertyOne;
+
+ @Property
+ protected ReturnCodeProperties complexJAXBPropertyTwo;
+
+ public String getLocation() {
+ return location;
+ }
+
+ public String getYear() {
+ return year;
+ }
+
+ public ComplexPropertyBean getComplexPropertyOne() {
+ //System.out.println(complexPropertyOne);
+ return complexPropertyOne;
+ }
+
+ public ComplexPropertyBean getComplexPropertyTwo() {
+ //System.out.println(complexPropertyTwo);
+ return complexPropertyTwo;
+ }
+
+ public ComplexPropertyBean getComplexPropertyThree() {
+ //System.out.println(complexPropertyThree);
+ return complexPropertyThree;
+ }
+
+ public Collection<ComplexPropertyBean> getComplexPropertyFour() {
+ //System.out.println(complexPropertyThree);
+ return complexPropertyFour;
+ }
+
+ public ComplexPropertyBean getComplexPropertyFive() {
+ return complexPropertyFive;
+ }
+
+ public DataObject getSdoProperty() {
+ return sdoProperty;
+ }
+
+ /**
+ * It is a method which injects the property value to the variable 'sdoProperty' from the SCA runtime environment.
+ */
+ public void setSdoProperty(DataObject sdoProperty) {
+ System.out.println("Reached here da machi");
+ this.sdoProperty = sdoProperty;
+ }
+
+ public CustomerImpl getCustomerSdo() {
+ return customerSdo;
+ }
+
+ /**
+ * It is a method which injects the property value to the variable 'customerSdo' from the SCA runtime environment.
+ */
+ public void setCustomerSdo(CustomerImpl customerSdo) {
+ this.customerSdo = customerSdo;
+ }
+
+ /**
+ * This method is used to test injecting an Array
+ *
+ * @return The injected array
+ */
+ public String[] getDaysOfTheWeek() {
+ return daysOfTheWeek;
+ }
+
+ /**
+ * This method is used to test injecting an Object Integer Array
+ *
+ * @return The injected array
+ */
+ public Integer[] getIntegerNumbers() {
+ return integerNumbers;
+ }
+
+ /**
+ * This method is used to test injecting an int Array
+ *
+ * @return The injected array
+ */
+ public int[] getIntNumbers() {
+ return intNumbers;
+ }
+
+ /**
+ * This method is used to test injecting an Object Array
+ *
+ * @return The injected array
+ */
+ public DataObject[] getSdoArrayProperty() {
+ return sdoArray;
+ }
+
+ public String getLocationFromComponentContext() {
+ return context.getProperty(String.class, "location");
+ }
+
+ public ReturnCodeProperties getComplexJAXBPropertyOne() {
+ return complexJAXBPropertyOne;
+ }
+
+ public ReturnCodeProperties getComplexJAXBPropertyTwo() {
+ return complexJAXBPropertyTwo;
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyService.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyService.java
new file mode 100644
index 0000000000..a57ccd90c8
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyService.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;
+
+/**
+ * This is an Interface for the services.
+ */
+public interface PropertyService {
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Bar.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Bar.java
new file mode 100644
index 0000000000..c147a2affe
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Bar.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.cdi;
+
+public interface Bar {
+ public String getBar();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo1.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo1.java
new file mode 100644
index 0000000000..7c700903d6
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo1.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.cdi;
+
+import org.oasisopen.sca.annotation.Constructor;
+import org.oasisopen.sca.annotation.Property;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(Bar.class)
+public class Foo1 implements Bar {
+
+ @Property
+ protected String bar;
+
+ @Constructor( {"bar"})
+ public Foo1(String b) {
+ this.bar = b;
+ }
+
+ public String getBar() {
+ return this.bar;
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo2.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo2.java
new file mode 100644
index 0000000000..1d2e563095
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo2.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.cdi;
+
+import org.oasisopen.sca.annotation.Constructor;
+import org.oasisopen.sca.annotation.Property;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(Bar.class)
+public class Foo2 implements Bar {
+
+ protected String bar;
+
+ @Constructor
+ public Foo2(@Property(name = "bar") String b) {
+ this.bar = b;
+ }
+
+ public String getBar() {
+ return this.bar;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo3.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo3.java
new file mode 100644
index 0000000000..54082e297a
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo3.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.cdi;
+
+import org.oasisopen.sca.annotation.Constructor;
+import org.oasisopen.sca.annotation.Property;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(Bar.class)
+public class Foo3 implements Bar {
+
+ protected String bar;
+
+ @Constructor
+ public Foo3() {
+ this.bar = "bar";
+ }
+
+ public String getBar() {
+ return this.bar;
+ }
+
+ @Property(name = "bar")
+ public void setBar(String b) {
+ this.bar = b;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/test/jaxb/props/ObjectFactory.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/test/jaxb/props/ObjectFactory.java
new file mode 100644
index 0000000000..15fb49ea4e
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/test/jaxb/props/ObjectFactory.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.
+ */
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.06.07 at 03:30:47 PM EDT
+//
+package test.jaxb.props;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the test.jaxb.props package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _MyRCProps_QNAME = new QName("http://test.sca.jaxb/rcprops", "MyRCProps");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: test.jaxb.props
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link ReturnCodeProperties }
+ *
+ */
+ public ReturnCodeProperties createReturnCodeProperties() {
+ return new ReturnCodeProperties();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link ReturnCodeProperties }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://test.sca.jaxb/rcprops", name = "MyRCProps")
+ public JAXBElement<ReturnCodeProperties> createMyRCProps(ReturnCodeProperties value) {
+ return new JAXBElement<ReturnCodeProperties>(_MyRCProps_QNAME, ReturnCodeProperties.class, null, value);
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/test/jaxb/props/ReturnCodeProperties.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/test/jaxb/props/ReturnCodeProperties.java
new file mode 100644
index 0000000000..0a1d4a34a3
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/test/jaxb/props/ReturnCodeProperties.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.
+ */
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.06.07 at 03:30:47 PM EDT
+//
+package test.jaxb.props;
+
+import java.math.BigInteger;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * <p>Java class for ReturnCodeProperties complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="ReturnCodeProperties">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="AInt" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ * &lt;element name="BInteger" type="{http://www.w3.org/2001/XMLSchema}integer"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ReturnCodeProperties", namespace = "http://test.sca.jaxb/rcprops", propOrder = {"a", "b"})
+public class ReturnCodeProperties {
+
+ @XmlElement(name = "AInt")
+ protected int a;
+ @XmlElement(name = "BInteger", required = true)
+ protected BigInteger b;
+
+ /**
+ * Gets the value of the a property.
+ *
+ */
+ public int getA() {
+ return a;
+ }
+
+ /**
+ * Sets the value of the a property.
+ *
+ */
+ public void setA(int value) {
+ this.a = value;
+ }
+
+ /**
+ * Gets the value of the b property.
+ *
+ * @return
+ * possible object is
+ * {@link BigInteger }
+ *
+ */
+ public BigInteger getB() {
+ return b;
+ }
+
+ /**
+ * Sets the value of the b property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigInteger }
+ *
+ */
+ public void setB(BigInteger value) {
+ this.b = value;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/test/jaxb/props/package-info.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/test/jaxb/props/package-info.java
new file mode 100644
index 0000000000..6a6fdd00cc
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/java/test/jaxb/props/package-info.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.
+ */
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.06.07 at 03:30:47 PM EDT
+//
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://test.sca.jaxb/rcprops", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package test.jaxb.props;
+
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/ConstructorPropertyInjection.composite b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/ConstructorPropertyInjection.composite
new file mode 100644
index 0000000000..24a2cca822
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/ConstructorPropertyInjection.composite
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" name="ConstructorPropertyInjection">
+
+ <component name="Foo1Component">
+ <implementation.java class="org.apache.tuscany.sca.itest.cdi.Foo1" />
+ <property name="bar" value="foobar" />
+ </component>
+
+ <component name="Foo2Component">
+ <implementation.java class="org.apache.tuscany.sca.itest.cdi.Foo2" />
+ <property name="bar">fubar</property>
+ </component>
+
+ <component name="Foo3Component">
+ <implementation.java class="org.apache.tuscany.sca.itest.cdi.Foo3" />
+ <property name="bar">
+ <value>fubar</value>
+ </property>
+ </component>
+
+</composite> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/Outer.composite b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/Outer.composite
new file mode 100644
index 0000000000..0ada194cb3
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/Outer.composite
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:foo="http://foo" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xsi:schemaLocation="http://docs.oasis-open.org/ns/opencsa/sca/200903 http://docs.oasis-open.org/ns/opencsa/sca/200903" name="Iteration3Composite"
+ targetNamespace="http://foo" local="true" autowire="false">
+
+ <property name="newLocation" type="xsd:anyURI">Raleigh</property>
+ <property name="newYear" type="xsd:anyURI">2008</property>
+ <component name="MyServiceComponent">
+ <implementation.java class="mysca.test.myservice.impl.MyServiceImpl" />
+ </component>
+ <component name="MyServiceComponentNew">
+ <implementation.java class="mysca.test.myservice.impl.MyServiceImpl" />
+ <property name="location" source="$newLocation" />
+ <property name="year" source="$newYear" />
+ </component>
+ <component name="MyTotalServiceNewComponent">
+ <implementation.java class="mysca.test.myservice.impl.MyTotalServiceImpl" />
+ <reference name="myService" target="MyServiceComponentNew/MyService" />
+ </component>
+ <component name="MySimpleServiceInRecursiveAnother">
+ <implementation.composite name="foo:MySimpleService" />
+ <property name="newLocation">Durham</property>
+ <property name="newYear">2009</property>
+ </component>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/OuterPropertyTest.composite b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/OuterPropertyTest.composite
new file mode 100644
index 0000000000..75fa0aaa81
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/OuterPropertyTest.composite
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:foo="http://foo"
+ targetNamespace="http://foo"
+ name="OuterPropertyTest"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <component name="OuterComponent">
+ <implementation.composite name="foo:PropertyTest"/>
+ <property name="number">125</property>
+ <property name="complex" type="foo:MyComplexType">
+ <foo:MyComplexValue xsi:type="foo:MyComplexType" >
+ <foo:a>Overriden A</foo:a>
+ <foo:b>Overriden B</foo:b>
+ <foo:c>Overriden C</foo:c>
+ <foo:d>Overriden D</foo:d>
+ <foo:x>
+ <foo:y>Overriden Y</foo:y>
+ <foo:z>Overriden Z</foo:z>
+ </foo:x>
+ </foo:MyComplexValue>
+ </property>
+ </component>
+</composite>
+
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/PropertyTest.composite b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/PropertyTest.composite
new file mode 100644
index 0000000000..4d3715dba6
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/PropertyTest.composite
@@ -0,0 +1,255 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:foo="http://foo"
+ xmlns:cust="http://www.example.com/Customer"
+ xmlns:dbsdo="http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:rcp="http://test.sca.jaxb/rcprops"
+ targetNamespace="http://foo"
+ name="PropertyTest"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <service name="ProperterTestService" promote="ABComponent">
+ <interface.java interface="org.apache.tuscany.sca.itest.ABComponent"/>
+ </service>
+
+ <dbsdo:import.sdo location="customer.xsd" />
+ <!-- dbsdo:import.sdo factory="com.example.customer.sdo.SdoFactory" / -->
+
+ <property name="number" type="xsd:int">1</property>
+ <property name="complex" type="foo:MyComplexType" >
+ <value xsi:type="foo:MyComplexType" >
+ <foo:a>a</foo:a>
+ <foo:b>b</foo:b>
+ <foo:c>c</foo:c>
+ <foo:d>d</foo:d>
+ <foo:x>
+ <foo:y>y</foo:y>
+ <foo:z>z</foo:z>
+ </foo:x>
+ </value>
+ </property>
+
+ <property name="moreComplex" type="foo:MyMoreComplexType">
+ <value>
+ <numberSetArray>
+ <integerNumber>1</integerNumber>
+ <floatNumber>11</floatNumber>
+ <doubleNumber>111</doubleNumber>
+ </numberSetArray>
+ <numberSetArray>
+ <integerNumber>2</integerNumber>
+ <floatNumber>22</floatNumber>
+ <doubleNumber>222</doubleNumber>
+ </numberSetArray>
+ <stringArray>TestString_1</stringArray>
+ <stringArray>TestString_2</stringArray>
+ <intArray>10</intArray>
+ <intArray>20</intArray>
+ <integerNumber>27</integerNumber>
+ <floatNumber>79.34</floatNumber>
+ <doubleNumber>184.52</doubleNumber>
+ <doubleArray>50.05</doubleArray>
+ <doubleArray>25.52</doubleArray>
+ <numberSet>
+ <integerNumber>54</integerNumber>
+ <floatNumber>158.68</floatNumber>
+ <doubleNumber>369.04</doubleNumber>
+ </numberSet>
+ </value>
+ </property>
+
+ <property name="complexFoo" type="foo:MyMoreComplexType">
+ <value>
+ <stringArray>TestString_3</stringArray>
+ <stringArray>TestString_4</stringArray>
+ <intArray>100</intArray>
+ <intArray>200</intArray>
+ </value>
+ </property>
+
+ <component name="ABCDComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.ABCDComponentImpl"/>
+ <reference name="ab" target="ABComponent"/>
+ <reference name="cd" target="CDComponent"/>
+ </component>
+
+ <component name="ABComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.ABComponentImpl"/>
+ <property name="a" source="$complex/foo:MyComplexValue/foo:a"/>
+ <property name="b" source="$complex/foo:MyComplexValue/foo:b"/>
+ <property name="f" source="$complex/foo:MyComplexValue/foo:a">f</property>
+ <property name="xpath" source="$complex/foo:MyComplexValue/foo:x/*[local-name()='z']"/>
+ <property name="one" source="$number"/>
+ <property name="foobar" many="true">"Apache" "Tuscany" "Java SCA"</property>
+ <property name="fooInts" many="true">123 456 789</property>
+ </component>
+
+
+ <component name="CDComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.CDComponentImpl"/>
+ <property name="c" source="$complex/foo:MyComplexValue/foo:c"/>
+ <property name="d" source="$complex/foo:MyComplexValue/foo:d"/>
+ <property name="nosource">aValue</property>
+ <property name="fileProperty" file="fileProperty.txt"/>
+ <property name="manyValuesFileProperty" many="true" file="manyValuesFileProperty.txt"/>
+ <property name="nonFileProperty" file="fileProperty.txt" source="$complex/foo:MyComplexValue/foo:c"/>
+ <property name="two" source="$number">25</property>
+ </component>
+
+ <component name="PropertyComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.PropertyComponentImpl"/>
+ <property name="complexPropertyOne" source="$moreComplex"></property>
+ <property name="complexPropertyTwo">
+ <value>
+ <stringArray>TestString_1</stringArray>
+ <stringArray>TestString_2</stringArray>
+ <intArray>10</intArray>
+ <integerNumber>27</integerNumber>
+ <floatNumber>79.34</floatNumber>
+ <doubleArray>25.52</doubleArray>
+ <doubleNumber>184.52</doubleNumber>
+ <doubleArray>50.05</doubleArray>
+ <intArray>20</intArray>
+ <numberSetArray>
+ <integerNumber>1</integerNumber>
+ <floatNumber>11</floatNumber>
+ <doubleNumber>111</doubleNumber>
+ </numberSetArray>
+ <numberSetArray>
+ <integerNumber>2</integerNumber>
+ <floatNumber>22</floatNumber>
+ <doubleNumber>222</doubleNumber>
+ </numberSetArray>
+ <numberSet>
+ <integerNumber>54</integerNumber>
+ <floatNumber>158.68</floatNumber>
+ <doubleNumber>369.04</doubleNumber>
+ </numberSet>
+ </value>
+ </property>
+ <property name="complexPropertyThree" element="foo:PropertyThreeElement">
+ <PropertyThreeElement xmlns="http://foo">
+ <stringArray>TestElementString_1</stringArray>
+ <stringArray>TestElementString_2</stringArray>
+ <intArray>10</intArray>
+ <integerNumber>27</integerNumber>
+ <floatNumber>79.34</floatNumber>
+ <doubleArray>25.52</doubleArray>
+ <doubleNumber>184.52</doubleNumber>
+ <doubleArray>50.05</doubleArray>
+ <intArray>20</intArray>
+ <numberSetArray>
+ <integerNumber>1</integerNumber>
+ <floatNumber>11</floatNumber>
+ <doubleNumber>111</doubleNumber>
+ </numberSetArray>
+ <numberSetArray>
+ <integerNumber>2</integerNumber>
+ <floatNumber>22</floatNumber>
+ <doubleNumber>222</doubleNumber>
+ </numberSetArray>
+ <numberSet>
+ <integerNumber>54</integerNumber>
+ <floatNumber>158.68</floatNumber>
+ <doubleNumber>369.04</doubleNumber>
+ </numberSet>
+ </PropertyThreeElement>
+ </property>
+ <property name="complexPropertyFour" element="foo:PropertyFourElement" many="true">
+ <PropertyFourElement xmlns="http://foo">
+ <integerNumber>1</integerNumber>
+ <floatNumber>11.11</floatNumber>
+ <doubleNumber>111.111</doubleNumber>
+ <numberSet>
+ <integerNumber>11</integerNumber>
+ <floatNumber>1111.1111</floatNumber>
+ <doubleNumber>11111.11111</doubleNumber>
+ </numberSet>
+ </PropertyFourElement>
+ <PropertyFourElement xmlns="http://foo">
+ <integerNumber>2</integerNumber>
+ <floatNumber>22.22</floatNumber>
+ <doubleNumber>222.222</doubleNumber>
+ <numberSet>
+ <integerNumber>22</integerNumber>
+ <floatNumber>2222.2222</floatNumber>
+ <doubleNumber>22222.22222</doubleNumber>
+ </numberSet>
+ </PropertyFourElement>
+ <PropertyFourElement xmlns="http://foo">
+ <integerNumber>3</integerNumber>
+ <floatNumber>33.33</floatNumber>
+ <doubleNumber>333.333</doubleNumber>
+ <numberSet>
+ <integerNumber>33</integerNumber>
+ <floatNumber>3333.3333</floatNumber>
+ <doubleNumber>33333.33333</doubleNumber>
+ </numberSet>
+ </PropertyFourElement>
+ </property>
+ <property name="complexPropertyFive" source="$complexFoo"/>
+ <property name="sdoProperty" type="cust:Customer">
+ <value>
+ <cust:firstName>Firstly Name</cust:firstName>
+ <cust:middleName>Middler Name</cust:middleName>
+ <cust:lastName>Lasting Name</cust:lastName>
+ </value>
+ </property>
+ <property name="customerSdo" type="cust:Customer">
+ <value>
+ <cust:firstName>Sdo Firstly Name</cust:firstName>
+ <cust:middleName>Sdo Middler Name</cust:middleName>
+ <cust:lastName>Sdo Lasting Name</cust:lastName>
+ </value>
+ </property>
+ <property name="location" type="xsd:string">RTP</property>
+ <property name="year" type="xsd:string">2006</property>
+ <property name="daysOfTheWeek" many="true" type="xsd:string">"Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday" "Sunday"</property>
+ <property name="integerNumbers" many="true" type="xsd:int">1 2 3 4 5 6 7 8 9 10</property>
+ <property name="intNumbers" many="true" type="xsd:int">10 9 8 7 6 5 4 3 2 1 0</property>
+ <property name="sdoArray" many="true" type="cust:Customer">
+ <value>
+ <cust:firstName>Firstly Name 1</cust:firstName>
+ <cust:middleName>Middler Name 1</cust:middleName>
+ <cust:lastName>Lasting Name 1</cust:lastName>
+ </value>
+ <value>
+ <cust:firstName>Firstly Name 2</cust:firstName>
+ <cust:middleName>Middler Name 2</cust:middleName>
+ <cust:lastName>Lasting Name 2</cust:lastName>
+ </value>
+ <value>
+ <cust:firstName>Firstly Name 3</cust:firstName>
+ <cust:middleName>Middler Name 3</cust:middleName>
+ <cust:lastName>Lasting Name 3</cust:lastName>
+ </value>
+ </property>
+ <property name="complexJAXBPropertyOne" type="rcp:ReturnCodeProperties">
+ <MyRCProps xmlns="http://test.sca.jaxb/rcprops">
+ <AInt>10</AInt>
+ <BInteger>10</BInteger>
+ </MyRCProps>
+ </property>
+ <property name="complexJAXBPropertyTwo" type="rcp:ReturnCodeProperties" file="rcProps.txt"/>
+ </component>
+</composite>
+
+
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/customer.xsd b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/customer.xsd
new file mode 100644
index 0000000000..8861d7e7b8
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/customer.xsd
@@ -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.
+-->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://www.example.com/Customer" targetNamespace="http://www.example.com/Customer">
+
+ <xsd:element name="customer" type="Customer"/>
+ <xsd:complexType name="Customer">
+ <xsd:sequence>
+ <xsd:element name="firstName" type="xsd:string"/>
+ <xsd:element name="middleName" type="xsd:string"/>
+ <xsd:element name="lastName" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:schema>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/fileProperty.txt b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/fileProperty.txt
new file mode 100644
index 0000000000..0d3d9ead83
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/fileProperty.txt
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<filePropertyTest>fileValue</filePropertyTest>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/manyValuesFileProperty.txt b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/manyValuesFileProperty.txt
new file mode 100644
index 0000000000..450f397b30
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/manyValuesFileProperty.txt
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<manyFilePropertyValues>
+ "fileValueOne" "fileValueTwo" "fileValueThree" "fileValueFour"
+</manyFilePropertyValues>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/mySimpleService.composite b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/mySimpleService.composite
new file mode 100644
index 0000000000..b22b32bc30
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/mySimpleService.composite
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite autowire="false" local="true" name="MySimpleService"
+ targetNamespace="http://foo" xmlns:foo="http://foo" xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://docs.oasis-open.org/ns/opencsa/sca/200903 http://docs.oasis-open.org/ns/opencsa/sca/200903 ">
+
+
+ <service name="MyServiceNew1" promote="MyServiceComponentNew/MyService">
+ <interface.java interface="mysca.test.myservice.impl.MyService" />
+ </service>
+
+ <property name="newLocation" type="xsd:anyURI">Raleigh</property>
+ <property name="newYear" type="xsd:anyURI">2008</property>
+
+
+ <component name="MyServiceComponentNew">
+ <implementation.java class="mysca.test.myservice.impl.MyServiceImpl" />
+ <property name="location" source="$newLocation" />
+ <property name="year" source="$newYear" />
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/rcProps.txt b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/rcProps.txt
new file mode 100644
index 0000000000..052c291fd0
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/rcProps.txt
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<MyRCProps xmlns="http://test.sca.jaxb/rcprops">
+ <AInt>20</AInt>
+ <BInteger>20</BInteger>
+</MyRCProps>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/rcprops.xsd b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/rcprops.xsd
new file mode 100644
index 0000000000..21289fa7b2
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/main/resources/rcprops.xsd
@@ -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
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<schema elementFormDefault="qualified" targetNamespace="http://test.sca.jaxb/rcprops"
+ xmlns:tns="http://test.sca.jaxb/rcprops" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0"
+ xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+
+ <!-- Use some JAXB customizations -->
+
+ <annotation>
+ <appinfo>
+ <jaxb:schemaBindings>
+ <jaxb:package name="test.jaxb.props" />
+ </jaxb:schemaBindings>
+ </appinfo>
+ </annotation>
+
+ <element name="MyRCProps" type="tns:ReturnCodeProperties" />
+
+ <complexType name="ReturnCodeProperties">
+ <sequence>
+ <element name="AInt" type="xsd:int">
+ <annotation>
+ <appinfo>
+ <jaxb:property name="a" />
+ </appinfo>
+ </annotation>
+ </element>
+ <element name="BInteger" type="xsd:integer">
+ <annotation>
+ <appinfo>
+ <jaxb:property name="b" />
+ </appinfo>
+ </annotation>
+ </element>
+ </sequence>
+ </complexType>
+</schema>
+
+
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/test/java/org/apache/tuscany/sca/itest/MyTotalServiceTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/test/java/org/apache/tuscany/sca/itest/MyTotalServiceTestCase.java
new file mode 100644
index 0000000000..efc635c72b
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/test/java/org/apache/tuscany/sca/itest/MyTotalServiceTestCase.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.itest;
+
+import static org.junit.Assert.assertEquals;
+import mysca.test.myservice.impl.MyService;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class MyTotalServiceTestCase {
+ private static MyService service1;
+ private static MyService service2;
+ private static MyService service3;
+
+ private static Node node;
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the local
+ * property variables defined in the implementation file with the expected values 'RTP' and '2006'
+ */
+ @Test
+ public void testPropertyDefault() {
+ assertEquals("RTP", service1.getLocation());
+ assertEquals("2006", service1.getYear());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using service2 from the SCA runtime environment with the expected values 'Raleigh'
+ * and '2008'. This overrides the local property values
+ */
+ @Test
+ public void testPropertyOverride() {
+ assertEquals("Raleigh", service2.getLocation());
+ assertEquals("2008", service2.getYear());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using service3 from the SCA runtime environment with the expected values 'Durham'
+ * and '2009'
+ */
+ @Test
+ public void testPropertyNestedOverride() {
+ assertEquals("Durham", service3.getLocation());
+ assertEquals("2009", service3.getYear());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @BeforeClass is used for one time set Up, it executes before every tests. This method is used to create a test
+ * Embedded SCA node, to start the SCA node and to get a reference to the 'outerABService' service
+ */
+ @BeforeClass
+ public static void setUp() throws Exception {
+
+ String location = ContributionLocationHelper.getContributionLocation("Outer.composite");
+ node = NodeFactory.newInstance().createNode("Outer.composite", new Contribution("c1", location));
+ node.start();
+ service1 = node.getService(MyService.class, "MyServiceComponent/MyService");
+ service2 = node.getService(MyService.class, "MyServiceComponentNew/MyService");
+ service3 = node.getService(MyService.class, "MySimpleServiceInRecursiveAnother");
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @AfterClass is used for one time Tear Down, it executes after every tests. This method is used to close the
+ * node, close any previously opened connections etc
+ */
+ @AfterClass
+ public static void tearDown() {
+ node.stop();
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/test/java/org/apache/tuscany/sca/itest/OuterPropertyTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/test/java/org/apache/tuscany/sca/itest/OuterPropertyTestCase.java
new file mode 100644
index 0000000000..da1ec5186f
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/test/java/org/apache/tuscany/sca/itest/OuterPropertyTestCase.java
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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 static org.junit.Assert.assertEquals;
+
+import java.util.Iterator;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * This is a class which makes user of JUnit Framework, all tests are written using JUnit notation. These tests are used
+ * to test different property values returned from the SCA Runtime Environment which is initialized with the composite
+ * 'OuterPropertyTest.composite'. It basically tests the Simple type of property and Complex type of property from the
+ * SCA Runtime Environment.
+ */
+public class OuterPropertyTestCase {
+
+ private static Node node;
+ private static ABComponent outerABService;
+
+ /**
+ * Method annotated with
+ *
+ * @BeforeClass is used for one time set Up, it executes before every tests. This method is used to create a test
+ * Embedded SCA node, to start the SCA node and to get a reference to the 'outerABService' service
+ */
+ @BeforeClass
+ public static void init() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("OuterPropertyTest.composite");
+ node = NodeFactory.newInstance().createNode("OuterPropertyTest.composite", new Contribution("c1", location));
+ node.start();
+ outerABService = node.getService(ABComponent.class, "OuterComponent");
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @AfterClass is used for one time Tear Down, it executes after every tests. This method is used to close the
+ * node, close any previously opened connections etc
+ */
+ @AfterClass
+ public static void destroy() throws Exception {
+ node.stop();
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 'Overriden
+ * A'
+ */
+ @Test
+ public void testOverridenA() {
+ assertEquals("Overriden A", outerABService.getA());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 'Overriden
+ * B'
+ */
+ @Test
+ public void testOverridenB() {
+ assertEquals("Overriden B", outerABService.getB());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 'Overriden
+ * A'
+ */
+ @Test
+ public void testOverridenF() {
+ assertEquals("Overriden A", outerABService.getF());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 'Overriden
+ * Z'
+ */
+ @Test
+ public void testOverridenZ() {
+ assertEquals("Overriden Z", outerABService.getZ());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 125
+ */
+ @Test
+ public void testOverridenIntValue() {
+ assertEquals(125, outerABService.getIntValue());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 125
+ */
+ @Test
+ public void testDefaultValue() {
+ assertEquals(125, outerABService.getIntValue());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property values obtained using a service from the SCA runtime environment with the expected values 'Apache' ,
+ * 'Tuscany' and 'Java SCA' respectively .
+ */
+ @Test
+ public void testManySimpleStringValues() {
+ Iterator<String> iterator = outerABService.getManyStringValues().iterator();
+ assertEquals("Apache", iterator.next());
+ assertEquals("Tuscany", iterator.next());
+ assertEquals("Java SCA", iterator.next());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property values obtained using a service from the SCA runtime environment with the expected values 123, 456
+ * and 789
+ */
+ @Test
+ public void testManySimpleIntegerValues() {
+ Iterator<Integer> iterator = outerABService.getManyIntegers().iterator();
+ assertEquals(123, iterator.next().intValue());
+ assertEquals(456, iterator.next().intValue());
+ assertEquals(789, iterator.next().intValue());
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java
new file mode 100644
index 0000000000..caf5a5e052
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java
@@ -0,0 +1,469 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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 static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.math.BigInteger;
+import java.util.Arrays;
+import java.util.Iterator;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import test.jaxb.props.ReturnCodeProperties;
+
+import commonj.sdo.DataObject;
+
+/**
+ * This is a class which makes user of JUnit Framework, all tests are written using JUnit notation. These tests are used
+ * to test different property values returned from the SCA Runtime Environment which is initialized with the composite
+ * 'PropertyTest.composite'. It basically tests all types of property values returned from SCA runtime environment.
+ */
+public class PropertyTestCase {
+ private static Node node;
+ private static ABComponent abService;
+ private static CDComponent cdService;
+ private static ABCDComponent abcdService;
+ private static PropertyComponent propertyService;
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 'a'
+ */
+ @Test
+ public void testA() {
+ assertEquals("a", abService.getA());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 'b'
+ */
+ @Test
+ public void testB() {
+ assertEquals("b", abService.getB());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 'c'
+ */
+ @Test
+ public void testC() {
+ assertEquals("c", cdService.getC());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 'c'
+ */
+ @Test
+ public void testC2() {
+ assertEquals("c", cdService.getC2());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 'd'
+ */
+ @Test
+ public void testD() {
+ assertEquals("d", cdService.getD());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 'a'
+ */
+ @Test
+ public void testF() {
+ assertEquals("a", abService.getF());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 'z'
+ */
+ @Test
+ public void testZ() {
+ assertEquals("z", abService.getZ());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 1.
+ */
+ @Test
+ public void testIntValue() {
+ assertEquals(1, abService.getIntValue());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 1.
+ */
+ @Test
+ public void testDefaultValue() {
+ assertEquals(1, abService.getIntValue());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 1.
+ */
+ @Test
+ public void testDefaultValueOverride() {
+ assertEquals(1, cdService.getOverrideValue());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 'aValue'
+ */
+ @Test
+ public void testNoSource() {
+ assertEquals("aValue", cdService.getNoSource());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value
+ * 'fileValue'
+ */
+ @Test
+ public void testFileProperty() {
+ assertEquals("fileValue", cdService.getFileProperty());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property values obtained using a service from the SCA runtime environment with the expected values 4 and
+ * 'fileValueTwo' respectively.
+ */
+ @Test
+ public void testManyValuesFileProperty() {
+ Iterator<String> iterator = cdService.getManyValuesFileProperty().iterator();
+ iterator.next();
+ String secondValue = iterator.next();
+ assertEquals(4, cdService.getManyValuesFileProperty().size());
+ assertEquals("fileValueTwo", secondValue);
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property values obtained using a service from the SCA runtime environment with the expected values 'a' ,
+ * 'b', 'c' and 'd' respectively.
+ */
+ @Test
+ public void testABCD() {
+ assertEquals("a", abcdService.getA());
+ assertEquals("b", abcdService.getB());
+ assertEquals("c", abcdService.getC());
+ assertEquals("d", abcdService.getD());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property values obtained using a service from the SCA runtime environment with the expected values 'RTP'
+ * and '2006' respectively
+ */
+ @Test
+ public void testDefaultProperty() {
+ assertEquals("RTP", propertyService.getLocation());
+ assertEquals("2006", propertyService.getYear());
+
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property values obtained using a service from the SCA runtime environment with the expected values 'Apache' ,
+ * 'Tuscany' and 'Java SCA' respectively .
+ */
+ @Test
+ public void testManySimpleStringValues() {
+ Iterator<String> iterator = abService.getManyStringValues().iterator();
+ assertEquals("Apache", iterator.next());
+ assertEquals("Tuscany", iterator.next());
+ assertEquals("Java SCA", iterator.next());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property values obtained using a service from the SCA runtime environment with the expected values 123, 456
+ * and 789 respectively.
+ */
+ @Test
+ public void testManySimpleIntegerValues() {
+ Iterator<Integer> iterator = abService.getManyIntegers().iterator();
+ assertEquals(123, iterator.next().intValue());
+ assertEquals(456, iterator.next().intValue());
+ assertEquals(789, iterator.next().intValue());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property values obtained using a service from the SCA runtime environment with the expected values
+ * 'TestString_1' and 2 respectively.
+ */
+ @Test
+ public void testComplexPropertyOne() {
+ ComplexPropertyBean propBean = propertyService.getComplexPropertyOne();
+ assertNotNull(propBean);
+ assertEquals("TestString_1", propBean.getStringArray()[0]);
+ assertEquals(2, propBean.numberSetArray[1].integerNumber);
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property values obtained using a service from the SCA runtime environment with the expected integer number
+ * and a float number
+ */
+ @Test
+ public void testComplexPropertyTwo() {
+ ComplexPropertyBean propBean = propertyService.getComplexPropertyTwo();
+ assertNotNull(propBean);
+ assertEquals(10, propBean.intArray[0]);
+ assertEquals((float)22, propBean.numberSetArray[1].floatNumber);
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property values obtained using a service from the SCA runtime environment with the expected value first
+ * element in the string array and the float number
+ */
+ @Test
+ public void testComplexPropertyThree() {
+ ComplexPropertyBean propBean = propertyService.getComplexPropertyThree();
+ assertNotNull(propBean);
+ assertEquals("TestElementString_1", propBean.stringArray[0]);
+ assertEquals((float)22, propBean.numberSetArray[1].floatNumber);
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * complex property value obtained using a service from the SCA runtime environment with the expected values
+ * 1, 222.222 and 33 respectively.
+ */
+ @Test
+ public void testComplexPropertyFour() {
+ Object[] propBeanCollection = propertyService.getComplexPropertyFour().toArray();
+ assertNotNull(propBeanCollection);
+ assertEquals(1, ((ComplexPropertyBean)propBeanCollection[0]).getIntegerNumber());
+ assertEquals(222.222, ((ComplexPropertyBean)propBeanCollection[1]).getDoubleNumber());
+ assertEquals(33, ((ComplexPropertyBean)propBeanCollection[2]).getNumberSet().getIntegerNumber());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property values obtained using a service from the SCA runtime environment with the expected values
+ * 'TestString_3', 'TestString_4', 100 and 200.
+ */
+ @Test
+ public void testComplexPropertyFive() {
+ ComplexPropertyBean propBean = propertyService.getComplexPropertyFive();
+ assertNotNull(propBean);
+ assertEquals("TestString_3", propBean.getStringArray()[0]);
+ assertEquals("TestString_4", propBean.getStringArray()[1]);
+ assertEquals(100, propBean.getIntArray()[0]);
+ assertEquals(200, propBean.getIntArray()[1]);
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property values obtained using a service from the SCA runtime environment with the expected string values
+ * 'Firstly Name' , 'Middler Name' and 'Lasting Name' respectively
+ */
+ @Test
+ public void testSDOProperty1() {
+ DataObject dataObject = propertyService.getSdoProperty();
+ assertNotNull(dataObject);
+ assertEquals("Firstly Name", dataObject.get("firstName"));
+ assertEquals("Middler Name", dataObject.getString("middleName"));
+ assertEquals("Lasting Name", dataObject.getString("lastName"));
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected string values
+ * 'Sdo Firstly Name', 'Sdo Middler Name' and 'Sdo Lasting Name' respectively
+ */
+ @Test
+ public void testSDOProperty2() {
+ DataObject dataObject = propertyService.getCustomerSdo();
+ assertNotNull(dataObject);
+ assertEquals("Sdo Firstly Name", dataObject.get("firstName"));
+ assertEquals("Sdo Middler Name", dataObject.getString("middleName"));
+ assertEquals("Sdo Lasting Name", dataObject.getString("lastName"));
+ }
+
+ @Test
+ public void testGetLocationFromComponentContext() {
+ String location = propertyService.getLocation();
+ assertNotNull(location);
+ String locationFromCC = propertyService.getLocationFromComponentContext();
+ assertNotNull(locationFromCC);
+ assertEquals(location, locationFromCC);
+ }
+
+ @Test
+ public void testGetInjectedStringArrayProperty() {
+ String[] daysOfWeek = propertyService.getDaysOfTheWeek();
+ assertNotNull(daysOfWeek);
+
+ String[] expected = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
+ Assert.assertTrue(Arrays.equals(expected, daysOfWeek));
+ }
+
+ @Test
+ public void testGetInjectedIntegerArrayProperty() {
+ Integer[] numbers = propertyService.getIntegerNumbers();
+ assertNotNull(numbers);
+
+ Integer[] expected = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
+ Assert.assertTrue(Arrays.equals(expected, numbers));
+ }
+
+ @Test
+ public void testGetInjectedIntArrayProperty() {
+ int[] numbers = propertyService.getIntNumbers();
+ assertNotNull(numbers);
+
+ int[] expected = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
+ Assert.assertTrue(Arrays.equals(expected, numbers));
+ }
+
+ @Test
+ public void testGetInjectedSdoArrayProperty() {
+ DataObject[] sdos = propertyService.getSdoArrayProperty();
+ assertNotNull(sdos);
+
+ for (int i = 1; i <= 3; i++) {
+ DataObject dataObject = sdos[i - 1];
+ assertEquals("Firstly Name " + i, dataObject.get("firstName"));
+ assertEquals("Middler Name " + i, dataObject.getString("middleName"));
+ assertEquals("Lasting Name " + i, dataObject.getString("lastName"));
+ }
+ }
+
+ @Test
+ public void testComplexJAXBProperty() {
+ ReturnCodeProperties rc = propertyService.getComplexJAXBPropertyOne();
+ assertEquals(10, rc.getA());
+ assertEquals(new BigInteger("10"), rc.getB());
+ }
+
+ @Test
+ public void testComplexJAXBPropertyFromFile() {
+ ReturnCodeProperties rc = propertyService.getComplexJAXBPropertyTwo();
+ System.out.println("SKSK: a =" + rc.getA());
+ System.out.println("SKSK: b =" + rc.getB());
+ assertEquals(20, rc.getA());
+ assertEquals(new BigInteger("20"), rc.getB());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @BeforeClass is used for one time set Up, it executes before every tests. This method is used to create a test
+ * Embedded SCA node, to start the SCA node and to get a reference to 4 services namely 'abService'
+ * service, 'cdService' service, 'abcdService' service and 'propertyService' service
+ */
+ @BeforeClass
+ public static void init() throws Exception {
+ try {
+ String location = ContributionLocationHelper.getContributionLocation("PropertyTest.composite");
+ node = NodeFactory.newInstance().createNode("PropertyTest.composite", new Contribution("c1", location));
+ node.start();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ abService = node.getService(ABComponent.class, "ABComponent");
+ cdService = node.getService(CDComponent.class, "CDComponent");
+ abcdService = node.getService(ABCDComponent.class, "ABCDComponent");
+ propertyService = node.getService(PropertyComponent.class, "PropertyComponent");
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @AfterClass is used for one time Tear Down, it executes after every tests. This method is used to close the
+ * node, close any previously opened connections etc
+ */
+ @AfterClass
+ public static void destroy() throws Exception {
+ node.stop();
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/properties/src/test/java/org/apache/tuscany/sca/itest/cdi/ConstructorPropertyInjectionTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/test/java/org/apache/tuscany/sca/itest/cdi/ConstructorPropertyInjectionTestCase.java
new file mode 100644
index 0000000000..a0213ced46
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/properties/src/test/java/org/apache/tuscany/sca/itest/cdi/ConstructorPropertyInjectionTestCase.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.cdi;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class ConstructorPropertyInjectionTestCase {
+ private static org.apache.tuscany.sca.node.Node node;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ try {
+ String location = ContributionLocationHelper.getContributionLocation("ConstructorPropertyInjection.composite");
+ node = NodeFactory.newInstance().createNode("ConstructorPropertyInjection.composite", new Contribution("c1", location));
+ node.start();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @AfterClass is used for one time Tear Down, it executes after every tests. This method is used to close the
+ * node, close any previously opened connections etc
+ */
+ @AfterClass
+ public static void destroy() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void testFoo1() throws Exception {
+ Bar foo = node.getService(Bar.class, "Foo1Component");
+ assertEquals("fubar", foo.getBar());
+ }
+
+ @Test
+ public void testFoo2() throws Exception {
+ Bar foo = node.getService(Bar.class, "Foo2Component");
+ assertEquals("fubar", foo.getBar());
+ }
+
+ @Test
+ public void testFoo3() throws Exception {
+ Bar foo = node.getService(Bar.class, "Foo3Component");
+ assertEquals("fubar", foo.getBar());
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/pom.xml
new file mode 100644
index 0000000000..437fbbff44
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/pom.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <!--relativePath>../pom.xml</relativePath-->
+ </parent>
+ <artifactId>itest-recursive-multi-level</artifactId>
+ <name>Apache Tuscany SCA iTest Recusive Multi-Level</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- XPathFactory -->
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.7.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyService.java b/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyService.java
new file mode 100644
index 0000000000..986c8305dd
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyService.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 mysca.test.myservice;
+
+public interface MyService {
+ String getLocation();
+
+ String getYear();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyServiceImpl.java
new file mode 100644
index 0000000000..6cad998042
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyServiceImpl.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 mysca.test.myservice;
+
+import org.oasisopen.sca.annotation.Property;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(MyService.class)
+public class MyServiceImpl implements MyService {
+
+ @Property(name = "location")
+ protected String location = "ABC";
+
+ @Property(name = "year")
+ protected String year = "2006";
+
+ public String getLocation() {
+ return location;
+ }
+
+ public String getYear() {
+ return year;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalService.java b/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalService.java
new file mode 100644
index 0000000000..261eff2584
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalService.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 mysca.test.myservice;
+
+public interface MySimpleTotalService {
+ String getLocation();
+
+ String getYear();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalServiceImpl.java
new file mode 100644
index 0000000000..f3c9280f96
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalServiceImpl.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 mysca.test.myservice;
+
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(MySimpleTotalService.class)
+public class MySimpleTotalServiceImpl implements MySimpleTotalService {
+ // default required==true so it is 1:1
+ @Reference
+ public MyService myService;
+
+ public String getLocation() {
+ return myService.getLocation();
+ }
+
+ public String getYear() {
+ return myService.getYear();
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/resources/TotalService1Auto.composite b/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/resources/TotalService1Auto.composite
new file mode 100644
index 0000000000..090bc49a41
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/resources/TotalService1Auto.composite
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<composite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:foo="http://foo"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xsi:schemaLocation="http://docs.oasis-open.org/ns/opencsa/sca/200903 http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ name="TotalComposite1Auto"
+ targetNamespace="http://foo"
+ local="true"
+ autowire="false">
+
+ <property name="newLocation" type="xsd:anyURI">Level 1</property>
+ <property name="newYear" type="xsd:anyURI">2001</property>
+
+ <component name="ServiceComponentLevel1Auto">
+ <implementation.java class="mysca.test.myservice.MyServiceImpl"/>
+ <property name="location" source="$newLocation"/>
+ <property name="year" source="$newYear"/>
+ </component>
+
+ <service name="MyServiceLevel1Auto" promote="TotalServiceComponentLevel1Auto/MySimpleTotalService">
+ <interface.java interface="mysca.test.myservice.MySimpleTotalService"/>
+ </service>
+
+ <component name="TotalServiceComponentLevel1Auto">
+ <implementation.java class="mysca.test.myservice.MySimpleTotalServiceImpl"/>
+ <reference name="myService" autowire="true"/>
+ </component>
+
+ <reference name="myServiceReference1Auto" promote="TotalServiceComponentLevel1Auto/myService">
+ <interface.java interface="mysca.test.myservice.MyService"/>
+ </reference>
+</composite>
+
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/resources/TotalService2Auto.composite b/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/resources/TotalService2Auto.composite
new file mode 100644
index 0000000000..8c1a9a2f72
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/resources/TotalService2Auto.composite
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<composite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:foo="http://foo"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xsi:schemaLocation="http://docs.oasis-open.org/ns/opencsa/sca/200903 http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ name="TotalComposite2Auto"
+ targetNamespace="http://foo"
+ local="true"
+ autowire="false">
+
+ <property name="newLocation" type="xsd:anyURI">Level 2</property>
+ <property name="newYear" type="xsd:anyURI">2002</property>
+
+ <component name="ServiceComponentLevel2Auto">
+ <implementation.java class="mysca.test.myservice.MyServiceImpl"/>
+ <property name="location">Default 2</property>
+ <property name="year">1992</property>
+ </component>
+
+ <service name="MyServiceLevel2Auto" promote="TotalServiceInRecursive2Auto/MyServiceLevel1Auto"/>
+
+ <component name="TotalServiceInRecursive2Auto">
+ <implementation.composite name="foo:TotalComposite1Auto"/>
+ <reference name="myServiceReference1Auto" autowire="true"/>
+ <property name="newLocation" source="$newLocation"/>
+ <property name="newYear" source="$newYear"/>
+ </component>
+
+ <reference name="myServiceReference2Auto" promote="TotalServiceInRecursive2Auto/myServiceReference1Auto"/>
+</composite> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/resources/TotalService3Auto.composite b/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/resources/TotalService3Auto.composite
new file mode 100644
index 0000000000..884a8b0a96
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/main/resources/TotalService3Auto.composite
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<composite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:foo="http://foo"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xsi:schemaLocation="http://docs.oasis-open.org/ns/opencsa/sca/200903 http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ name="TotalComposite3Auto"
+ targetNamespace="http://foo"
+ local="true"
+ autowire="false">
+
+ <property name="newLocation" type="xsd:anyURI">Level 3</property>
+ <property name="newYear" type="xsd:anyURI">2003</property>
+
+ <component name="ServiceComponentLevel3Auto">
+ <implementation.java class="mysca.test.myservice.MyServiceImpl"/>
+ <property name="location">Default 3</property>
+ <property name="year">1993</property>
+ </component>
+
+ <service name="MyServiceLevel3Auto" promote="TotalServiceInRecursive3Auto/MyServiceLevel2Auto">
+ </service>
+
+ <component name="TotalServiceInRecursive3Auto" autowire="true">
+ <implementation.composite name="foo:TotalComposite2Auto"/>
+ <reference name="myServiceReference2Auto"/>
+ <property name="newLocation" source="$newLocation"/>
+ <property name="newYear" source="$newYear"/>
+ </component>
+
+ <reference name="myServiceReference3Auto" promote="TotalServiceInRecursive3Auto/myServiceReference2Auto">
+ </reference>
+
+</composite> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/test/java/test/sca/tests/MultiLevelTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/test/java/test/sca/tests/MultiLevelTestCase.java
new file mode 100644
index 0000000000..b9b4e3ba7c
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/recursive-multi-level/src/test/java/test/sca/tests/MultiLevelTestCase.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.sca.tests;
+
+import static org.junit.Assert.assertEquals;
+import mysca.test.myservice.MySimpleTotalService;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * Tests to make sure that autowiring and recusive composite work together
+ *
+ */
+public class MultiLevelTestCase {
+ private static Node node1;
+ private static Node node2;
+ private static Node node3;
+ private static MySimpleTotalService myService1;
+ private static MySimpleTotalService myService2;
+ private static MySimpleTotalService myService3;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("TotalService1Auto.composite");
+ Contribution contribution = new Contribution("c1", location);
+ try {
+ node1 = NodeFactory.newInstance().createNode("TotalService1Auto.composite", contribution);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ node2 = NodeFactory.newInstance().createNode("TotalService2Auto.composite", contribution);
+ node3 = NodeFactory.newInstance().createNode("TotalService3Auto.composite", contribution);
+
+ node1.start();
+ node2.start();
+ node3.start();
+
+ myService1 = node1.getService(MySimpleTotalService.class, "TotalServiceComponentLevel1Auto");
+ myService2 = node2.getService(MySimpleTotalService.class, "TotalServiceInRecursive2Auto/MyServiceLevel1Auto");
+ myService3 = node3.getService(MySimpleTotalService.class, "TotalServiceInRecursive3Auto/MyServiceLevel2Auto");
+ }
+
+ @Test
+ public void testLevel1() {
+ assertEquals("Level 1", myService1.getLocation());
+ assertEquals("2001", myService1.getYear());
+ }
+
+ @Test
+ public void testLevel2() {
+ assertEquals("Default 2", myService2.getLocation());
+ assertEquals("1992", myService2.getYear());
+ }
+
+ @Test
+ public void testLevel3() {
+ assertEquals("Default 3", myService3.getLocation());
+ assertEquals("1993", myService3.getYear());
+ }
+
+ @AfterClass
+ public static void tearDown() {
+ node1.stop();
+ node2.stop();
+ node3.stop();
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/references/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/references/pom.xml
new file mode 100644
index 0000000000..05daa07fba
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/references/pom.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-references</artifactId>
+ <name>Apache Tuscany SCA iTest References</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponent.java b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponent.java
new file mode 100644
index 0000000000..f8c0850118
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponent.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.references;
+
+public interface AComponent {
+
+ String fooB();
+
+ String fooC();
+
+ String fooBC();
+
+ String fooD1();
+
+ String fooD2();
+
+ String fooMultipleD();
+
+ String fooMultipleDArray();
+
+ String fooMultipleDServiceRef();
+
+ DComponent getDReference();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponentImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponentImpl.java
new file mode 100644
index 0000000000..49c3deb84d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponentImpl.java
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.references;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.oasisopen.sca.ServiceReference;
+import org.oasisopen.sca.annotation.Reference;
+
+public class AComponentImpl implements AComponent {
+
+ @Reference(name = "bReference")
+ protected BComponent b;
+
+ @Reference
+ protected CComponent cReference;
+
+ @Reference(required = false)
+ protected DComponent dReference;
+
+ @Reference(name = "dReferences")
+ public Collection<DComponent> dReferences;
+
+ @Reference(name = "dReferenceArray")
+ public DComponent[] dReferenceArray;
+
+ @Reference(name = "dServiceReferences")
+ public List<ServiceReference<DComponent>> dServiceReferences;
+
+ private DComponent dReference1;
+
+ private DComponent dReference2;
+
+ @Reference(name = "dReference1")
+ public void setDReference(DComponent dReference) {
+ this.dReference1 = dReference;
+ }
+
+ @Reference
+ public void setDReference2(DComponent dReference2) {
+ this.dReference2 = dReference2;
+ }
+
+ public String fooB() {
+ return b.bFoo();
+ }
+
+ public String fooC() {
+ return cReference.cFoo();
+ }
+
+ public String fooBC() {
+ return b.fooC();
+ }
+
+ public String fooD() {
+ return dReference1.dFoo();
+ }
+
+ public String fooD1() {
+ return dReference1.dFoo();
+ }
+
+ public String fooD2() {
+ return dReference2.dFoo();
+ }
+
+ public String fooMultipleDArray() {
+ StringBuffer str = new StringBuffer();
+ for (DComponent d : dReferenceArray) {
+ str.append(d.getComponentName());
+ str.append(',');
+ }
+ if (str.length() > 0) {
+ str.deleteCharAt(str.length() - 1);
+ }
+ return str.toString();
+ }
+
+ public String fooMultipleD() {
+ StringBuffer str = new StringBuffer();
+ for (DComponent d : dReferences) {
+ str.append(d.getComponentName());
+ str.append(',');
+ }
+ if (str.length() > 0) {
+ str.deleteCharAt(str.length() - 1);
+ }
+ return str.toString();
+ }
+
+ public String fooMultipleDServiceRef() {
+ StringBuffer str = new StringBuffer();
+ for (ServiceReference<DComponent> d : dServiceReferences) {
+ str.append(d.getService().getComponentName());
+ str.append(',');
+ }
+ if (str.length() > 0) {
+ str.deleteCharAt(str.length() - 1);
+ }
+ return str.toString();
+ }
+
+ public DComponent getDReference() {
+ return dReference;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponent.java b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponent.java
new file mode 100644
index 0000000000..785920bb2d
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponent.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.references;
+
+public interface BComponent {
+
+ String bFoo();
+
+ String fooC();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentImpl.java
new file mode 100644
index 0000000000..211e6160f6
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentImpl.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.references;
+
+import org.oasisopen.sca.annotation.Reference;
+
+public class BComponentImpl implements BComponent {
+
+ protected CComponent cReference;
+
+ public BComponentImpl(@Reference(name = "cReference") CComponent cReference) {
+ this.cReference = cReference;
+ }
+
+ public String bFoo() {
+ return "BComponent";
+ }
+
+ public String fooC() {
+ return "B" + cReference.cFoo();
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentWrongTargetImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentWrongTargetImpl.java
new file mode 100644
index 0000000000..47a1f9bde8
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentWrongTargetImpl.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.references;
+
+import org.oasisopen.sca.annotation.Reference;
+
+public class BComponentWrongTargetImpl implements BComponent {
+
+ protected CComponent cReference;
+
+ public BComponentWrongTargetImpl(@Reference(name = "cReference") CComponent cReference) {
+ this.cReference = cReference;
+ }
+
+ public String bFoo() {
+ return "BComponentWrongTarget";
+ }
+
+ public String fooC() {
+ return "B" + cReference.cFoo();
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponent.java b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponent.java
new file mode 100644
index 0000000000..d436c28adc
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponent.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.references;
+
+public interface CComponent {
+
+ String cFoo();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponentImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponentImpl.java
new file mode 100644
index 0000000000..a1823e1cdc
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponentImpl.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.references;
+
+public class CComponentImpl implements CComponent {
+
+ public String cFoo() {
+ return "CComponent";
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponent.java b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponent.java
new file mode 100644
index 0000000000..80617bdec2
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponent.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.references;
+
+public interface DComponent {
+
+ String dFoo();
+
+ String getComponentName();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponentImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponentImpl.java
new file mode 100644
index 0000000000..d181ac96ca
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponentImpl.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.references;
+
+import org.oasisopen.sca.annotation.ComponentName;
+
+public class DComponentImpl implements DComponent {
+ @ComponentName
+ public String name;
+
+ public String dFoo() {
+ return "DComponent";
+ }
+
+ public String getComponentName() {
+ return name;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/resources/AutoWiredReferencesTest.composite b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/resources/AutoWiredReferencesTest.composite
new file mode 100644
index 0000000000..5300107706
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/resources/AutoWiredReferencesTest.composite
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:foo="http://foo" targetNamespace="http://foo"
+ name="AutowireReferencesTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autowire="true">
+
+ <component name="AComponent" autowire="false">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.AComponentImpl" />
+ <reference name="bReference" target="BComponent" />
+ <reference name="cReference" autowire="true" />
+ <reference name="dReference1" />
+ <!--
+ <reference name="dReference1" target="DComponent" />
+ -->
+ <reference name="DReference2" target="DComponent" />
+ <reference name="dReferences" autowire="true" />
+ <reference name="dReferenceArray" autowire="true" />
+ <reference name="dServiceReferences" target="DComponent DComponent1" />
+
+ </component>
+
+ <component name="AComponentAutowire" autowire="true">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.AComponentImpl" />
+ <reference name="bReference" target="BComponent" />
+ </component>
+
+ <component name="BComponentWrongTarget">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.BComponentWrongTargetImpl" />
+ </component>
+
+ <component name="BComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.BComponentImpl" />
+ </component>
+
+ <component name="CComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.CComponentImpl" />
+ </component>
+
+ <component name="DComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.DComponentImpl" />
+ </component>
+
+ <component name="DComponent1">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.DComponentImpl" />
+ </component>
+</composite> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/resources/InnerReferencesTest.composite b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/resources/InnerReferencesTest.composite
new file mode 100644
index 0000000000..be4ac75b3c
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/resources/InnerReferencesTest.composite
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:foo="http://foo" targetNamespace="http://foo"
+ name="InnerReferencesTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+
+ <component name="AComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.AComponentImpl" />
+ <reference name="bReference" target="BComponent" />
+ <reference name="cReference" target="CComponent" />
+ <reference name="dReference1" target="DComponent" />
+ <reference name="DReference2" target="DComponent" />
+ <reference name="dReferences" target="DComponent DComponent1" />
+ <reference name="dReferenceArray" target="DComponent1" />
+ <reference name="dServiceReferences" target="DComponent DComponent1" />
+ </component>
+
+ <component name="BComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.BComponentImpl" />
+ <reference name="cReference" target="CComponent" />
+ </component>
+
+ <component name="CComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.CComponentImpl" />
+ </component>
+
+ <component name="DComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.DComponentImpl" />
+ </component>
+
+ <component name="DComponent1">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.DComponentImpl" />
+ </component>
+
+</composite> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/resources/ManualWiredReferencesTest.composite b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/resources/ManualWiredReferencesTest.composite
new file mode 100644
index 0000000000..d5596e3da4
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/references/src/main/resources/ManualWiredReferencesTest.composite
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:foo="http://foo" targetNamespace="http://foo"
+ name="ManualWiredReferencesTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autowire="true">
+
+ <component name="AComponent" >
+ <implementation.java class="org.apache.tuscany.sca.itest.references.AComponentImpl" />
+ <reference name="bReference" target="BComponent" />
+ <reference name="cReference" target="CComponent/CComponentImpl">
+ <!-- reference name="cReference" target="CComponent"-->
+ <binding.sca uri="DComponent"/>
+ </reference>
+ <reference name="dReference1" >
+ <binding.sca uri="DComponent"/>
+ </reference>
+ <reference name="DReference2" target="DComponent" >
+ <!-- binding.ws uri="DComponent"/-->
+ </reference>
+ <reference name="dReferences" target="DComponent DComponent1" />
+ <reference name="dReferenceArray" target="DComponent DComponent1" />
+ <reference name="dServiceReferences" target="DComponent DComponent1" />
+
+ </component>
+
+ <component name="BComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.BComponentImpl" />
+ </component>
+
+ <component name="CComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.CComponentImpl" />
+ </component>
+
+ <component name="DComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.DComponentImpl" />
+ <service name="DComponentImpl">
+ <binding.sca/>
+ <!-- binding.ws/-->
+ </service>
+ </component>
+
+ <component name="DComponent1">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.DComponentImpl" />
+ </component>
+</composite> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/AutoWiredReferenceTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/AutoWiredReferenceTestCase.java
new file mode 100644
index 0000000000..76264d308f
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/AutoWiredReferenceTestCase.java
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.references;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.oasisopen.sca.ServiceUnavailableException;
+
+public class AutoWiredReferenceTestCase {
+ private static Node node;
+ private static AComponent acomponent;
+ private static AComponent acomponentAutowire;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ try {
+ String location = ContributionLocationHelper.getContributionLocation("AutoWiredReferencesTest.composite");
+ node =
+ NodeFactory.newInstance().createNode("AutoWiredReferencesTest.composite",
+ new Contribution("c1", location));
+ node.start();
+ acomponent = node.getService(AComponent.class, "AComponent");
+ acomponentAutowire = node.getService(AComponent.class, "AComponentAutowire");
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void testBReference() {
+ assertEquals("BComponent", acomponent.fooB());
+ }
+
+ @Test
+ public void testCReference() {
+ assertEquals("CComponent", acomponent.fooC());
+ }
+
+ @Test
+ public void testBCReference() {
+ assertEquals("BCComponent", acomponent.fooBC());
+ }
+
+ @Test(expected = Exception.class)
+ public void testD1Reference() {
+ acomponent.fooD1();
+ }
+
+ @Test
+ public void testD2Reference() {
+ assertEquals("DComponent", acomponent.fooD2());
+ }
+
+ @Test
+ public void testMultiDReferenceArray() {
+ String components = acomponent.fooMultipleDArray();
+ Assert.assertTrue(components.contains("DComponent1"));
+ }
+
+ @Test
+ public void testMultiDServiceReference() {
+ String components = acomponent.fooMultipleDServiceRef();
+ Assert.assertTrue(components.contains("DComponent"));
+ Assert.assertTrue(components.contains("DComponent1"));
+ }
+
+ @Test
+ public void testRequiredFalseReference() {
+ try {
+ acomponent.getDReference().dFoo();
+ } catch (Exception e) {
+ Assert.assertTrue(true);
+ }
+ }
+
+ @Test
+ public void testTargetPrecendence() {
+ try {
+ assertEquals("BComponent", acomponentAutowire.fooB());
+ } catch (Exception e) {
+ Assert.assertTrue(true);
+ }
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/InnerReferenceTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/InnerReferenceTestCase.java
new file mode 100644
index 0000000000..6e4212fd9a
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/InnerReferenceTestCase.java
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.references;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class InnerReferenceTestCase {
+ private static Node node;
+ private static AComponent acomponent;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("InnerReferencesTest.composite");
+ node = NodeFactory.newInstance().createNode("InnerReferencesTest.composite", new Contribution("c1", location));
+ node.start();
+ acomponent = node.getService(AComponent.class, "AComponent");
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void testBReference() {
+ assertEquals("BComponent", acomponent.fooB());
+ }
+
+ @Test
+ public void testCReference() {
+ assertEquals("CComponent", acomponent.fooC());
+ }
+
+ @Test
+ public void testBCReference() {
+ assertEquals("BCComponent", acomponent.fooBC());
+ }
+
+ @Test
+ public void testD1Reference() {
+ assertEquals("DComponent", acomponent.fooD1());
+ }
+
+ @Test
+ public void testD2Reference() {
+ assertEquals("DComponent", acomponent.fooD2());
+ }
+
+ @Test
+ public void testMultiDReference() {
+ String components = acomponent.fooMultipleD();
+ Assert.assertTrue(components.contains("DComponent"));
+ Assert.assertTrue(components.contains("DComponent1"));
+ }
+
+ @Test
+ public void testMultiDReferenceArray() {
+ String components = acomponent.fooMultipleDArray();
+ Assert.assertTrue(components.equals("DComponent1"));
+ }
+
+ @Test
+ public void testMultiDServiceReference() {
+ String components = acomponent.fooMultipleDServiceRef();
+ Assert.assertTrue(components.contains("DComponent"));
+ Assert.assertTrue(components.contains("DComponent1"));
+ }
+
+ @Test(expected = Exception.class)
+ public void testRequiredFalseReference() {
+ acomponent.getDReference().dFoo();
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/ManualWiredReferenceTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/ManualWiredReferenceTestCase.java
new file mode 100644
index 0000000000..6349e4f827
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/ManualWiredReferenceTestCase.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.itest.references;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class ManualWiredReferenceTestCase {
+ private static Node node;
+ private static AComponent acomponent;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("ManualWiredReferencesTest.composite");
+ node = NodeFactory.newInstance().createNode("ManualWiredReferencesTest.composite", new Contribution("c1", location));
+ node.start();
+ acomponent = node.getService(AComponent.class, "AComponent");
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void testBReference() {
+ assertEquals("BComponent", acomponent.fooB());
+ }
+
+ @Test
+ public void testCReference() {
+ assertEquals("CComponent", acomponent.fooC());
+ }
+
+ @Test
+ public void testBCReference() {
+ assertEquals("BCComponent", acomponent.fooBC());
+ }
+
+ @Test
+ public void testD1Reference() {
+ acomponent.fooD1();
+ }
+
+ @Ignore
+ @Test
+ public void testD2Reference() {
+ assertEquals("DComponent", acomponent.fooD2());
+ }
+
+ @Test
+ public void testMultiDReferenceArray() {
+ String components = acomponent.fooMultipleDArray();
+ Assert.assertTrue(components.contains("DComponent1"));
+ }
+
+ @Test
+ public void testMultiDServiceReference() {
+ String components = acomponent.fooMultipleDServiceRef();
+ Assert.assertTrue(components.contains("DComponent"));
+ Assert.assertTrue(components.contains("DComponent1"));
+ }
+
+ @Test
+ public void testRequiredFalseReference() {
+ try {
+ acomponent.getDReference().dFoo();
+ } catch (Exception e) {
+ Assert.assertTrue(true);
+ }
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/pom.xml
new file mode 100644
index 0000000000..0af889cdf6
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/pom.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-scaclient-api</artifactId>
+ <name>Apache Tuscany SCA iTest SCAClient API</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-client-impl</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/src/main/java/itest/HelloworldService.java b/tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/src/main/java/itest/HelloworldService.java
new file mode 100644
index 0000000000..1c7edaefb6
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/src/main/java/itest/HelloworldService.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 itest;
+
+public interface HelloworldService {
+
+ String sayHello(String name);
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/src/main/java/itest/HelloworldServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/src/main/java/itest/HelloworldServiceImpl.java
new file mode 100644
index 0000000000..4b9910bb21
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/src/main/java/itest/HelloworldServiceImpl.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 itest;
+
+import org.oasisopen.sca.annotation.EagerInit;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Scope;
+
+@EagerInit
+@Scope("COMPOSITE")
+public class HelloworldServiceImpl implements HelloworldService {
+
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+
+ @Init
+ public void init() {
+ System.out.println(sayHello("world"));
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/src/main/resources/Helloworld.composite b/tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/src/main/resources/Helloworld.composite
new file mode 100644
index 0000000000..0352aabfb1
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/src/main/resources/Helloworld.composite
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://itest"
+ name="Helloworld">
+
+ <component name="HelloworldComponent">
+ <implementation.java class="itest.HelloworldServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..d8604a5cc0
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:itest="http://itest">
+ <deployable composite="itest:Helloworld"/>
+</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java
new file mode 100644
index 0000000000..f8c0d9034e
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.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 test.scaclient;
+
+import itest.HelloworldService;
+
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.oasisopen.sca.client.SCAClientFactory;
+
+/**
+ * Test SCADomain.newInstance and invocation of a service.
+ *
+ * @version $Rev$ $Date$
+ */
+public class SCAClientTestCase extends TestCase {
+
+ private Node node;
+
+ @Override
+ protected void setUp() throws Exception {
+ node = NodeFactory.newInstance().createNode();
+ node.start();
+ }
+
+ public void testInvoke() throws Exception {
+ HelloworldService service =
+ SCAClientFactory.newInstance().getService(HelloworldService.class,
+ "HelloworldComponent",
+ URI.create(Node.DEFAULT_DOMAIN_URI));
+ assertEquals("Hello petra", service.sayHello("petra"));
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/scopes/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/scopes/pom.xml
new file mode 100644
index 0000000000..a154779531
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/scopes/pom.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <name>Apache Tuscany SCA iTest Scopes</name>
+ <artifactId>itest-scopes</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/CompositeScopeStateVerifierImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/CompositeScopeStateVerifierImpl.java
new file mode 100644
index 0000000000..208ac3ba44
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/CompositeScopeStateVerifierImpl.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.scopes;
+
+import org.oasisopen.sca.annotation.Scope;
+
+/**
+ * Test Composite scope
+ */
+@Scope("COMPOSITE")
+public class CompositeScopeStateVerifierImpl implements StateVerifier {
+
+ // State data for this module (composite).
+ // In order to support thread-based state verification,
+ // the module state needs to be a ThreadLocal.
+ ThreadLocal<Integer> moduleState;
+
+ public CompositeScopeStateVerifierImpl() {
+ moduleState = new ThreadLocal<Integer>();
+ }
+
+ public void setState(int i) {
+ moduleState.set(i);
+ }
+
+ public boolean checkState(int i) {
+ return (moduleState.get() == i);
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/RequestScopeStateVerifierImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/RequestScopeStateVerifierImpl.java
new file mode 100644
index 0000000000..ff116070b5
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/RequestScopeStateVerifierImpl.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.scopes;
+
+import org.oasisopen.sca.annotation.Destroy;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Scope;
+
+/**
+ * Test request scope
+ */
+@Scope("REQUEST")
+public class RequestScopeStateVerifierImpl implements StateVerifier {
+ // State data for this request thread.
+ int requestState;
+
+ public void setState(int i) {
+ requestState = i;
+ }
+
+ public boolean checkState(int i) {
+ return (requestState == i);
+ }
+
+ @Init
+ public void init() {
+ requestState = 0;
+ }
+
+ @Destroy
+ public void destroy() {
+ requestState = -1;
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/StateVerifier.java b/tags/java/sca/2.0-M3-RC3a/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/StateVerifier.java
new file mode 100644
index 0000000000..e6bf08ccf2
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/StateVerifier.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.scopes;
+
+public interface StateVerifier {
+ void setState(int i);
+
+ boolean checkState(int i);
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/scopes/src/main/resources/scopes.composite b/tags/java/sca/2.0-M3-RC3a/itest/scopes/src/main/resources/scopes.composite
new file mode 100644
index 0000000000..ac6de1b8bc
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/scopes/src/main/resources/scopes.composite
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ name="Scopes">
+
+ <!-- Components used to test scopes. -->
+
+ <component name="RequestScopeComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.scopes.RequestScopeStateVerifierImpl"/>
+ </component>
+
+ <component name="ModuleScopeComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.scopes.CompositeScopeStateVerifierImpl"/>
+ </component>
+
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/scopes/src/test/java/org/apache/tuscany/sca/test/ScopeTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/scopes/src/test/java/org/apache/tuscany/sca/test/ScopeTestCase.java
new file mode 100644
index 0000000000..959a6067ee
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/scopes/src/test/java/org/apache/tuscany/sca/test/ScopeTestCase.java
@@ -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 org.apache.tuscany.sca.test;
+
+import static org.junit.Assert.fail;
+
+import org.apache.tuscany.sca.itest.scopes.StateVerifier;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ScopeTestCase {
+
+ /**
+ * Number of threads to drive each scope container.
+ */
+ private static final int NUM_THREADS = 4;
+
+ /**
+ * Number of iterations per thread.
+ */
+ private static final int ITERATIONS = 200;
+
+ private Node node;
+
+ /**
+ * Test scope containers.
+ *
+ * The request scope container isn't hooked up for some reason so the code below
+ * that tests request scope is commented out.
+ * Code could be added to test session scope once it is supported in a standalone environment.
+ *
+ * @throws InterruptedException Test failed
+ */
+ @Test
+ public void testScopes() throws InterruptedException {
+
+ Thread[] moduleScopeThreadTable = new Thread[NUM_THREADS];
+ Thread[] requestScopeThreadTable = new Thread[NUM_THREADS];
+
+ for (int i = 0; i < NUM_THREADS; i++) {
+ moduleScopeThreadTable[i] = new ModuleScopeTestThread();
+ requestScopeThreadTable[i] = new RequestScopeTestThread();
+ }
+ for (int j = 0; j < NUM_THREADS; j++) {
+ moduleScopeThreadTable[j].start();
+ requestScopeThreadTable[j].start();
+ }
+ for (int k = 0; k < NUM_THREADS; k++) {
+ moduleScopeThreadTable[k].join();
+ requestScopeThreadTable[k].join();
+ }
+ }
+
+ private class ModuleScopeTestThread extends Thread {
+
+ public void run() {
+ StateVerifier moduleScopeService = node.getService(StateVerifier.class, "ModuleScopeComponent");
+ for (int i = 1; i <= ITERATIONS; i++) {
+ moduleScopeService.setState(i);
+ if (!moduleScopeService.checkState(i)) {
+ fail("The module scope service lost its state on iteration " + i);
+ }
+ }
+ }
+ }
+
+ private class RequestScopeTestThread extends Thread {
+
+ public void run() {
+ StateVerifier requestScopeService = node.getService(StateVerifier.class, "RequestScopeComponent");
+ for (int i = 1; i <= ITERATIONS; i++) {
+ requestScopeService.setState(i);
+ if (!requestScopeService.checkState(i)) {
+ fail("The request scope service lost its state on iteration " + i);
+ }
+ }
+ }
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("scopes.composite");
+ node = NodeFactory.newInstance().createNode("scopes.composite", new Contribution("c1", location));
+ node.start();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/services/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/services/pom.xml
new file mode 100644
index 0000000000..e2030af889
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/services/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-services</artifactId>
+ <name>Apache Tuscany SCA iTest Services</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponent.java b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponent.java
new file mode 100644
index 0000000000..26e58dc530
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponent.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.services;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface AComponent {
+ String foo();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponentImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponentImpl.java
new file mode 100644
index 0000000000..627ff4976f
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponentImpl.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.services;
+
+public class AComponentImpl implements AComponent {
+
+ public String foo() {
+ return "AComponent";
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponent.java b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponent.java
new file mode 100644
index 0000000000..d04bd1b985
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponent.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.services;
+
+public interface BComponent {
+
+ String foo();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponentImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponentImpl.java
new file mode 100644
index 0000000000..01df89a8fa
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponentImpl.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.itest.services;
+
+import org.oasisopen.sca.annotation.Service;
+
+@Service(BComponent.class)
+public class BComponentImpl implements BComponent {
+
+ public String foo() {
+ return "BComponent";
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponent.java b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponent.java
new file mode 100644
index 0000000000..07397e4502
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/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.services;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface CComponent {
+ String foo();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponentImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponentImpl.java
new file mode 100644
index 0000000000..8713e5ab22
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponentImpl.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.services;
+
+public class CComponentImpl implements CComponent {
+
+ public String foo() {
+ return "CComponent";
+ }
+
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/D1Component.java b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/D1Component.java
new file mode 100644
index 0000000000..842a85e000
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/D1Component.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.services;
+
+public interface D1Component {
+ String foo1();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponent.java b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponent.java
new file mode 100644
index 0000000000..8a3923b351
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponent.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.services;
+
+public interface DComponent {
+ String foo();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponentImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponentImpl.java
new file mode 100644
index 0000000000..59ffce8205
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponentImpl.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.services;
+
+import org.oasisopen.sca.annotation.Service;
+
+@Service(interfaces = {DComponent.class, D1Component.class})
+public class DComponentImpl implements DComponent, D1Component {
+
+ public String foo() {
+ return "DComponent";
+ }
+
+ public String foo1() {
+ return "DComponent";
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..a3c87f60c7
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" targetNamespace="http://foo" xmlns:foo="http://foo">
+ <deployable composite="foo:InnerServicesTest" />
+</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/resources/ServicesTest.composite b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/resources/ServicesTest.composite
new file mode 100644
index 0000000000..9b7a30d850
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/services/src/main/resources/ServicesTest.composite
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:foo="http://foo" targetNamespace="http://foo"
+ name="InnerServicesTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <component name="AComponent1">
+ <implementation.java class="org.apache.tuscany.sca.itest.services.AComponentImpl" />
+ </component>
+
+ <component name="AComponent2">
+ <implementation.java class="org.apache.tuscany.sca.itest.services.AComponentImpl" />
+ <service name="AComponent">
+ <interface.java interface="org.apache.tuscany.sca.itest.services.AComponent" />
+ </service>
+ </component>
+
+ <component name="BComponent1">
+ <implementation.java class="org.apache.tuscany.sca.itest.services.BComponentImpl" />
+ </component>
+
+ <component name="BComponent2">
+ <implementation.java class="org.apache.tuscany.sca.itest.services.BComponentImpl" />
+ <service name="BComponent">
+ <interface.java interface="org.apache.tuscany.sca.itest.services.BComponent" />
+ </service>
+ </component>
+
+ <component name="CComponent1">
+ <implementation.java class="org.apache.tuscany.sca.itest.services.CComponentImpl" />
+ </component>
+
+ <component name="CComponent2">
+ <implementation.java class="org.apache.tuscany.sca.itest.services.CComponentImpl" />
+ <service name="CComponent">
+ <interface.java interface="org.apache.tuscany.sca.itest.services.CComponent" />
+ </service>
+ </component>
+
+ <component name="DComponent1">
+ <implementation.java class="org.apache.tuscany.sca.itest.services.DComponentImpl" />
+ </component>
+
+ <component name="DComponent2">
+ <implementation.java class="org.apache.tuscany.sca.itest.services.DComponentImpl" />
+ <service name="DComponent">
+ <interface.java interface="org.apache.tuscany.sca.itest.services.DComponent" />
+ </service>
+ <service name="D1Component">
+ <interface.java interface="org.apache.tuscany.sca.itest.services.D1Component" />
+ </service>
+ </component>
+
+</composite> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/services/src/test/java/org/apache/tuscany/sca/itest/services/ServicesTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/services/src/test/java/org/apache/tuscany/sca/itest/services/ServicesTestCase.java
new file mode 100644
index 0000000000..da779b2c54
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/services/src/test/java/org/apache/tuscany/sca/itest/services/ServicesTestCase.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.services;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.oasisopen.sca.ServiceRuntimeException;
+
+public class ServicesTestCase {
+ private static Node node;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("ServicesTest.composite");
+ node = NodeFactory.newInstance().createNode("ServicesTest.composite", new Contribution("c1", location));
+ node.start();
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void testAService() {
+ AComponent a1 = node.getService(AComponent.class, "AComponent1");
+ assertEquals("AComponent", a1.foo());
+
+ AComponent a2 = node.getService(AComponent.class, "AComponent2/AComponent");
+ assertEquals("AComponent", a2.foo());
+ }
+
+ @Test
+ public void testBService() {
+ BComponent a1 = node.getService(BComponent.class, "BComponent1");
+ assertEquals("BComponent", a1.foo());
+
+ BComponent a2 = node.getService(BComponent.class, "BComponent2/BComponent");
+ assertEquals("BComponent", a2.foo());
+ }
+
+ @Test
+ public void testCService() {
+ CComponent a1 = node.getService(CComponent.class, "CComponent1");
+ assertEquals("CComponent", a1.foo());
+
+ CComponent a2 = node.getService(CComponent.class, "CComponent2/CComponent");
+ assertEquals("CComponent", a2.foo());
+ }
+
+ @Test
+ public void testDService() {
+ DComponent a1 = node.getService(DComponent.class, "DComponent1/DComponent");
+ assertEquals("DComponent", a1.foo());
+
+ D1Component a2 = node.getService(D1Component.class, "DComponent1/D1Component");
+ assertEquals("DComponent", a2.foo1());
+
+ try {
+ node.getService(DComponent.class, "DComponent1");
+ Assert.fail("The service name is required");
+ } catch (ServiceRuntimeException e) {
+ Assert.assertTrue("The service name is required", true);
+ }
+
+ DComponent a3 = node.getService(DComponent.class, "DComponent2/DComponent");
+ assertEquals("DComponent", a3.foo());
+
+ D1Component a4 = node.getService(D1Component.class, "DComponent2/D1Component");
+ assertEquals("DComponent", a4.foo1());
+
+ }
+
+ public static void main(String[] args) throws Exception {
+ ServicesTestCase.init();
+ ServicesTestCase tester = new ServicesTestCase();
+ tester.testAService();
+ tester.testBService();
+ tester.testCService();
+ tester.testDService();
+ ServicesTestCase.destroy();
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/wires/pom.xml b/tags/java/sca/2.0-M3-RC3a/itest/wires/pom.xml
new file mode 100644
index 0000000000..f4e24067f3
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/wires/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-M3</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-wires</artifactId>
+ <name>Apache Tuscany SCA iTest Wires Basic</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-M3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-M3</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClient.java b/tags/java/sca/2.0-M3-RC3a/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClient.java
new file mode 100644
index 0000000000..f5a4337254
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClient.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.oasisopen.sca.annotation.Remotable;
+
+/**
+ * This is the client interface for the wires tests
+ */
+@Remotable
+public interface WireClient {
+
+ /**
+ * This tests the wires.
+ */
+ void runTests();
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClientImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClientImpl.java
new file mode 100644
index 0000000000..82f0e26d58
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClientImpl.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;
+
+import org.junit.Assert;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * This is the client implementation for the wires tests
+ */
+@Service(WireClient.class)
+public class WireClientImpl implements WireClient {
+ /**
+ * This is our injected reference to the WireService
+ */
+ @Reference
+ protected WireService aWireService;
+
+ /**
+ * This tests the wire reference
+ */
+ public void runTests() {
+ // Make sure the wire has injected a reference
+ Assert.assertNotNull(aWireService);
+
+ // Test the injected reference
+ String msg = aWireService.sayHello("MCC");
+
+ // Validate the response
+ Assert.assertNotNull(msg);
+ Assert.assertEquals("Hello MCC", msg);
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireService.java b/tags/java/sca/2.0-M3-RC3a/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireService.java
new file mode 100644
index 0000000000..67df1e3a52
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireService.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;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * Sample Wire Service
+ */
+@Remotable
+public interface WireService {
+ /**
+ * Returns "Hello " + aName
+ *
+ * @param aName The name to say hello
+ * @return "Hello " + aName
+ */
+ String sayHello(String aName);
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireServiceImpl.java b/tags/java/sca/2.0-M3-RC3a/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireServiceImpl.java
new file mode 100644
index 0000000000..f0308252ba
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireServiceImpl.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;
+
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * Sample WireService Implementation
+ */
+@Service(WireService.class)
+public class WireServiceImpl implements WireService {
+
+ /**
+ * Returns "Hello " + aName
+ *
+ * @param aName The name to say hello
+ * @return "Hello " + aName
+ */
+ public String sayHello(String aName) {
+ return "Hello " + aName;
+ }
+}
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/wires/src/main/resources/WireTest.composite b/tags/java/sca/2.0-M3-RC3a/itest/wires/src/main/resources/WireTest.composite
new file mode 100644
index 0000000000..fc8f61f459
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/wires/src/main/resources/WireTest.composite
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" targetNamespace="http://wires" name="WireTest">
+
+ <component name="WireClient">
+ <implementation.java class="org.apache.tuscany.sca.itest.WireClientImpl"/>
+<!-- We are not using a reference - we are using a wire - see below -->
+<!-- The equivalent reference for the wire would be as follows -->
+<!-- <reference name="aWireService" target="WireService"/>-->
+ </component>
+
+ <component name="AnotherWireClient">
+ <implementation.java class="org.apache.tuscany.sca.itest.WireClientImpl"/>
+ </component>
+
+ <component name="WireServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.WireServiceImpl"/>
+ </component>
+
+ <wire source="WireClient/aWireService" target="WireServiceComponent"/>
+ <wire source="AnotherWireClient/aWireService" target="WireServiceComponent/WireService"/>
+</composite>
diff --git a/tags/java/sca/2.0-M3-RC3a/itest/wires/src/test/java/org/apache/tuscany/sca/itest/WireTestCase.java b/tags/java/sca/2.0-M3-RC3a/itest/wires/src/test/java/org/apache/tuscany/sca/itest/WireTestCase.java
new file mode 100644
index 0000000000..2a0095cabc
--- /dev/null
+++ b/tags/java/sca/2.0-M3-RC3a/itest/wires/src/test/java/org/apache/tuscany/sca/itest/WireTestCase.java
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.itest;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * This test case will attempt to use a wire
+ */
+public class WireTestCase {
+
+ /**
+ * The Node we are using
+ */
+ private Node node;
+
+ /**
+ * The client the tests should use
+ */
+ private WireClient aWireClient;
+
+ /**
+ * Run the wire tests
+ */
+ @Test
+ public void testWire() {
+ aWireClient.runTests();
+ }
+
+ /**
+ * Load the Wire composite and look up the client.
+ */
+
+ @Before
+ public void setUp() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("WireTest.composite");
+ node = NodeFactory.newInstance().createNode("WireTest.composite", new Contribution("c1", location));
+ node.start();
+ aWireClient = node.getService(WireClient.class, "WireClient");
+ Assert.assertNotNull(aWireClient);
+
+ aWireClient = node.getService(WireClient.class, "AnotherWireClient");
+ Assert.assertNotNull(aWireClient);
+ }
+
+ /**
+ * Shutdown the SCA node
+ */
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+}