Index: org/apache/ivy/matcher/ExactOrRegexpPatternMatcherTest.java =================================================================== --- org/apache/ivy/matcher/ExactOrRegexpPatternMatcherTest.java (revision 0) +++ org/apache/ivy/matcher/ExactOrRegexpPatternMatcherTest.java (revision 0) @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ivy.matcher; + +import java.util.regex.PatternSyntaxException; + +/** + * + */ +public class ExactOrRegexpPatternMatcherTest extends AbstractPatternMatcherTest { + + protected void setUp() throws Exception { + setUp(new ExactOrRegexpPatternMatcher(), false); + } + + public void testImplementation() { + Matcher matcher = patternMatcher.getMatcher("."); + assertFalse(matcher.matches("")); + assertTrue("Exact match failed", matcher.matches(".")); + assertTrue("Regexp match failed", matcher.matches("a")); + assertFalse(matcher.matches("aa")); + + matcher = patternMatcher.getMatcher(".*"); + assertTrue("Exact match failed", matcher.matches(".*")); + assertTrue("Regexp match failed", matcher.matches("")); + assertTrue(matcher.matches("a")); + assertTrue(matcher.matches("aa")); + + try { + matcher = patternMatcher.getMatcher("("); + fail("Should fail on invalid regexp syntax"); + } catch (PatternSyntaxException e) { + + } + } +} Property changes on: org\apache\ivy\matcher\ExactOrRegexpPatternMatcherTest.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Index: org/apache/ivy/matcher/AbstractPatternMatcherTest.java =================================================================== --- org/apache/ivy/matcher/AbstractPatternMatcherTest.java (revision 0) +++ org/apache/ivy/matcher/AbstractPatternMatcherTest.java (revision 0) @@ -0,0 +1,101 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ivy.matcher; + +import junit.framework.TestCase; + + +/** + * Base test classes for PatternMatcher testcase implementation + */ +public abstract class AbstractPatternMatcherTest extends TestCase { + protected PatternMatcher patternMatcher; + protected boolean exact; + + protected abstract void setUp() throws Exception; + protected void setUp(PatternMatcher matcher, boolean exact) { + this.patternMatcher = matcher; + this.exact = exact; + } + + public void testAnyExpression() { + Matcher matcher = patternMatcher.getMatcher("*"); + assertTrue(matcher.matches("")); + assertTrue(matcher.matches("We shall transcend borders. The new is old.")); + assertTrue(matcher.matches(" ")); + } + + + public void testIsExact() { + Matcher matcher = patternMatcher.getMatcher("*"); + assertEquals(false, matcher.isExact()); + matcher.matches("The words aren't what they were."); + assertEquals(false, matcher.isExact()); + + matcher = patternMatcher.getMatcher("some expression"); + assertEquals(exact, matcher.isExact()); + matcher.matches("The words aren't what they were."); + assertEquals(exact, matcher.isExact()); + } + + public void testNullInput() { + Matcher matcher = patternMatcher.getMatcher("some expression"); + try { + matcher.matches(null); + fail("Should fail for null input"); + } catch (NullPointerException expected) { + + } + } + + public void testNullExpression() { + try { + Matcher matcher = patternMatcher.getMatcher(null); + fail("Should fail for null expression"); + } catch (NullPointerException expected) { + + } + } + + public abstract void testImplementation(); + + + public void testLoadTestMatches() { + Matcher matcher = patternMatcher.getMatcher("this.is.an.expression"); + String[] inputs = { + "this.is.an.expression", "this:is:an:expression", "this is an expression", + "whatever this is", "maybe, maybe not" + }; + for (int i = 0; i < 100000; i++) { + String input = inputs[i%inputs.length]; + boolean success = matcher.matches(input); + } + } + + public void testLoadTestGetMatcher() { + String[] inputs = { + "this.is.an.expression", "this:is:an:expression", "this is an expression", + "whatever this is", "maybe, maybe not" + }; + + for (int i = 0; i < 100000; i++) { + String expression = inputs[i%inputs.length]; + Matcher matcher = patternMatcher.getMatcher(expression); + } + } +} Property changes on: org\apache\ivy\matcher\AbstractPatternMatcherTest.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Index: org/apache/ivy/matcher/GlobPatternMatcherTest.java =================================================================== --- org/apache/ivy/matcher/GlobPatternMatcherTest.java (revision 0) +++ org/apache/ivy/matcher/GlobPatternMatcherTest.java (revision 0) @@ -0,0 +1,80 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ivy.matcher; + +import java.util.regex.PatternSyntaxException; + +/** +* @see GlobPatternMatcher + */ +public class GlobPatternMatcherTest extends AbstractPatternMatcherTest { + + protected void setUp() throws Exception { + setUp(new GlobPatternMatcher(), false); + } + + public void testValidRegexpSyntaxAsNormalCharacter() { + Matcher matcher = patternMatcher.getMatcher("."); + assertFalse(matcher.matches("")); + assertTrue(matcher.matches(".")); + assertFalse(matcher.matches("a")); + assertFalse(matcher.matches("aa")); + } + + public void testRegexpSyntaxAndGlob() { + Matcher matcher = patternMatcher.getMatcher(".*"); + assertTrue(matcher.matches(".*")); + assertFalse(matcher.matches("")); + assertFalse(matcher.matches("a")); + assertTrue(matcher.matches(".a")); + assertFalse(matcher.matches("abcdef")); + assertTrue(matcher.matches(".abcdef")); + } + + public void testImplementation() { + } + + public void testQuoteMeta() { + Matcher matcher = patternMatcher.getMatcher("\\*"); + assertTrue(matcher.matches("*")); + assertFalse(matcher.matches("X")); + assertFalse(matcher.matches("Xsfsdfsd")); + } + + public void testInvalidRegexpSyntaxAsNormalCharacter() { + Matcher matcher = patternMatcher.getMatcher("("); + assertTrue(matcher.matches("(")); + } + + public void testGlob() { + Matcher matcher = patternMatcher.getMatcher("*ivy*"); + assertTrue(matcher.matches("ivy")); + assertTrue(matcher.matches("abcdefivyuvw")); + assertTrue(matcher.matches("ivyuvw")); + assertTrue(matcher.matches("abcdefivy")); + } + + public void testInvalidSyntax() { + try { + Matcher matcher = patternMatcher.getMatcher("["); + fail("Should fail on invalid regexp syntax"); + } catch (PatternSyntaxException e) { + + } + } +} Property changes on: org\apache\ivy\matcher\GlobPatternMatcherTest.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Index: org/apache/ivy/matcher/ExactPatternMatcherTest.java =================================================================== --- org/apache/ivy/matcher/ExactPatternMatcherTest.java (revision 0) +++ org/apache/ivy/matcher/ExactPatternMatcherTest.java (revision 0) @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ivy.matcher; + +/** +* @see ExactPatternMatcher + */ +public class ExactPatternMatcherTest extends AbstractPatternMatcherTest { + + + protected void setUp() throws Exception { + setUp(new ExactPatternMatcher(), true); + } + + public void testImplementation() { + Matcher matcher = patternMatcher.getMatcher("."); + assertFalse(matcher.matches("")); + assertTrue(matcher.matches(".")); + assertFalse(matcher.matches("a")); + assertFalse(matcher.matches("aa")); + } +} Property changes on: org\apache\ivy\matcher\ExactPatternMatcherTest.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Index: org/apache/ivy/matcher/RegexpPatternMatcherTest.java =================================================================== --- org/apache/ivy/matcher/RegexpPatternMatcherTest.java (revision 0) +++ org/apache/ivy/matcher/RegexpPatternMatcherTest.java (revision 0) @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ivy.matcher; + +import java.util.regex.PatternSyntaxException; + +/** + * @see RegexpPatternMatcher + */ +public class RegexpPatternMatcherTest extends AbstractPatternMatcherTest { + + protected void setUp() throws Exception { + setUp(new RegexpPatternMatcher(), false); + } + + public void testImplementation() { + Matcher matcher = patternMatcher.getMatcher(".*"); + assertTrue(matcher.matches(".*")); + assertTrue(matcher.matches("")); + assertTrue(matcher.matches("a")); + assertTrue(matcher.matches("aa")); + + try { + matcher = patternMatcher.getMatcher("("); + fail("Should fail on invalid syntax"); + } catch (PatternSyntaxException e) { + + } + } +} Property changes on: org\apache\ivy\matcher\RegexpPatternMatcherTest.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Index: org/apache/ivy/matcher/AbstractPatternMatcherTest.java =================================================================== --- org/apache/ivy/matcher/AbstractPatternMatcherTest.java (revision 0) +++ org/apache/ivy/matcher/AbstractPatternMatcherTest.java (revision 0) @@ -0,0 +1,101 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ivy.matcher; + +import junit.framework.TestCase; + + +/** + * Base test classes for PatternMatcher testcase implementation + */ +public abstract class AbstractPatternMatcherTest extends TestCase { + protected PatternMatcher patternMatcher; + protected boolean exact; + + protected abstract void setUp() throws Exception; + protected void setUp(PatternMatcher matcher, boolean exact) { + this.patternMatcher = matcher; + this.exact = exact; + } + + public void testAnyExpression() { + Matcher matcher = patternMatcher.getMatcher("*"); + assertTrue(matcher.matches("")); + assertTrue(matcher.matches("We shall transcend borders. The new is old.")); + assertTrue(matcher.matches(" ")); + } + + + public void testIsExact() { + Matcher matcher = patternMatcher.getMatcher("*"); + assertEquals(false, matcher.isExact()); + matcher.matches("The words aren't what they were."); + assertEquals(false, matcher.isExact()); + + matcher = patternMatcher.getMatcher("some expression"); + assertEquals(exact, matcher.isExact()); + matcher.matches("The words aren't what they were."); + assertEquals(exact, matcher.isExact()); + } + + public void testNullInput() { + Matcher matcher = patternMatcher.getMatcher("some expression"); + try { + matcher.matches(null); + fail("Should fail for null input"); + } catch (NullPointerException expected) { + + } + } + + public void testNullExpression() { + try { + Matcher matcher = patternMatcher.getMatcher(null); + fail("Should fail for null expression"); + } catch (NullPointerException expected) { + + } + } + + public abstract void testImplementation(); + + + public void testLoadTestMatches() { + Matcher matcher = patternMatcher.getMatcher("this.is.an.expression"); + String[] inputs = { + "this.is.an.expression", "this:is:an:expression", "this is an expression", + "whatever this is", "maybe, maybe not" + }; + for (int i = 0; i < 100000; i++) { + String input = inputs[i%inputs.length]; + boolean success = matcher.matches(input); + } + } + + public void testLoadTestGetMatcher() { + String[] inputs = { + "this.is.an.expression", "this:is:an:expression", "this is an expression", + "whatever this is", "maybe, maybe not" + }; + + for (int i = 0; i < 100000; i++) { + String expression = inputs[i%inputs.length]; + Matcher matcher = patternMatcher.getMatcher(expression); + } + } +} Property changes on: org\apache\ivy\matcher\AbstractPatternMatcherTest.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Index: org/apache/ivy/matcher/ExactOrRegexpPatternMatcherTest.java =================================================================== --- org/apache/ivy/matcher/ExactOrRegexpPatternMatcherTest.java (revision 0) +++ org/apache/ivy/matcher/ExactOrRegexpPatternMatcherTest.java (revision 0) @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ivy.matcher; + +import java.util.regex.PatternSyntaxException; + +/** + * + */ +public class ExactOrRegexpPatternMatcherTest extends AbstractPatternMatcherTest { + + protected void setUp() throws Exception { + setUp(new ExactOrRegexpPatternMatcher(), false); + } + + public void testImplementation() { + Matcher matcher = patternMatcher.getMatcher("."); + assertFalse(matcher.matches("")); + assertTrue("Exact match failed", matcher.matches(".")); + assertTrue("Regexp match failed", matcher.matches("a")); + assertFalse(matcher.matches("aa")); + + matcher = patternMatcher.getMatcher(".*"); + assertTrue("Exact match failed", matcher.matches(".*")); + assertTrue("Regexp match failed", matcher.matches("")); + assertTrue(matcher.matches("a")); + assertTrue(matcher.matches("aa")); + + try { + matcher = patternMatcher.getMatcher("("); + fail("Should fail on invalid regexp syntax"); + } catch (PatternSyntaxException e) { + + } + } +} Property changes on: org\apache\ivy\matcher\ExactOrRegexpPatternMatcherTest.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Index: org/apache/ivy/matcher/ExactPatternMatcherTest.java =================================================================== --- org/apache/ivy/matcher/ExactPatternMatcherTest.java (revision 0) +++ org/apache/ivy/matcher/ExactPatternMatcherTest.java (revision 0) @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ivy.matcher; + +/** +* @see ExactPatternMatcher + */ +public class ExactPatternMatcherTest extends AbstractPatternMatcherTest { + + + protected void setUp() throws Exception { + setUp(new ExactPatternMatcher(), true); + } + + public void testImplementation() { + Matcher matcher = patternMatcher.getMatcher("."); + assertFalse(matcher.matches("")); + assertTrue(matcher.matches(".")); + assertFalse(matcher.matches("a")); + assertFalse(matcher.matches("aa")); + } +} Property changes on: org\apache\ivy\matcher\ExactPatternMatcherTest.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Index: org/apache/ivy/matcher/GlobPatternMatcherTest.java =================================================================== --- org/apache/ivy/matcher/GlobPatternMatcherTest.java (revision 0) +++ org/apache/ivy/matcher/GlobPatternMatcherTest.java (revision 0) @@ -0,0 +1,80 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ivy.matcher; + +import java.util.regex.PatternSyntaxException; + +/** +* @see GlobPatternMatcher + */ +public class GlobPatternMatcherTest extends AbstractPatternMatcherTest { + + protected void setUp() throws Exception { + setUp(new GlobPatternMatcher(), false); + } + + public void testValidRegexpSyntaxAsNormalCharacter() { + Matcher matcher = patternMatcher.getMatcher("."); + assertFalse(matcher.matches("")); + assertTrue(matcher.matches(".")); + assertFalse(matcher.matches("a")); + assertFalse(matcher.matches("aa")); + } + + public void testRegexpSyntaxAndGlob() { + Matcher matcher = patternMatcher.getMatcher(".*"); + assertTrue(matcher.matches(".*")); + assertFalse(matcher.matches("")); + assertFalse(matcher.matches("a")); + assertTrue(matcher.matches(".a")); + assertFalse(matcher.matches("abcdef")); + assertTrue(matcher.matches(".abcdef")); + } + + public void testImplementation() { + } + + public void testQuoteMeta() { + Matcher matcher = patternMatcher.getMatcher("\\*"); + assertTrue(matcher.matches("*")); + assertFalse(matcher.matches("X")); + assertFalse(matcher.matches("Xsfsdfsd")); + } + + public void testInvalidRegexpSyntaxAsNormalCharacter() { + Matcher matcher = patternMatcher.getMatcher("("); + assertTrue(matcher.matches("(")); + } + + public void testGlob() { + Matcher matcher = patternMatcher.getMatcher("*ivy*"); + assertTrue(matcher.matches("ivy")); + assertTrue(matcher.matches("abcdefivyuvw")); + assertTrue(matcher.matches("ivyuvw")); + assertTrue(matcher.matches("abcdefivy")); + } + + public void testInvalidSyntax() { + try { + Matcher matcher = patternMatcher.getMatcher("["); + fail("Should fail on invalid regexp syntax"); + } catch (PatternSyntaxException e) { + + } + } +} Property changes on: org\apache\ivy\matcher\GlobPatternMatcherTest.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Index: org/apache/ivy/matcher/RegexpPatternMatcherTest.java =================================================================== --- org/apache/ivy/matcher/RegexpPatternMatcherTest.java (revision 0) +++ org/apache/ivy/matcher/RegexpPatternMatcherTest.java (revision 0) @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ivy.matcher; + +import java.util.regex.PatternSyntaxException; + +/** + * @see RegexpPatternMatcher + */ +public class RegexpPatternMatcherTest extends AbstractPatternMatcherTest { + + protected void setUp() throws Exception { + setUp(new RegexpPatternMatcher(), false); + } + + public void testImplementation() { + Matcher matcher = patternMatcher.getMatcher(".*"); + assertTrue(matcher.matches(".*")); + assertTrue(matcher.matches("")); + assertTrue(matcher.matches("a")); + assertTrue(matcher.matches("aa")); + + try { + matcher = patternMatcher.getMatcher("("); + fail("Should fail on invalid syntax"); + } catch (PatternSyntaxException e) { + + } + } +} Property changes on: org\apache\ivy\matcher\RegexpPatternMatcherTest.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Index: org/apache/ivy/resolver/IBiblioResolverTest.java =================================================================== --- org/apache/ivy/resolver/IBiblioResolverTest.java (revision 493699) +++ org/apache/ivy/resolver/IBiblioResolverTest.java (working copy) @@ -169,8 +169,8 @@ ModuleRevisionId mrid = ModuleRevisionId.newInstance("apache", "nanning", "0.9"); DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(mrid, false); - dd.addDependencyArtifactIncludes("default", new DefaultDependencyArtifactDescriptor(dd, "nanning-profiler", "jar", "jar", true, ExactPatternMatcher.getInstance())); - dd.addDependencyArtifactIncludes("default", new DefaultDependencyArtifactDescriptor(dd, "nanning-trace", "jar", "jar", true, ExactPatternMatcher.getInstance())); + dd.addDependencyArtifactIncludes("default", new DefaultDependencyArtifactDescriptor(dd, "nanning-profiler", "jar", "jar", true, ExactPatternMatcher.INSTANCE)); + dd.addDependencyArtifactIncludes("default", new DefaultDependencyArtifactDescriptor(dd, "nanning-trace", "jar", "jar", true, ExactPatternMatcher.INSTANCE)); ResolvedModuleRevision rmr = resolver.getDependency(dd, _data); assertNotNull(rmr); assertEquals(mrid, rmr.getId()); Index: org/apache/ivy/resolver/URLResolverTest.java =================================================================== --- org/apache/ivy/resolver/URLResolverTest.java (revision 493699) +++ org/apache/ivy/resolver/URLResolverTest.java (working copy) @@ -181,8 +181,8 @@ ModuleRevisionId mrid = ModuleRevisionId.newInstance("apache", "nanning", "0.9"); DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(mrid, false); - dd.addDependencyArtifactIncludes("default", new DefaultDependencyArtifactDescriptor(dd, "nanning-profiler", "jar", "jar", true, ExactPatternMatcher.getInstance())); - dd.addDependencyArtifactIncludes("default", new DefaultDependencyArtifactDescriptor(dd, "nanning-trace", "jar", "jar", true, ExactPatternMatcher.getInstance())); + dd.addDependencyArtifactIncludes("default", new DefaultDependencyArtifactDescriptor(dd, "nanning-profiler", "jar", "jar", true, ExactPatternMatcher.INSTANCE)); + dd.addDependencyArtifactIncludes("default", new DefaultDependencyArtifactDescriptor(dd, "nanning-trace", "jar", "jar", true, ExactPatternMatcher.INSTANCE)); ResolvedModuleRevision rmr = resolver.getDependency(dd, _data); assertNotNull(rmr); assertEquals(mrid, rmr.getId());