diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-18 21:14:42 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-18 21:14:42 +0000 |
commit | 8978628160d020c0300dc90f2a282b93311d53b1 (patch) | |
tree | d96598ccb9e23d5483331d041cf73d626f9bc549 /sca-java-2.x/trunk/itest/policy | |
parent | 80b3ade6f34fb14be296bf04dcc878a6e435dec7 (diff) |
TUSCANY-3503 - turn off the automatic application of policy sets based on intents. Various changes to tests to take account of this change.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@924994 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/itest/policy')
4 files changed, 20 insertions, 10 deletions
diff --git a/sca-java-2.x/trunk/itest/policy/matching/src/main/resources/org/apache/tuscany/sca/policy/matching/helloworld/definitions.xml b/sca-java-2.x/trunk/itest/policy/matching/src/main/resources/org/apache/tuscany/sca/policy/matching/helloworld/definitions.xml index e56ebc859a..1d1f2131bb 100644 --- a/sca-java-2.x/trunk/itest/policy/matching/src/main/resources/org/apache/tuscany/sca/policy/matching/helloworld/definitions.xml +++ b/sca-java-2.x/trunk/itest/policy/matching/src/main/resources/org/apache/tuscany/sca/policy/matching/helloworld/definitions.xml @@ -20,7 +20,7 @@ <definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912" targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1" - xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" + xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"> <intent name="testIntent1" constrains="sca:binding" intentType="interaction"/> diff --git a/sca-java-2.x/trunk/itest/policy/matching/src/main/resources/org/apache/tuscany/sca/policy/matching/helloworld/helloworld.composite b/sca-java-2.x/trunk/itest/policy/matching/src/main/resources/org/apache/tuscany/sca/policy/matching/helloworld/helloworld.composite index 0dacc5b9bc..f5c05c2de6 100644 --- a/sca-java-2.x/trunk/itest/policy/matching/src/main/resources/org/apache/tuscany/sca/policy/matching/helloworld/helloworld.composite +++ b/sca-java-2.x/trunk/itest/policy/matching/src/main/resources/org/apache/tuscany/sca/policy/matching/helloworld/helloworld.composite @@ -17,6 +17,11 @@ * specific language governing permissions and limitations * under the License. --> + +<!-- + NOTE - not using external attachment yet in this test because the + policy xpath functions are not working yet +--> <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912" targetNamespace="http://www.tuscany.apache.org/itests/policy" @@ -35,7 +40,7 @@ <component name="HelloUnresolvedIntentsOnReference"> <implementation.java class="org.apache.tuscany.sca.policy.matching.helloworld.HelloWorldClient"/> - <reference name="helloWorld" target="HelloWorldService2" requires="tuscany:testIntent1 tuscany:testIntent2"/> + <reference name="helloWorld" target="HelloWorldService2" requires="tuscany:testIntent1 tuscany:testIntent2" policySets="tuscany:testPolicy1"/> </component> <component name="HelloWorldClientIntentsButNoPolicies1"> @@ -45,7 +50,7 @@ <component name="HelloWorldClientIntentsButNoPolicies2"> <implementation.java class="org.apache.tuscany.sca.policy.matching.helloworld.HelloWorldClient"/> - <reference name="helloWorld" target="HelloWorldService2" requires="tuscany:testIntent1"/> + <reference name="helloWorld" target="HelloWorldService2" requires="tuscany:testIntent1" policySets="tuscany:testPolicy1"/> </component> <component name="HelloWorldClientSomePoliciesOnOneSideButNoneOnTheOther"> @@ -55,12 +60,12 @@ <component name="HelloWorldClientPolicySetQNameMatch"> <implementation.java class="org.apache.tuscany.sca.policy.matching.helloworld.HelloWorldClient"/> - <reference name="helloWorld" target="HelloWorldService3" requires="tuscany:testIntent5"/> + <reference name="helloWorld" target="HelloWorldService3" requires="tuscany:testIntent5" policySets="tuscany:testPolicy2"/> </component> <component name="HelloWorldClientDifferentPolicyLanguage"> <implementation.java class="org.apache.tuscany.sca.policy.matching.helloworld.HelloWorldClient"/> - <reference name="helloWorld" target="HelloWorldService3" requires="tuscany:testIntent6"/> + <reference name="helloWorld" target="HelloWorldService3" requires="tuscany:testIntent6" policySets="tuscany:testPolicy3"/> </component> <component name="HelloWorldService1"> @@ -75,7 +80,7 @@ <component name="HelloWorldService3"> <implementation.java class="org.apache.tuscany.sca.policy.matching.helloworld.HelloWorldService"/> - <service name="HelloWorld" requires="tuscany:testIntent4"/> + <service name="HelloWorld" requires="tuscany:testIntent4" policySets="tuscany:testPolicy2"/> </component> </composite> diff --git a/sca-java-2.x/trunk/itest/policy/matching/src/test/java/org/apache/tuscany/sca/policy/matching/MatchingTestCase.java b/sca-java-2.x/trunk/itest/policy/matching/src/test/java/org/apache/tuscany/sca/policy/matching/MatchingTestCase.java index beadbec397..762194afbf 100644 --- a/sca-java-2.x/trunk/itest/policy/matching/src/test/java/org/apache/tuscany/sca/policy/matching/MatchingTestCase.java +++ b/sca-java-2.x/trunk/itest/policy/matching/src/test/java/org/apache/tuscany/sca/policy/matching/MatchingTestCase.java @@ -49,8 +49,12 @@ public class MatchingTestCase { @BeforeClass public static void setUp() throws Exception { - node = NodeFactory.newInstance().createNode(new Contribution("test", "target/classes")); - node.start(); + try { + node = NodeFactory.newInstance().createNode(new Contribution("test", "target/classes")); + node.start(); + } catch (Exception ex) { + ex.printStackTrace(); + } } @Test @@ -114,7 +118,7 @@ public class MatchingTestCase { helloWorld.getGreetings("petra"); fail("Exception expected"); } catch (Exception ex) { - assertTrue(ex.getMessage().indexOf("No match because the policy sets on either side have policies in differnt languages {http://schemas.xmlsoap.org/ws/2004/09/policy}ExactlyOne and {http://tuscany.apache.org/xmlns/sca/1.1}jdkLogger") > -1); + assertTrue(ex.getMessage().indexOf("No match because the policy sets on either side have policies in differnt languages {http://www.w3.org/ns/ws-policy}ExactlyOne and {http://tuscany.apache.org/xmlns/sca/1.1}jdkLogger") > -1); } } diff --git a/sca-java-2.x/trunk/itest/policy/wspolicy/src/main/resources/org/apache/tuscany/sca/policy/wspolicy/helloworld/definitions.xml b/sca-java-2.x/trunk/itest/policy/wspolicy/src/main/resources/org/apache/tuscany/sca/policy/wspolicy/helloworld/definitions.xml index c78485547c..425f511273 100644 --- a/sca-java-2.x/trunk/itest/policy/wspolicy/src/main/resources/org/apache/tuscany/sca/policy/wspolicy/helloworld/definitions.xml +++ b/sca-java-2.x/trunk/itest/policy/wspolicy/src/main/resources/org/apache/tuscany/sca/policy/wspolicy/helloworld/definitions.xml @@ -25,7 +25,8 @@ <policySet name="JDKLoggingPolicy" provides="tuscany:logging" - appliesTo="//binding | //implementation"> + appliesTo="//binding | //implementation" + attachTo="//sca:service | //sca:reference"> <wsp:Policy> <wsp:ExactlyOne> <wsp:All> |