From 5e520b1b65c79cd828057cb628b9367acb266880 Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:05:59 +0000 Subject: Moving 1.x branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835117 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/calculator/AddService.java | 34 ----- .../src/main/java/calculator/AddServiceImpl.java | 35 ----- .../src/main/java/calculator/CalculatorClient.java | 69 ---------- .../main/java/calculator/CalculatorService.java | 35 ----- .../java/calculator/CalculatorServiceImpl.java | 76 ----------- .../src/main/java/calculator/DivideService.java | 33 ----- .../main/java/calculator/DivideServiceImpl.java | 35 ----- .../src/main/java/calculator/MultiplyService.java | 28 ---- .../main/java/calculator/MultiplyServiceImpl.java | 35 ----- .../src/main/java/calculator/PolicyQNames.java | 43 ------ .../src/main/java/calculator/SubtractService.java | 28 ---- .../main/java/calculator/SubtractServiceImpl.java | 35 ----- .../calculator/policy/TestImplPolicyHandler.java | 84 ------------ .../calculator/policy/TestRefPolicyHandler.java | 61 --------- .../calculator/policy/TestSvcPolicyHandler.java | 61 --------- .../policy/src/main/resources/Calculator.composite | 66 --------- ...ca.contribution.processor.StAXArtifactProcessor | 19 --- ...rg.apache.tuscany.sca.policy.util.PolicyHandler | 28 ---- .../policy/src/main/resources/definitions.xml | 147 --------------------- 19 files changed, 952 deletions(-) delete mode 100644 branches/sca-android/itest/policy/src/main/java/calculator/AddService.java delete mode 100644 branches/sca-android/itest/policy/src/main/java/calculator/AddServiceImpl.java delete mode 100644 branches/sca-android/itest/policy/src/main/java/calculator/CalculatorClient.java delete mode 100644 branches/sca-android/itest/policy/src/main/java/calculator/CalculatorService.java delete mode 100644 branches/sca-android/itest/policy/src/main/java/calculator/CalculatorServiceImpl.java delete mode 100644 branches/sca-android/itest/policy/src/main/java/calculator/DivideService.java delete mode 100644 branches/sca-android/itest/policy/src/main/java/calculator/DivideServiceImpl.java delete mode 100644 branches/sca-android/itest/policy/src/main/java/calculator/MultiplyService.java delete mode 100644 branches/sca-android/itest/policy/src/main/java/calculator/MultiplyServiceImpl.java delete mode 100644 branches/sca-android/itest/policy/src/main/java/calculator/PolicyQNames.java delete mode 100644 branches/sca-android/itest/policy/src/main/java/calculator/SubtractService.java delete mode 100644 branches/sca-android/itest/policy/src/main/java/calculator/SubtractServiceImpl.java delete mode 100644 branches/sca-android/itest/policy/src/main/java/calculator/policy/TestImplPolicyHandler.java delete mode 100644 branches/sca-android/itest/policy/src/main/java/calculator/policy/TestRefPolicyHandler.java delete mode 100644 branches/sca-android/itest/policy/src/main/java/calculator/policy/TestSvcPolicyHandler.java delete mode 100644 branches/sca-android/itest/policy/src/main/resources/Calculator.composite delete mode 100644 branches/sca-android/itest/policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor delete mode 100644 branches/sca-android/itest/policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler delete mode 100644 branches/sca-android/itest/policy/src/main/resources/definitions.xml (limited to 'branches/sca-android/itest/policy/src/main') diff --git a/branches/sca-android/itest/policy/src/main/java/calculator/AddService.java b/branches/sca-android/itest/policy/src/main/java/calculator/AddService.java deleted file mode 100644 index 3e56bf3fad..0000000000 --- a/branches/sca-android/itest/policy/src/main/java/calculator/AddService.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.osoa.sca.annotations.Remotable; -import org.osoa.sca.annotations.Service; - -/** - * The Add service interface - */ -@Remotable -@Service -//@Requires(PolicyQNames.TEST_INTENT_FIVE) -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/branches/sca-android/itest/policy/src/main/java/calculator/AddServiceImpl.java b/branches/sca-android/itest/policy/src/main/java/calculator/AddServiceImpl.java deleted file mode 100644 index 7ca8fb04b5..0000000000 --- a/branches/sca-android/itest/policy/src/main/java/calculator/AddServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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; - } - -} diff --git a/branches/sca-android/itest/policy/src/main/java/calculator/CalculatorClient.java b/branches/sca-android/itest/policy/src/main/java/calculator/CalculatorClient.java deleted file mode 100644 index 9abc488523..0000000000 --- a/branches/sca-android/itest/policy/src/main/java/calculator/CalculatorClient.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 javax.security.auth.login.Configuration; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -/** - * This client program shows how to create an SCA runtime, start it, - * and locate and invoke a SCA component - */ -public class CalculatorClient { - public static void main(String[] args) throws Exception { - try { - Configuration secConf = Configuration.getConfiguration(); - } catch ( java.lang.SecurityException e ) { - if ( e.getMessage().equals("Unable to locate a login configuration") ) { - System.setProperty("java.security.auth.login.config", "target/classes/CalculatorJass.config"); - } else { - throw e; - } - } - - SCADomain scaDomain = SCADomain.newInstance("Calculator.composite"); - - CalculatorService calculatorService = - scaDomain.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 = - scaDomain.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)); - - scaDomain.close(); - } - -} diff --git a/branches/sca-android/itest/policy/src/main/java/calculator/CalculatorService.java b/branches/sca-android/itest/policy/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index a1880698ea..0000000000 --- a/branches/sca-android/itest/policy/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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/branches/sca-android/itest/policy/src/main/java/calculator/CalculatorServiceImpl.java b/branches/sca-android/itest/policy/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index 28ce0ec78a..0000000000 --- a/branches/sca-android/itest/policy/src/main/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Requires; - - -/** - * An implementation of the Calculator service. - */ -@Requires(PolicyQNames.TEST_INTENT_ONE) -public class CalculatorServiceImpl implements CalculatorService, PolicyQNames { - - private AddService addService; - private SubtractService subtractService; - private MultiplyService multiplyService; - private DivideService divideService; - - @Reference - public void setAddService(AddService addService) { - this.addService = addService; - } - - //@Requires({TEST_INTENT_TWO, TEST_INTENT_THREE}) - @Reference - public void setSubtractService(SubtractService subtractService) { - this.subtractService = subtractService; - } - - @Reference - public void setDivideService(DivideService divideService) { - this.divideService = divideService; - } - - @Reference - public void setMultiplyService(MultiplyService multiplyService) { - this.multiplyService = multiplyService; - } - - @Requires(TEST_INTENT_TWO) - public double add(double n1, double n2) { - return addService.add(n1, n2); - } - - @Requires(PolicyQNames.QUALIFIED_TEST_INTENT_ONE) - public double subtract(double n1, double n2) { - return subtractService.subtract(n1, n2); - } - - public double multiply(double n1, double n2) { - return multiplyService.multiply(n1, n2); - } - - //@Requires(QUALIFIED_TEST_INTENT_FOUR) - public double divide(double n1, double n2) { - return divideService.divide(n1, n2); - } - -} diff --git a/branches/sca-android/itest/policy/src/main/java/calculator/DivideService.java b/branches/sca-android/itest/policy/src/main/java/calculator/DivideService.java deleted file mode 100644 index f72b05cece..0000000000 --- a/branches/sca-android/itest/policy/src/main/java/calculator/DivideService.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.osoa.sca.annotations.Remotable; -import org.osoa.sca.annotations.Service; - -/** - * The divide service interface - */ -@Remotable -@Service -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/branches/sca-android/itest/policy/src/main/java/calculator/DivideServiceImpl.java b/branches/sca-android/itest/policy/src/main/java/calculator/DivideServiceImpl.java deleted file mode 100644 index 1323edf55a..0000000000 --- a/branches/sca-android/itest/policy/src/main/java/calculator/DivideServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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/branches/sca-android/itest/policy/src/main/java/calculator/MultiplyService.java b/branches/sca-android/itest/policy/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index 5290605938..0000000000 --- a/branches/sca-android/itest/policy/src/main/java/calculator/MultiplyService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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/branches/sca-android/itest/policy/src/main/java/calculator/MultiplyServiceImpl.java b/branches/sca-android/itest/policy/src/main/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index 91b803bc9e..0000000000 --- a/branches/sca-android/itest/policy/src/main/java/calculator/MultiplyServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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/branches/sca-android/itest/policy/src/main/java/calculator/PolicyQNames.java b/branches/sca-android/itest/policy/src/main/java/calculator/PolicyQNames.java deleted file mode 100644 index 3e1bc45842..0000000000 --- a/branches/sca-android/itest/policy/src/main/java/calculator/PolicyQNames.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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; - -/** - * @version $Rev$ $Date$ - */ -public interface PolicyQNames { - public static final String QUALIFIER = "."; - - public static final String POLICY_ITEST_PREFIX="{http://itest/policy}"; - public static final String TEST_INTENT_ONE = POLICY_ITEST_PREFIX + "TestIntent_1"; - public static final String TEST_INTENT_TWO = POLICY_ITEST_PREFIX + "TestIntent_2"; - public static final String TEST_INTENT_THREE = POLICY_ITEST_PREFIX + "TestIntent_3"; - public static final String TEST_INTENT_FOUR = POLICY_ITEST_PREFIX + "TestIntent_4"; - public static final String TEST_INTENT_FIVE = POLICY_ITEST_PREFIX + "TestIntent_5"; - - public static final String QUALIFIER_ONE = "Qualifier_1"; - - public static final String QUALIFIED_TEST_INTENT_FOUR = - TEST_INTENT_FOUR + QUALIFIER + QUALIFIER_ONE; - - public static final String QUALIFIED_TEST_INTENT_ONE = - TEST_INTENT_ONE + QUALIFIER + QUALIFIER_ONE; - -} diff --git a/branches/sca-android/itest/policy/src/main/java/calculator/SubtractService.java b/branches/sca-android/itest/policy/src/main/java/calculator/SubtractService.java deleted file mode 100644 index bf0d1882b6..0000000000 --- a/branches/sca-android/itest/policy/src/main/java/calculator/SubtractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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/branches/sca-android/itest/policy/src/main/java/calculator/SubtractServiceImpl.java b/branches/sca-android/itest/policy/src/main/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index 58cc4a3547..0000000000 --- a/branches/sca-android/itest/policy/src/main/java/calculator/SubtractServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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/branches/sca-android/itest/policy/src/main/java/calculator/policy/TestImplPolicyHandler.java b/branches/sca-android/itest/policy/src/main/java/calculator/policy/TestImplPolicyHandler.java deleted file mode 100644 index 4b04a4d0b8..0000000000 --- a/branches/sca-android/itest/policy/src/main/java/calculator/policy/TestImplPolicyHandler.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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.policy; - -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.policy.PolicySet; -import org.apache.tuscany.sca.policy.util.PolicyHandler; -import org.junit.Assert; - -/** - * @version $Rev$ $Date$ - */ -public class TestImplPolicyHandler implements PolicyHandler { - private PolicySet applicablePolicySet = null; - - public void afterInvoke(Object... arg0) { - } - - public void beforeInvoke(Object... context) { - for ( Object contextObj : context) { - if ( contextObj instanceof Operation ) { - Operation op = (Operation)contextObj; - //System.out.println(" *TestImplPolicyHandler* " + op.getName() + " ** " + applicablePolicySet); - if ( op.getName().equals("add") ) { - boolean match = applicablePolicySet.getName().getLocalPart().equals("TestPolicySet_1_implementation") || - applicablePolicySet.getName().getLocalPart().equals("TestPolicySet_2_implementation") || - applicablePolicySet.getName().getLocalPart().equals("TestPolicySet_1_Qualified_implementation") || - applicablePolicySet.getName().getLocalPart().equals("TestPolicySet_3_implementation") ; - Assert.assertTrue(match); - } else if ( op.getName().equals("subtract") ) { - boolean match = applicablePolicySet.getName().getLocalPart().equals("TestPolicySet_1_Qualified_implementation") || - applicablePolicySet.getName().getLocalPart().equals("TestPolicySet_1_implementation"); - Assert.assertTrue(match); - } else if ( op.getName().equals("divide")) { - Assert.assertEquals(applicablePolicySet.getName().getLocalPart(), - "TestPolicySet_1_implementation"); - } else if ( op.getName().equals("multiply") ) { - boolean match = applicablePolicySet.getName().getLocalPart().equals("TestPolicySet_5_implementation") || - applicablePolicySet.getName().getLocalPart().equals("TestPolicySet_1_implementation"); - Assert.assertTrue(match); - } - else { - Assert.fail(); - } - //System.out.println(" *TestImplPolicyHandler* " + op.getName() + " ** " + applicablePolicySet); - } else if ( contextObj instanceof Message ) { - Message msg = (Message)contextObj; - System.out.println(" *TestImplPolicyHandler* " + msg.getOperation().getName() + " ** " + applicablePolicySet); - } - } - } - - public void cleanUp(Object... arg0) { - } - - public PolicySet getApplicablePolicySet() { - return applicablePolicySet; - } - - public void setApplicablePolicySet(PolicySet arg0) { - this.applicablePolicySet = arg0; - } - - public void setUp(Object... arg0) { - } -} diff --git a/branches/sca-android/itest/policy/src/main/java/calculator/policy/TestRefPolicyHandler.java b/branches/sca-android/itest/policy/src/main/java/calculator/policy/TestRefPolicyHandler.java deleted file mode 100644 index 3dcadd724e..0000000000 --- a/branches/sca-android/itest/policy/src/main/java/calculator/policy/TestRefPolicyHandler.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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.policy; - -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.policy.PolicySet; -import org.apache.tuscany.sca.policy.util.PolicyHandler; - -/** - * @version $Rev$ $Date$ - */ -public class TestRefPolicyHandler implements PolicyHandler { - private PolicySet applicablePolicySet = null; - - public void afterInvoke(Object... arg0) { - } - - public void beforeInvoke(Object... context) { - for ( Object contextObj : context) { - if ( contextObj instanceof Operation ) { - Operation op = (Operation)contextObj; - System.out.println(" *TestReflPolicyHandler* " + op.getName() + " ** " + applicablePolicySet); - } else if ( contextObj instanceof Message ) { - Message msg = (Message)contextObj; - System.out.println(" *TestRefPolicyHandler* " + msg.getOperation().getName() + " ** " + applicablePolicySet); - } - } - } - - public void cleanUp(Object... arg0) { - } - - public PolicySet getApplicablePolicySet() { - return applicablePolicySet; - } - - public void setApplicablePolicySet(PolicySet arg0) { - this.applicablePolicySet = arg0; - } - - public void setUp(Object... arg0) { - } -} diff --git a/branches/sca-android/itest/policy/src/main/java/calculator/policy/TestSvcPolicyHandler.java b/branches/sca-android/itest/policy/src/main/java/calculator/policy/TestSvcPolicyHandler.java deleted file mode 100644 index 3d314a9d14..0000000000 --- a/branches/sca-android/itest/policy/src/main/java/calculator/policy/TestSvcPolicyHandler.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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.policy; - -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.policy.PolicySet; -import org.apache.tuscany.sca.policy.util.PolicyHandler; - -/** - * @version $Rev$ $Date$ - */ -public class TestSvcPolicyHandler implements PolicyHandler { - private PolicySet applicablePolicySet = null; - - public void afterInvoke(Object... arg0) { - } - - public void beforeInvoke(Object... context) { - for ( Object contextObj : context) { - if ( contextObj instanceof Operation ) { - Operation op = (Operation)contextObj; - System.out.println(" *TestSvcPolicyHandler* " + op.getName() + " ** " + applicablePolicySet); - } else if ( contextObj instanceof Message ) { - Message msg = (Message)contextObj; - System.out.println(" *TestSvcPolicyHandler* " + msg.getOperation().getName() + " ** " + applicablePolicySet); - } - } - } - - public void cleanUp(Object... arg0) { - } - - public PolicySet getApplicablePolicySet() { - return applicablePolicySet; - } - - public void setApplicablePolicySet(PolicySet arg0) { - this.applicablePolicySet = arg0; - } - - public void setUp(Object... arg0) { - } -} diff --git a/branches/sca-android/itest/policy/src/main/resources/Calculator.composite b/branches/sca-android/itest/policy/src/main/resources/Calculator.composite deleted file mode 100644 index aed7684099..0000000000 --- a/branches/sca-android/itest/policy/src/main/resources/Calculator.composite +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-android/itest/policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-android/itest/policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor deleted file mode 100644 index a20489035b..0000000000 --- a/branches/sca-android/itest/policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Implementation class for the artifact processor extension -org.apache.tuscany.sca.itest.TestPolicyProcessor;qname=http://schemas.xmlsoap.org/ws/2004/09/policy#Policy,model=org.apache.tuscany.sca.itest.Policy diff --git a/branches/sca-android/itest/policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler b/branches/sca-android/itest/policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler deleted file mode 100644 index d9f144b3ff..0000000000 --- a/branches/sca-android/itest/policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler +++ /dev/null @@ -1,28 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -# PolicyHandlerClasses to interpret specific PolicyModels against specific QoS infrastructures -# handler classname;qname=;model= -calculator.policy.TestImplPolicyHandler;intent=http://itest/policy#TestIntent_1,model=org.apache.neethi.Policy,appliesTo=sca:implementation.java -calculator.policy.TestRefPolicyHandler;intent=http://itest/policy#TestIntent_1,model=org.apache.neethi.Policy,appliesTo=sca:reference -calculator.policy.TestSvcPolicyHandler;intent=http://itest/policy#TestIntent_1,model=org.apache.neethi.Policy,appliesTo=sca:service -calculator.policy.TestImplPolicyHandler;intent=http://itest/policy#TestIntent_1.Qualifier_1,model=org.apache.neethi.Policy,appliesTo=sca:implementation.java -calculator.policy.TestImplPolicyHandler;intent=http://itest/policy#TestIntent_2,model=org.apache.neethi.Policy,appliesTo=sca:implementation.java -calculator.policy.TestRefPolicyHandler;intent=http://itest/policy#TestIntent_2,model=org.apache.neethi.Policy,appliesTo=sca:reference -calculator.policy.TestSvcPolicyHandler;intent=http://itest/policy#TestIntent_2,model=org.apache.neethi.Policy,appliesTo=sca:service -calculator.policy.TestImplPolicyHandler;intent=http://itest/policy#TestIntent_3,model=org.apache.neethi.Policy,appliesTo=sca:implementation.java -calculator.policy.TestImplPolicyHandler;intent=http://itest/policy#TestIntent_5,model=org.apache.neethi.Policy,appliesTo=sca:implementation.java \ No newline at end of file diff --git a/branches/sca-android/itest/policy/src/main/resources/definitions.xml b/branches/sca-android/itest/policy/src/main/resources/definitions.xml deleted file mode 100644 index 0009d712f3..0000000000 --- a/branches/sca-android/itest/policy/src/main/resources/definitions.xml +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - Test Intent One - - - - Test Intent Two - - - - Test Intent Three - - - - Test Intent Four - - - - Test Intent Five - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file -- cgit v1.2.3