You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by dk...@apache.org on 2013/12/16 21:47:33 UTC

svn commit: r1551343 - in /aries/trunk/blueprint/blueprint-itests: pom.xml src/test/java/org/apache/aries/blueprint/itests/ASMMultiBundleTest.java src/test/java/org/apache/aries/blueprint/itests/MultiInterfacesTest.java

Author: dkulp
Date: Mon Dec 16 20:47:33 2013
New Revision: 1551343

URL: http://svn.apache.org/r1551343
Log:
Pull the multi interface related stuff into it's own test.

Added:
    aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/MultiInterfacesTest.java   (with props)
Modified:
    aries/trunk/blueprint/blueprint-itests/pom.xml
    aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/ASMMultiBundleTest.java

Modified: aries/trunk/blueprint/blueprint-itests/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-itests/pom.xml?rev=1551343&r1=1551342&r2=1551343&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-itests/pom.xml (original)
+++ aries/trunk/blueprint/blueprint-itests/pom.xml Mon Dec 16 20:47:33 2013
@@ -56,6 +56,42 @@
             <artifactId>osgi</artifactId>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.aries.blueprint</groupId>
+            <artifactId>org.apache.aries.blueprint.core</artifactId>
+            <version>1.4.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.aries.blueprint</groupId>
+            <artifactId>blueprint-parser</artifactId>
+            <version>1.1.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.aries.proxy</groupId>
+            <artifactId>org.apache.aries.proxy</artifactId>
+            <version>1.0.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.aries.quiesce</groupId>
+            <artifactId>org.apache.aries.quiesce.api</artifactId>
+            <type>bundle</type>
+            <scope>provided</scope>
+            <version>1.0.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.aries.blueprint</groupId>
+            <artifactId>org.apache.aries.blueprint.cm</artifactId>
+            <version>1.0.3</version>
+            <type>bundle</type>
+            <scope>compile</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.aries.blueprint</groupId>
+                    <artifactId>org.apache.aries.blueprint.core</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
 
         <dependency>
             <groupId>org.apache.aries.blueprint</groupId>
@@ -79,7 +115,7 @@
             <groupId>org.apache.aries.blueprint</groupId>
             <artifactId>org.apache.aries.blueprint.sample</artifactId>
             <scope>test</scope>
-            <version>1.0.0</version>
+            <version>1.0.1-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.aries.blueprint</groupId>
@@ -167,24 +203,6 @@
         </dependency>
         <dependency>
             <groupId>org.apache.aries.blueprint</groupId>
-            <artifactId>org.apache.aries.blueprint.core</artifactId>
-            <version>1.4.0-SNAPSHOT</version>
-            <type>bundle</type>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.aries.proxy</groupId>
-            <artifactId>org.apache.aries.proxy</artifactId>
-            <version>1.0.1</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.aries.quiesce</groupId>
-            <artifactId>org.apache.aries.quiesce.api</artifactId>
-            <type>bundle</type>
-            <scope>provided</scope>
-            <version>1.0.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.aries.blueprint</groupId>
             <artifactId>org.apache.aries.blueprint.testquiescebundle</artifactId>
             <version>1.0.0</version>
             <type>bundle</type>
@@ -203,19 +221,6 @@
             <scope>compile</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.aries.blueprint</groupId>
-            <artifactId>org.apache.aries.blueprint.cm</artifactId>
-            <version>1.0.3</version>
-            <type>bundle</type>
-            <scope>compile</scope>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.apache.aries.blueprint</groupId>
-                    <artifactId>org.apache.aries.blueprint.core</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-jexl</artifactId>
             <version>2.0</version>

Modified: aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/ASMMultiBundleTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/ASMMultiBundleTest.java?rev=1551343&r1=1551342&r2=1551343&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/ASMMultiBundleTest.java (original)
+++ aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/ASMMultiBundleTest.java Mon Dec 16 20:47:33 2013
@@ -206,48 +206,6 @@ public class ASMMultiBundleTest extends 
         assertEquals("test1value", ((OtherBean)objOther).getTestValue());
     }
 
-    @Test
-    public void testMultiInterfaceReferences() throws Exception {
-        //bundlea provides the ns handlers, bean processors, interceptors etc for this test.
-        Bundle bundlea = context().getBundleByName("org.apache.aries.blueprint.testbundlea");
-        assertNotNull(bundlea);
-        bundlea.start();
-        
-        //bundleb makes use of the extensions provided by bundlea
-        Bundle bundleb = context().getBundleByName("org.apache.aries.blueprint.testbundleb");
-        assertNotNull(bundleb);
-        bundleb.start();
-        
-        //bundleb's container will hold the beans we need to query to check the function
-        //provided by bundlea functioned as expected
-        BlueprintContainer beanContainer = 
-            Helper.getBlueprintContainerForBundle(context(), "org.apache.aries.blueprint.testbundleb");
-        assertNotNull(beanContainer);
-
-        Object obj1 = beanContainer.getComponentInstance("OnlyA");
-        Object obj2 = beanContainer.getComponentInstance("AandB");
-        Object obj3 = beanContainer.getComponentInstance("AandBandC");
-        Object obj4 = beanContainer.getComponentInstance("AandBandCandD");
-        
-        assertEquals("A", ((InterfaceA)obj1).methodA());
-        assertEquals("A", ((InterfaceA)obj2).methodA());
-        assertEquals("A", ((InterfaceA)obj3).methodA());
-        assertEquals("B", ((InterfaceB)obj2).methodB());
-        assertEquals("C", ((InterfaceC)obj3).methodC());
-        
-        assertFalse(obj1 instanceof InterfaceC);
-        assertFalse(obj2 instanceof InterfaceC);
-        assertFalse(obj1 instanceof InterfaceB);
-        
-        assertTrue(obj4 instanceof InterfaceD);
-        try {
-            ((InterfaceD)obj4).methodD();
-            fail("This should not work");
-        } catch (org.osgi.service.blueprint.container.ServiceUnavailableException t) {
-            //expected
-        }        
-    }
-    
     @org.ops4j.pax.exam.junit.Configuration
     public static Option[] configuration() {
         return testOptions(

Added: aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/MultiInterfacesTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/MultiInterfacesTest.java?rev=1551343&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/MultiInterfacesTest.java (added)
+++ aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/MultiInterfacesTest.java Mon Dec 16 20:47:33 2013
@@ -0,0 +1,102 @@
+/*
+ * 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.aries.blueprint.itests;
+
+import static org.apache.aries.itest.ExtraOptions.mavenBundle;
+import static org.apache.aries.itest.ExtraOptions.paxLogging;
+import static org.apache.aries.itest.ExtraOptions.testOptions;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import static org.ops4j.pax.exam.CoreOptions.equinox;
+
+import org.apache.aries.blueprint.testbundlea.multi.InterfaceA;
+import org.apache.aries.blueprint.testbundlea.multi.InterfaceB;
+import org.apache.aries.blueprint.testbundlea.multi.InterfaceC;
+import org.apache.aries.blueprint.testbundlea.multi.InterfaceD;
+import org.apache.aries.itest.AbstractIntegrationTest;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.osgi.framework.Bundle;
+import org.osgi.service.blueprint.container.BlueprintContainer;
+
+@RunWith(JUnit4TestRunner.class)
+public class MultiInterfacesTest extends AbstractIntegrationTest {
+
+    @Test
+    public void testMultiInterfaceReferences() throws Exception {
+        //bundlea provides the ns handlers, bean processors, interceptors etc for this test.
+        Bundle bundlea = context().getBundleByName("org.apache.aries.blueprint.testbundlea");
+        assertNotNull(bundlea);
+        bundlea.start();
+        
+        //bundleb makes use of the extensions provided by bundlea
+        Bundle bundleb = context().getBundleByName("org.apache.aries.blueprint.testbundleb");
+        assertNotNull(bundleb);
+        bundleb.start();
+        
+        //bundleb's container will hold the beans we need to query to check the function
+        //provided by bundlea functioned as expected
+        BlueprintContainer beanContainer = 
+            Helper.getBlueprintContainerForBundle(context(), "org.apache.aries.blueprint.testbundleb");
+        assertNotNull(beanContainer);
+
+        Object obj1 = beanContainer.getComponentInstance("OnlyA");
+        Object obj2 = beanContainer.getComponentInstance("AandB");
+        Object obj3 = beanContainer.getComponentInstance("AandBandC");
+        Object obj4 = beanContainer.getComponentInstance("AandBandCandD");
+        
+        assertEquals("A", ((InterfaceA)obj1).methodA());
+        assertEquals("A", ((InterfaceA)obj2).methodA());
+        assertEquals("A", ((InterfaceA)obj3).methodA());
+        assertEquals("B", ((InterfaceB)obj2).methodB());
+        assertEquals("C", ((InterfaceC)obj3).methodC());
+        
+        assertFalse(obj1 instanceof InterfaceC);
+        assertFalse(obj2 instanceof InterfaceC);
+        assertFalse(obj1 instanceof InterfaceB);
+        
+        assertTrue(obj4 instanceof InterfaceD);
+        try {
+            ((InterfaceD)obj4).methodD();
+            fail("This should not work");
+        } catch (org.osgi.service.blueprint.container.ServiceUnavailableException t) {
+            //expected
+        }        
+    }
+    
+    @org.ops4j.pax.exam.junit.Configuration
+    public static Option[] configuration() {
+        return testOptions(
+            paxLogging("DEBUG"),
+            Helper.blueprintBundles(),
+            mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint.testbundlea").noStart(),
+            mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint.testbundleb").noStart(),
+            equinox().version("3.5.0")
+        );
+    } 
+}

Propchange: aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/MultiInterfacesTest.java
------------------------------------------------------------------------------
    svn:eol-style = native