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/02/14 19:12:13 UTC

[2/3] camel git commit: CAMEL-10828: camel-catalog-nexus - Initial work

CAMEL-10828: camel-catalog-nexus - Initial work


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

Branch: refs/heads/master
Commit: 8dfed853caa1c357c71276736ab84d037cd12492
Parents: c871ca9
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Feb 14 19:42:16 2017 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Feb 14 19:42:16 2017 +0100

----------------------------------------------------------------------
 platforms/catalog-nexus/pom.xml                 | 27 +++++++++++++++++++-
 .../catalog/nexus/LocalFileNexusRepository.java |  4 +--
 .../catalog/nexus/LocalNexusRepositoryTest.java |  5 +---
 .../src/test/resources/nexus-sample-result.xml  | 12 ++++-----
 4 files changed, 35 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/8dfed853/platforms/catalog-nexus/pom.xml
----------------------------------------------------------------------
diff --git a/platforms/catalog-nexus/pom.xml b/platforms/catalog-nexus/pom.xml
index e3bfe15..e0fbc32 100644
--- a/platforms/catalog-nexus/pom.xml
+++ b/platforms/catalog-nexus/pom.xml
@@ -42,7 +42,6 @@
       <groupId>org.apache.camel</groupId>
       <artifactId>camel-catalog</artifactId>
     </dependency>
-
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
@@ -81,6 +80,32 @@
     <plugins>
 
       <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-resources-plugin</artifactId>
+        <version>${maven-resources-plugin-version}</version>
+        <executions>
+          <execution>
+            <id>copy-dummy-component</id>
+            <phase>process-resources</phase>
+            <goals>
+              <goal>copy-resources</goal>
+            </goals>
+            <configuration>
+              <outputDirectory>${project.build.directory}/localrepo</outputDirectory>
+              <resources>
+                <resource>
+                  <directory>../dummy-component/target</directory>
+                  <includes>
+                    <include>*.jar</include>
+                  </includes>
+                </resource>
+              </resources>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+
+      <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
         <extensions>true</extensions>

http://git-wip-us.apache.org/repos/asf/camel/blob/8dfed853/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalFileNexusRepository.java
----------------------------------------------------------------------
diff --git a/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalFileNexusRepository.java b/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalFileNexusRepository.java
index 1d341d3..f3c3327 100644
--- a/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalFileNexusRepository.java
+++ b/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalFileNexusRepository.java
@@ -30,7 +30,7 @@ public class LocalFileNexusRepository extends ComponentNexusRepository {
 
     @Override
     protected String createArtifactURL(NexusArtifactDto dto) {
-        // load from file instead
-        return "file:target/" + dto.getArtifactId() + "-" + dto.getVersion() + ".jar";
+        // load from local file instead
+        return "file:target/localrepo/" + dto.getArtifactId() + "-" + dto.getVersion() + ".jar";
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/8dfed853/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalNexusRepositoryTest.java
----------------------------------------------------------------------
diff --git a/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalNexusRepositoryTest.java b/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalNexusRepositoryTest.java
index 9f9d7ec..5382b41 100644
--- a/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalNexusRepositoryTest.java
+++ b/platforms/catalog-nexus/src/test/java/org/apache/camel/catalog/nexus/LocalNexusRepositoryTest.java
@@ -19,7 +19,6 @@ package org.apache.camel.catalog.nexus;
 import junit.framework.TestCase;
 import org.apache.camel.catalog.CamelCatalog;
 import org.apache.camel.catalog.DefaultCamelCatalog;
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class LocalNexusRepositoryTest extends TestCase {
@@ -37,14 +36,12 @@ public class LocalNexusRepositoryTest extends TestCase {
     }
 
     @Test
-    @Ignore("Work in progress")
     public void testLocalNexus() throws Exception {
         int before = catalog.findComponentNames().size();
 
         repo.start();
 
-        // TODO: create custom component we can use for testing here
-        // and only wait as long until a new component is added
+        // TODO only wait as long until a new component is added
         Thread.sleep(5000);
 
         repo.stop();

http://git-wip-us.apache.org/repos/asf/camel/blob/8dfed853/platforms/catalog-nexus/src/test/resources/nexus-sample-result.xml
----------------------------------------------------------------------
diff --git a/platforms/catalog-nexus/src/test/resources/nexus-sample-result.xml b/platforms/catalog-nexus/src/test/resources/nexus-sample-result.xml
index 16b60b0..8357e21 100644
--- a/platforms/catalog-nexus/src/test/resources/nexus-sample-result.xml
+++ b/platforms/catalog-nexus/src/test/resources/nexus-sample-result.xml
@@ -21,17 +21,17 @@
   <tooManyResults>false</tooManyResults>
   <data>
     <artifact>
-      <resourceURI>http://nexus.dummy/service/local/repositories/staging/content/org/foo/beverage-component/2.19.0/beverage-component-2.19.0.jar</resourceURI>
-      <groupId>org.foo</groupId>
-      <artifactId>beverage-component</artifactId>
+      <resourceURI>http://nexus.dummy/service/local/repositories/staging/content/org/apache/camel/dummy-component/2.19.0/dummy-component-2.19.0.jar</resourceURI>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>dummy-component</artifactId>
       <version>2.19.0</version>
       <packaging>jar</packaging>
       <extension>jar</extension>
       <repoId>staging</repoId>
       <contextId>Staging</contextId>
-      <pomLink>http://nexus.dummy/service/local/artifact/maven/redirect?r=staging&amp;g=org.foo&amp;a=beverage-component&amp;v=2.19.0&amp;e=pom</pomLink>
-      <artifactLink>http://nexus.dummy/service/local/artifact/maven/redirect?r=staging&amp;g=org.foo&amp;a=beverage-component&amp;v=2.19.0&amp;e=jar</artifactLink>
-      <highlightedFragment>&lt;blockquote&gt;Artifact ID&lt;UL&gt;&lt;LI&gt;beverage-&lt;B&gt;component&lt;/B&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/blockquote&gt;</highlightedFragment>
+      <pomLink>http://nexus.dummy/service/local/artifact/maven/redirect?r=staging&amp;g=org.apache.camel&amp;a=dummy-component&amp;v=2.19.0&amp;e=pom</pomLink>
+      <artifactLink>http://nexus.dummy/service/local/artifact/maven/redirect?r=staging&amp;g=org.apache.camel&amp;a=dummy-component&amp;v=2.19.0&amp;e=jar</artifactLink>
+      <highlightedFragment>&lt;blockquote&gt;Artifact ID&lt;UL&gt;&lt;LI&gt;dummy-&lt;B&gt;component&lt;/B&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/blockquote&gt;</highlightedFragment>
     </artifact>
   </data>
 </search-results>
\ No newline at end of file