diff options
Diffstat (limited to 'tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test')
18 files changed, 0 insertions, 951 deletions
diff --git a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/SpringConfigSchemaTestCase.java b/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/SpringConfigSchemaTestCase.java deleted file mode 100644 index 13b2c684d7..0000000000 --- a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/SpringConfigSchemaTestCase.java +++ /dev/null @@ -1,52 +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.container.spring; - -import junit.framework.TestCase; - -/** - * Tests the SCA extensible schema elements for Spring's XML configuration files - * - * @version $$Rev$$ $$Date$$ - */ - -public class SpringConfigSchemaTestCase extends TestCase { - -// private ConfigurableApplicationContext applicationContext; -// -// public void setUp() { -// applicationContext = -// new ScaApplicationContext(null, -// new ClassPathResource("org/apache/tuscany/container/spring/SpringConfigSchemaTest.xml")); -// } -// - public void testSCAService() { -// ScaServiceExporter service = (ScaServiceExporter) applicationContext.getBean("fooService"); -// // FIXME andyp -- this is not really right. -//// TestBean service = (TestBean) applicationContext.getBean("fooService"); -//// assertEquals("call me", service.echo("call me")); - } -// -// public void testSCAReference() { -// ScaServiceProxyFactoryBean pf = (ScaServiceProxyFactoryBean) applicationContext.getBean("&fooReference"); -// assertEquals("fooReference", pf.getReferenceName()); -// TestReference ref = (TestReference) applicationContext.getBean("fooReference"); -//// assertNotNull(ref); -// } -} diff --git a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/SpringTestUtils.java b/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/SpringTestUtils.java deleted file mode 100644 index 4a73b6628b..0000000000 --- a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/SpringTestUtils.java +++ /dev/null @@ -1,73 +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.container.spring; - -import java.net.URI; -import javax.xml.namespace.QName; - -import org.apache.tuscany.spi.builder.WiringException; -import org.apache.tuscany.spi.component.ServiceBinding; -import org.apache.tuscany.spi.component.TargetInvokerCreationException; -import org.apache.tuscany.spi.extension.ServiceBindingExtension; -import org.apache.tuscany.spi.idl.InvalidServiceContractException; -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.model.physical.PhysicalOperationDefinition; -import org.apache.tuscany.spi.wire.TargetInvoker; - -import org.apache.tuscany.container.spring.mock.TestBeanImpl; -import org.springframework.beans.factory.config.BeanDefinition; -import org.springframework.beans.factory.support.RootBeanDefinition; -import org.springframework.context.support.GenericApplicationContext; - -/** - * @version $$Rev$$ $$Date$$ - */ - -public final class SpringTestUtils { - private SpringTestUtils() { - } - - public static <T> ServiceBinding createService(URI uri, Class<T> serviceInterface) - throws InvalidServiceContractException, WiringException { - return new ServiceBindingExtension(uri) { - public QName getBindingType() { - return null; - } - - public TargetInvoker createTargetInvoker(String targetName, Operation operation) - throws TargetInvokerCreationException { - return null; - } - - public TargetInvoker createTargetInvoker(String targetName, PhysicalOperationDefinition operation) - throws TargetInvokerCreationException { - return null; - } - }; - } - - - public static GenericApplicationContext createContext() { - GenericApplicationContext ctx = new GenericApplicationContext(); - BeanDefinition definition = new RootBeanDefinition(TestBeanImpl.class); - ctx.registerBeanDefinition("foo", definition); - return ctx; - } - -} diff --git a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/TestClassResource.java b/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/TestClassResource.java deleted file mode 100644 index f93957cb8b..0000000000 --- a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/TestClassResource.java +++ /dev/null @@ -1,45 +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.container.spring; - -import java.io.InputStream; -import java.io.IOException; - -import org.springframework.core.io.AbstractResource; - -/** - * @version $Rev$ $Date$ - */ -public class TestClassResource extends AbstractResource { - private Class<?> clazz; - private String fileName; - - public TestClassResource(Class<?> clazz, String fileName) { - this.clazz = clazz; - this.fileName = fileName; - } - - public String getDescription() { - return "test resource"; - } - - public InputStream getInputStream() throws IOException { - return clazz.getResourceAsStream(fileName); - } -} diff --git a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/impl/ReferenceWiringTestCase.java b/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/impl/ReferenceWiringTestCase.java deleted file mode 100644 index b1e5733cd8..0000000000 --- a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/impl/ReferenceWiringTestCase.java +++ /dev/null @@ -1,151 +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.container.spring.impl; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; -import java.net.URI; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.osoa.sca.CallableReference; - -import org.apache.tuscany.spi.component.Reference; -import org.apache.tuscany.spi.component.ReferenceBinding; -import org.apache.tuscany.spi.component.TargetInvokerCreationException; -import org.apache.tuscany.spi.model.ServiceContract; -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.model.physical.PhysicalOperationDefinition; -import org.apache.tuscany.spi.wire.ChainHolder; -import org.apache.tuscany.spi.wire.IncompatibleServiceContractException; -import org.apache.tuscany.spi.wire.ProxyCreationException; -import org.apache.tuscany.spi.wire.ProxyService; -import org.apache.tuscany.spi.wire.Wire; -import org.apache.tuscany.spi.wire.TargetInvoker; -import org.apache.tuscany.spi.extension.ReferenceBindingExtension; - -import junit.framework.TestCase; -import org.apache.tuscany.container.spring.mock.TestBean; -import org.easymock.EasyMock; -import org.springframework.core.io.Resource; -import org.springframework.core.io.UrlResource; - -/** - * Verifies wiring from a Spring bean to an SCA composite reference - * - * @version $$Rev$$ $$Date$$ - */ -public class ReferenceWiringTestCase extends TestCase { - - public void testInvocation() throws Exception { - ClassLoader loader = getClass().getClassLoader(); - URL url = loader.getResource("META-INF/sca/testReferenceContext.xml"); - Resource resource = new UrlResource(url); - URI uri = URI.create("spring"); - ProxyService proxyService = new MockProxyService(); - SpringCompositeComponent parent = new SpringCompositeComponent(uri, resource, proxyService, null, loader); - Wire wire = EasyMock.createMock(Wire.class); - ServiceContract<?> contract = new ServiceContract(TestBean.class) { - }; - EasyMock.expect(wire.getSourceContract()).andReturn(contract).atLeastOnce(); - EasyMock.replay(wire); - ReferenceBinding referenceBinding = EasyMock.createMock(ReferenceBinding.class); - EasyMock.expect(referenceBinding.getWire()).andStubReturn(wire); - referenceBinding.start(); - EasyMock.replay(referenceBinding); - - URI referenceUri = URI.create("spring#testReference"); - ReferenceBinding binding = new ReferenceBindingExtension(referenceUri, null){ - - public QName getBindingType() { - return null; - } - - public TargetInvoker createTargetInvoker(String targetName, Operation operation) - throws TargetInvokerCreationException { - throw new UnsupportedOperationException(); - } - - public TargetInvoker createTargetInvoker(String targetName, PhysicalOperationDefinition operation) - throws TargetInvokerCreationException { - return null; - } - }; - binding.setWire(wire); - List<ReferenceBinding> bindings = new ArrayList<ReferenceBinding>(); - bindings.add(binding); - Reference reference = EasyMock.createMock(Reference.class); - EasyMock.expect(reference.getUri()).andReturn(referenceUri).anyTimes(); - EasyMock.expect(reference.getReferenceBindings()).andReturn(bindings).atLeastOnce(); - reference.start(); - EasyMock.replay(reference); - parent.register(reference); - parent.start(); - TestBean bean = parent.getBean(TestBean.class, "testBean"); - assertNotNull(bean.getBean()); - EasyMock.verify(reference); - } - - private class MockInvocationHandler implements InvocationHandler { - - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - return null; - } - } - - private class MockProxyService implements ProxyService { - - public <T> T createProxy(Class<T> interfaze, Wire wire) throws ProxyCreationException { - ClassLoader cl = interfaze.getClassLoader(); - Class[] interfaces = new Class[]{interfaze}; - MockInvocationHandler handler = new MockInvocationHandler(); - return interfaze.cast(Proxy.newProxyInstance(cl, interfaces, handler)); - } - - public <T> T createProxy(Class<T> interfaze, Wire wire, Map<Method, ChainHolder> mapping) - throws ProxyCreationException { - throw new UnsupportedOperationException(); - } - - public Object createCallbackProxy(Class<?> interfaze, List<Wire> wires) throws ProxyCreationException { - throw new UnsupportedOperationException(); - } - - public Object createCallbackProxy(Class<?> interfaze) throws ProxyCreationException { - throw new UnsupportedOperationException(); - } - - public <B, R extends CallableReference<B>> R cast(B target) throws IllegalArgumentException { - throw new UnsupportedOperationException(); - } - - public boolean checkCompatibility(ServiceContract<?> source, - ServiceContract<?> target, - boolean ignoreCallback, - boolean silent) throws IncompatibleServiceContractException { - throw new UnsupportedOperationException(); - } - } - -} diff --git a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/impl/SpringCompositeBuilderTestCase.java b/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/impl/SpringCompositeBuilderTestCase.java deleted file mode 100644 index fb9d107b71..0000000000 --- a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/impl/SpringCompositeBuilderTestCase.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 org.apache.tuscany.container.spring.impl; - -import java.net.URI; -import java.net.URL; - -import org.apache.tuscany.spi.builder.BuilderRegistry; -import org.apache.tuscany.spi.component.Component; -import org.apache.tuscany.spi.component.Service; -import org.apache.tuscany.spi.deployer.DeploymentContext; -import org.apache.tuscany.spi.model.ComponentDefinition; -import org.apache.tuscany.spi.model.Property; -import org.apache.tuscany.spi.model.ReferenceDefinition; -import org.apache.tuscany.spi.model.ServiceDefinition; - -import junit.framework.TestCase; -import org.apache.tuscany.container.spring.model.SpringComponentType; -import org.apache.tuscany.container.spring.model.SpringImplementation; -import org.easymock.EasyMock; -import org.springframework.core.io.Resource; -import org.springframework.core.io.UrlResource; - -/** - * @version $$Rev$$ $$Date$$ - */ -public class SpringCompositeBuilderTestCase extends TestCase { - - /** - * Verifies that the builder calls back into the registry to load services and references when no - * <code>sca:service</code> tag is specified in the Spring application.xml - */ - public void testImplicitServiceWiring() throws Exception { - Service service = EasyMock.createMock(Service.class); - // Configure the mock builder registry - BuilderRegistry registry = EasyMock.createMock(BuilderRegistry.class); - EasyMock.expect(registry.build( - EasyMock.isA(ServiceDefinition.class), - EasyMock.isA(DeploymentContext.class))).andStubReturn(service); - EasyMock.replay(registry); - SpringCompositeBuilder builder = new SpringCompositeBuilder(); - builder.setBuilderRegistry(registry); - ComponentDefinition<SpringImplementation> definition = createDefinitionWithService(); - Component component = builder.build(definition, null); - assertNotNull(component); - EasyMock.verify(registry); - } - - /** - * Verifies that the builder calls back into the registry to load services and references when no - * <code>sca:reference</code> tag is specified in the Spring application.xml - */ - public void testImplicitReferenceWiring() throws Exception { - Service service = EasyMock.createMock(Service.class); - // Configure the mock builder registry - BuilderRegistry registry = EasyMock.createMock(BuilderRegistry.class); - EasyMock.expect(registry.build( - EasyMock.isA(ServiceDefinition.class), - EasyMock.isA(DeploymentContext.class))).andStubReturn(service); - EasyMock.replay(registry); - SpringCompositeBuilder builder = new SpringCompositeBuilder(); - builder.setBuilderRegistry(registry); - ComponentDefinition<SpringImplementation> definition = createDefinitionWithReference(); - Component component = builder.build(definition, null); - assertNotNull(component); - EasyMock.verify(registry); - } - - protected ComponentDefinition<SpringImplementation> createDefinitionWithService() throws Exception { - super.setUp(); - ClassLoader loader = getClass().getClassLoader(); - URL url = loader.getResource("META-INF/sca/testServiceContext.xml"); - Resource resource = new UrlResource(url); - SpringComponentType<Property<?>> type = createComponentTypeWithService(); - SpringImplementation impl = new SpringImplementation(loader); - impl.setComponentType(type); - URI uri = URI.create("composite"); - ComponentDefinition<SpringImplementation> definition = new ComponentDefinition<SpringImplementation>(uri, impl); - impl.setApplicationResource(resource); - return definition; - } - - protected ComponentDefinition<SpringImplementation> createDefinitionWithReference() throws Exception { - super.setUp(); - ClassLoader loader = getClass().getClassLoader(); - URL url = loader.getResource("META-INF/sca/testServiceContext.xml"); - Resource resource = new UrlResource(url); - SpringComponentType<Property<?>> type = createComponentTypeWithReference(); - SpringImplementation impl = new SpringImplementation(loader); - impl.setComponentType(type); - URI uri = URI.create("composite"); - ComponentDefinition<SpringImplementation> definition = new ComponentDefinition<SpringImplementation>(uri, impl); - impl.setApplicationResource(resource); - return definition; - } - - private SpringComponentType<Property<?>> createComponentTypeWithService() { - SpringComponentType<Property<?>> componentType = new SpringComponentType<Property<?>>(); - ServiceDefinition serviceDefinition = new ServiceDefinition(); - serviceDefinition.setUri(URI.create("fooService")); - serviceDefinition.setTarget(URI.create("testBean")); - componentType.add(serviceDefinition); - return componentType; - } - - private SpringComponentType<Property<?>> createComponentTypeWithReference() { - SpringComponentType<Property<?>> componentType = new SpringComponentType<Property<?>>(); - ReferenceDefinition referenceDefinition = new ReferenceDefinition(); - referenceDefinition.setUri(URI.create("fooReference")); - componentType.add(referenceDefinition); - return componentType; - } - - -} diff --git a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/impl/SpringCompositeComponentTestCase.java b/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/impl/SpringCompositeComponentTestCase.java deleted file mode 100644 index d014d99ad7..0000000000 --- a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/impl/SpringCompositeComponentTestCase.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 org.apache.tuscany.container.spring.impl; - -import java.lang.reflect.Type; -import java.net.URI; -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.spi.component.Service; -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.model.ServiceContract; - -import junit.framework.TestCase; -import org.easymock.classextension.EasyMock; -import org.springframework.context.support.AbstractApplicationContext; - -/** - * @version $Rev$ $Date$ - */ -public class SpringCompositeComponentTestCase extends TestCase { - private SpringCompositeComponent component; - - public void testChildStart() throws Exception { - AbstractApplicationContext appContext = EasyMock.createNiceMock(AbstractApplicationContext.class); - EasyMock.replay(appContext); - Service service = EasyMock.createMock(Service.class); - URI uri = URI.create("composite#service"); - EasyMock.expect(service.getUri()).andReturn(uri).atLeastOnce(); - service.start(); - EasyMock.replay(service); - component.setSpringContext(appContext); - component.register(service); - component.start(); - EasyMock.verify(service); - } - - public void testTargetInvokerCreation() throws Exception { - ServiceContract<Type> contract = new ServiceContract<Type>(Foo.class) { - }; - Operation<Type> operation = new Operation<Type>("operation", null, null, null); - Map<String, Operation<Type>> operations = new HashMap<String, Operation<Type>>(); - operations.put("operation", operation); - contract.setOperations(operations); - operation.setServiceContract(contract); - component.createTargetInvoker("bean", operation); - } - - - protected void setUp() throws Exception { - super.setUp(); - URI compositeUri = URI.create("composite"); - component = new SpringCompositeComponent(compositeUri, null, null, null, null); - - } - - private interface Foo { - void operation(); - } -} diff --git a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/impl/SpringInvocationTestCase.java b/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/impl/SpringInvocationTestCase.java deleted file mode 100644 index e4a6ad0eb7..0000000000 --- a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/impl/SpringInvocationTestCase.java +++ /dev/null @@ -1,57 +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.container.spring.impl; - -import org.apache.tuscany.spi.wire.Message; -import org.apache.tuscany.spi.wire.MessageImpl; - -import junit.framework.TestCase; -import org.easymock.classextension.EasyMock; - -/** - * Verifies a simple invocation on a Spring bean - * - * @version $$Rev$$ $$Date$$ - */ -public class SpringInvocationTestCase extends TestCase { - - /** - * Verifies the invoker can resolve a bean in an application context and call a method l - */ - public void testInvocation() throws Exception { - TestBean bean = EasyMock.createMock(TestBean.class); - bean.test("bar"); - EasyMock.expectLastCall(); - EasyMock.replay(bean); - SpringCompositeComponent context = EasyMock.createMock(SpringCompositeComponent.class); - EasyMock.expect(context.getBean(Object.class, "foo")).andReturn(bean); - EasyMock.replay(context); - SpringInvoker invoker = new SpringInvoker("foo", TestBean.class.getMethod("test", String.class), context); - Message msg = new MessageImpl(); - msg.setBody(new String[]{"bar"}); - invoker.invoke(msg); - EasyMock.verify(context); - EasyMock.verify(bean); - } - - - private interface TestBean { - void test(String msg); - } -} diff --git a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/mock/TestBean.java b/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/mock/TestBean.java deleted file mode 100644 index 1c768e53cc..0000000000 --- a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/mock/TestBean.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.container.spring.mock; - -/** - * @version $$Rev$$ $$Date$$ - */ -public interface TestBean { - String echo(String msg); - - TestBean getBean(); - - void setBean(TestBean bean); - -} diff --git a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/mock/TestBeanImpl.java b/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/mock/TestBeanImpl.java deleted file mode 100644 index db04d8bcad..0000000000 --- a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/mock/TestBeanImpl.java +++ /dev/null @@ -1,42 +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.container.spring.mock; - -/** - * @version $$Rev$$ $$Date$$ - */ -public class TestBeanImpl implements TestBean { - - private TestBean bean; - - public TestBeanImpl() { - } - - public String echo(String msg) { - return msg; - } - - public TestBean getBean() { - return bean; - } - - public void setBean(TestBean bean) { - this.bean = bean; - } -} diff --git a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/mock/TestReference.java b/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/mock/TestReference.java deleted file mode 100644 index 618c0d60cc..0000000000 --- a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/java/org/apache/tuscany/container/spring/mock/TestReference.java +++ /dev/null @@ -1,27 +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.container.spring.mock; - -/** - * @version $$Rev$$ $$Date$$ - */ -public interface TestReference { - String echo(String msg); -} diff --git a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/META-INF/sca/application-context.xml b/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/META-INF/sca/application-context.xml deleted file mode 100644 index 6ccd3963a9..0000000000 --- a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/META-INF/sca/application-context.xml +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:sca="http://www.springframework.org/schema/sca" - xsi:schemaLocation=" -http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd -http://www.springframework.org/schema/sca http://www.springframework.org/schema/sca/spring-sca.xsd"> - - <bean id="testBean" class="org.apache.tuscany.container.spring.mock.TestBeanImpl" lazy-init="true"> - <property name="bean" ref="testReference"/> - </bean> - <!-- <sca:reference name="testReference" type="org.apache.tuscany.container.spring.mock.TestReference"/> --> - -</beans> diff --git a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/META-INF/sca/default.scdl b/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/META-INF/sca/default.scdl deleted file mode 100644 index 0b2c92c667..0000000000 --- a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/META-INF/sca/default.scdl +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - --> -<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" - name="spring.test"> - - <component name="Spring"> - <implementation.spring location="META-INF/sca/application-context.xml"> - <service name="fooService"> - <binding.test/> - <interface.java class="org.apache.tuscany.container.spring.mock.TestBean"/> - <reference>testBean</reference> - </service> - <reference name="testReference"> - <interface.java class="org.apache.tuscany.container.spring.mock.TestBean"/> - <binding.test/> - </reference> - </implementation.spring> - </component> - -</composite> diff --git a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/META-INF/sca/testReferenceContext.xml b/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/META-INF/sca/testReferenceContext.xml deleted file mode 100644 index 282c8c50fa..0000000000 --- a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/META-INF/sca/testReferenceContext.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:sca="http://www.springframework.org/schema/sca" - xsi:schemaLocation=" -http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd -http://www.springframework.org/schema/sca http://www.springframework.org/schema/sca/spring-sca.xsd"> - - <bean id="testBean" class="org.apache.tuscany.container.spring.mock.TestBeanImpl"> - <property name="bean" ref="testReference"/> - </bean> - - <sca:reference name="testReference" type="org.apache.tuscany.container.spring.mock.TestBean"/> - -</beans> diff --git a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/META-INF/sca/testServiceContext.xml b/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/META-INF/sca/testServiceContext.xml deleted file mode 100644 index 0a3e597fc1..0000000000 --- a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/META-INF/sca/testServiceContext.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:sca="http://www.springframework.org/schema/sca" - xsi:schemaLocation=" -http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd -http://www.springframework.org/schema/sca http://www.springframework.org/schema/sca/spring-sca.xsd"> - - <sca:service name="fooService" type="org.apache.tuscany.container.spring.mock.TestBeanImpl" target="testBean"/> - - <bean id="testBean" class="org.apache.tuscany.container.spring.mock.TestBeanImpl"/> - -</beans> diff --git a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/META-INF/tuscany/xsystem.scdl b/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/META-INF/tuscany/xsystem.scdl deleted file mode 100644 index 0ef2781492..0000000000 --- a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/META-INF/tuscany/xsystem.scdl +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - --> -<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" - name="spring.test"> - <!-- - <component name="Spring"> - <implementation.spring location="META-INF/sca/application-context.xml"> - <service name="fooService"> - <binding.test/> - <interface.java class="org.apache.tuscany.container.spring.mock.TestBean"/> - <reference>testBean</reference> - </service> - <reference name="testReference"> - <interface.java class="org.apache.tuscany.container.spring.mock.TestBean"/> - <binding.test/> - </reference> - </implementation.spring> - </component> --> - -</composite> diff --git a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/org/apache/tuscany/container/spring/ExplicitSpring.xml b/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/org/apache/tuscany/container/spring/ExplicitSpring.xml deleted file mode 100644 index 211211511b..0000000000 --- a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/org/apache/tuscany/container/spring/ExplicitSpring.xml +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:sca="http://www.springframework.org/schema/sca" - xsi:schemaLocation=" -http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd -http://www.springframework.org/schema/sca http://www.springframework.org/schema/sca/spring-sca.xsd"> - - <sca:service name="fooBean" type="org.apache.tuscany.container.spring.mock.TestBeanImpl" target="testBean"/> - - <bean id="testBean" class="org.apache.tuscany.container.spring.mock.TestBeanImpl"> - </bean> - -</beans> diff --git a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/org/apache/tuscany/container/spring/SpringConfigSchemaTest.xml b/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/org/apache/tuscany/container/spring/SpringConfigSchemaTest.xml deleted file mode 100644 index 96a3e1ed46..0000000000 --- a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/org/apache/tuscany/container/spring/SpringConfigSchemaTest.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:sca="http://www.springframework.org/schema/sca" - xsi:schemaLocation=" -http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd -http://www.springframework.org/schema/sca http://www.springframework.org/schema/sca/spring-sca.xsd"> - - <bean id="testBean" class="org.apache.tuscany.container.spring.mock.TestBeanImpl"> - </bean> - - <sca:service name="fooService" type="org.apache.tuscany.container.spring.mock.TestBean" target="testBean"/> - - <sca:reference name="fooReference" type="org.apache.tuscany.container.spring.mock.TestReference"/> - - -</beans> diff --git a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/test.xml b/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/test.xml deleted file mode 100644 index d438b88577..0000000000 --- a/tags/java/sca/0.90-rc1-incubating/modules/implementation-spring/src/test/resources/test.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:sca="http://www.springframework.org/schema/sca" - xsi:schemaLocation=" -http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd -http://www.springframework.org/schema/sca http://www.springframework.org/schema/sca/spring-sca.xsd"> - - <bean id="testBean" class="org.apache.tuscany.container.spring.mock.TestBeanImpl"/> - -</beans> |