You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by li...@apache.org on 2010/09/30 16:14:38 UTC

svn commit: r1003071 - in /db/derby/code/branches/10.5: ./ java/testing/org/apache/derbyTesting/functionTests/master/ java/testing/org/apache/derbyTesting/functionTests/tests/tools/ java/tools/org/apache/derby/impl/tools/sysinfo/

Author: lilywei
Date: Thu Sep 30 14:14:37 2010
New Revision: 1003071

URL: http://svn.apache.org/viewvc?rev=1003071&view=rev
Log:
DERBY-4806 DERBY-4597 removes references to IBM jcc driver on Main.java, fixing extracting derbyTesting.jar information when it is not in the same directory as derbyrun.jar

Modified:
    db/derby/code/branches/10.5/   (props changed)
    db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out
    db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/tools/SysinfoCPCheckTest.java
    db/derby/code/branches/10.5/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java

Propchange: db/derby/code/branches/10.5/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Sep 30 14:14:37 2010
@@ -1,2 +1,2 @@
 /db/derby/code/branches/10.6:942027,957000,962738,965351,987678
-/db/derby/code/trunk:757811,769596,769602,769606,769962,772090,772337,772449,772534,774281,777105,779681,782991,785131,785139,785163,785570,785662,788369,788670,788674,788968,789264,790218,791027,792434,793089,793588,794106,794303,794955,795166,795459,796020,796027,796316,796372,797147,798347,798742,800523,803548,803948,805696,808494,808850,809643,810860,812669,816531,816536,819006,822289,823659,824694,827505,829022,829410,830545,831304,831319,832379,833430,835286,881074,881444,882732,884163,885421,885659,887246,888311,892912,897161,898635,901165,901648,901760,902857,903108,905224,908418,908586,909176,910481,910511,911315,911793,915733,916075,916897,918152,918359,921028,927430,928065,929085,934474,936215,938959,940462,940469,942286,942476,942480,942587,946794,948045,948069,951346,951366,952138,952581,954748,955001,955634,956075,956445,956659,958163,959550,962716,965647,967304,980684,986689,986834,999119,1002291
+/db/derby/code/trunk:757811,769596,769602,769606,769962,772090,772337,772449,772534,774281,777105,779681,782991,785131,785139,785163,785570,785662,788369,788670,788674,788968,789264,790218,791027,792434,793089,793588,794106,794303,794955,795166,795459,796020,796027,796316,796372,797147,798347,798742,800523,803548,803948,805696,808494,808850,809643,810860,812669,816531,816536,819006,822289,823659,824694,827505,829022,829410,830545,831304,831319,832379,833430,835286,881074,881444,882732,884163,885421,885659,887246,888311,892912,897161,898635,901165,901648,901760,902857,903108,905224,908418,908586,909176,910481,910511,911315,911793,915733,916075,916897,918152,918359,921028,927430,928065,929085,934474,936215,938959,940462,940469,942286,942476,942480,942587,946794,948045,948069,951346,951366,952138,952581,954748,955001,955634,956075,956445,956659,958163,959550,962716,965647,967304,980684,986689,986834,999119,1002291,1002682,1002853

Modified: db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out?rev=1003071&r1=1003070&r2=1003071&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out (original)
+++ db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out Thu Sep 30 14:14:37 2010
@@ -1,7 +1,7 @@
 ij --help:
 Usage: java org.apache.derby.tools.ij [-p propertyfile] [inputfile]
 sysinfo -cp help:
-USAGE: java org.apache.derby.tools.sysinfo -cp [ [ embedded ][ server ][ client] [ db2driver ] [ tools ] [  anyClass.class ] ]
+USAGE: java org.apache.derby.tools.sysinfo -cp [ [ embedded ][ server ][ client] [ tools ] [ anyClass.class ] ]
 dblook:
  USAGE:
  java org.apache.derby.tools.dblook -d <sourceDBUrl> [OPTIONS]

Modified: db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/tools/SysinfoCPCheckTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/tools/SysinfoCPCheckTest.java?rev=1003071&r1=1003070&r2=1003071&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/tools/SysinfoCPCheckTest.java (original)
+++ db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/tools/SysinfoCPCheckTest.java Thu Sep 30 14:14:37 2010
@@ -91,16 +91,16 @@ public class SysinfoCPCheckTest extends 
                 {null, "0", "Testing for presence of all Derby-related " +
                     "libraries; typically, only some are needed.", null},
                 // incorrect syntax, or 'args' - should return usage
-                {"a", "0", "USAGE: java org.apache.derby.tools.sysinfo -cp [" +
-                    " [ embedded ][ server ][ client] [ db2driver ] [ tools ]" +
-                    " [  anyClass.class ] ]", null},
+                {
+                        "a",
+                        "0",
+                        "USAGE: java org.apache.derby.tools.sysinfo -cp ["
+                                + " [ embedded ][ server ][ client] [ tools ]"
+                                + " [ anyClass.class ] ]", null },
                 {"embedded", "6", Success, "derby.jar"}, 
                 {"server", "10", Success, "derbynet.jar"},
                 {"tools", "6", Success, "derbytools.jar"},
                 {"client", "6", Success, "derbyclient.jar"},
-                // let's not test the following valid value, it will 
-                // fail if db2jcc.jar is not on CLASSPATH
-                //{"db2driver", "6", Success, "db2jcc.jar"},
                 {thisclass, "6", Success, "SysinfoCPCheckTest"},
                 // neg tst, hope this doesn't exist
                 {"nonexist.class", "6", "    (nonexist not found.)", null}

Modified: db/derby/code/branches/10.5/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java?rev=1003071&r1=1003070&r2=1003071&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java (original)
+++ db/derby/code/branches/10.5/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java Thu Sep 30 14:14:37 2010
@@ -139,9 +139,9 @@ public static void getMainInfo (java.io.
     reportJavaInfo (aw);
     aw.println (jbmsSep);
     reportDerby (aw);
-
     aw.println (sep);
 
+
     // Locales info
     try {
       reportLocales (aw);
@@ -512,13 +512,14 @@ public static void getMainInfo (java.io.
 
 	private static final String NET = "server";
 	private static final String CLIENT = "client";
-	private static final String DB2DRIVER = "db2driver";
 
 	/* you can add this if you like */
 
 	private static final String MAINUSAGESTRING = "java org.apache.derby.tools.sysinfo -cp";
 
-	private static final String USAGESTRINGPARTA = MAINUSAGESTRING + " [ [ " + EMBEDDED + " ][ " + NET + " ][ " + CLIENT + "] [ " + DB2DRIVER + " ] [ " + TOOLS + " ] [ ";
+    private static final String USAGESTRINGPARTA = MAINUSAGESTRING + " [ [ "
+            + EMBEDDED + " ][ " + NET + " ][ " + CLIENT + "] [ " + TOOLS
+            + " ] [";
     private static final String USAGESTRINGPARTB = ".class ] ]";
 
   static  void useMe(String[] args, java.io.PrintWriter pw) {
@@ -566,7 +567,6 @@ public static void getMainInfo (java.io.
 		  tryCoreClasspath(successes, failures);
 		  tryNetClasspath(successes, failures);
 		  tryClientClasspath(successes, failures);
-		  tryDB2DriverClasspath(successes, failures);
 		  tryUtilsClasspath(successes, failures);
 		  localPW.println(successes.toString());
 		  if (!failures.toString().equals(crLf() + Main.getTextMessage("SIF08.E") + crLf())) {
@@ -602,10 +602,6 @@ public static void getMainInfo (java.io.
 			seenArg =true;
 
 		}
-		if (argumentsContain(args,DB2DRIVER)) {
-			tryDB2DriverClasspath(successes, failures);
-			seenArg =true;
-		}
 
 		if (argumentsContain(args,TOOLS) || argumentsContain(args,"utils")) {
 		  tryUtilsClasspath(successes, failures);
@@ -650,13 +646,6 @@ public static void getMainInfo (java.io.
 	private static void tryClientClasspath(StringBuffer successes, StringBuffer failures) {
 		tryMyClasspath("org.apache.derby.jdbc.ClientDriver", Main.getTextMessage("SIF08.L", "derbyclient.jar"), successes, failures);
 	}
-    private static void tryDB2DriverClasspath(StringBuffer successes,
-            StringBuffer failures)
-    {
-        tryMyClasspath("com.ibm.db2.jcc.DB2Driver",
-                Main.getTextMessage("SIF08.L", "db2jcc.jar"),
-                successes, failures);
-    }
 
 	private static void tryUtilsClasspath(StringBuffer successes, StringBuffer failures) {
 		tryMyClasspath("org.apache.derby.tools.ij", Main.getTextMessage("SIF08.Q", "derbytools.jar"), successes, failures);
@@ -1021,14 +1010,12 @@ public static void getMainInfo (java.io.
     }
 
     /**
-     *  Check inside a jar file for the presence of a Derby info properties
-     *  file. There is a special case for db2jcc, which does not have a Derby
-     *  info propeties file. If db2jcc is in the filename, acquire DB2Driver
-     *  via reflection and get the version number from it.
-     *
-     *  @param filename the jar file to check
-     *  @return ZipInfoProperties with the jar file set as the location
-     *          or null if not found.
+     * Check inside a jar file for the presence of a Derby info properties file.
+     * 
+     * @param filename
+     *            the jar file to check
+     * @return ZipInfoProperties with the jar file set as the location or null
+     *         if not found.
      */
     private static ZipInfoProperties checkFile(String filename)
     {
@@ -1126,8 +1113,16 @@ public static void getMainInfo (java.io.
                     return null;        
      
                 URL result = cs.getLocation ();
-     
-                return formatURL(result);
+
+                try {
+                    // DERBY-4806 Should use UTF-8 according to
+                    // http://www.w3.org/TR/html40/appendix/notes.html#non-ascii-chars
+                    // to get the string of the file name
+                    return URLDecoder.decode(result.toString(), "UTF-8");
+                } catch (UnsupportedEncodingException e) {
+                    // All JVMs are required to support UTF-8.
+                    return e.getMessage();
+                }
             }
         });
     }
@@ -1228,7 +1223,7 @@ public static void getMainInfo (java.io.
         try {
             result = new File(filename).getCanonicalPath().replace('/', File.separatorChar);
         } catch (IOException e) {
-            result = "IOException";
+            result = e.getMessage();
         }
         return result;
     }