Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 96089 invoked from network); 17 Oct 2006 15:41:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Oct 2006 15:41:57 -0000 Received: (qmail 17903 invoked by uid 500); 17 Oct 2006 15:41:47 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 17865 invoked by uid 500); 17 Oct 2006 15:41:47 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 17702 invoked by uid 99); 17 Oct 2006 15:41:47 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Oct 2006 08:41:46 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [192.18.1.36] (HELO gmp-ea-fw-1.sun.com) (192.18.1.36) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Oct 2006 08:41:41 -0700 Received: from d1-emea-10.sun.com ([192.18.2.120]) by gmp-ea-fw-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id k9HFfJjX026479 for ; Tue, 17 Oct 2006 16:41:20 +0100 (BST) Received: from conversion-daemon.d1-emea-10.sun.com by d1-emea-10.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) id <0J7A00C01E5MZ900@d1-emea-10.sun.com> (original mail from Kristian.Waagan@Sun.COM) for derby-dev@db.apache.org; Tue, 17 Oct 2006 16:41:19 +0100 (BST) Received: from [129.159.112.188] by d1-emea-10.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPSA id <0J7A00FB5E8VT8Y5@d1-emea-10.sun.com> for derby-dev@db.apache.org; Tue, 17 Oct 2006 16:41:19 +0100 (BST) Date: Tue, 17 Oct 2006 17:41:18 +0200 From: Kristian Waagan Subject: Workaround for running JUnit tests with the GUI runners (was: Re: [junit] Making progess faster towards a pure Junit world) In-reply-to: Sender: Kristian.Waagan@Sun.COM To: derby-dev@db.apache.org Message-id: <4534F99E.4080001@Sun.com> Organization: Sun Microsystems Inc. MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7BIT References: <452553E8.4070805@apache.org> <452B8419.5090903@Sun.com> User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; no-NO; rv:1.8.0.5) Gecko/20060730 Thunderbird/1.5.0.5 Mnenhy/0.7.4.0 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Dyre.Tjeldvoll@Sun.COM wrote: > Kristian Waagan writes: > >> Daniel John Debrunner wrote: [ snip - progress towards a pure JUnit world ] > > Should it be possible to run junit tests with ALL the junit runners, > or just with junit.textui.TestRunner? > > With the current trunk I able to > run > > org.apache.derbyTesting.functionTests.tests.jdbcapi._Suite > > successfully with junit.textui.TestRunner (if I set > derby.system.home), but with > junit.awtui.TestRunner or junit.swingui.TestRunner the first test > fails with > > java.lang.ExceptionInInitializerError > at org.apache.derbyTesting.junit.TestConfiguration.defaultSecurityManagerSetup(TestConfiguration.java:667) > at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:73) > at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) > at junit.extensions.TestSetup$1.protect(TestSetup.java:19) > at junit.extensions.TestSetup.run(TestSetup.java:23) > at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) > at junit.extensions.TestSetup$1.protect(TestSetup.java:19) > at junit.extensions.TestSetup.run(TestSetup.java:23) > Caused by: java.lang.NullPointerException > at org.apache.derbyTesting.junit.SecurityManagerSetup.determineClasspath(SecurityManagerSetup.java:218) > at org.apache.derbyTesting.junit.SecurityManagerSetup.(SecurityManagerSetup.java:56) > ... 19 more > > and the following tests fail with > > java.lang.NoClassDefFoundError: Could not initialize class org.apache.derbyTesting.junit.SecurityManagerSetup > at org.apache.derbyTesting.junit.TestConfiguration.defaultSecurityManagerSetup(TestConfiguration.java:667) > at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:73) > at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) > at junit.extensions.TestSetup$1.protect(TestSetup.java:19) > at junit.extensions.TestSetup.run(TestSetup.java:23) > at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) > at junit.extensions.TestSetup$1.protect(TestSetup.java:19) > at junit.extensions.TestSetup.run(TestSetup.java:23) > > Should I create a JIRA for this? Hi Dyre, I think you can create a Jira for this, if you haven't already. The problem is that the GUI runners are using a custom classload to allow for dynamic reloading of the test classes. It defeats the getURL method in SecurityManagerSetup, seemingly by returning an empty/null (the object itself isn't null) ProtectionDomain object. This finally leads to the URL object extracted being null, which causes the NPE. A workaround is to specify the -noloading option for the runner, like this: java -classpath X junit.swingui.TestRunner -noloading org.apache.derbyTesting... If you do this, you must restart the GUI if you recompile the test classes. We should investigate this and see if we can get it working without specifying the -noloading argument. -- Kristian >