diff options
Diffstat (limited to 'sandbox/old/contrib/implementation-spring/integration-test')
10 files changed, 363 insertions, 0 deletions
diff --git a/sandbox/old/contrib/implementation-spring/integration-test/core/pom.xml.off b/sandbox/old/contrib/implementation-spring/integration-test/core/pom.xml.off new file mode 100644 index 0000000000..f86c9cc409 --- /dev/null +++ b/sandbox/old/contrib/implementation-spring/integration-test/core/pom.xml.off @@ -0,0 +1,58 @@ +<?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. +--> +<project> + <parent> + <groupId>org.apache.tuscany.sca.spring</groupId> + <artifactId>spring-integration-test</artifactId> + <version>2.0-alpha2-incubating-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.tuscany.sca.extensions.spring.spring-integration-test</groupId> + <artifactId>spring-integration-test-core</artifactId> + <packaging>jar</packaging> + <name>Core Integration Test Suite for the Spring Extension</name> + <description>Tests core Spring extension functionality</description> + <build> + <plugins> + <plugin> + <groupId>org.apache.tuscany</groupId> + <artifactId>tuscany-itest-plugin</artifactId> + <configuration> + <systemScdl>file:./src/test/resources/system.scdl</systemScdl> + </configuration> + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca.spring</groupId> + <artifactId>spring-container</artifactId> + <version>2.0-alpha2-incubating-SNAPSHOT</version> + <scope>compile</scope> + </dependency> + </dependencies> + <executions> + <execution> + <goals> + <goal>test</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project>
\ No newline at end of file diff --git a/sandbox/old/contrib/implementation-spring/integration-test/core/src/main/java/org/apache/tuscany/sca/extensions/spring/TestBean.java b/sandbox/old/contrib/implementation-spring/integration-test/core/src/main/java/org/apache/tuscany/sca/extensions/spring/TestBean.java new file mode 100644 index 0000000000..9d7bf96cbc --- /dev/null +++ b/sandbox/old/contrib/implementation-spring/integration-test/core/src/main/java/org/apache/tuscany/sca/extensions/spring/TestBean.java @@ -0,0 +1,26 @@ +/* + * 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.extensions.spring; + +/** + * @version $Rev$ $Date$ + */ +public interface TestBean { + String echo(String msg); +} diff --git a/sandbox/old/contrib/implementation-spring/integration-test/core/src/main/java/org/apache/tuscany/sca/extensions/spring/TestBeanImpl.java b/sandbox/old/contrib/implementation-spring/integration-test/core/src/main/java/org/apache/tuscany/sca/extensions/spring/TestBeanImpl.java new file mode 100644 index 0000000000..4804c1b8b9 --- /dev/null +++ b/sandbox/old/contrib/implementation-spring/integration-test/core/src/main/java/org/apache/tuscany/sca/extensions/spring/TestBeanImpl.java @@ -0,0 +1,29 @@ +/* + * 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.extensions.spring; + +/** + * @version $Rev$ $Date$ + */ +public class TestBeanImpl implements TestBean { + + public String echo(String msg) { + return msg; + } +} diff --git a/sandbox/old/contrib/implementation-spring/integration-test/core/src/main/resources/META-INF/sca/spring.composite.scdl b/sandbox/old/contrib/implementation-spring/integration-test/core/src/main/resources/META-INF/sca/spring.composite.scdl new file mode 100644 index 0000000000..f2aa95de6e --- /dev/null +++ b/sandbox/old/contrib/implementation-spring/integration-test/core/src/main/resources/META-INF/sca/spring.composite.scdl @@ -0,0 +1,30 @@ +<?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"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ name="SpringSmoketestComposite">
+
+ <component name="SpringComposite">
+ <implementation.spring location="applicationContext.xml"/>
+ </component>
+
+</composite>
+
+
diff --git a/sandbox/old/contrib/implementation-spring/integration-test/core/src/test/java/org/apache/tuscany/sca/extensions/spring/WiringTestComponent.java b/sandbox/old/contrib/implementation-spring/integration-test/core/src/test/java/org/apache/tuscany/sca/extensions/spring/WiringTestComponent.java new file mode 100644 index 0000000000..dd485b8923 --- /dev/null +++ b/sandbox/old/contrib/implementation-spring/integration-test/core/src/test/java/org/apache/tuscany/sca/extensions/spring/WiringTestComponent.java @@ -0,0 +1,25 @@ +/* + * 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.extensions.spring; + +/** + * @version $Rev$ $Date$ + */ +public interface WiringTestComponent { +} diff --git a/sandbox/old/contrib/implementation-spring/integration-test/core/src/test/java/org/apache/tuscany/sca/extensions/spring/WiringTestComponentImpl.java b/sandbox/old/contrib/implementation-spring/integration-test/core/src/test/java/org/apache/tuscany/sca/extensions/spring/WiringTestComponentImpl.java new file mode 100644 index 0000000000..4a59f03a18 --- /dev/null +++ b/sandbox/old/contrib/implementation-spring/integration-test/core/src/test/java/org/apache/tuscany/sca/extensions/spring/WiringTestComponentImpl.java @@ -0,0 +1,50 @@ +/* + * 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.extensions.spring; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import junit.framework.TestCase; + +/** + * Verifies beans contained in a Spring composite are properly wired to as targets. + * + * @version $Rev$ $Date$ + */ +@Service(WiringTestComponent.class) +public class WiringTestComponentImpl extends TestCase { + private TestBean bean; + + /** + * Constructor. Accepts a reference to a Spring Bean + * + * @param bean the Spring Bean + */ + public WiringTestComponentImpl(@Reference(name = "bean")TestBean bean) { + this.bean = bean; + } + + /** + * Invoke to a target Spring Bean + */ + public void testTargetInvocation() { + assertEquals("test", bean.echo("test")); + } +} diff --git a/sandbox/old/contrib/implementation-spring/integration-test/core/src/test/resources/applicationContext.xml b/sandbox/old/contrib/implementation-spring/integration-test/core/src/test/resources/applicationContext.xml new file mode 100644 index 0000000000..6f0f3cfb56 --- /dev/null +++ b/sandbox/old/contrib/implementation-spring/integration-test/core/src/test/resources/applicationContext.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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.sca.extensions.spring.TestBeanImpl"/> + +</beans> diff --git a/sandbox/old/contrib/implementation-spring/integration-test/core/src/test/resources/itest.scdl b/sandbox/old/contrib/implementation-spring/integration-test/core/src/test/resources/itest.scdl new file mode 100644 index 0000000000..c15c7c3579 --- /dev/null +++ b/sandbox/old/contrib/implementation-spring/integration-test/core/src/test/resources/itest.scdl @@ -0,0 +1,33 @@ +<?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" + xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0" + xmlns:system="http://tuscany.apache.org/xmlns/system/1.0-SNAPSHOT" + name="SpecTestHarnessComposite" + autowire="true"> + + <include scdlResource="META-INF/sca/spring.composite.scdl"/> + + <component name="WiringTestComponent"> + <tuscany:junit class="org.apache.tuscany.sca.extensions.spring.WiringTestComponentImpl"/> + <reference name="bean" target="SpringComposite/TestBean"/> + </component> + +</composite> diff --git a/sandbox/old/contrib/implementation-spring/integration-test/core/src/test/resources/system.scdl b/sandbox/old/contrib/implementation-spring/integration-test/core/src/test/resources/system.scdl new file mode 100644 index 0000000000..9735a1a228 --- /dev/null +++ b/sandbox/old/contrib/implementation-spring/integration-test/core/src/test/resources/system.scdl @@ -0,0 +1,27 @@ +<?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" + xmlns:system="http://tuscany.apache.org/xmlns/system/1.0-SNAPSHOT" + name="SpringCoreIntegrationTestSystemComposite"> + + <include name="MavenSystemComposite" scdlResource="META-INF/tuscany/embeddedMaven.scdl"/> + <include name="SpringSystemComposite" scdlResource="META-INF/sca/spring.system.scdl"/> + +</composite>
\ No newline at end of file diff --git a/sandbox/old/contrib/implementation-spring/integration-test/pom.xml.off b/sandbox/old/contrib/implementation-spring/integration-test/pom.xml.off new file mode 100644 index 0000000000..96fd51cf07 --- /dev/null +++ b/sandbox/old/contrib/implementation-spring/integration-test/pom.xml.off @@ -0,0 +1,74 @@ +<?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. +--> +<project> + <parent> + <groupId>org.apache.tuscany.sca.spring</groupId> + <artifactId>spring</artifactId> + <version>2.0-alpha2-incubating-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.tuscany.sca.spring</groupId> + <artifactId>spring-integration-test</artifactId> + <version>2.0-alpha2-incubating-SNAPSHOT</version> + <packaging>pom</packaging> + <name>Apache Tuscany Spring Integration Tests</name> + <description>Integration tests for Spring Integration.</description> + + <properties> + <!-- version the Apache Tuscany kernel that the runtimes work with --> + <kernelVersion>2.0-alpha2-incubating-SNAPSHOT</kernelVersion> + </properties> + + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca.spring</groupId> + <artifactId>spring-container</artifactId> + <version>2.0-alpha2-incubating-SNAPSHOT</version> + <scope>compile</scope> + </dependency> + </dependencies> + + <build> + <defaultGoal>verify</defaultGoal> + + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.tuscany</groupId> + <artifactId>tuscany-itest-plugin</artifactId> + <version>${kernelVersion}</version> + <executions> + <execution> + <goals> + <goal>test</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </pluginManagement> + </build> +</project> |