You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by to...@apache.org on 2016/09/17 05:32:47 UTC
buildr git commit: BUILDR-723: JavaTestFilter is unable to parse
paths containing %2F
Repository: buildr
Updated Branches:
refs/heads/master 13a57a857 -> 0916a14b2
BUILDR-723: JavaTestFilter is unable to parse paths containing %2F
Project: http://git-wip-us.apache.org/repos/asf/buildr/repo
Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/0916a14b
Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/0916a14b
Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/0916a14b
Branch: refs/heads/master
Commit: 0916a14b23ce2e79d20f2d31d7e70f67d4073761
Parents: 13a57a8
Author: Antoine Toulme <an...@lunar-ocean.com>
Authored: Fri Sep 16 22:32:36 2016 -0700
Committer: Antoine Toulme <an...@lunar-ocean.com>
Committed: Fri Sep 16 22:32:36 2016 -0700
----------------------------------------------------------------------
CHANGELOG | 1 +
.../java/org/apache/buildr/JavaTestFilter.class | Bin 3552 -> 3941 bytes
.../java/org/apache/buildr/JavaTestFilter.java | 2 +-
spec/java/tests_spec.rb | 15 +++++++++++++++
4 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/buildr/blob/0916a14b/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index fc1e2a6..5ee7723 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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.
http://git-wip-us.apache.org/repos/asf/buildr/blob/0916a14b/lib/buildr/java/org/apache/buildr/JavaTestFilter.class
----------------------------------------------------------------------
diff --git a/lib/buildr/java/org/apache/buildr/JavaTestFilter.class b/lib/buildr/java/org/apache/buildr/JavaTestFilter.class
index 2ed8524..f65575b 100644
Binary files a/lib/buildr/java/org/apache/buildr/JavaTestFilter.class and b/lib/buildr/java/org/apache/buildr/JavaTestFilter.class differ
http://git-wip-us.apache.org/repos/asf/buildr/blob/0916a14b/lib/buildr/java/org/apache/buildr/JavaTestFilter.java
----------------------------------------------------------------------
diff --git a/lib/buildr/java/org/apache/buildr/JavaTestFilter.java b/lib/buildr/java/org/apache/buildr/JavaTestFilter.java
index 19583c1..db05ffa 100644
--- a/lib/buildr/java/org/apache/buildr/JavaTestFilter.java
+++ b/lib/buildr/java/org/apache/buildr/JavaTestFilter.java
@@ -41,7 +41,7 @@ public class JavaTestFilter {
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);
}
http://git-wip-us.apache.org/repos/asf/buildr/blob/0916a14b/spec/java/tests_spec.rb
----------------------------------------------------------------------
diff --git a/spec/java/tests_spec.rb b/spec/java/tests_spec.rb
index a6b1648..93fc835 100644
--- a/spec/java/tests_spec.rb
+++ b/spec/java/tests_spec.rb
@@ -415,6 +415,21 @@ describe Buildr::TestNG do
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