ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [1/2] ant git commit: simplification suggested by @silviu-burcea
Date Fri, 01 Apr 2016 04:19:22 GMT
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 <bodewig@apache.org>
Authored: Fri Apr 1 06:17:09 2016 +0200
Committer: Stefan Bodewig <bodewig@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
-        }
     }
 }


Mime
View raw message