You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2008/03/04 22:59:52 UTC
svn commit: r633663 - in /incubator/tuscany/java/sca/itest/policy/src:
main/resources/Calculator.composite main/resources/definitions.xml
test/java/org/apache/tuscany/sca/itest/PoliciedCalculatorTestCase.java
Author: rfeng
Date: Tue Mar 4 13:59:49 2008
New Revision: 633663
URL: http://svn.apache.org/viewvc?rev=633663&view=rev
Log:
Fix the http port to be 8085 to avoid the continuum build break
Modified:
incubator/tuscany/java/sca/itest/policy/src/main/resources/Calculator.composite
incubator/tuscany/java/sca/itest/policy/src/main/resources/definitions.xml
incubator/tuscany/java/sca/itest/policy/src/test/java/org/apache/tuscany/sca/itest/PoliciedCalculatorTestCase.java
Modified: incubator/tuscany/java/sca/itest/policy/src/main/resources/Calculator.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/policy/src/main/resources/Calculator.composite?rev=633663&r1=633662&r2=633663&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/policy/src/main/resources/Calculator.composite (original)
+++ incubator/tuscany/java/sca/itest/policy/src/main/resources/Calculator.composite Tue Mar 4 13:59:49 2008
@@ -1,36 +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.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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:sca="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://itest/policy"
- xmlns:sample="http://itest/policy"
- name="Calculator"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0">
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://itest/policy" xmlns:sample="http://itest/policy" name="Calculator"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0">
<component name="CalculatorServiceComponent">
- <implementation.java class="calculator.CalculatorServiceImpl">
- </implementation.java>
+ <implementation.java class="calculator.CalculatorServiceImpl"></implementation.java>
<!-- reference name="addService" target="AddServiceComponent" /-->
- <reference name="addService" >
- <interface.java interface="calculator.AddService" />
- <binding.ws uri="http://localhost:8080/AddServiceComponent"/>
+ <reference name="addService">
+ <interface.java interface="calculator.AddService" />
+ <binding.ws uri="http://localhost:8085/AddServiceComponent" />
</reference>
<reference name="subtractService" target="SubtractServiceComponent" />
<reference name="multiplyService" target="MultiplyServiceComponent" />
@@ -38,15 +34,16 @@
</component>
<component name="AddServiceComponent">
- <implementation.java class="calculator.AddServiceImpl" requires="tuscany:TestIntent_3"/>
+ <implementation.java class="calculator.AddServiceImpl" requires="tuscany:TestIntent_3" />
<service name="AddService">
- <interface.java interface="calculator.AddService" />
- <binding.ws/>
+ <interface.java interface="calculator.AddService" />
+ <binding.ws uri="http://localhost:8085/AddServiceComponent" />
+ <binding.sca/>
</service>
</component>
<component name="SubtractServiceComponent">
- <implementation.java class="calculator.SubtractServiceImpl"/>
+ <implementation.java class="calculator.SubtractServiceImpl" />
</component>
<component name="MultiplyServiceComponent">
@@ -54,11 +51,11 @@
</component>
<component name="DivideServiceComponent">
- <implementation.java class="calculator.DivideServiceImpl"/>
+ <implementation.java class="calculator.DivideServiceImpl" />
</component>
-
+
<component name="AnotherCalculatorServiceComponent">
- <implementation.java class="calculator.CalculatorServiceImpl" />
+ <implementation.java class="calculator.CalculatorServiceImpl" />
<reference name="addService" target="AddServiceComponent" />
<reference name="subtractService" target="SubtractServiceComponent" />
<reference name="multiplyService" target="MultiplyServiceComponent" />
Modified: incubator/tuscany/java/sca/itest/policy/src/main/resources/definitions.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/policy/src/main/resources/definitions.xml?rev=633663&r1=633662&r2=633663&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/policy/src/main/resources/definitions.xml (original)
+++ incubator/tuscany/java/sca/itest/policy/src/main/resources/definitions.xml Tue Mar 4 13:59:49 2008
@@ -1,198 +1,136 @@
<?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.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://test"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:calc="http://calculator">
-
-<!-- Policy Intents -->
-<sca:intent name="tuscany:TestIntent_1"
- constrains="sca:implementation.java sca:binding.ws">
- <description>
- Test Intent One
- </description>
-</sca:intent>
-
-<sca:intent name="tuscany:TestIntent_2"
- constrains="sca:implementation.java sca:binding.ws">
- <description>
- Test Intent Two
- </description>
-</sca:intent>
-
-<sca:intent name="tuscany:TestIntent_3"
- constrains="sca:implementation.java sca:binding.ws">
- <description>
- Test Intent Three
- </description>
-</sca:intent>
-
-<sca:intent name="tuscany:TestIntent_4"
- constrains="sca:implementation.java sca:binding.ws">
- <description>
- Test Intent Four
- </description>
-</sca:intent>
-
-<sca:intent name="tuscany:TestIntent_5"
- constrains="sca:implementation.java sca:binding.ws">
- <description>
- Test Intent Five
- </description>
-</sca:intent>
-
-<sca:intent name="tuscany:TestIntent_1.Qualifier_1" />
-
-
-
-<!-- PolicySets -->
-<sca:policySet name="tuscany:TestPolicySet_1_implementation"
- provides="tuscany:TestIntent_1"
- appliesTo="sca:implementation.java"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
- >
- <intentMap provides="tuscany:TestIntent_1" default="Qualifier_1">
- <qualifier name="Qualifier_1">
- <wsp:Policy/>
- </qualifier>
- </intentMap>
- <wsp:Policy/>
- </sca:policySet>
-
-<sca:policySet name="tuscany:TestPolicySet_1_Qualified_implementation"
- provides="tuscany:TestIntent_1.Qualifier_1"
- appliesTo="sca:implementation.java"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
- >
- <wsp:Policy/>
- </sca:policySet>
-
- <sca:policySet name="tuscany:TestPolicySet_1_reference"
- provides="tuscany:TestIntent_1"
- appliesTo="sca:reference"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
- >
- <wsp:Policy/>
- </sca:policySet>
-
- <sca:policySet name="tuscany:TestPolicySet_1_service"
- provides="tuscany:TestIntent_1"
- appliesTo="sca:service"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
- >
- <wsp:Policy/>
- </sca:policySet>
-
-
- <sca:policySet name="tuscany:TestPolicySet_2_implementation"
- provides="tuscany:TestIntent_2"
- appliesTo="sca:implementation.java"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
- >
- <wsp:Policy/>
- </sca:policySet>
-
- <sca:policySet name="tuscany:TestPolicySet_2_reference"
- provides="tuscany:TestIntent_2"
- appliesTo="sca:reference"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
- >
- <wsp:Policy/>
- </sca:policySet>
-
- <sca:policySet name="tuscany:TestPolicySet_2_service"
- provides="tuscany:TestIntent_2"
- appliesTo="sca:service"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
- >
- <wsp:Policy/>
- </sca:policySet>
-
-
- <sca:policySet name="tuscany:TestPolicySet_3_implementation"
- provides="tuscany:TestIntent_3"
- appliesTo="sca:implementation.java"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
- >
- <wsp:Policy/>
- </sca:policySet>
-
- <sca:policySet name="tuscany:TestPolicySet_4_implementation"
- provides="tuscany:TestIntent_4"
- appliesTo="sca:implementation.java"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
- >
- <wsp:Policy/>
- </sca:policySet>
-
- <sca:policySet name="tuscany:TestPolicySet_4_service"
- provides="tuscany:TestIntent_4"
- appliesTo="sca:service"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
- >
- <wsp:Policy/>
- </sca:policySet>
-
- <sca:policySet name="tuscany:TestPolicySet_4_reference"
- provides="tuscany:TestIntent_4"
- appliesTo="sca:reference"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
- >
- <wsp:Policy/>
- </sca:policySet>
-
- <sca:policySet name="tuscany:TestPolicySet_5_implementation"
- provides=""
- appliesTo="sca:implementation.java"
- tuscany:alwaysAppliesTo="sca:component[@name='MultiplyServiceComponent']"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
- >
- <wsp:Policy/>
- </sca:policySet>
-
- <sca:policySet name="tuscany:TestPolicySet_5_service"
- provides="tuscany:TestIntent_5"
- appliesTo="sca:service"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
- >
- <wsp:Policy/>
- </sca:policySet>
-
- <sca:policySet name="tuscany:TestPolicySet_5_reference"
- provides="tuscany:TestIntent_5"
- appliesTo="sca:reference"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
- >
- <wsp:Policy/>
- </sca:policySet>
-
- <sca:policySet name="tuscany:TestPolicySet_4_qualified_1_implementation"
- provides="tuscany:TestIntent_4"
- appliesTo="sca:implementation.java"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
- >
- <intentMap provides="tuscany:TestIntent_4" default="Qualifier_1">
- <qualifier name="Qualifier_1">
- <wsp:Policy/>
- </qualifier>
- </intentMap>
- </sca:policySet>
+<definitions xmlns="http://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://test"
+ xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ xmlns:calc="http://calculator">
+
+ <!-- Policy Intents -->
+ <sca:intent name="tuscany:TestIntent_1" constrains="sca:implementation.java sca:binding.ws">
+ <description>Test Intent One</description>
+ </sca:intent>
+
+ <sca:intent name="tuscany:TestIntent_2" constrains="sca:implementation.java sca:binding.ws">
+ <description>Test Intent Two</description>
+ </sca:intent>
+
+ <sca:intent name="tuscany:TestIntent_3" constrains="sca:implementation.java sca:binding.ws">
+ <description>Test Intent Three</description>
+ </sca:intent>
+
+ <sca:intent name="tuscany:TestIntent_4" constrains="sca:implementation.java sca:binding.ws">
+ <description>Test Intent Four</description>
+ </sca:intent>
+
+ <sca:intent name="tuscany:TestIntent_5" constrains="sca:implementation.java sca:binding.ws">
+ <description>Test Intent Five</description>
+ </sca:intent>
+
+ <sca:intent name="tuscany:TestIntent_1.Qualifier_1" />
+
+
+
+ <!-- PolicySets -->
+ <sca:policySet name="tuscany:TestPolicySet_1_implementation" provides="tuscany:TestIntent_1"
+ appliesTo="sca:implementation.java" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <intentMap provides="tuscany:TestIntent_1" default="Qualifier_1">
+ <qualifier name="Qualifier_1">
+ <wsp:Policy />
+ </qualifier>
+ </intentMap>
+ <wsp:Policy />
+ </sca:policySet>
+
+ <sca:policySet name="tuscany:TestPolicySet_1_Qualified_implementation" provides="tuscany:TestIntent_1.Qualifier_1"
+ appliesTo="sca:implementation.java" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:Policy />
+ </sca:policySet>
+
+ <sca:policySet name="tuscany:TestPolicySet_1_reference" provides="tuscany:TestIntent_1" appliesTo="sca:reference"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:Policy />
+ </sca:policySet>
+
+ <sca:policySet name="tuscany:TestPolicySet_1_service" provides="tuscany:TestIntent_1" appliesTo="sca:service"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:Policy />
+ </sca:policySet>
+
+
+ <sca:policySet name="tuscany:TestPolicySet_2_implementation" provides="tuscany:TestIntent_2"
+ appliesTo="sca:implementation.java" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:Policy />
+ </sca:policySet>
+
+ <sca:policySet name="tuscany:TestPolicySet_2_reference" provides="tuscany:TestIntent_2" appliesTo="sca:reference"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:Policy />
+ </sca:policySet>
+
+ <sca:policySet name="tuscany:TestPolicySet_2_service" provides="tuscany:TestIntent_2" appliesTo="sca:service"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:Policy />
+ </sca:policySet>
+
+
+ <sca:policySet name="tuscany:TestPolicySet_3_implementation" provides="tuscany:TestIntent_3"
+ appliesTo="sca:implementation.java" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:Policy />
+ </sca:policySet>
+
+ <sca:policySet name="tuscany:TestPolicySet_4_implementation" provides="tuscany:TestIntent_4"
+ appliesTo="sca:implementation.java" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:Policy />
+ </sca:policySet>
+
+ <sca:policySet name="tuscany:TestPolicySet_4_service" provides="tuscany:TestIntent_4" appliesTo="sca:service"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:Policy />
+ </sca:policySet>
+
+ <sca:policySet name="tuscany:TestPolicySet_4_reference" provides="tuscany:TestIntent_4" appliesTo="sca:reference"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:Policy />
+ </sca:policySet>
+
+ <sca:policySet name="tuscany:TestPolicySet_5_implementation" provides="" appliesTo="sca:implementation.java"
+ tuscany:alwaysAppliesTo="sca:component[@name='MultiplyServiceComponent']"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:Policy />
+ </sca:policySet>
+
+ <sca:policySet name="tuscany:TestPolicySet_5_service" provides="tuscany:TestIntent_5" appliesTo="sca:service"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:Policy />
+ </sca:policySet>
+
+ <sca:policySet name="tuscany:TestPolicySet_5_reference" provides="tuscany:TestIntent_5" appliesTo="sca:reference"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:Policy />
+ </sca:policySet>
+
+ <sca:policySet name="tuscany:TestPolicySet_4_qualified_1_implementation" provides="tuscany:TestIntent_4"
+ appliesTo="sca:implementation.java" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <intentMap provides="tuscany:TestIntent_4" default="Qualifier_1">
+ <qualifier name="Qualifier_1">
+ <wsp:Policy />
+ </qualifier>
+ </intentMap>
+ </sca:policySet>
</definitions>
Modified: incubator/tuscany/java/sca/itest/policy/src/test/java/org/apache/tuscany/sca/itest/PoliciedCalculatorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/policy/src/test/java/org/apache/tuscany/sca/itest/PoliciedCalculatorTestCase.java?rev=633663&r1=633662&r2=633663&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/policy/src/test/java/org/apache/tuscany/sca/itest/PoliciedCalculatorTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/policy/src/test/java/org/apache/tuscany/sca/itest/PoliciedCalculatorTestCase.java Tue Mar 4 13:59:49 2008
@@ -19,10 +19,6 @@
package org.apache.tuscany.sca.itest;
-import java.io.File;
-import java.io.FileDescriptor;
-import java.net.URL;
-
import org.apache.tuscany.sca.host.embedded.SCADomain;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -33,8 +29,7 @@
public class PoliciedCalculatorTestCase {
private static SCADomain domain;
private static CalculatorService calculatorService;
-
-
+
@Test
public void testPolicies() {
calculatorService.add(10, 10);
@@ -42,13 +37,13 @@
calculatorService.divide(10, 10);
calculatorService.subtract(10, 10);
}
-
+
@BeforeClass
public static void init() throws Exception {
try {
domain = SCADomain.newInstance("Calculator.composite");
- } catch ( Exception e ) {
- e.printStackTrace();
+ } catch (Exception e) {
+ e.printStackTrace();
}
calculatorService = domain.getService(CalculatorService.class, "CalculatorServiceComponent");
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org