ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs SignJarTest.java
Date Wed, 23 Mar 2005 15:36:10 GMT
stevel      2005/03/23 07:36:10

  Modified:    src/main/org/apache/tools/ant/util JavaEnvUtils.java
               src/testcases/org/apache/tools/ant/taskdefs SignJarTest.java
  Log:
  -env util to get an ordered version number,
  -test of tsa only runs on java1.5+
  
  Revision  Changes    Path
  1.26      +12 -1     ant/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
  
  Index: JavaEnvUtils.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/JavaEnvUtils.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- JavaEnvUtils.java	24 Jan 2005 18:13:20 -0000	1.25
  +++ JavaEnvUtils.java	23 Mar 2005 15:36:10 -0000	1.26
  @@ -123,6 +123,17 @@
           return javaVersion;
       }
   
  +
  +    /**
  +     * Returns the version of Java this class is running under.
  +     * This number can be used for comparisions; it will always be 
  +     * @return the version of Java as a number 10x the major/minor,
  +     * e.g Java1.5 has a value of 15
  +     */
  +    public static int getJavaVersionNumber() {
  +        return javaVersionNumber;
  +    }
  +
       /**
        * Compares the current Java version to the passed in String -
        * assumes the argument is one of the constants defined in this
  @@ -139,7 +150,7 @@
        * Checks whether the current Java VM is Kaffe.
        * @return true if the current Java VM is Kaffe.
        * @since Ant 1.6.3
  -     * @see http://www.kaffe.org/
  +     * @see <a href="http://www.kaffe.org/">http://www.kaffe.org/</a>
        */
       public static boolean isKaffe() {
           return kaffeDetected;
  
  
  
  1.12      +7 -3      ant/src/testcases/org/apache/tools/ant/taskdefs/SignJarTest.java
  
  Index: SignJarTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/SignJarTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SignJarTest.java	23 Mar 2005 15:06:48 -0000	1.11
  +++ SignJarTest.java	23 Mar 2005 15:36:10 -0000	1.12
  @@ -25,6 +25,7 @@
   import java.util.Enumeration;
   import org.apache.tools.ant.BuildFileTest;
   import org.apache.tools.ant.Project;
  +import org.apache.tools.ant.util.JavaEnvUtils;
   
   /**
    * Testcase for the Signjar task
  @@ -148,8 +149,11 @@
       }
   
       public void testTsaLocalhost() {
  -        expectBuildException("testTsaLocalhost",
  -            "no TSA at localhost:0");
  -        assertLogContaining("java.net.ConnectException");
  +        //only test on java1.5+
  +        if(JavaEnvUtils.getJavaVersionNumber()>=15) {
  +            expectBuildException("testTsaLocalhost",
  +                "no TSA at localhost:0");
  +            assertLogContaining("java.net.ConnectException");
  +        }
       }
   }
  
  
  

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


Mime
View raw message