summaryrefslogtreecommitdiffstats
path: root/branches
diff options
context:
space:
mode:
Diffstat (limited to 'branches')
-rw-r--r--branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/DService.java29
-rw-r--r--branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/EEService.java31
-rw-r--r--branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/EService.java31
-rw-r--r--branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/ABServiceImpl.componentType32
-rw-r--r--branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/ABServiceImpl.java51
-rw-r--r--branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/DServiceImpl.componentType31
-rw-r--r--branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/DServiceImpl.java29
-rw-r--r--branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/EServiceImpl.componentType31
-rw-r--r--branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/EServiceImpl.java38
-rw-r--r--branches/sca-java-1.x/vtest/assembly/component/src/main/resources/nonuniqueservicenameincomponenttype.composite29
-rw-r--r--branches/sca-java-1.x/vtest/assembly/component/src/main/resources/nonuniqueservicenameincomposite.composite47
-rw-r--r--branches/sca-java-1.x/vtest/assembly/component/src/main/resources/notcompatibleinterface.composite38
-rw-r--r--branches/sca-java-1.x/vtest/assembly/component/src/main/resources/notmatchofservicename.composite36
-rw-r--r--branches/sca-java-1.x/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java82
14 files changed, 534 insertions, 1 deletions
diff --git a/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/DService.java b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/DService.java
new file mode 100644
index 0000000000..f5832aa7ce
--- /dev/null
+++ b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/DService.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.component;
+
+/**
+ * simple service
+ */
+public interface DService {
+
+ public String sayHello();
+
+
+}
diff --git a/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/EEService.java b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/EEService.java
new file mode 100644
index 0000000000..87de618ad3
--- /dev/null
+++ b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/EEService.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.component;
+
+/**
+ * simple service
+ *
+ */
+public interface EEService {
+
+ public String method1() ;
+
+ public String method3() ;
+
+}
diff --git a/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/EService.java b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/EService.java
new file mode 100644
index 0000000000..5d3bbb26c3
--- /dev/null
+++ b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/EService.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.component;
+
+/**
+ * simple service
+ *
+ */
+public interface EService {
+
+ public String method1() ;
+
+ public String method2() ;
+
+}
diff --git a/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/ABServiceImpl.componentType b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/ABServiceImpl.componentType
new file mode 100644
index 0000000000..7cc63afee1
--- /dev/null
+++ b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/ABServiceImpl.componentType
@@ -0,0 +1,32 @@
+<?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.
+-->
+<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0">
+
+
+ <service name="AService">
+ <interface.java interface="org.apache.tuscany.sca.vtest.assembly.component.AService"/>
+ </service>
+
+ <service name="AService">
+ <interface.java interface="org.apache.tuscany.sca.vtest.assembly.component.BService"/>
+ </service>
+
+
+</componentType> \ No newline at end of file
diff --git a/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/ABServiceImpl.java b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/ABServiceImpl.java
new file mode 100644
index 0000000000..98f0291be3
--- /dev/null
+++ b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/ABServiceImpl.java
@@ -0,0 +1,51 @@
+/*
+ * 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.component.impl;
+
+import org.apache.tuscany.sca.vtest.assembly.component.AService;
+import org.apache.tuscany.sca.vtest.assembly.component.BService;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * service implementation of AService and BService
+ *
+ */
+@Service(interfaces={AService.class, BService.class})
+public class ABServiceImpl implements AService, BService{
+
+ public String getState() {
+ return "OK";
+ }
+
+ public String getBProperty() {
+ return "";
+ }
+
+ public String getB2Property() {
+ return "";
+ }
+
+
+ public String getSomeProperty() {
+ return "SomeProperty";
+ }
+
+}
diff --git a/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/DServiceImpl.componentType b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/DServiceImpl.componentType
new file mode 100644
index 0000000000..899f84b2dd
--- /dev/null
+++ b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/DServiceImpl.componentType
@@ -0,0 +1,31 @@
+<?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.
+-->
+<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0">
+
+ <implementation.java class="org.apache.tuscany.sca.vtest.assembly.component.impl.DServiceImpl"/>
+
+ <service name="DService">
+ <interface.java interface="org.apache.tuscany.sca.vtest.assembly.component.DService"/>
+ </service>
+
+
+
+
+</componentType> \ No newline at end of file
diff --git a/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/DServiceImpl.java b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/DServiceImpl.java
new file mode 100644
index 0000000000..fce89b7bb9
--- /dev/null
+++ b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/DServiceImpl.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.component.impl;
+
+public class DServiceImpl {
+
+ public String sayHello() {
+ return "hello";
+ }
+
+}
+
diff --git a/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/EServiceImpl.componentType b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/EServiceImpl.componentType
new file mode 100644
index 0000000000..86a7be9cc0
--- /dev/null
+++ b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/EServiceImpl.componentType
@@ -0,0 +1,31 @@
+<?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.
+-->
+<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0">
+
+ <implementation.java class="org.apache.tuscany.sca.vtest.assembly.component.impl.EServiceImpl"/>
+
+ <service name="EEService">
+ <interface.java interface="org.apache.tuscany.sca.vtest.assembly.component.EService"/>
+ </service>
+
+
+
+
+</componentType> \ No newline at end of file
diff --git a/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/EServiceImpl.java b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/EServiceImpl.java
new file mode 100644
index 0000000000..4adb361ee5
--- /dev/null
+++ b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/EServiceImpl.java
@@ -0,0 +1,38 @@
+/*
+ * 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.component.impl;
+
+import org.apache.tuscany.sca.vtest.assembly.component.EService;
+import org.osoa.sca.annotations.Service;
+
+
+@Service(EService.class)
+public class EServiceImpl {
+
+ public String method1() {
+
+ return "method1" ;
+ }
+
+ public String method2() {
+
+ return "method2" ;
+ }
+
+}
diff --git a/branches/sca-java-1.x/vtest/assembly/component/src/main/resources/nonuniqueservicenameincomponenttype.composite b/branches/sca-java-1.x/vtest/assembly/component/src/main/resources/nonuniqueservicenameincomponenttype.composite
new file mode 100644
index 0000000000..0f859f908f
--- /dev/null
+++ b/branches/sca-java-1.x/vtest/assembly/component/src/main/resources/nonuniqueservicenameincomponenttype.composite
@@ -0,0 +1,29 @@
+<?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="ABComponent">
+ <implementation.java class="org.apache.tuscany.sca.vtest.assembly.component.impl.ABServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/branches/sca-java-1.x/vtest/assembly/component/src/main/resources/nonuniqueservicenameincomposite.composite b/branches/sca-java-1.x/vtest/assembly/component/src/main/resources/nonuniqueservicenameincomposite.composite
new file mode 100644
index 0000000000..00f3d00a2d
--- /dev/null
+++ b/branches/sca-java-1.x/vtest/assembly/component/src/main/resources/nonuniqueservicenameincomposite.composite
@@ -0,0 +1,47 @@
+<?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-servicewithinterface-Composite">
+
+
+ <component name="CDComponent">
+
+ <implementation.java class="org.apache.tuscany.sca.vtest.assembly.component.impl.CServiceImpl"/>
+
+ <service name="CServiceImpl">
+ <interface.java interface="org.apache.tuscany.sca.vtest.assembly.component.CService"/>
+ </service>
+
+
+ <service name="CServiceImpl">
+ <interface.java interface="org.apache.tuscany.sca.vtest.assembly.component.DService"/>
+
+ </service>
+
+
+
+
+
+ </component>
+
+</composite> \ No newline at end of file
diff --git a/branches/sca-java-1.x/vtest/assembly/component/src/main/resources/notcompatibleinterface.composite b/branches/sca-java-1.x/vtest/assembly/component/src/main/resources/notcompatibleinterface.composite
new file mode 100644
index 0000000000..b4d2abc011
--- /dev/null
+++ b/branches/sca-java-1.x/vtest/assembly/component/src/main/resources/notcompatibleinterface.composite
@@ -0,0 +1,38 @@
+<?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-servicewithinterface-Composite">
+
+ <component name="EEComponent">
+ <implementation.java class="org.apache.tuscany.sca.vtest.assembly.component.impl.EServiceImpl"/>
+
+
+ <service name="EEService">
+ <interface.java interface="org.apache.tuscany.sca.vtest.assembly.component.EEService"/>
+
+ </service>
+
+
+
+ </component>
+
+</composite>
diff --git a/branches/sca-java-1.x/vtest/assembly/component/src/main/resources/notmatchofservicename.composite b/branches/sca-java-1.x/vtest/assembly/component/src/main/resources/notmatchofservicename.composite
new file mode 100644
index 0000000000..7d49f8baf1
--- /dev/null
+++ b/branches/sca-java-1.x/vtest/assembly/component/src/main/resources/notmatchofservicename.composite
@@ -0,0 +1,36 @@
+<?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-servicewithinterface-Composite">
+
+ <component name="DComponent1">
+ <implementation.java class="org.apache.tuscany.sca.vtest.assembly.component.impl.DServiceImpl"/>
+
+ <service name="DService1">
+ <interface.java interface="org.apache.tuscany.sca.vtest.assembly.component.DService"/>
+
+ </service>
+
+
+ </component>
+
+</composite>
diff --git a/branches/sca-java-1.x/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java b/branches/sca-java-1.x/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java
index de4fbe39ce..2d245d10a8 100644
--- a/branches/sca-java-1.x/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java
+++ b/branches/sca-java-1.x/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java
@@ -33,6 +33,7 @@ public class ComponentTestCase {
private void initDomain(String compositePath) {
System.out.println("Setting up");
+
ServiceFinder.init(compositePath);
}
@@ -40,6 +41,8 @@ public class ComponentTestCase {
System.out.println("Cleaning up");
ServiceFinder.cleanup();
}
+
+
/**
* Lines 92-96:
@@ -72,7 +75,7 @@ public class ComponentTestCase {
/**
* Lines 142-143:
* <p>
- * name (required) – the name of the component. The name must be unique
+ * name (required) ?the name of the component. The name must be unique
* across all the components in the composite.
*/
@Test(expected = ServiceRuntimeException.class)
@@ -146,5 +149,82 @@ public class ComponentTestCase {
cleanupDomain();
}
+ /**
+ * Lines 599-601:
+ * <p>
+ * ASM50001
+ * <p>
+ * The @name attribute of a <service/> child element of a <componentType/> MUST
+ * be unique amongst the service elements of that <componentType/>
+ *
+ */
+ @Test(expected=ServiceRuntimeException.class)
+ @Ignore("TUSCANY-2675")
+ public void ASM50001() throws Exception {
+ initDomain("nonuniqueservicenameincomponenttype.composite");
+ AService service = ServiceFinder.getService(AService.class, "ABComponent/AService");
+ Assert.assertEquals("OK", service.getState());
+ cleanupDomain();
+ }
+
+ /**
+ * Lines 695-697:
+ * <p>
+ * ASM50002
+ * <p>
+ * The @name attribute of a service element of a <component/> MUST be unique amongst
+ * the service elements of that <component/>
+ *
+ */
+ @Test(expected=ServiceRuntimeException.class)
+ public void ASM50002() throws Exception {
+ initDomain("nonuniqueservicenameincomposite.composite");
+ DService service = ServiceFinder.getService(DService.class, "CDComponent/CServiceImpl");
+ Assert.assertEquals("hello", service.sayHello());
+ cleanupDomain();
+ }
+
+ /**
+ * Lines 697-699:
+ * <p>
+ * ASM50003
+ * <p>
+ * OSOA
+ * The @name attribute of a service element of a <component/> MUST match the
+ * @name attribute of a service element of the componentType of the <implementation/> child element of the component.
+ * <p>
+ * OASIS
+ * the name of the service has to match a name of a service defined by the implementation
+ *
+ */
+ @Test(expected=ServiceRuntimeException.class)
+ public void ASM50003() throws Exception {
+ initDomain("notmatchofservicename.composite");
+ DService service = ServiceFinder.getService(DService.class, "DComponent1/DService1");
+ Assert.assertEquals("hello", service.sayHello());
+ cleanupDomain();
+ }
+
+ /**
+ * Lines 709-715:
+ * <p>
+ * ASM50004
+ * <p>
+ * If a <service/> element has an interface subelement specified, the interface MUST
+ * provide a compatible subset of the interface declared on the componentType of the
+ * implementation.
+ */
+ @Test(expected=ServiceRuntimeException.class)
+ public void ASM50004() throws Exception {
+ //for this case, if you remove the method3() in the EEService
+ //the EEService will be a compatible subset of EService.
+ initDomain("notcompatibleinterface.composite");
+ EEService service = ServiceFinder.getService(EEService.class, "EEComponent/EEService");
+ Assert.assertEquals("method1", service.method1());
+ cleanupDomain();
+ }
+
+
+
}