db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lily...@apache.org
Subject svn commit: r1003070 - in /db/derby/code/branches/10.6: ./ java/testing/org/apache/derbyTesting/functionTests/master/ java/testing/org/apache/derbyTesting/functionTests/tests/tools/ java/tools/org/apache/derby/impl/tools/sysinfo/
Date Thu, 30 Sep 2010 14:13:47 GMT
Author: lilywei
Date: Thu Sep 30 14:13:46 2010
New Revision: 1003070

URL: http://svn.apache.org/viewvc?rev=1003070&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.6/   (props changed)
    db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out
    db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/tools/SysinfoCPCheckTest.java
    db/derby/code/branches/10.6/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java

Propchange: db/derby/code/branches/10.6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Sep 30 14:13:46 2010
@@ -1,2 +1,2 @@
-/db/derby/code/trunk:938547,938796,938959,939231,940462,940469,941627,942031,942286,942476,942480,942587,944152,946794,948045,948069,951346,951366,952138,952237,952581,954344,954421,954544,954748,955001,955540,955634,956075,956234,956445,956569,956659,957260,958163,958522,958555,958618,958939,959550,962716,963206,963705,964115,965647,967304,980684,986689,986834,987539,989099,990292,997325,998170,999119,1002291
+/db/derby/code/trunk:938547,938796,938959,939231,940462,940469,941627,942031,942286,942476,942480,942587,944152,946794,948045,948069,951346,951366,952138,952237,952581,954344,954421,954544,954748,955001,955540,955634,956075,956234,956445,956569,956659,957260,958163,958522,958555,958618,958939,959550,962716,963206,963705,964115,965647,967304,980684,986689,986834,987539,989099,990292,997325,998170,999119,1002291,1002682,1002853
 /db/derby/docs/trunk:954344

Modified: db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out?rev=1003070&r1=1003069&r2=1003070&view=diff
==============================================================================
--- db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out
(original)
+++ db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out
Thu Sep 30 14:13:46 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.6/java/testing/org/apache/derbyTesting/functionTests/tests/tools/SysinfoCPCheckTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/tools/SysinfoCPCheckTest.java?rev=1003070&r1=1003069&r2=1003070&view=diff
==============================================================================
--- db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/tools/SysinfoCPCheckTest.java
(original)
+++ db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/tools/SysinfoCPCheckTest.java
Thu Sep 30 14:13:46 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.6/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.6/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java?rev=1003070&r1=1003069&r2=1003070&view=diff
==============================================================================
--- db/derby/code/branches/10.6/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java (original)
+++ db/derby/code/branches/10.6/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java Thu
Sep 30 14:13:46 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);
@@ -1022,14 +1011,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)
     {
@@ -1127,8 +1114,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();
+                }
             }
         });
     }
@@ -1229,7 +1224,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;
     }



Mime
View raw message