You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/04/06 20:26:24 UTC

[2/2] camel git commit: Fixed and improve test

Fixed and improve test


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/077e5df4
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/077e5df4
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/077e5df4

Branch: refs/heads/master
Commit: 077e5df4f6904e13d76444821737bcc0dafe23c0
Parents: 0052430
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Apr 6 22:25:28 2017 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Apr 6 22:25:28 2017 +0200

----------------------------------------------------------------------
 platforms/camel-catalog-maven/pom.xml                 |  5 +++++
 .../camel/catalog/maven/MavenVersionManagerTest.java  | 14 +++++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/077e5df4/platforms/camel-catalog-maven/pom.xml
----------------------------------------------------------------------
diff --git a/platforms/camel-catalog-maven/pom.xml b/platforms/camel-catalog-maven/pom.xml
index f1f0ff9..d4f1340 100644
--- a/platforms/camel-catalog-maven/pom.xml
+++ b/platforms/camel-catalog-maven/pom.xml
@@ -75,6 +75,11 @@
       <artifactId>camel-catalog-provider-springboot</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-catalog-provider-karaf</artifactId>
+      <scope>test</scope>
+    </dependency>
 
     <!-- logging -->
     <dependency>

http://git-wip-us.apache.org/repos/asf/camel/blob/077e5df4/platforms/camel-catalog-maven/src/test/java/org/apache/camel/catalog/maven/MavenVersionManagerTest.java
----------------------------------------------------------------------
diff --git a/platforms/camel-catalog-maven/src/test/java/org/apache/camel/catalog/maven/MavenVersionManagerTest.java b/platforms/camel-catalog-maven/src/test/java/org/apache/camel/catalog/maven/MavenVersionManagerTest.java
index dc76769..8342d2a 100644
--- a/platforms/camel-catalog-maven/src/test/java/org/apache/camel/catalog/maven/MavenVersionManagerTest.java
+++ b/platforms/camel-catalog-maven/src/test/java/org/apache/camel/catalog/maven/MavenVersionManagerTest.java
@@ -23,6 +23,7 @@ import junit.framework.TestCase;
 import org.apache.camel.catalog.CamelCatalog;
 import org.apache.camel.catalog.CatalogHelper;
 import org.apache.camel.catalog.DefaultCamelCatalog;
+import org.apache.camel.catalog.karaf.KarafRuntimeProvider;
 import org.apache.camel.catalog.springboot.SpringBootRuntimeProvider;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -139,28 +140,39 @@ public class MavenVersionManagerTest extends TestCase {
     }
 
     @Test
-    public void testCatalogVersionSwitch() throws Exception {
+    public void testCatalogKarafRuntimeProviderVersionSwitch() throws Exception {
         CamelCatalog catalog = new DefaultCamelCatalog(true);
         MavenVersionManager mvm = new MavenVersionManager();
         mvm.addMavenRepository("asf-ga", "https://repo.maven.apache.org/maven2");
         mvm.addMavenRepository("asf-snapshots", "https://repository.apache.org/content/groups/snapshots");
         catalog.setVersionManager(mvm);
+        catalog.setRuntimeProvider(new KarafRuntimeProvider());
+
         boolean loaded = catalog.loadVersion("2.18.1");
         assertTrue("Unable to load Camel Catalog 2.18.1", loaded);
         loaded = catalog.loadRuntimeProviderVersion("org.apache.camel", "camel-catalog-provider-karaf", "2.18.1");
         assertTrue("Unable to load Karaf Provider Camel Catalog 2.18.1", loaded);
         int components = catalog.findComponentNames().size();
+        System.out.println("2.18.1 has " + components + " components");
+        assertFalse("Should not have ejb component", catalog.findComponentNames().contains("ejb"));
+
         loaded = catalog.loadVersion("2.19.0-SNAPSHOT");
         assertTrue("Unable to switch to Camel Catalog 2.19.0-SNAPSHOT", loaded);
         loaded = catalog.loadRuntimeProviderVersion("org.apache.camel", "camel-catalog-provider-karaf", "2.19.0-SNAPSHOT");
         assertTrue("Unable to load Karaf Provider Camel Catalog 2.19.0-SNAPSHOT", loaded);
         int componentsNewer = catalog.findComponentNames().size();
         assertTrue("Both catalog versions shouldn't have the same count of components.", components != componentsNewer);
+        System.out.println("2.19.0-SNAPSHOT has " + componentsNewer + " components");
+        assertFalse("Should not have ejb component", catalog.findComponentNames().contains("ejb"));
+
         loaded = catalog.loadVersion("2.18.1");
         assertTrue("Unable to load Camel Catalog 2.18.1", loaded);
         loaded = catalog.loadRuntimeProviderVersion("org.apache.camel", "camel-catalog-provider-karaf", "2.18.1");
         assertTrue("Unable to load Karaf Provider Camel Catalog 2.18.1", loaded);
         int components3 = catalog.findComponentNames().size();
         assertTrue("Newer load does not match older one", components == components3);
+        assertFalse("Should not have ejb component", catalog.findComponentNames().contains("ejb"));
+
+        System.out.println("2.18.1 has " + components3 + " components");
     }
 }