maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r752100 - /maven/components/trunk/maven-project-builder/src/test/java/org/apache/maven/project/builder/profile/JdkMatcherTest.java
Date Tue, 10 Mar 2009 12:56:21 GMT
Author: bentmann
Date: Tue Mar 10 12:56:20 2009
New Revision: 752100

URL: http://svn.apache.org/viewvc?rev=752100&view=rev
Log:
o Added UT to demonstrate bug in JDK-based profile activation

Modified:
    maven/components/trunk/maven-project-builder/src/test/java/org/apache/maven/project/builder/profile/JdkMatcherTest.java

Modified: maven/components/trunk/maven-project-builder/src/test/java/org/apache/maven/project/builder/profile/JdkMatcherTest.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project-builder/src/test/java/org/apache/maven/project/builder/profile/JdkMatcherTest.java?rev=752100&r1=752099&r2=752100&view=diff
==============================================================================
--- maven/components/trunk/maven-project-builder/src/test/java/org/apache/maven/project/builder/profile/JdkMatcherTest.java
(original)
+++ maven/components/trunk/maven-project-builder/src/test/java/org/apache/maven/project/builder/profile/JdkMatcherTest.java
Tue Mar 10 12:56:20 2009
@@ -194,7 +194,27 @@
         JdkMatcher matcher = new JdkMatcher();
         assertFalse(matcher.isMatch(modelContainer, props));
     } 
-    
+
+    /* FIXME: Instead of re-inventing the version comparison logic for the JdkMatcher, can't
we recycle stuff from
+    //*  the old artifact code of from Mercury?
+    @org.junit.Test
+    public void jdkVersionRange_WithExclusionPoint()
+    {
+        List<ModelProperty> modelProperties = new ArrayList<ModelProperty>();
+        modelProperties.add( new ModelProperty( ProjectUri.Profiles.Profile.xUri, null )
);
+        modelProperties.add( new ModelProperty( ProjectUri.Profiles.Profile.Activation.xUri,
null ) );
+        modelProperties.add( new ModelProperty( ProjectUri.Profiles.Profile.Activation.jdk,
"(,1.5.2),(1.5.2,)" ) );
+
+        ModelContainer modelContainer = new DefaultModelContainer( modelProperties );
+
+        List<InterpolatorProperty> props = new ArrayList<InterpolatorProperty>();
+        props.add( new InterpolatorProperty( "${java.specification.version}", "1.5" ) );
+
+        JdkMatcher matcher = new JdkMatcher();
+        assertTrue( matcher.isMatch( modelContainer, props ) );
+    }
+    //*/
+
     @org.junit.Test
     public void jdkVersionNotFound()  {
         List<ModelProperty> modelProperties = new ArrayList<ModelProperty>();



Mime
View raw message