camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1078340 - in /camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint: CamelBlueprint2Test.java CamelBlueprint3Test.java CamelBlueprintTest.java OSGiBlueprintHelloWorldTest.java
Date Sat, 05 Mar 2011 20:09:36 GMT
Author: davsclaus
Date: Sat Mar  5 20:09:36 2011
New Revision: 1078340

URL: http://svn.apache.org/viewvc?rev=1078340&view=rev
Log:
Splitted blueprint test into smaller pieces.

Added:
    camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprint3Test.java
      - copied, changed from r1078258, camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java
Modified:
    camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprint2Test.java
    camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java
    camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintHelloWorldTest.java

Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprint2Test.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprint2Test.java?rev=1078340&r1=1078339&r2=1078340&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprint2Test.java
(original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprint2Test.java
Sat Mar  5 20:09:36 2011
@@ -139,7 +139,7 @@ public class CamelBlueprint2Test extends
                 // install the spring dm profile
                 profile("spring.dm").version("1.2.0"),
                 // this is how you set the default log level when using pax logging (logProfile)
-                org.ops4j.pax.exam.CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("TRACE"),
+                //org.ops4j.pax.exam.CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("TRACE"),
 
                 // install blueprint requirements
                 mavenBundle("org.apache.felix", "org.apache.felix.configadmin"),

Copied: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprint3Test.java
(from r1078258, camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprint3Test.java?p2=camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprint3Test.java&p1=camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java&r1=1078258&r2=1078340&rev=1078340&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java
(original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprint3Test.java
Sat Mar  5 20:09:36 2011
@@ -38,73 +38,7 @@ import static org.ops4j.pax.swissbox.tin
  * @version 
  */
 @RunWith(JUnit4TestRunner.class)
-public class CamelBlueprintTest extends OSGiBlueprintTestSupport {
-
-    @Test
-    public void testRouteWithAllComponents() throws Exception {
-        try {
-            getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle1)",
1000);
-            fail("The blueprint container should not be available");
-        } catch (Exception e) {
-        }
-        getInstalledBundle("CamelBlueprintTestBundle1").start();
-        getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle1)",
10000);
-        getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle1)",
10000);
-    }
-
-    @Test
-    public void testRouteWithMissingComponent() throws Exception {
-        getInstalledBundle("org.apache.camel.camel-ftp").stop();
-        try {
-            getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle2)",
500);
-            fail("The blueprint container should not be available");
-        } catch (Exception e) {
-        }
-        getInstalledBundle("CamelBlueprintTestBundle2").start();
-        try {
-            getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle2)",
500);
-            fail("The blueprint container should not be available");
-        } catch (Exception e) {
-        }
-        getInstalledBundle("org.apache.camel.camel-ftp").start();
-        getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle2)",
10000);
-        getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle2)",
10000);
-    }
-
-    @Test
-    public void testRouteWithMissingDataFormat() throws Exception {
-        getInstalledBundle("org.apache.camel.camel-jackson").stop();
-        try {
-            getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle3)",
500);
-            fail("The blueprint container should not be available");
-        } catch (Exception e) {
-        }
-        getInstalledBundle("CamelBlueprintTestBundle3").start();
-        try {
-            getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle3)",
500);
-            fail("The blueprint container should not be available");
-        } catch (Exception e) {
-        }
-        getInstalledBundle("org.apache.camel.camel-jackson").start();
-        getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle3)",
10000);
-        getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle3)",
10000);
-    }
-
-    @Test
-    public void testRouteWithPackage() throws Exception {
-        getInstalledBundle("CamelBlueprintTestBundle4").start();
-        getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle4)",
10000);
-        CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle4)",
10000);
-        assertEquals(1, ctx.getRoutes().size());
-    }
-
-    @Test
-    public void testRouteWithPackageScan() throws Exception {
-        getInstalledBundle("CamelBlueprintTestBundle5").start();
-        getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle5)",
10000);
-        CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle5)",
10000);
-        assertEquals(1, ctx.getRoutes().size());
-    }
+public class CamelBlueprint3Test extends OSGiBlueprintTestSupport {
 
     @Test
     public void testRouteWithComponentFromBlueprint() throws Exception {
@@ -148,35 +82,6 @@ public class CamelBlueprintTest extends 
         Option[] options = options(
 
                 bundle(newBundle()
-                        .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-1.xml"))
-                        .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle1")
-                        .build()).noStart(),
-
-                bundle(newBundle()
-                        .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-2.xml"))
-                        .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle2")
-                        .build()).noStart(),
-
-                bundle(newBundle()
-                        .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-3.xml"))
-                        .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle3")
-                        .build()).noStart(),
-
-                bundle(newBundle()
-                        .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-4.xml"))
-                        .add(TestRouteBuilder.class)
-                        .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle4")
-                        .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
-                        .build()).noStart(),
-
-                bundle(newBundle()
-                        .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-5.xml"))
-                        .add(TestRouteBuilder.class)
-                        .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle5")
-                        .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
-                        .build()).noStart(),
-
-                bundle(newBundle()
                         .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-6.xml"))
                         .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle6")
                         .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
@@ -206,7 +111,7 @@ public class CamelBlueprintTest extends 
                 // install the spring dm profile
                 profile("spring.dm").version("1.2.0"),
                 // this is how you set the default log level when using pax logging (logProfile)
-                org.ops4j.pax.exam.CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("TRACE"),
+                // org.ops4j.pax.exam.CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("TRACE"),
 
                 // install blueprint requirements
                 mavenBundle("org.apache.felix", "org.apache.felix.configadmin"),

Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java?rev=1078340&r1=1078339&r2=1078340&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java
(original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java
Sat Mar  5 20:09:36 2011
@@ -106,42 +106,6 @@ public class CamelBlueprintTest extends 
         assertEquals(1, ctx.getRoutes().size());
     }
 
-    @Test
-    public void testRouteWithComponentFromBlueprint() throws Exception {
-        getInstalledBundle("CamelBlueprintTestBundle6").start();
-        BlueprintContainer ctn = getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle6)",
10000);
-        CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle6)",
10000);
-        assertEquals(1, ctx.getRoutes().size());
-        assertSame(ctn.getComponentInstance("seda"), ctx.getComponent("seda"));
-    }
-
-    @Test
-    public void testRouteWithInterceptStrategy() throws Exception {
-        getInstalledBundle("CamelBlueprintTestBundle7").start();
-        BlueprintContainer ctn = getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle7)",
10000);
-        CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle7)",
10000);
-        assertEquals(1, ctx.getRoutes().size());
-        assertEquals(1, ctx.getInterceptStrategies().size());
-        assertEquals(TestInterceptStrategy.class.getName(), ctx.getInterceptStrategies().get(0).getClass().getName());
-    }
-
-    @Test
-    public void testComponentProperties() throws Exception {
-        getInstalledBundle("CamelBlueprintTestBundle8").start();
-        BlueprintContainer ctn = getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle8)",
10000);
-        CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle8)",
10000);
-        assertEquals(1, ctx.getRoutes().size());
-        assertEquals("direct://start", ctx.getRoutes().get(0).getEndpoint().getEndpointUri());
-    }
-
-    @Test
-    public void testRouteBuilderRef() throws Exception {
-        getInstalledBundle("CamelBlueprintTestBundle9").start();
-        BlueprintContainer ctn = getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle9)",
10000);
-        CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle9)",
10000);
-        assertEquals(1, ctx.getRoutes().size());
-    }
-
     @Configuration
     public static Option[] configure() throws Exception {
 
@@ -176,37 +140,10 @@ public class CamelBlueprintTest extends 
                         .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
                         .build()).noStart(),
 
-                bundle(newBundle()
-                        .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-6.xml"))
-                        .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle6")
-                        .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
-                        .build()).noStart(),
-
-                bundle(newBundle()
-                        .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-7.xml"))
-                        .add(TestInterceptStrategy.class)
-                        .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle7")
-                        .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
-                        .build()).noStart(),
-
-                bundle(newBundle()
-                        .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-8.xml"))
-                        .add("org/apache/camel/component/properties/cheese.properties", OSGiBlueprintTestSupport.class.getResource("cheese.properties"))
-                        .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle8")
-                        .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
-                        .build()).noStart(),
-
-                bundle(newBundle()
-                        .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-9.xml"))
-                        .add(TestRouteBuilder.class)
-                        .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle9")
-                        .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
-                        .build()).noStart(),
-
                 // install the spring dm profile
                 profile("spring.dm").version("1.2.0"),
                 // this is how you set the default log level when using pax logging (logProfile)
-                org.ops4j.pax.exam.CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("TRACE"),
+                // org.ops4j.pax.exam.CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("TRACE"),
 
                 // install blueprint requirements
                 mavenBundle("org.apache.felix", "org.apache.felix.configadmin"),

Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintHelloWorldTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintHelloWorldTest.java?rev=1078340&r1=1078339&r2=1078340&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintHelloWorldTest.java
(original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintHelloWorldTest.java
Sat Mar  5 20:09:36 2011
@@ -68,6 +68,8 @@ public class OSGiBlueprintHelloWorldTest
         myTemplate.sendBodyAndHeader("file:target/foo", "Hello World", Exchange.FILE_NAME,
"hello.txt");
 
         mock.assertIsSatisfied();
+
+        myTemplate.stop();
     }
 
     @Configuration



Mime
View raw message