db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From myrn...@apache.org
Subject svn commit: r538724 - in /db/derby/code/trunk: java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeRun.java java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/_Suite.java tools/testing/
Date Wed, 16 May 2007 20:42:42 GMT
Author: myrnavl
Date: Wed May 16 13:42:40 2007
New Revision: 538724

URL: http://svn.apache.org/viewvc?view=rev&rev=538724
Log:
DERBY-1746 - removing svn:externals property from <trunk>/tools/testing, adjusting upgrade
tests to by default attempt to access https://svn.apache.org/repos/asf/db/derby/jars for the
older version's derby.jar files; removing dependency on 'lib' in old version's directory structure.
Also adjusted comments.  

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeRun.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/_Suite.java
    db/derby/code/trunk/tools/testing/   (props changed)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeRun.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeRun.java?view=diff&rev=538724&r1=538723&r2=538724
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeRun.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeRun.java
Wed May 16 13:42:40 2007
@@ -242,17 +242,31 @@
      */
     private static String getOldJarLocation(int[] oldVersion) {
         String jarPath = System.getProperty(_Suite.OLD_RELEASE_PATH_PROPERTY);
-        
-        Assert.assertNotNull(_Suite.OLD_RELEASE_PATH_PROPERTY
-                + " not set", jarPath);
       
+        if (jarPath == null)
+            return null;
+        
         String version = getTextVersion(oldVersion);
-        String jarLocation = jarPath + File.separator + version
-            + File.separator + "lib";
-                
+        String jarLocation = jarPath + File.separator + version;
+        
         return jarLocation;
     }
-    
+
+    /**
+     * Get the location of jars of old release, using the url for svn at apache.
+     *  
+     * @return location of jars of old release
+     */
+    private static String getOldJarURLLocation(int[] oldVersion) {
+
+        String oldJarUrl = _Suite.OLD_JAR_URL;
+        
+        String version = getTextVersion(oldVersion);
+        String jarLocation = oldJarUrl + "/" + version;
+        
+        return jarLocation;       
+    }
+
     /**
      * Create a class loader using jars in the specified location. Add all jars 
      * specified in jarFiles and the testing jar.
@@ -266,19 +280,38 @@
         
         String jarLocation = getOldJarLocation(version);
         
-        File lib = new File(jarLocation);
-                
-        // If the jars do not exist then return null
-        // and the caller will set up to skip this.
-        if (!lib.exists())
-            return null;
-        
+        if (jarLocation != null)
+        {
+            File lib = new File(jarLocation);
+
+            // If the jars do not exist then return null
+            // and the caller will set up to skip this.
+            if (!lib.exists())
+                return null;
+
+            for (int i=0; i < jarFiles.length; i++) {
+                try {
+                    url[i] = new File(lib, jarFiles[i]).toURL();
+                } catch (MalformedURLException e) {
+                    Assert.fail(e.toString());
+                }
+            }
+        }
+        else
         
-        for (int i=0; i < jarFiles.length; i++) {
-            try {
-                url[i] = new File(lib, jarFiles[i]).toURL();
-            } catch (MalformedURLException e) {
-                Assert.fail(e.toString());
+        // if the property was not set, attempt to access the jars from 
+        // the saved svn location.
+        // Note, this means the test fails if there is no network connection
+        // (or the server at apache is down) unless the property is set
+        // to a valid location
+        {
+            String oldURLJarLocation = getOldJarURLLocation(version);
+            for (int i=0; i < jarFiles.length; i++) {
+                try {
+                    url[i] = new URL(oldURLJarLocation + "/" + jarFiles[i]);
+                } catch (MalformedURLException e) {
+                    Assert.fail(e.toString());
+                }
             }
         }
         

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/_Suite.java?view=diff&rev=538724&r1=538723&r2=538724
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/_Suite.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/_Suite.java
Wed May 16 13:42:40 2007
@@ -73,16 +73,23 @@
         "derbyTesting.oldReleasePath";
     
     /**
+     * The saved location in svn at apache for older releases for testing
+     */
+    public static final String OLD_JAR_URL =
+        "https://svn.apache.org/repos/asf/db/derby/jars";
+    
+    /**
      * List of the versions to test against.
      * The tests look for the jar files in each releasae
      * in the folder:
-     * ${derbyTesting.jar.path}/M.m.f.p/lib
+     * ${derbyTesting.oldReleasePath}/M.m.f.p
      * 
-     * If derbyTesting.jar.path is not set then no tests will be run.
+     * If derbyTesting.oldReleasePath is not set then it is assumed the files can
+     * be accessed from the svn repository at apache. If this location is
+     * not available, then the test will fail.
      * 
-     * If ${derbyTesting.jar.path}/M.m.f.p/lib does not exist
-     * for a specific release then those sets of tests will
-     * be skipped.
+     * If the property is set, but ${derbyTesting.oldReleasePath}/M.m.f.p does not exist
+     * for a specific release then those sets of tests will be skipped.
      */
     private static final int[][] OLD_VERSIONS =
     {
@@ -94,7 +101,6 @@
         {10, 2, 2, 0}, // 10.2.2.0 (Dec 12, 2006 / SVN 485682)
     };
 
-
     /**
      * Use suite method instead.
      */
@@ -103,11 +109,6 @@
     }
     
     public static Test suite() {
-        
-        if (getSystemProperty(OLD_RELEASE_PATH_PROPERTY) == null)
-            return new TestSuite(
-                    "empty: no upgrade tests: " +
-                    OLD_RELEASE_PATH_PROPERTY + " not set");
         
         TestSuite suite = new TestSuite("Upgrade Suite");       
 

Propchange: db/derby/code/trunk/tools/testing/
            ('svn:externals' removed)



Mime
View raw message