]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2193 Pattern matching should work in case if pattern ends on "/**"
authorEvgeny Mandrikov <mandrikov@gmail.com>
Mon, 14 Feb 2011 10:56:49 +0000 (13:56 +0300)
committerEvgeny Mandrikov <mandrikov@gmail.com>
Fri, 18 Feb 2011 23:16:01 +0000 (02:16 +0300)
plugins/sonar-squid-java-plugin/src/test/java/org/sonar/java/PatternUtilsTest.java
sonar-plugin-api/src/main/java/org/sonar/api/utils/WildcardPattern.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/WildcardPatternTest.java

index bb968b068215e8987c81cace5ef9f1f351c27f43..d10b9254f02e886f998a4054fa9cd3e60d1d2612 100644 (file)
@@ -34,6 +34,6 @@ public class PatternUtilsTest {
 
     assertThat(patterns.length, is(2));
     assertThat(patterns[0].match("org/sonar/Foo"), is(true));
-    assertThat(patterns[1].match("javax.Bar"), is(true));
+    assertThat(patterns[1].match("javax/Bar"), is(true));
   }
 }
index 2f1a46a9a1d2cce2eb614ffafe3e58eab979bd36..0403d82aa3b3b1feff8969a92e405be6f3422e6a 100644 (file)
@@ -48,7 +48,7 @@ public class WildcardPattern {
     String patternStr = removeSlahesToIgnore(wildcardPattern);
     patternStr = StringUtils.replace(patternStr, "**/**", "**");
     patternStr = StringUtils.replace(patternStr, "**/", "(&/|)");
-    patternStr = StringUtils.replace(patternStr, "/**", "&");
+    patternStr = StringUtils.replace(patternStr, "/**", "/&");
     patternStr = StringUtils.replace(patternStr, "**", "&");
     StringBuilder sb = new StringBuilder();
 
index 16ece8c3704cc5754dabd9e5752fe2779b67bbc6..0a5a7aeaff7bec89b6b0f0d0058fda5c9cc002f7 100644 (file)
@@ -24,7 +24,6 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class WildcardPatternTest {
@@ -106,7 +105,6 @@ public class WildcardPatternTest {
   /**
    * See http://jira.codehaus.org/browse/SONAR-2193
    */
-  @Ignore
   @Test
   public void issue2193() {
     assertTrue(match("**/app/**", "com.app.Utils", "."));