Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
BUILDR-723: JavaTestFilter is unable to parse paths containing %2F
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulme committed Sep 17, 2016
1 parent 13a57a8 commit 0916a14
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -47,6 +47,7 @@
* Fixed: BUILDR-620 resources.filter should not run on non-text files
* Fixed: BUILDR-489 Java + Scala joint compiler fails if default encoding and source file encoding are not same and special characters have been used in source code
* Fixed: BUILDR-486 Buildr-generated poms should include dependencies
* Fixed: BUILDR-723 JavaTestFilter is unable to parse paths containing %2F
* Change: Update the custom_pom addon to generate poms with exclusions section that excludes
all transitive dependencies. This is required as buildr dependencies are not
transitive while Maven's dependencies are transitive by default.
Expand Down
Binary file modified lib/buildr/java/org/apache/buildr/JavaTestFilter.class
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/buildr/java/org/apache/buildr/JavaTestFilter.java
Expand Up @@ -41,7 +41,7 @@ public JavaTestFilter(String[] paths) throws IOException {
for (int i = 0 ; i < paths.length ; ++i) {
File file = new File(paths[i]).getCanonicalFile();
if (file.exists())
urls[i] = file.toURL();
urls[i] = file.toURI().toURL();
else
throw new IOException("No file or directory with the name " + file);
}
Expand Down
15 changes: 15 additions & 0 deletions spec/java/tests_spec.rb
Expand Up @@ -415,6 +415,21 @@ def fork_tests(mode)
project('foo').test.compile.dependencies.should include(artifact("#{group}:jmock:jar:#{JMock.version}"))
project('foo').test.dependencies.should include(artifact("#{group}:jmock:jar:#{JMock.version}"))
end

it 'should parse test classes in paths containing escaped sequences' do
write 'bar%2F/src/test/java/com/example/AnnotatedClass.java', <<-JAVA
package com.example;
@org.testng.annotations.Test
public class AnnotatedClass { }
JAVA
define 'foo' do
define 'bar%2F' do
test.using(:testng)
end
end
project('foo:bar%2F').test.invoke
project('foo:bar%2F').test.tests.should include('com.example.AnnotatedClass')
end

it 'should include classes using TestNG annotations' do
write 'src/test/java/com/example/AnnotatedClass.java', <<-JAVA
Expand Down

0 comments on commit 0916a14

Please sign in to comment.