ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/sitraka ClassFileTest.java
Date Wed, 20 Nov 2002 12:56:49 GMT
bodewig     2002/11/20 04:56:48

  Modified:    src/testcases/org/apache/tools/ant/taskdefs/optional/sitraka
                        Tag: ANT_15_BRANCH ClassFileTest.java
  Log:
  Looks as if JDK 1.4 is counting lines differently
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.1   +10 -2     jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/sitraka/ClassFileTest.java
  
  Index: ClassFileTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/sitraka/ClassFileTest.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- ClassFileTest.java	28 Jan 2002 16:32:06 -0000	1.3
  +++ ClassFileTest.java	20 Nov 2002 12:56:47 -0000	1.3.2.1
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -57,6 +57,7 @@
   import java.io.InputStream;
   
   import junit.framework.TestCase;
  +import org.apache.tools.ant.util.JavaEnvUtils;
   import org.apache.tools.ant.taskdefs.optional.sitraka.bytecode.ClassFile;
   import org.apache.tools.ant.taskdefs.optional.sitraka.bytecode.MethodInfo;
   
  @@ -81,7 +82,14 @@
           assertEquals(3, methods.length);
           assertHasMethod("void <init>()", 2, methods);
           assertHasMethod("void testTwoLines()", 2, methods);
  -        assertHasMethod("void testOneLine()", 3, methods);
  +        assertHasMethod("void testOneLine()", 
  +                        // in JDK 1.4 we get four lines
  +                        3 + 
  +                        (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)
  +                         || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)
  +                         || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)
  +                         ? 0 : 1),
  +                        methods);
       }
   
       protected void assertHasMethod(String methodsig, int line, MethodInfo[] methods) {
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message