Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 96874 invoked from network); 9 Nov 2007 19:40:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Nov 2007 19:40:13 -0000 Received: (qmail 48401 invoked by uid 500); 9 Nov 2007 19:40:01 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 48332 invoked by uid 500); 9 Nov 2007 19:40:01 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 48321 invoked by uid 99); 9 Nov 2007 19:40:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Nov 2007 11:40:01 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Nov 2007 19:40:49 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3997C1A9838; Fri, 9 Nov 2007 11:39:49 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r593635 - in /db/derby/code/trunk/java: testing/org/apache/derbyTesting/functionTests/tests/tools/SysinfoCPCheckTest.java testing/org/apache/derbyTesting/functionTests/tests/tools/_Suite.java tools/org/apache/derby/impl/tools/sysinfo/Main.java Date: Fri, 09 Nov 2007 19:39:48 -0000 To: derby-commits@db.apache.org From: myrnavl@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071109193949.3997C1A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: myrnavl Date: Fri Nov 9 11:39:48 2007 New Revision: 593635 URL: http://svn.apache.org/viewvc?rev=593635&view=rev Log: DERBY-2903 ; adding init() to sysinfo.Main.java's call to LocalizedResource.getInstance() ensures that if sysinfo has a clean one that does not get affected by any earlier calls to init. After this, the redirections of system.out work correctly in a loop, so adjusting the test to do away with the hoky annotating and unraveling of the output; also now sequence of tests in tools._Suite no longer matters. Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/SysinfoCPCheckTest.java db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/_Suite.java db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/SysinfoCPCheckTest.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/SysinfoCPCheckTest.java?rev=593635&r1=593634&r2=593635&view=diff ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/SysinfoCPCheckTest.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/SysinfoCPCheckTest.java Fri Nov 9 11:39:48 2007 @@ -91,87 +91,77 @@ final String[][] tstargs = { // empty string; should check all; what to check? Just check top // to ensure it recognizes it needs to check all. - {null, "0", "Testing for presence of all Derby-related librari" + - "es; typically, only some are needed.", null, "0"}, - // 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, "1"}, - {"embedded", "6", Success, "derby.jar", "2"}, - {"server", "10", Success, "derbynet.jar", "3"}, - {"tools", "6", Success, "derbytools.jar", "4"}, - {"client", "6", Success, "derbyclient.jar", "5"}, - // let's not test the following valid value, it's likely to fail: - // {"db2driver", "6", Success, "db2jcc.jar"}, - {thisclass, "6", Success, "SysinfoCPCheckTest", "6"}, - // neg tst, hope this doesn't exist - {"nonexist.class", "6", " (nonexist not found.)", null, "7"} + {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}, + {"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} }; - // First obtain the output of all sysinfo commands we want to test - // we print a number for each of the commands to test for unraveling - // them later. - final String outputEncoding = "US-ASCII"; PrintStream out = System.out; - try { - PrintStream testOut = new PrintStream(getOutputStream(), - false, outputEncoding); - setSystemOut(testOut); - } catch (UnsupportedEncodingException uee) { - uee.printStackTrace(); - } - for (int tst=0; tst