You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2016/04/01 06:19:22 UTC

[1/2] ant git commit: simplification suggested by @silviu-burcea

Repository: ant
Updated Branches:
  refs/heads/master a2eb30552 -> d02ecf6fe


simplification suggested by @silviu-burcea


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/fd2327b8
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/fd2327b8
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/fd2327b8

Branch: refs/heads/master
Commit: fd2327b8bcc472560dd671faf028447876005da9
Parents: a2eb305
Author: Stefan Bodewig <bo...@apache.org>
Authored: Fri Apr 1 06:17:09 2016 +0200
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Fri Apr 1 06:18:22 2016 +0200

----------------------------------------------------------------------
 .../apache/tools/ant/taskdefs/JavacTest.java    | 29 +++-----------------
 1 file changed, 4 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/fd2327b8/src/tests/junit/org/apache/tools/ant/taskdefs/JavacTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/JavacTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/JavacTest.java
index 67e31e9..755921d 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/JavacTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/JavacTest.java
@@ -35,7 +35,6 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
 
 /**
  * Testcase for <javac>.
@@ -249,19 +248,13 @@ public class JavacTest {
         assertEquals("1.5", javac.getTarget());
     }
 
-    @Test
+    @Test(expected = BuildException.class)
     public void testModulesourcepathOrSrcDirRequired() {
-        try {
             javac.checkParameters();
-            fail("Build exception should have been thrown - neither srcDir nor modulesourcepath");
-        } catch (BuildException e) {
-            //pass
-        }
     }
 
-    @Test
+    @Test(expected = BuildException.class)
     public void testModulesourcepathAndSrcDirForbidden() {
-        try {
             javac.checkParameters();
             final Path p = new Path(project);
             p.setPath("src");
@@ -269,15 +262,10 @@ public class JavacTest {
             final Path mp = new Path(project);
             p.setPath("modsrc");
             javac.setModulesourcepath(mp);
-            fail("Build exception should have been thrown - neither srcDir nor modulesourcepath");
-        } catch (BuildException e) {
-            //pass
-        }
     }
 
-    @Test
+    @Test(expected = BuildException.class)
     public void testModulesourcepathAndSourcepathForbidden() {
-        try {
             javac.checkParameters();
             final Path p = new Path(project);
             p.setPath("src");
@@ -285,10 +273,6 @@ public class JavacTest {
             final Path mp = new Path(project);
             p.setPath("modsrc");
             javac.setModulesourcepath(mp);
-            fail("Build exception should have been thrown - neither srcDir nor modulesourcepath");
-        } catch (BuildException e) {
-            //pass
-        }
     }
 
     @Test
@@ -317,16 +301,11 @@ public class JavacTest {
         }
     }
 
-    @Test
+    @Test(expected = BuildException.class)
     public void testModulesourcepathRequiresDestdir() {
-        try {
             final Path p = new Path(project);
             p.setPath("src");
             javac.setModulesourcepath(p);
             javac.checkParameters();
-            fail("Build exception should have been thrown - modulesourcepath requires destdir");
-        } catch (BuildException e) {
-            //pass
-        }
     }
 }


[2/2] ant git commit: whitespace

Posted by bo...@apache.org.
whitespace


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/d02ecf6f
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/d02ecf6f
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/d02ecf6f

Branch: refs/heads/master
Commit: d02ecf6fec116b2a97418c6365d35ecfc1d432d1
Parents: fd2327b
Author: Stefan Bodewig <bo...@apache.org>
Authored: Fri Apr 1 06:19:02 2016 +0200
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Fri Apr 1 06:19:02 2016 +0200

----------------------------------------------------------------------
 .../apache/tools/ant/taskdefs/JavacTest.java    | 38 ++++++++++----------
 1 file changed, 19 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/d02ecf6f/src/tests/junit/org/apache/tools/ant/taskdefs/JavacTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/JavacTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/JavacTest.java
index 755921d..364a50e 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/JavacTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/JavacTest.java
@@ -250,29 +250,29 @@ public class JavacTest {
 
     @Test(expected = BuildException.class)
     public void testModulesourcepathOrSrcDirRequired() {
-            javac.checkParameters();
+        javac.checkParameters();
     }
 
     @Test(expected = BuildException.class)
     public void testModulesourcepathAndSrcDirForbidden() {
-            javac.checkParameters();
-            final Path p = new Path(project);
-            p.setPath("src");
-            javac.setSrcdir(p);
-            final Path mp = new Path(project);
-            p.setPath("modsrc");
-            javac.setModulesourcepath(mp);
+        javac.checkParameters();
+        final Path p = new Path(project);
+        p.setPath("src");
+        javac.setSrcdir(p);
+        final Path mp = new Path(project);
+        p.setPath("modsrc");
+        javac.setModulesourcepath(mp);
     }
 
     @Test(expected = BuildException.class)
     public void testModulesourcepathAndSourcepathForbidden() {
-            javac.checkParameters();
-            final Path p = new Path(project);
-            p.setPath("src");
-            javac.setSourcepath(p);
-            final Path mp = new Path(project);
-            p.setPath("modsrc");
-            javac.setModulesourcepath(mp);
+        javac.checkParameters();
+        final Path p = new Path(project);
+        p.setPath("src");
+        javac.setSourcepath(p);
+        final Path mp = new Path(project);
+        p.setPath("modsrc");
+        javac.setModulesourcepath(mp);
     }
 
     @Test
@@ -303,9 +303,9 @@ public class JavacTest {
 
     @Test(expected = BuildException.class)
     public void testModulesourcepathRequiresDestdir() {
-            final Path p = new Path(project);
-            p.setPath("src");
-            javac.setModulesourcepath(p);
-            javac.checkParameters();
+        final Path p = new Path(project);
+        p.setPath("src");
+        javac.setModulesourcepath(p);
+        javac.checkParameters();
     }
 }