You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Bryan Pendleton <bp...@amberpoint.com> on 2006/10/26 01:13:24 UTC

Test count dropping?

My most recent run of derbyall ran 662 tests.

I can't remember for sure, but I thought that my runs
late last week were running 669 or 670 tests.

Did a number of tests recently get removed from derbyall?

thanks,

bryan

P.S. I'm a bit behind on making the transition to JUnit,
so it's possible that I don't have the right JUnit environment
set up yet. Could that explain this finding?


Re: DERBY-2006, adding ant task to generate html report. (was Re: Test count dropping?)

Posted by Rajesh Kartha <ka...@gmail.com>.
Andrew McIntyre wrote:

> On 10/26/06, Sunitha Kambhampati <ks...@gmail.com> wrote:
>
>>
>> Thanks Andrew for working on this. I applied the patch attached to
>> derby-2006 and after adding junit.jar to the $ANT_HOME/lib path, I can
>> run the junitreport task.
>
>
> Do you have junit.jar in tools/java? I was hoping this wouldn't be 
> necessary.
>
After applying the patch I did not see any path element in the build.xml 
pointing to tools.java/junit.jar, could
that be the reason. 

All  the jars in $ANT_HOME/lib are accessible to the ant, hence placing 
the junit.jar always works.

But I do think the new ant task should utilize the junit.jar from the 
tools/java rather than placing it in
the $ANT_HOME/lib.

-Rajesh



Re: DERBY-2006, adding ant task to generate html report. (was Re: Test count dropping?)

Posted by Andrew McIntyre <mc...@gmail.com>.
On 10/26/06, Sunitha Kambhampati <ks...@gmail.com> wrote:
>
> Thanks Andrew for working on this. I applied the patch attached to
> derby-2006 and after adding junit.jar to the $ANT_HOME/lib path, I can
> run the junitreport task.

Do you have junit.jar in tools/java? I was hoping this wouldn't be necessary.

> junit-oneclass:
>     [junit] Running org.apache.derbyTesting.functionTests.suites.All
>     [junit] Exception in thread "main"
> java.security.AccessControlException: access denied
> (java.lang.RuntimePermission setIO)

This looks like the change to derby_tests.policy was not picked up for
some reason. Could you check that the test policy change is reflected
in your classes dir?

andrew

DERBY-2006, adding ant task to generate html report. (was Re: Test count dropping?)

Posted by Sunitha Kambhampati <ks...@gmail.com>.
Andrew McIntyre wrote:

>
> I've attached a patch to DERBY-2006 that adds basic support for this
> to our top-level build.xml. With the patch running 'ant junitreport'
> runs the All suite and generates an HTML report.
>
Thanks Andrew for working on this. I applied the patch attached to 
derby-2006 and after adding junit.jar to the $ANT_HOME/lib path, I can 
run the junitreport task.

First time I ran, my classpath settings were not correct so the tests 
didnt run but I got the report saying classnotfound so that was expected.

Second time I ran, I am getting this error:
[junitreport] [Fatal Error] :-1:-1: Premature end of file.
[junitreport] The file 
C:\workghm\svnclient\ks_trunk\junit\TEST-org.apache.derbyTesting.functionTests.suites.All.xml 
is not a valid XML document. It is possibly corrupted.

I see a file: 
/junit/org/apache/derbyTesting/functionTests/suites/0_All.html  amd that 
has the following exception

org.apache.derbyTesting.functionTests.suites.All

|java.lang.ClassNotFoundException: 
org.apache.derbyTesting.functionTests.suites.All at 
java.net.URLClassLoader.findClass(URLClassLoader.java:376) at 
java.lang.ClassLoader.loadClass(ClassLoader.java:572) at 
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:442) at 
java.lang.ClassLoader.loadClass(ClassLoader.java:504) at 
java.lang.Class.forName1(Native Method) at 
java.lang.Class.forName(Class.java:180)

|What could I be doing wrong ?

Here is the output :
ks_trunk>ant junitreport
Buildfile: build.xml

junit-init:

junit-all:

junit-oneclass:
    [junit] Running org.apache.derbyTesting.functionTests.suites.All
    [junit] Exception in thread "main" 
java.security.AccessControlException: access denied 
(java.lang.RuntimePermission setIO)
    [junit]     at 
java.security.AccessControlContext.checkPermission(AccessControlContext.java(Compiled 
Code))
    [junit]     at 
java.security.AccessController.checkPermission(AccessController.java(Compiled 
Code))
    [junit]     at 
java.lang.SecurityManager.checkPermission(SecurityManager.java(Compiled 
Code))
    [junit]     at java.lang.System.checkIO(System.java:225)
    [junit]     at java.lang.System.setOut(System.java:189)
    [junit]     at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:309)
    [junit]     at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672)
    [junit]     at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567)
    [junit] Test org.apache.derbyTesting.functionTests.suites.All FAILED

junitreport:
[junitreport] [Fatal Error] :-1:-1: Premature end of file.
[junitreport] The file 
C:\workghm\svnclient\ks_trunk\junit\TEST-org.apache.derbyTesting.functionTests.suites.All.xml 
is not a valid XML document. It is possibly corrupted.
[junitreport] Transform time: 741ms

BUILD SUCCESSFUL
Total time: 9 minutes 29 seconds
ks_trunk>
----------------

Thanks,
Sunitha.

Re: Re: Test count dropping?

Posted by Andrew McIntyre <mc...@gmail.com>.
On 10/26/06, Yip Ng <yi...@gmail.com> wrote:
> On 10/26/06, Daniel John Debrunner <dj...@apache.org> wrote:
> >
> > Ant has a mechanism to run tests and produce an HTML report, I hope
> > eventually that there will be ant targets to run the derby tests.
> > (I thought I'd entered a Jira issue for this, but can't find it).
>
> I couldn't find it either.  I opened a jira for the this. (DERBY-2006).

I've attached a patch to DERBY-2006 that adds basic support for this
to our top-level build.xml. With the patch running 'ant junitreport'
runs the All suite and generates an HTML report.

andrew

Re: Test count dropping?

Posted by Yip Ng <yi...@gmail.com>.
On 10/26/06, Daniel John Debrunner <dj...@apache.org> wrote:
>
>
> Ant has a mechanism to run tests and produce an HTML report, I hope
> eventually that there will be ant targets to run the derby tests.
> (I thought I'd entered a Jira issue for this, but can't find it).



I couldn't find it either.  I opened a jira for the this. (DERBY-2006).

Yip

Re: Test count dropping?

Posted by Daniel John Debrunner <dj...@apache.org>.
Bryan Pendleton wrote:

> In this new JUnit world, with tests that cleverly enable and disable
> themselves based on environment, configuration, etc., how does a
> developer inspect the JUnit run to verify that the desired set of
> tests actually did get run?

One can use a test runner that shows which tests are run, passed, failed 
etc., such as the swing tester from JUnit or the test runner built into 
Eclipse (right click, Run as Junit on a test class).

Ant has a mechanism to run tests and produce an HTML report, I hope 
eventually that there will be ant targets to run the derby tests.
(I thought I'd entered a Jira issue for this, but can't find it).

There is lots of functionality around JUnit that is out there, by 
standardizing our tests on JUnit we can take advantage of any or all of it.

Thanks,
Dan.



Re: Test count dropping?

Posted by Knut Anders Hatlen <Kn...@Sun.COM>.
Bryan Pendleton <bp...@amberpoint.com> writes:

>>> Did a number of tests recently get removed from derbyall?
>>
>> Most of the JUnit tests have been removed from derbyall. See
>> DERBY-1952. To run the JUnit tests, you now need to invoke a JUnit
>> test runner directly, for instance:
>>
>> java junit.textui.TestRunner \
>>      org.apache.derbyTesting.functionTests.suites.All
>>
> Thanks Knut Anders, that makes perfect sense.
>
> I tried running those tests, and indeed they seem to work in my environment.
> At least, my system whirs and hums for a while and ........ gets printed
> and then OK.
>
> I guess I was feeling a little insecure because I didn't get the
> "traditional" results like derbyall_pass.txt, etc.
>
> In this new JUnit world, with tests that cleverly enable and disable
> themselves based on environment, configuration, etc., how does a
> developer inspect the JUnit run to verify that the desired set of
> tests actually did get run?

That's a good question! I had the same problem earlier today when I
discovered that BlobClob4BlobTest used more time alone than the entire
All suite. The first thing I tried in order to verify that
BlobClob4BlobTest actually was running as part of All, was to start
the Swing test runner (junit.swingui.TestRunner, and remember the
-noloading option!). There I could browse all the test that would be
run, and it did indeed report that BlobClob4BlobTest was being
run. Since I did not completely trust those results (All still ran
faster than BlobClob4BlobTest), I wrote my own test runner which
printed the name of each test case that had been run and how long each
test case had run. Still the same results: BlobClob4BlobTest was
running under All, only faster. I finally found out why (DERBY-2004),
but it took me quite some time to convince myself that the test was
running.

Writing a JUnit test runner is really easy, by the way. I have
attached the test runner I wrote as an example.

-- 
Knut Anders

Re: Test count dropping?

Posted by Bryan Pendleton <bp...@amberpoint.com>.
>> Did a number of tests recently get removed from derbyall?
> 
> Most of the JUnit tests have been removed from derbyall. See
> DERBY-1952. To run the JUnit tests, you now need to invoke a JUnit
> test runner directly, for instance:
> 
> java junit.textui.TestRunner \
>      org.apache.derbyTesting.functionTests.suites.All
> 
Thanks Knut Anders, that makes perfect sense.

I tried running those tests, and indeed they seem to work in my environment.
At least, my system whirs and hums for a while and ........ gets printed
and then OK.

I guess I was feeling a little insecure because I didn't get the
"traditional" results like derbyall_pass.txt, etc.

In this new JUnit world, with tests that cleverly enable and disable
themselves based on environment, configuration, etc., how does a
developer inspect the JUnit run to verify that the desired set of
tests actually did get run?

thanks,

bryan


Re: Test count dropping?

Posted by Knut Anders Hatlen <Kn...@Sun.COM>.
Bryan Pendleton <bp...@amberpoint.com> writes:

> My most recent run of derbyall ran 662 tests.
>
> I can't remember for sure, but I thought that my runs
> late last week were running 669 or 670 tests.
>
> Did a number of tests recently get removed from derbyall?

Most of the JUnit tests have been removed from derbyall. See
DERBY-1952. To run the JUnit tests, you now need to invoke a JUnit
test runner directly, for instance:

java junit.textui.TestRunner \
     org.apache.derbyTesting.functionTests.suites.All

-- 
Knut Anders

Re: Test count dropping?

Posted by Yip Ng <yi...@gmail.com>.
On 10/25/06, Bryan Pendleton <bp...@amberpoint.com> wrote:
>
> My most recent run of derbyall ran 662 tests.
>
> I can't remember for sure, but I thought that my runs
> late last week were running 669 or 670 tests.



I noticed this also.   Last time I ran derbyall was 10/17 and it had 671
tests.
And now with the current trunk (revision 467808), it ran 662 tests only.


Yip