From 9425990f532b1152c2d73db96c0f07ef5216a3d1 Mon Sep 17 00:00:00 2001 From: lresende Date: Thu, 12 Nov 2009 00:43:48 +0000 Subject: Moving 2.x contribs git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835178 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/bigbank/stockquote/StockQuoteImpl.java | 38 ----- .../java/bigbank/stockquote/StockQuoteService.java | 30 ---- .../src/main/java/calculator/AddService.java | 28 ---- .../src/main/java/calculator/AddServiceImpl.java | 35 ---- .../main/java/calculator/CalculatorService.java | 35 ---- .../java/calculator/CalculatorServiceImpl.java | 79 --------- .../src/main/java/calculator/DivideService.java | 28 ---- .../main/java/calculator/DivideServiceImpl.java | 35 ---- .../src/main/java/calculator/MultiplyService.java | 28 ---- .../main/java/calculator/MultiplyServiceImpl.java | 35 ---- .../src/main/java/calculator/SubtractService.java | 28 ---- .../main/java/calculator/SubtractServiceImpl.java | 35 ---- .../security/CalculatorCallbackHandler.java | 50 ------ .../java/calculator/security/JaasLoginModule.java | 178 --------------------- .../java/calculator/security/UserPrincipal.java | 66 -------- .../access/SCAApplicationContextProvider.java | 19 --- .../spring/annotations/CalculatorServiceImpl.java | 131 --------------- .../main/resources/CalculatorService-context.xml | 39 ----- .../sca/SpringDelegationHelloWorld-context.xml | 37 ----- .../META-INF/sca/SpringHelloWorld-context.xml | 31 ---- .../context-access/CalculatorService-context.xml | 45 ------ .../context-imports/CalculatorService-context.xml | 39 ----- .../sca/context-imports/SpringImport-context.xml | 29 ---- .../context-multiple/StockQuoteService-context.xml | 36 ----- .../sca/context-multiple/beanRefContext.xml | 34 ---- .../CalculatorService-context.xml | 39 ----- .../CalculatorService-context.xml | 41 ----- .../resources/context/access/Calculator.composite | 49 ------ .../resources/context/imports/Calculator.composite | 49 ------ .../context/multiple/StockQuote.composite | 35 ---- .../implementation/policies/Calculator.composite | 61 ------- .../implementation/policies/CalculatorJass.config | 3 - .../policies/CalculatorLogMessages.properties | 18 --- .../implementation/policies/definitions.xml | 40 ----- .../spring/SpringDelegationHelloWorld.composite | 32 ---- .../sca/itest/spring/SpringHelloWorld.composite | 32 ---- .../spring/annotations/Calculator.composite | 60 ------- .../test/java/context/access/CalculatorClient.java | 60 ------- .../java/context/access/ContextAccessTestCase.java | 32 ---- .../java/context/imports/CalculatorClient.java | 54 ------- .../context/imports/ContextImportsTestCase.java | 32 ---- .../context/multiple/MultipleContextTestCase.java | 32 ---- .../java/context/multiple/StockQuoteServer.java | 51 ------ .../implementation/policies/CalculatorClient.java | 78 --------- .../policies/ImplementationPoliciesTestCase.java | 32 ---- .../itest/spring/AbstractHelloWorldTestCase.java | 40 ----- .../sca/itest/spring/AbstractSCATestCase.java | 51 ------ .../tuscany/sca/itest/spring/HelloWorld.java | 34 ---- .../tuscany/sca/itest/spring/HelloWorldProxy.java | 41 ----- .../spring/SpringDelegationHelloWorldTestCase.java | 31 ---- .../sca/itest/spring/SpringHelloWorldTestCase.java | 32 ---- .../sca/itest/spring/TestHelloWorldBean.java | 36 ----- .../itest/spring/TestHelloWorldDelegatorBean.java | 40 ----- .../java/spring/annotations/CalculatorClient.java | 65 -------- .../annotations/SpringAnnotationsTestCase.java | 32 ---- 55 files changed, 2400 deletions(-) delete mode 100644 java/sca-contrib/itest/spring/src/main/java/bigbank/stockquote/StockQuoteImpl.java delete mode 100644 java/sca-contrib/itest/spring/src/main/java/bigbank/stockquote/StockQuoteService.java delete mode 100644 java/sca-contrib/itest/spring/src/main/java/calculator/AddService.java delete mode 100644 java/sca-contrib/itest/spring/src/main/java/calculator/AddServiceImpl.java delete mode 100644 java/sca-contrib/itest/spring/src/main/java/calculator/CalculatorService.java delete mode 100644 java/sca-contrib/itest/spring/src/main/java/calculator/CalculatorServiceImpl.java delete mode 100644 java/sca-contrib/itest/spring/src/main/java/calculator/DivideService.java delete mode 100644 java/sca-contrib/itest/spring/src/main/java/calculator/DivideServiceImpl.java delete mode 100644 java/sca-contrib/itest/spring/src/main/java/calculator/MultiplyService.java delete mode 100644 java/sca-contrib/itest/spring/src/main/java/calculator/MultiplyServiceImpl.java delete mode 100644 java/sca-contrib/itest/spring/src/main/java/calculator/SubtractService.java delete mode 100644 java/sca-contrib/itest/spring/src/main/java/calculator/SubtractServiceImpl.java delete mode 100644 java/sca-contrib/itest/spring/src/main/java/calculator/security/CalculatorCallbackHandler.java delete mode 100644 java/sca-contrib/itest/spring/src/main/java/calculator/security/JaasLoginModule.java delete mode 100644 java/sca-contrib/itest/spring/src/main/java/calculator/security/UserPrincipal.java delete mode 100644 java/sca-contrib/itest/spring/src/main/java/context/access/SCAApplicationContextProvider.java delete mode 100644 java/sca-contrib/itest/spring/src/main/java/spring/annotations/CalculatorServiceImpl.java delete mode 100644 java/sca-contrib/itest/spring/src/main/resources/CalculatorService-context.xml delete mode 100644 java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/SpringDelegationHelloWorld-context.xml delete mode 100644 java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/SpringHelloWorld-context.xml delete mode 100644 java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/context-access/CalculatorService-context.xml delete mode 100644 java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/context-imports/CalculatorService-context.xml delete mode 100644 java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/context-imports/SpringImport-context.xml delete mode 100644 java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/context-multiple/StockQuoteService-context.xml delete mode 100644 java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/context-multiple/beanRefContext.xml delete mode 100644 java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/implementation-policies/CalculatorService-context.xml delete mode 100644 java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/spring-annotation/CalculatorService-context.xml delete mode 100644 java/sca-contrib/itest/spring/src/main/resources/context/access/Calculator.composite delete mode 100644 java/sca-contrib/itest/spring/src/main/resources/context/imports/Calculator.composite delete mode 100644 java/sca-contrib/itest/spring/src/main/resources/context/multiple/StockQuote.composite delete mode 100644 java/sca-contrib/itest/spring/src/main/resources/implementation/policies/Calculator.composite delete mode 100644 java/sca-contrib/itest/spring/src/main/resources/implementation/policies/CalculatorJass.config delete mode 100644 java/sca-contrib/itest/spring/src/main/resources/implementation/policies/CalculatorLogMessages.properties delete mode 100644 java/sca-contrib/itest/spring/src/main/resources/implementation/policies/definitions.xml delete mode 100644 java/sca-contrib/itest/spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorld.composite delete mode 100644 java/sca-contrib/itest/spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringHelloWorld.composite delete mode 100644 java/sca-contrib/itest/spring/src/main/resources/spring/annotations/Calculator.composite delete mode 100644 java/sca-contrib/itest/spring/src/test/java/context/access/CalculatorClient.java delete mode 100644 java/sca-contrib/itest/spring/src/test/java/context/access/ContextAccessTestCase.java delete mode 100644 java/sca-contrib/itest/spring/src/test/java/context/imports/CalculatorClient.java delete mode 100644 java/sca-contrib/itest/spring/src/test/java/context/imports/ContextImportsTestCase.java delete mode 100644 java/sca-contrib/itest/spring/src/test/java/context/multiple/MultipleContextTestCase.java delete mode 100644 java/sca-contrib/itest/spring/src/test/java/context/multiple/StockQuoteServer.java delete mode 100644 java/sca-contrib/itest/spring/src/test/java/implementation/policies/CalculatorClient.java delete mode 100644 java/sca-contrib/itest/spring/src/test/java/implementation/policies/ImplementationPoliciesTestCase.java delete mode 100644 java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractHelloWorldTestCase.java delete mode 100644 java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java delete mode 100644 java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorld.java delete mode 100644 java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorldProxy.java delete mode 100644 java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorldTestCase.java delete mode 100644 java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringHelloWorldTestCase.java delete mode 100644 java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldBean.java delete mode 100644 java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldDelegatorBean.java delete mode 100644 java/sca-contrib/itest/spring/src/test/java/spring/annotations/CalculatorClient.java delete mode 100644 java/sca-contrib/itest/spring/src/test/java/spring/annotations/SpringAnnotationsTestCase.java (limited to 'java/sca-contrib/itest/spring/src') diff --git a/java/sca-contrib/itest/spring/src/main/java/bigbank/stockquote/StockQuoteImpl.java b/java/sca-contrib/itest/spring/src/main/java/bigbank/stockquote/StockQuoteImpl.java deleted file mode 100644 index 833cc50f71..0000000000 --- a/java/sca-contrib/itest/spring/src/main/java/bigbank/stockquote/StockQuoteImpl.java +++ /dev/null @@ -1,38 +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 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/java/sca-contrib/itest/spring/src/main/java/bigbank/stockquote/StockQuoteService.java b/java/sca-contrib/itest/spring/src/main/java/bigbank/stockquote/StockQuoteService.java deleted file mode 100644 index d6db2bd182..0000000000 --- a/java/sca-contrib/itest/spring/src/main/java/bigbank/stockquote/StockQuoteService.java +++ /dev/null @@ -1,30 +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 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/java/sca-contrib/itest/spring/src/main/java/calculator/AddService.java b/java/sca-contrib/itest/spring/src/main/java/calculator/AddService.java deleted file mode 100644 index 5a1e7a638a..0000000000 --- a/java/sca-contrib/itest/spring/src/main/java/calculator/AddService.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 Add service interface - */ -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/java/sca-contrib/itest/spring/src/main/java/calculator/AddServiceImpl.java b/java/sca-contrib/itest/spring/src/main/java/calculator/AddServiceImpl.java deleted file mode 100644 index a597691905..0000000000 --- a/java/sca-contrib/itest/spring/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; - } - -} \ No newline at end of file diff --git a/java/sca-contrib/itest/spring/src/main/java/calculator/CalculatorService.java b/java/sca-contrib/itest/spring/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index ad87375529..0000000000 --- a/java/sca-contrib/itest/spring/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/java/sca-contrib/itest/spring/src/main/java/calculator/CalculatorServiceImpl.java b/java/sca-contrib/itest/spring/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index 4363650e52..0000000000 --- a/java/sca-contrib/itest/spring/src/main/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,79 +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; - -/** - * 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/java/sca-contrib/itest/spring/src/main/java/calculator/DivideService.java b/java/sca-contrib/itest/spring/src/main/java/calculator/DivideService.java deleted file mode 100644 index ef6a8b375b..0000000000 --- a/java/sca-contrib/itest/spring/src/main/java/calculator/DivideService.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 divide service interface - */ -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/java/sca-contrib/itest/spring/src/main/java/calculator/DivideServiceImpl.java b/java/sca-contrib/itest/spring/src/main/java/calculator/DivideServiceImpl.java deleted file mode 100644 index cd91935f08..0000000000 --- a/java/sca-contrib/itest/spring/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/java/sca-contrib/itest/spring/src/main/java/calculator/MultiplyService.java b/java/sca-contrib/itest/spring/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index db568cc762..0000000000 --- a/java/sca-contrib/itest/spring/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/java/sca-contrib/itest/spring/src/main/java/calculator/MultiplyServiceImpl.java b/java/sca-contrib/itest/spring/src/main/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index c85357fcd8..0000000000 --- a/java/sca-contrib/itest/spring/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/java/sca-contrib/itest/spring/src/main/java/calculator/SubtractService.java b/java/sca-contrib/itest/spring/src/main/java/calculator/SubtractService.java deleted file mode 100644 index 56ee372fc4..0000000000 --- a/java/sca-contrib/itest/spring/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/java/sca-contrib/itest/spring/src/main/java/calculator/SubtractServiceImpl.java b/java/sca-contrib/itest/spring/src/main/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index 1b669084d9..0000000000 --- a/java/sca-contrib/itest/spring/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/java/sca-contrib/itest/spring/src/main/java/calculator/security/CalculatorCallbackHandler.java b/java/sca-contrib/itest/spring/src/main/java/calculator/security/CalculatorCallbackHandler.java deleted file mode 100644 index b48fb90148..0000000000 --- a/java/sca-contrib/itest/spring/src/main/java/calculator/security/CalculatorCallbackHandler.java +++ /dev/null @@ -1,50 +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.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/java/sca-contrib/itest/spring/src/main/java/calculator/security/JaasLoginModule.java b/java/sca-contrib/itest/spring/src/main/java/calculator/security/JaasLoginModule.java deleted file mode 100644 index fe4097640b..0000000000 --- a/java/sca-contrib/itest/spring/src/main/java/calculator/security/JaasLoginModule.java +++ /dev/null @@ -1,178 +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.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 sharedState, - Map 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; - } - } - - /** - *

This method is called if the LoginContext's - * overall authentication succeeded - * (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules - * succeeded). - * - *

If this LoginModule's own authentication attempt - * succeeded (checked by retrieving the private state saved by the - * login method), then this method associates a - * UserPrincipal - * with the Subject located in the - * LoginModule. If this LoginModule's own - * authentication attempted failed, then this method removes - * any state that was originally saved. - * - *

- * - * @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; - } - } - - /** - *

This method is called if the LoginContext's - * overall authentication failed. - * (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules - * did not succeed). - * - *

If this LoginModule's own authentication attempt - * succeeded (checked by retrieving the private state saved by the - * login and commit methods), - * then this method cleans up any state that was originally saved. - * - *

- * - * @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. - * - *

This method removes the SimplePrincipal - * that was added by the commit method. - * - *

- * - * @exception LoginException if the logout fails. - * - * @return true in all cases since this LoginModule - * 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/java/sca-contrib/itest/spring/src/main/java/calculator/security/UserPrincipal.java b/java/sca-contrib/itest/spring/src/main/java/calculator/security/UserPrincipal.java deleted file mode 100644 index 09024197db..0000000000 --- a/java/sca-contrib/itest/spring/src/main/java/calculator/security/UserPrincipal.java +++ /dev/null @@ -1,66 +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.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/java/sca-contrib/itest/spring/src/main/java/context/access/SCAApplicationContextProvider.java b/java/sca-contrib/itest/spring/src/main/java/context/access/SCAApplicationContextProvider.java deleted file mode 100644 index dea3790494..0000000000 --- a/java/sca-contrib/itest/spring/src/main/java/context/access/SCAApplicationContextProvider.java +++ /dev/null @@ -1,19 +0,0 @@ -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/java/sca-contrib/itest/spring/src/main/java/spring/annotations/CalculatorServiceImpl.java b/java/sca-contrib/itest/spring/src/main/java/spring/annotations/CalculatorServiceImpl.java deleted file mode 100644 index 000b135f01..0000000000 --- a/java/sca-contrib/itest/spring/src/main/java/spring/annotations/CalculatorServiceImpl.java +++ /dev/null @@ -1,131 +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 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/java/sca-contrib/itest/spring/src/main/resources/CalculatorService-context.xml b/java/sca-contrib/itest/spring/src/main/resources/CalculatorService-context.xml deleted file mode 100644 index 7c84965629..0000000000 --- a/java/sca-contrib/itest/spring/src/main/resources/CalculatorService-context.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/SpringDelegationHelloWorld-context.xml b/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/SpringDelegationHelloWorld-context.xml deleted file mode 100644 index 18ab7e332d..0000000000 --- a/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/SpringDelegationHelloWorld-context.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/SpringHelloWorld-context.xml b/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/SpringHelloWorld-context.xml deleted file mode 100644 index 62e4e077b6..0000000000 --- a/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/SpringHelloWorld-context.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/context-access/CalculatorService-context.xml b/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/context-access/CalculatorService-context.xml deleted file mode 100644 index 87458b99a3..0000000000 --- a/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/context-access/CalculatorService-context.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/context-imports/CalculatorService-context.xml b/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/context-imports/CalculatorService-context.xml deleted file mode 100644 index 7c84965629..0000000000 --- a/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/context-imports/CalculatorService-context.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/context-imports/SpringImport-context.xml b/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/context-imports/SpringImport-context.xml deleted file mode 100644 index 3faed92fd2..0000000000 --- a/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/context-imports/SpringImport-context.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/context-multiple/StockQuoteService-context.xml b/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/context-multiple/StockQuoteService-context.xml deleted file mode 100644 index 74473073ea..0000000000 --- a/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/context-multiple/StockQuoteService-context.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/context-multiple/beanRefContext.xml b/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/context-multiple/beanRefContext.xml deleted file mode 100644 index fb4be314b6..0000000000 --- a/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/context-multiple/beanRefContext.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - META-INF/sca/context-multiple/StockQuoteService-context.xml - - - - \ No newline at end of file diff --git a/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/implementation-policies/CalculatorService-context.xml b/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/implementation-policies/CalculatorService-context.xml deleted file mode 100644 index 7c84965629..0000000000 --- a/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/implementation-policies/CalculatorService-context.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/spring-annotation/CalculatorService-context.xml b/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/spring-annotation/CalculatorService-context.xml deleted file mode 100644 index 4110a9a7b7..0000000000 --- a/java/sca-contrib/itest/spring/src/main/resources/META-INF/sca/spring-annotation/CalculatorService-context.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/java/sca-contrib/itest/spring/src/main/resources/context/access/Calculator.composite b/java/sca-contrib/itest/spring/src/main/resources/context/access/Calculator.composite deleted file mode 100644 index 03116905fc..0000000000 --- a/java/sca-contrib/itest/spring/src/main/resources/context/access/Calculator.composite +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/sca-contrib/itest/spring/src/main/resources/context/imports/Calculator.composite b/java/sca-contrib/itest/spring/src/main/resources/context/imports/Calculator.composite deleted file mode 100644 index 709de34a34..0000000000 --- a/java/sca-contrib/itest/spring/src/main/resources/context/imports/Calculator.composite +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/sca-contrib/itest/spring/src/main/resources/context/multiple/StockQuote.composite b/java/sca-contrib/itest/spring/src/main/resources/context/multiple/StockQuote.composite deleted file mode 100644 index 3838515055..0000000000 --- a/java/sca-contrib/itest/spring/src/main/resources/context/multiple/StockQuote.composite +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - diff --git a/java/sca-contrib/itest/spring/src/main/resources/implementation/policies/Calculator.composite b/java/sca-contrib/itest/spring/src/main/resources/implementation/policies/Calculator.composite deleted file mode 100644 index 0551dc60ef..0000000000 --- a/java/sca-contrib/itest/spring/src/main/resources/implementation/policies/Calculator.composite +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/sca-contrib/itest/spring/src/main/resources/implementation/policies/CalculatorJass.config b/java/sca-contrib/itest/spring/src/main/resources/implementation/policies/CalculatorJass.config deleted file mode 100644 index 0e7cb86633..0000000000 --- a/java/sca-contrib/itest/spring/src/main/resources/implementation/policies/CalculatorJass.config +++ /dev/null @@ -1,3 +0,0 @@ -Calculator { - calculator.security.JaasLoginModule required debug=true; -}; diff --git a/java/sca-contrib/itest/spring/src/main/resources/implementation/policies/CalculatorLogMessages.properties b/java/sca-contrib/itest/spring/src/main/resources/implementation/policies/CalculatorLogMessages.properties deleted file mode 100644 index f62125eaa9..0000000000 --- a/java/sca-contrib/itest/spring/src/main/resources/implementation/policies/CalculatorLogMessages.properties +++ /dev/null @@ -1,18 +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. -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/java/sca-contrib/itest/spring/src/main/resources/implementation/policies/definitions.xml b/java/sca-contrib/itest/spring/src/main/resources/implementation/policies/definitions.xml deleted file mode 100644 index 992c1b92f5..0000000000 --- a/java/sca-contrib/itest/spring/src/main/resources/implementation/policies/definitions.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - Calculator - calculator.security.CalculatorCallbackHandler - - - - - - - FINER - - - \ No newline at end of file diff --git a/java/sca-contrib/itest/spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorld.composite b/java/sca-contrib/itest/spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorld.composite deleted file mode 100644 index 70b2d5fdab..0000000000 --- a/java/sca-contrib/itest/spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorld.composite +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - diff --git a/java/sca-contrib/itest/spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringHelloWorld.composite b/java/sca-contrib/itest/spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringHelloWorld.composite deleted file mode 100644 index bab9ecb528..0000000000 --- a/java/sca-contrib/itest/spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringHelloWorld.composite +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - diff --git a/java/sca-contrib/itest/spring/src/main/resources/spring/annotations/Calculator.composite b/java/sca-contrib/itest/spring/src/main/resources/spring/annotations/Calculator.composite deleted file mode 100644 index a8a1f5b703..0000000000 --- a/java/sca-contrib/itest/spring/src/main/resources/spring/annotations/Calculator.composite +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - HelloWorld - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/sca-contrib/itest/spring/src/test/java/context/access/CalculatorClient.java b/java/sca-contrib/itest/spring/src/test/java/context/access/CalculatorClient.java deleted file mode 100644 index 9b7202d951..0000000000 --- a/java/sca-contrib/itest/spring/src/test/java/context/access/CalculatorClient.java +++ /dev/null @@ -1,60 +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 context.access; - -import java.io.File; -import org.apache.tuscany.sca.node.SCAClient; -import org.apache.tuscany.sca.node.SCANode; -import org.apache.tuscany.sca.node.SCANodeFactory; -import org.apache.tuscany.sca.node.SCAContribution; -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 { - - SCANodeFactory factory = SCANodeFactory.newInstance(); - SCANode node = factory.createSCANode(new File("src/main/resources/context/access/Calculator.composite").toURL().toString(), - new SCAContribution("TestContribution", new File("src/main/resources/context/access/").toURL().toString())); - 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 = - ((SCAClient)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/java/sca-contrib/itest/spring/src/test/java/context/access/ContextAccessTestCase.java b/java/sca-contrib/itest/spring/src/test/java/context/access/ContextAccessTestCase.java deleted file mode 100644 index 5feb293bc8..0000000000 --- a/java/sca-contrib/itest/spring/src/test/java/context/access/ContextAccessTestCase.java +++ /dev/null @@ -1,32 +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 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/java/sca-contrib/itest/spring/src/test/java/context/imports/CalculatorClient.java b/java/sca-contrib/itest/spring/src/test/java/context/imports/CalculatorClient.java deleted file mode 100644 index d3bd190cc0..0000000000 --- a/java/sca-contrib/itest/spring/src/test/java/context/imports/CalculatorClient.java +++ /dev/null @@ -1,54 +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 context.imports; - -import java.io.File; -import org.apache.tuscany.sca.node.SCAClient; -import org.apache.tuscany.sca.node.SCANode; -import org.apache.tuscany.sca.node.SCANodeFactory; -import org.apache.tuscany.sca.node.SCAContribution; - -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 { - - SCANodeFactory factory = SCANodeFactory.newInstance(); - SCANode node = factory.createSCANode(new File("src/main/resources/context/imports/Calculator.composite").toURL().toString(), - new SCAContribution("TestContribution", new File("src/main/resources/context/imports/").toURL().toString())); - node.start(); - - CalculatorService calculatorService = - ((SCAClient)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/java/sca-contrib/itest/spring/src/test/java/context/imports/ContextImportsTestCase.java b/java/sca-contrib/itest/spring/src/test/java/context/imports/ContextImportsTestCase.java deleted file mode 100644 index 3940bf65fa..0000000000 --- a/java/sca-contrib/itest/spring/src/test/java/context/imports/ContextImportsTestCase.java +++ /dev/null @@ -1,32 +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 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/java/sca-contrib/itest/spring/src/test/java/context/multiple/MultipleContextTestCase.java b/java/sca-contrib/itest/spring/src/test/java/context/multiple/MultipleContextTestCase.java deleted file mode 100644 index 75b296bf32..0000000000 --- a/java/sca-contrib/itest/spring/src/test/java/context/multiple/MultipleContextTestCase.java +++ /dev/null @@ -1,32 +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 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/java/sca-contrib/itest/spring/src/test/java/context/multiple/StockQuoteServer.java b/java/sca-contrib/itest/spring/src/test/java/context/multiple/StockQuoteServer.java deleted file mode 100644 index ca64d5fcb9..0000000000 --- a/java/sca-contrib/itest/spring/src/test/java/context/multiple/StockQuoteServer.java +++ /dev/null @@ -1,51 +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 context.multiple; - -import org.apache.tuscany.sca.node.SCANode; -import org.apache.tuscany.sca.node.SCANodeFactory; -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..."); - - SCANodeFactory factory = SCANodeFactory.newInstance(); - SCANode node = factory.createSCANodeFromClassLoader("context/multiple/StockQuote.composite", StockQuoteServer.class.getClassLoader()); - 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/java/sca-contrib/itest/spring/src/test/java/implementation/policies/CalculatorClient.java b/java/sca-contrib/itest/spring/src/test/java/implementation/policies/CalculatorClient.java deleted file mode 100644 index 27e634d301..0000000000 --- a/java/sca-contrib/itest/spring/src/test/java/implementation/policies/CalculatorClient.java +++ /dev/null @@ -1,78 +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 implementation.policies; - -import java.io.File; - -import javax.security.auth.login.Configuration; -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.apache.tuscany.sca.node.SCAClient; -import org.apache.tuscany.sca.node.SCAContribution; -import org.apache.tuscany.sca.node.SCANode; -import org.apache.tuscany.sca.node.SCANodeFactory; - -import calculator.CalculatorService; -import calculator.CalculatorServiceImpl; - - -/** - * 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()); - } - - SCANodeFactory factory = SCANodeFactory.newInstance(); - SCANode node = factory.createSCANodeFromClassLoader("implementation/policies/Calculator.composite", CalculatorServiceImpl.class.getClassLoader()); - node.start(); - - CalculatorService calculatorService = - ((SCAClient)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 = - ((SCAClient)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/java/sca-contrib/itest/spring/src/test/java/implementation/policies/ImplementationPoliciesTestCase.java b/java/sca-contrib/itest/spring/src/test/java/implementation/policies/ImplementationPoliciesTestCase.java deleted file mode 100644 index 1e759f98a0..0000000000 --- a/java/sca-contrib/itest/spring/src/test/java/implementation/policies/ImplementationPoliciesTestCase.java +++ /dev/null @@ -1,32 +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 implementation.policies; - -import junit.framework.TestCase; - -/** - * Tests out the big bank service - * - */ -public class ImplementationPoliciesTestCase extends TestCase { - - public void testServer() throws Exception { - CalculatorClient.main(new String[] {""}); - } -} diff --git a/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractHelloWorldTestCase.java b/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractHelloWorldTestCase.java deleted file mode 100644 index 634e3d34af..0000000000 --- a/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractHelloWorldTestCase.java +++ /dev/null @@ -1,40 +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 org.apache.tuscany.sca.itest.spring; - - -/** - * Basic "hello world" style test case for testing Spring component implementation - * - */ -public abstract class AbstractHelloWorldTestCase extends AbstractSCATestCase { - - /** - * 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 getServiceClass() { - return HelloWorld.class; - } -} diff --git a/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java b/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java deleted file mode 100644 index aeb7918add..0000000000 --- a/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java +++ /dev/null @@ -1,51 +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 org.apache.tuscany.sca.itest.spring; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -public abstract class AbstractSCATestCase extends TestCase { - - protected SCADomain domain; - protected T service; - - @Override - protected void setUp() throws Exception { - domain = SCADomain.newInstance(getCompositeName()); - service = domain.getService(getServiceClass(), "ClientComponent"); - } - - abstract protected Class getServiceClass(); - - @Override - protected void tearDown() throws Exception { - domain.close(); - } - - 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/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorld.java b/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorld.java deleted file mode 100644 index 5869d344f6..0000000000 --- a/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorld.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 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/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorldProxy.java b/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorldProxy.java deleted file mode 100644 index 90d26dd89f..0000000000 --- a/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorldProxy.java +++ /dev/null @@ -1,41 +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 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/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorldTestCase.java b/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorldTestCase.java deleted file mode 100644 index 4088691ccd..0000000000 --- a/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorldTestCase.java +++ /dev/null @@ -1,31 +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 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/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringHelloWorldTestCase.java b/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringHelloWorldTestCase.java deleted file mode 100644 index 840bf59b73..0000000000 --- a/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringHelloWorldTestCase.java +++ /dev/null @@ -1,32 +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 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/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldBean.java b/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldBean.java deleted file mode 100644 index fa7967c964..0000000000 --- a/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldBean.java +++ /dev/null @@ -1,36 +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 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/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldDelegatorBean.java b/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldDelegatorBean.java deleted file mode 100644 index b57cc7f366..0000000000 --- a/java/sca-contrib/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldDelegatorBean.java +++ /dev/null @@ -1,40 +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 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/java/sca-contrib/itest/spring/src/test/java/spring/annotations/CalculatorClient.java b/java/sca-contrib/itest/spring/src/test/java/spring/annotations/CalculatorClient.java deleted file mode 100644 index c21561a962..0000000000 --- a/java/sca-contrib/itest/spring/src/test/java/spring/annotations/CalculatorClient.java +++ /dev/null @@ -1,65 +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 spring.annotations; - -import java.io.File; - -import org.apache.tuscany.sca.node.SCAClient; -import org.apache.tuscany.sca.node.SCAContribution; -import org.apache.tuscany.sca.node.SCANode; -import org.apache.tuscany.sca.node.SCANodeFactory; - -import calculator.CalculatorService; -import calculator.CalculatorServiceImpl; - - -/** - * 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 { - - SCANodeFactory factory = SCANodeFactory.newInstance(); - SCANode node = factory.createSCANode(new File("src/main/resources/spring/annotations/Calculator.composite").toURL().toString(), - new SCAContribution("TestContribution", new File("src/main/resources/spring/annotations/").toURL().toString())); - node.start(); - - CalculatorService calculatorService = - ((SCAClient)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/java/sca-contrib/itest/spring/src/test/java/spring/annotations/SpringAnnotationsTestCase.java b/java/sca-contrib/itest/spring/src/test/java/spring/annotations/SpringAnnotationsTestCase.java deleted file mode 100644 index 3a9ec4bbb2..0000000000 --- a/java/sca-contrib/itest/spring/src/test/java/spring/annotations/SpringAnnotationsTestCase.java +++ /dev/null @@ -1,32 +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 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[] {""}); - } -} -- cgit v1.2.3