diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2008-11-12 09:10:10 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2008-11-12 09:10:10 +0000 |
commit | a91ed268f5f81428fdbb6666afbce207294c1ffa (patch) | |
tree | eda015a6d3a478fcc422bee330a84c650b7fe350 /java/sca/vtest | |
parent | b2748f28b364ac11d7c026f17d81f98d040f5c36 (diff) |
A place holder for a composite vtest
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@713325 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/vtest')
10 files changed, 355 insertions, 0 deletions
diff --git a/java/sca/vtest/assembly/composite/pom.xml b/java/sca/vtest/assembly/composite/pom.xml new file mode 100644 index 0000000000..2ee14dd37f --- /dev/null +++ b/java/sca/vtest/assembly/composite/pom.xml @@ -0,0 +1,49 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>vtest-assembly</artifactId> + <version>1.4-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>vtest-assembly-composite</artifactId> + + <name>Apache Tuscany SCA Assembly Verification Tests - Composite</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-embedded</artifactId> + <version>1.4-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>1.4-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + </dependencies> + + +</project> diff --git a/java/sca/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/AService.java b/java/sca/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/AService.java new file mode 100644 index 0000000000..a5cff3972b --- /dev/null +++ b/java/sca/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/AService.java @@ -0,0 +1,31 @@ +/* + * 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.vtest.assembly.composite; + +/** + * Simple Remotable Service + */ +public interface AService { + + public String getState(); + public String getBProperty(); + public String getB2Property(); + + +} diff --git a/java/sca/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/BService.java b/java/sca/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/BService.java new file mode 100644 index 0000000000..39d879e745 --- /dev/null +++ b/java/sca/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/BService.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.vtest.assembly.composite; + +/** + * Simple Service + */ +public interface BService { + + public String getState(); + public String getSomeProperty(); + +} diff --git a/java/sca/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/CService.java b/java/sca/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/CService.java new file mode 100644 index 0000000000..dd80c4dc6a --- /dev/null +++ b/java/sca/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/CService.java @@ -0,0 +1,28 @@ +/* + * 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.vtest.assembly.composite; + +/** + * + */ +public interface CService { + + public String getState(); + +} diff --git a/java/sca/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/impl/AServiceImpl.java b/java/sca/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/impl/AServiceImpl.java new file mode 100644 index 0000000000..359e8e2b78 --- /dev/null +++ b/java/sca/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/impl/AServiceImpl.java @@ -0,0 +1,49 @@ +/* + * 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.vtest.assembly.composite.impl; + +import org.apache.tuscany.sca.vtest.assembly.composite.AService; +import org.apache.tuscany.sca.vtest.assembly.composite.BService; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +@Service(AService.class) +public class AServiceImpl implements AService { + + @Reference + protected BService b; + + @Reference + protected BService b2; + + public String getState() { + return b.getState(); + } + + public String getBProperty() { + return b.getSomeProperty(); + } + + public String getB2Property() { + return b2.getSomeProperty(); + } + +} + diff --git a/java/sca/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/impl/BServiceImpl.java b/java/sca/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/impl/BServiceImpl.java new file mode 100644 index 0000000000..2c7123e00b --- /dev/null +++ b/java/sca/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/impl/BServiceImpl.java @@ -0,0 +1,40 @@ +/* + * 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.vtest.assembly.composite.impl; + +import org.apache.tuscany.sca.vtest.assembly.composite.BService; +import org.osoa.sca.annotations.Property; +import org.osoa.sca.annotations.Service; + +@Service(BService.class) +public class BServiceImpl implements BService { + + @Property + protected String someProperty; + + public String getState() { + return "SomeStateFromB"; + } + + public String getSomeProperty() { + return someProperty; + } + +} diff --git a/java/sca/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/impl/CServiceImpl.java b/java/sca/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/impl/CServiceImpl.java new file mode 100644 index 0000000000..2f091a8ef2 --- /dev/null +++ b/java/sca/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/impl/CServiceImpl.java @@ -0,0 +1,31 @@ +/* + * 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.vtest.assembly.composite.impl; + +public class CServiceImpl { + + private String state = "Some State"; + + public String getState() { + return state; + } + +} + diff --git a/java/sca/vtest/assembly/composite/src/main/resources/composite.composite b/java/sca/vtest/assembly/composite/src/main/resources/composite.composite new file mode 100644 index 0000000000..d533cb8dcf --- /dev/null +++ b/java/sca/vtest/assembly/composite/src/main/resources/composite.composite @@ -0,0 +1,41 @@ +<?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:xsd="http://www.w3.org/2001/XMLSchema" + targetNamespace="http://assembly-tests" + name="Assemby-component--Composite"> + + <component name="AComponent"> + <implementation.java class="org.apache.tuscany.sca.vtest.assembly.composite.impl.AServiceImpl"/> + <reference name="b" target="BComponent"/> + <reference name="b2" target="B2Component"/> + </component> + + <component name="BComponent"> + <implementation.java class="org.apache.tuscany.sca.vtest.assembly.composite.impl.BServiceImpl"/> + <property name="someProperty">some b component value</property> + </component> + + <component name="B2Component"> + <implementation.java class="org.apache.tuscany.sca.vtest.assembly.composite.impl.BServiceImpl"/> + <property name="someProperty">some b2 component value</property> + </component> + +</composite> diff --git a/java/sca/vtest/assembly/composite/src/test/java/org/apache/tuscany/sca/vtest/assembly/composite/CompositeTestCase.java b/java/sca/vtest/assembly/composite/src/test/java/org/apache/tuscany/sca/vtest/assembly/composite/CompositeTestCase.java new file mode 100644 index 0000000000..c828ace15c --- /dev/null +++ b/java/sca/vtest/assembly/composite/src/test/java/org/apache/tuscany/sca/vtest/assembly/composite/CompositeTestCase.java @@ -0,0 +1,56 @@ +/* + * 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.vtest.assembly.composite; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; +import org.junit.Ignore; +import org.junit.Test; +import org.osoa.sca.ServiceRuntimeException; + +/** + * + */ +public class CompositeTestCase { + + private void initDomain(String compositePath) { + System.out.println("Setting up"); + ServiceFinder.init(compositePath); + } + + private void cleanupDomain() { + System.out.println("Cleaning up"); + ServiceFinder.cleanup(); + } + + + /** + * Lines nn-n: + * <p> + * spec + */ + @Test + public void composite1() throws Exception { + initDomain("composite.composite"); + + cleanupDomain(); + } +} diff --git a/java/sca/vtest/assembly/pom.xml b/java/sca/vtest/assembly/pom.xml index 9a907402bf..c44ecaacd3 100644 --- a/java/sca/vtest/assembly/pom.xml +++ b/java/sca/vtest/assembly/pom.xml @@ -62,6 +62,7 @@ <modules> <module>ctypefile</module> <module>component</module> + <module>composite</module> </modules> </profile> </profiles> |