Hi

I also verified my patch against jdk 1.4.2 and IBM jdk 1.4.1 and am sure it keeps running.
The numerals in assertHasMethod are lower limits according to the test case, so the if is not necessery and furthermore makes in necessary to also verify again against jdk 1.3 and ibm jdk's. Furthermore it may become lower with future java versions again. When looking at the code one would not necessarily expect more than one line in the method (empty constructor). Therefore I had not put the if statement in there.


Kind Regards, Martijn

[EMAIL PROTECTED] wrote:

antoine     2003/10/27 10:32:13

Modified: src/testcases/org/apache/tools/ant/taskdefs/optional/sitraka
Tag: ANT_16_BRANCH ClassFileTest.java
Log:
Merge from HEAD
Prevent ClassFileTest from failing under JDK 1.2
PR: 23919
Submitted by: Martijn Kruithof
Revision Changes Path
No revision
No revision
1.7.2.1 +6 -1 ant/src/testcases/org/apache/tools/ant/taskdefs/optional/sitraka/ClassFileTest.java
Index: ClassFileTest.java
===================================================================
RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/optional/sitraka/ClassFileTest.java,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -u -r1.7 -r1.7.2.1
--- ClassFileTest.java 10 Feb 2003 14:14:54 -0000 1.7
+++ ClassFileTest.java 27 Oct 2003 18:32:13 -0000 1.7.2.1
@@ -65,6 +65,7 @@
* Nothing special about this testcase...
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Bailliez</a>
+ * @author <a href="mailto:[EMAIL PROTECTED]">Martijn Kruithof</a>
*/
public class ClassFileTest extends TestCase {
public ClassFileTest(String s) {
@@ -80,7 +81,11 @@
assertEquals("ClassFileTest.java", clazzfile.getSourceFile());
MethodInfo[] methods = clazzfile.getMethods();
assertEquals(3, methods.length);
- assertHasMethod("void <init>()", 2, methods);
+ if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)) {
+ assertHasMethod("void <init>()", 1, methods);
+ } else {
+ assertHasMethod("void <init>()", 2, methods);
+ }
assertHasMethod("void testTwoLines()", 2, methods);
assertHasMethod("void testOneLine()", 3, methods);
}


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to