felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mccu...@apache.org
Subject svn commit: r1189407 - in /felix/trunk/bundleplugin/src: main/java/org/apache/felix/bundleplugin/AbstractDependencyFilter.java test/java/org/apache/felix/bundleplugin/BundlePluginTest.java
Date Wed, 26 Oct 2011 19:36:52 GMT
Author: mcculls
Date: Wed Oct 26 19:36:52 2011
New Revision: 1189407

URL: http://svn.apache.org/viewvc?rev=1189407&view=rev
Log:
Backup Embed-Dependency work

Modified:
    felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AbstractDependencyFilter.java
    felix/trunk/bundleplugin/src/test/java/org/apache/felix/bundleplugin/BundlePluginTest.java

Modified: felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AbstractDependencyFilter.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AbstractDependencyFilter.java?rev=1189407&r1=1189406&r2=1189407&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AbstractDependencyFilter.java
(original)
+++ felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AbstractDependencyFilter.java
Wed Oct 26 19:36:52 2011
@@ -112,12 +112,13 @@ public abstract class AbstractDependency
 
             // CLAUSE: REGEXP --> { ATTRIBUTE MAP }
             Map.Entry clause = ( Map.Entry ) clauseIterator.next();
-            StringBuilder tag = new StringBuilder();
-            tag.append( clause.getKey() );
 
-            if ( !( ( String ) clause.getKey() ).matches( "\\*~*" ) )
+            String primaryKey = ( String ) clause.getKey();
+            StringBuilder tag = new StringBuilder( primaryKey );
+
+            if ( !primaryKey.matches( "\\*~*" ) )
             {
-                filter = new DependencyFilter( ( String ) clause.getKey() )
+                filter = new DependencyFilter( primaryKey )
                 {
                     boolean matches( Artifact dependency )
                     {

Modified: felix/trunk/bundleplugin/src/test/java/org/apache/felix/bundleplugin/BundlePluginTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/test/java/org/apache/felix/bundleplugin/BundlePluginTest.java?rev=1189407&r1=1189406&r2=1189407&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/test/java/org/apache/felix/bundleplugin/BundlePluginTest.java
(original)
+++ felix/trunk/bundleplugin/src/test/java/org/apache/felix/bundleplugin/BundlePluginTest.java
Wed Oct 26 19:36:52 2011
@@ -215,7 +215,7 @@ public class BundlePluginTest extends Ab
     }
 
 
-    public void testEmbedDependency() throws Exception
+    public void testPositiveEmbedDependency() throws Exception
     {
         ArtifactStubFactory artifactFactory = new ArtifactStubFactory( plugin.getOutputDirectory(),
true );
 
@@ -229,18 +229,23 @@ public class BundlePluginTest extends Ab
         project.setDependencyArtifacts( artifacts );
 
         Map instructions = new HashMap();
-        instructions.put( DependencyEmbedder.EMBED_DEPENDENCY, "!a|c|e;classifier=!four;scope=compile|runtime"
);
+        instructions.put( DependencyEmbedder.EMBED_DEPENDENCY, "*;classifier=;type=jar;scope=compile,"
+            + "*;classifier=;type=jar;scope=runtime" );
         Properties props = new Properties();
 
         Builder builder = plugin.buildOSGiBundle( project, instructions, props, plugin.getClasspath(
project ) );
         Manifest manifest = builder.getJar().getManifest();
 
         String bcp = manifest.getMainAttributes().getValue( Constants.BUNDLE_CLASSPATH );
-        assertEquals( bcp, ".,compile-1.0.jar,runtime-1.0.jar,b-1.0.jar,b-1.0-two.jar,d-1.0.zip"
);
+        assertEquals( ".,compile-1.0.jar,b-1.0.jar,runtime-1.0.jar", bcp );
 
         String eas = manifest.getMainAttributes().getValue( "Embedded-Artifacts" );
-        assertEquals( eas, "compile-1.0.jar;g=\"g\";a=\"compile\";v=\"1.0\","
-            + "runtime-1.0.jar;g=\"g\";a=\"runtime\";v=\"1.0\"," + "b-1.0.jar;g=\"g\";a=\"b\";v=\"1.0\","
-            + "b-1.0-two.jar;g=\"g\";a=\"b\";v=\"1.0\";c=\"two\"," + "d-1.0.zip;g=\"g\";a=\"d\";v=\"1.0\""
);
+        assertEquals( "compile-1.0.jar;g=\"g\";a=\"compile\";v=\"1.0\"," + "b-1.0.jar;g=\"g\";a=\"b\";v=\"1.0\","
+            + "runtime-1.0.jar;g=\"g\";a=\"runtime\";v=\"1.0\"", eas );
+    }
+
+
+    public void testNegativeEmbedDependency() throws Exception
+    {
     }
 }



Mime
View raw message