Browse Source

simplification suggested by @silviu-burcea

master
Stefan Bodewig 9 years ago
parent
commit
fd2327b8bc
1 changed files with 4 additions and 25 deletions
  1. +4
    -25
      src/tests/junit/org/apache/tools/ant/taskdefs/JavacTest.java

+ 4
- 25
src/tests/junit/org/apache/tools/ant/taskdefs/JavacTest.java View File

@@ -35,7 +35,6 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull; import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;


/** /**
* Testcase for <javac>. * Testcase for <javac>.
@@ -249,19 +248,13 @@ public class JavacTest {
assertEquals("1.5", javac.getTarget()); assertEquals("1.5", javac.getTarget());
} }


@Test
@Test(expected = BuildException.class)
public void testModulesourcepathOrSrcDirRequired() { public void testModulesourcepathOrSrcDirRequired() {
try {
javac.checkParameters(); 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() { public void testModulesourcepathAndSrcDirForbidden() {
try {
javac.checkParameters(); javac.checkParameters();
final Path p = new Path(project); final Path p = new Path(project);
p.setPath("src"); p.setPath("src");
@@ -269,15 +262,10 @@ public class JavacTest {
final Path mp = new Path(project); final Path mp = new Path(project);
p.setPath("modsrc"); p.setPath("modsrc");
javac.setModulesourcepath(mp); 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() { public void testModulesourcepathAndSourcepathForbidden() {
try {
javac.checkParameters(); javac.checkParameters();
final Path p = new Path(project); final Path p = new Path(project);
p.setPath("src"); p.setPath("src");
@@ -285,10 +273,6 @@ public class JavacTest {
final Path mp = new Path(project); final Path mp = new Path(project);
p.setPath("modsrc"); p.setPath("modsrc");
javac.setModulesourcepath(mp); javac.setModulesourcepath(mp);
fail("Build exception should have been thrown - neither srcDir nor modulesourcepath");
} catch (BuildException e) {
//pass
}
} }


@Test @Test
@@ -317,16 +301,11 @@ public class JavacTest {
} }
} }


@Test
@Test(expected = BuildException.class)
public void testModulesourcepathRequiresDestdir() { public void testModulesourcepathRequiresDestdir() {
try {
final Path p = new Path(project); final Path p = new Path(project);
p.setPath("src"); p.setPath("src");
javac.setModulesourcepath(p); javac.setModulesourcepath(p);
javac.checkParameters(); javac.checkParameters();
fail("Build exception should have been thrown - modulesourcepath requires destdir");
} catch (BuildException e) {
//pass
}
} }
} }

Loading…
Cancel
Save