summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--java/sca/vtest/assembly/component/src/main/resources/nonuniquename.composite33
-rw-r--r--java/sca/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java39
2 files changed, 62 insertions, 10 deletions
diff --git a/java/sca/vtest/assembly/component/src/main/resources/nonuniquename.composite b/java/sca/vtest/assembly/component/src/main/resources/nonuniquename.composite
new file mode 100644
index 0000000000..d53e2ba776
--- /dev/null
+++ b/java/sca/vtest/assembly/component/src/main/resources/nonuniquename.composite
@@ -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:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://assembly-tests"
+ name="Assemby-non-unique-name--Composite">
+
+ <component name="AComponent">
+ <implementation.java class="org.apache.tuscany.sca.vtest.assembly.component.impl.AServiceImpl"/>
+ </component>
+
+ <component name="AComponent">
+ <implementation.java class="org.apache.tuscany.sca.vtest.assembly.component.impl.BServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java b/java/sca/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java
index 84e141c031..379a19b238 100644
--- a/java/sca/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java
+++ b/java/sca/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java
@@ -22,15 +22,25 @@ package org.apache.tuscany.sca.vtest.assembly.component;
import junit.framework.Assert;
import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
+import org.osoa.sca.ConversationEndedException;
/**
*
*/
public class ComponentTestCase {
+ private void initDomain(String compositePath) {
+ System.out.println("Setting up");
+ ServiceFinder.init(compositePath);
+ }
+
+ private void cleanupDomain() {
+ System.out.println("Cleaning up");
+ ServiceFinder.cleanup();
+ }
+
/**
* Lines 92-96:
* <p>
@@ -41,13 +51,11 @@ public class ComponentTestCase {
*/
@Test
public void components1() throws Exception {
- System.out.println("Setting up");
- ServiceFinder.init("component.composite");
+ initDomain("component.composite");
AService service = ServiceFinder.getService(AService.class, "AComponent/AService");
Assert.assertEquals("some b component value", service.getBProperty());
Assert.assertEquals("some b2 component value", service.getB2Property());
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
+ cleanupDomain();
}
/**
@@ -57,10 +65,21 @@ public class ComponentTestCase {
*/
@Test
public void components2() throws Exception {
- System.out.println("Setting up");
- ServiceFinder.init("zerocomponents.composite");
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
+ initDomain("zerocomponents.composite");
+ cleanupDomain();
+ }
+
+ /**
+ * Lines 142-143:
+ * <p>
+ * name (required) – the name of the component. The name must be unique
+ * across all the components in the composite.
+ */
+ @Test(expected = RuntimeException.class)
+ @Ignore("TUSCANY-2455")
+ public void components3() throws Exception {
+ initDomain("nonuniquename.composite");
+ cleanupDomain();
}
}