Browse Source

Tidy javadoc and use isEmpty()

master
Gintas Grigelionis 7 years ago
parent
commit
633446cfaf
12 changed files with 30 additions and 31 deletions
  1. +4
    -5
      src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java
  2. +2
    -0
      src/tests/junit/org/apache/tools/ant/IncludeTest.java
  3. +1
    -2
      src/tests/junit/org/apache/tools/ant/ProjectTest.java
  4. +4
    -6
      src/tests/junit/org/apache/tools/ant/TaskContainerTest.java
  5. +1
    -2
      src/tests/junit/org/apache/tools/ant/UnknownElementTest.java
  6. +5
    -2
      src/tests/junit/org/apache/tools/ant/XmlLoggerTest.java
  7. +1
    -1
      src/tests/junit/org/apache/tools/ant/taskdefs/AntlibTest.java
  8. +2
    -2
      src/tests/junit/org/apache/tools/ant/taskdefs/ParallelTest.java
  9. +1
    -1
      src/tests/junit/org/apache/tools/ant/taskdefs/SubAntTest.java
  10. +5
    -6
      src/tests/junit/org/apache/tools/ant/taskdefs/optional/vss/MSVSSTest.java
  11. +3
    -1
      src/tests/junit/org/apache/tools/ant/util/DateUtilsTest.java
  12. +1
    -3
      src/tests/junit/org/apache/tools/zip/ZipEntryTest.java

+ 4
- 5
src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java View File

@@ -170,9 +170,9 @@ public class AntClassLoaderTest {
} }


/** /**
* @see <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=47593">
* bug 47593, request to log the name of corrupt zip files from which
* classes cannot be loaded</a>
* @see <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=47593">bug 47593</a>
* request to log the name of corrupt zip files from which
* classes cannot be loaded
*/ */
@Test @Test
public void testInvalidZipException() { public void testInvalidZipException() {
@@ -204,8 +204,7 @@ public class AntClassLoaderTest {
* Asserts that getResources won't return resources that cannot be * Asserts that getResources won't return resources that cannot be
* seen by AntClassLoader but by ClassLoader.this.parent. * seen by AntClassLoader but by ClassLoader.this.parent.
* *
* @see <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=46752">
* https://issues.apache.org/bugzilla/show_bug.cgi?id=46752</a>
* @see <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=46752">bug 46752</a>
*/ */
@SuppressWarnings("resource") @SuppressWarnings("resource")
@Test @Test


+ 2
- 0
src/tests/junit/org/apache/tools/ant/IncludeTest.java View File

@@ -86,6 +86,7 @@ public class IncludeTest {


@Test @Test
public void testTaskErrorInIncluding() { public void testTaskErrorInIncluding() {
// TODO the test breaks in IDE
thrown.expect(BuildException.class); thrown.expect(BuildException.class);
thrown.expect(hasProperty("location", thrown.expect(hasProperty("location",
both(hasProperty("fileName", containsString("build.xml"))) both(hasProperty("fileName", containsString("build.xml")))
@@ -104,6 +105,7 @@ public class IncludeTest {


@Test @Test
public void testTaskErrorInIncluded() { public void testTaskErrorInIncluded() {
// TODO the test breaks in IDE
thrown.expect(BuildException.class); thrown.expect(BuildException.class);
thrown.expect(hasProperty("location", thrown.expect(hasProperty("location",
both(hasProperty("fileName", containsString("included_file.xml"))) both(hasProperty("fileName", containsString("included_file.xml")))


+ 1
- 2
src/tests/junit/org/apache/tools/ant/ProjectTest.java View File

@@ -309,8 +309,7 @@ public class ProjectTest {
} }


/** /**
* @see <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=47623">
* https://issues.apache.org/bugzilla/show_bug.cgi?id=47623</a>
* @see <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=47623">bug 47623</a>
*/ */
@Test @Test
public void testNullThrowableMessageLog() { public void testNullThrowableMessageLog() {


+ 4
- 6
src/tests/junit/org/apache/tools/ant/TaskContainerTest.java View File

@@ -48,20 +48,18 @@ public class TaskContainerTest {
public void testTaskdef() { public void testTaskdef() {
buildRule.executeTarget("testTaskdef"); buildRule.executeTarget("testTaskdef");
assertThat("attribute worked", buildRule.getLog(), assertThat("attribute worked", buildRule.getLog(),
containsString(("As attribute: it worked")));
assertThat("nested text worked", buildRule.getLog(),
containsString(("As nested text: it worked")));
containsString("As attribute: it worked"));
assertThat("nested text worked", buildRule.getLog(), assertThat("nested text worked", buildRule.getLog(),
containsString(("As nested task: it worked")));
containsString("As nested text: it worked"));
} }


@Test @Test
public void testCaseInsensitive() { public void testCaseInsensitive() {
buildRule.executeTarget("testCaseInsensitive"); buildRule.executeTarget("testCaseInsensitive");
assertThat("works outside of container", buildRule.getLog(), assertThat("works outside of container", buildRule.getLog(),
containsString(("hello ")));
containsString("hello "));
assertThat("works inside of container", buildRule.getLog(), assertThat("works inside of container", buildRule.getLog(),
containsString(("world")));
containsString("world"));
} }


} }

+ 1
- 2
src/tests/junit/org/apache/tools/ant/UnknownElementTest.java View File

@@ -49,8 +49,7 @@ public class UnknownElementTest {
/** /**
* Not really a UnknownElement test but rather one of "what * Not really a UnknownElement test but rather one of "what
* information is available in taskFinished". * information is available in taskFinished".
* @see <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=26197">
* https://issues.apache.org/bugzilla/show_bug.cgi?id=26197</a>
* @see <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=26197">bug 26197</a>
*/ */
@Test @Test
@Ignore("Previously disabled through naming convention") @Ignore("Previously disabled through naming convention")


+ 5
- 2
src/tests/junit/org/apache/tools/ant/XmlLoggerTest.java View File

@@ -23,9 +23,12 @@ import org.junit.Test;


public class XmlLoggerTest { public class XmlLoggerTest {


/**
* "NPE in XmlLogger.buildFinished"
*
* @see <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=56850">bug 56850</a>
*/
@Test @Test
// see https://issues.apache.org/bugzilla/show_bug.cgi?id=56850
// "NPE in XmlLogger.buildFinished"
public void test() { public void test() {
final XmlLogger logger = new XmlLogger(); final XmlLogger logger = new XmlLogger();
final Cvs task = new Cvs(); final Cvs task = new Cvs();


+ 1
- 1
src/tests/junit/org/apache/tools/ant/taskdefs/AntlibTest.java View File

@@ -58,7 +58,7 @@ public class AntlibTest {
/** /**
* Confirms that all matching resources will be used, so that you * Confirms that all matching resources will be used, so that you
* can collect several antlibs in one Definer call. * can collect several antlibs in one Definer call.
* @see "http://issues.apache.org/bugzilla/show_bug.cgi?id=24024"
* @see <a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=24024">bug 24024</a>
*/ */
@Test @Test
public void testAntlibResource() { public void testAntlibResource() {


+ 2
- 2
src/tests/junit/org/apache/tools/ant/taskdefs/ParallelTest.java View File

@@ -164,7 +164,7 @@ public class ParallelTest {
} }


/** /**
* @see "https://issues.apache.org/bugzilla/show_bug.cgi?id=55539"
* @see <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=55539">bug 55539</a>
*/ */
@Test @Test
public void testSingleExit() { public void testSingleExit() {
@@ -177,7 +177,7 @@ public class ParallelTest {
} }


/** /**
* @see "https://issues.apache.org/bugzilla/show_bug.cgi?id=55539"
* @see <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=55539">bug 55539</a>
*/ */
@Test @Test
public void testExitAndOtherException() { public void testExitAndOtherException() {


+ 1
- 1
src/tests/junit/org/apache/tools/ant/taskdefs/SubAntTest.java View File

@@ -144,7 +144,7 @@ public class SubAntTest {
} }


public void targetStarted(BuildEvent event) { public void targetStarted(BuildEvent event) {
if (event.getTarget().getName().equals("")) {
if (event.getTarget().getName().isEmpty()) {
return; return;
} }
if (error == null) { if (error == null) {


+ 5
- 6
src/tests/junit/org/apache/tools/ant/taskdefs/optional/vss/MSVSSTest.java View File

@@ -36,6 +36,7 @@ import org.junit.Rule;
import org.junit.Test; import org.junit.Test;


import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;


/** /**
@@ -445,7 +446,7 @@ public class MSVSSTest implements MSVSSConstants {


while (testIndex < testLength) { while (testIndex < testLength) {
try { try {
if (sGeneratedCmdLine[genIndex].equals("")) {
if (sGeneratedCmdLine[genIndex].isEmpty()) {
genIndex++; genIndex++;
continue; continue;
} }
@@ -462,13 +463,11 @@ public class MSVSSTest implements MSVSSConstants {
// Count the number of empty strings // Count the number of empty strings
int cnt = 0; int cnt = 0;
for (String argument : sGeneratedCmdLine) { for (String argument : sGeneratedCmdLine) {
if (argument.equals("")) {
if (argument.isEmpty()) {
cnt++; cnt++;
} }
} }
if (genLength - cnt > sTestCmdLine.length) {
// We have extra elements
fail("extra args");
}
// We have extra elements
assertFalse("extra args", genLength - cnt > sTestCmdLine.length);
} }
} }

+ 3
- 1
src/tests/junit/org/apache/tools/ant/util/DateUtilsTest.java View File

@@ -43,7 +43,9 @@ public class DateUtilsTest {
assertEquals("2 minutes 1 second", text); assertEquals("2 minutes 1 second", text);
} }


// https://issues.apache.org/bugzilla/show_bug.cgi?id=44659
/**
* @see <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=44659">bug 44659</a>
*/
@Test @Test
public void testLongElapsedTime() { public void testLongElapsedTime() {
assertEquals("2926 minutes 13 seconds", assertEquals("2926 minutes 13 seconds",


+ 1
- 3
src/tests/junit/org/apache/tools/zip/ZipEntryTest.java View File

@@ -32,7 +32,6 @@ import static org.junit.Assert.fail;
*/ */
public class ZipEntryTest { public class ZipEntryTest {



/** /**
* test handling of extra fields * test handling of extra fields
*/ */
@@ -203,8 +202,7 @@ public class ZipEntryTest {


/** /**
* Test case for * Test case for
* <a href="https://issues.apache.org/jira/browse/COMPRESS-94"
* >COMPRESS-94</a>.
* <a href="https://issues.apache.org/jira/browse/COMPRESS-94">COMPRESS-94</a>
*/ */
@Test @Test
public void testNotEquals() { public void testNotEquals() {


Loading…
Cancel
Save