You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by kw...@apache.org on 2008/07/03 17:33:26 UTC

svn commit: r673710 - in /tuscany/java/sca/vtest/assembly/component/src: main/resources/nonuniquename.composite test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java

Author: kwilliams
Date: Thu Jul  3 08:33:26 2008
New Revision: 673710

URL: http://svn.apache.org/viewvc?rev=673710&view=rev
Log:
Test for duplicate component names

Added:
    tuscany/java/sca/vtest/assembly/component/src/main/resources/nonuniquename.composite   (with props)
Modified:
    tuscany/java/sca/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java

Added: tuscany/java/sca/vtest/assembly/component/src/main/resources/nonuniquename.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/vtest/assembly/component/src/main/resources/nonuniquename.composite?rev=673710&view=auto
==============================================================================
--- tuscany/java/sca/vtest/assembly/component/src/main/resources/nonuniquename.composite (added)
+++ tuscany/java/sca/vtest/assembly/component/src/main/resources/nonuniquename.composite Thu Jul  3 08:33:26 2008
@@ -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>

Propchange: tuscany/java/sca/vtest/assembly/component/src/main/resources/nonuniquename.composite
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/vtest/assembly/component/src/main/resources/nonuniquename.composite
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: tuscany/java/sca/vtest/assembly/component/src/main/resources/nonuniquename.composite
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: tuscany/java/sca/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java?rev=673710&r1=673709&r2=673710&view=diff
==============================================================================
--- tuscany/java/sca/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java (original)
+++ tuscany/java/sca/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java Thu Jul  3 08:33:26 2008
@@ -22,15 +22,25 @@
 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 @@
      */
     @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 @@
      */
     @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();
     }
 
 }