Browse Source

Simplify assertion in testcase (remark of Martin Kruithof)

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275570 13f79535-47bb-0310-9956-ffa450edef68
master
Antoine Levy-Lambert 21 years ago
parent
commit
fc760b24e7
1 changed files with 2 additions and 6 deletions
  1. +2
    -6
      src/testcases/org/apache/tools/ant/taskdefs/optional/sitraka/ClassFileTest.java

+ 2
- 6
src/testcases/org/apache/tools/ant/taskdefs/optional/sitraka/ClassFileTest.java View File

@@ -81,11 +81,7 @@ public class ClassFileTest extends TestCase {
assertEquals("ClassFileTest.java", clazzfile.getSourceFile());
MethodInfo[] methods = clazzfile.getMethods();
assertEquals(3, methods.length);
if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)) {
assertHasMethod("void <init>()", 1, methods);
} else {
assertHasMethod("void <init>()", 2, methods);
}
assertHasMethod("void <init>()", 1, methods);
assertHasMethod("void testTwoLines()", 2, methods);
assertHasMethod("void testOneLine()", 3, methods);
}
@@ -95,7 +91,7 @@ public class ClassFileTest extends TestCase {
for (int i = 0; i < methods.length; i++) {
MethodInfo method = methods[i];
if (methodsig.equals(method.getFullSignature())) {
assertTrue(methodsig, method.getNumberOfLines() >= line);
return;
}


Loading…
Cancel
Save