db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3156) Convert testing of derby error stream to JUnit
Date Wed, 07 Nov 2007 14:33:50 GMT

    [ https://issues.apache.org/jira/browse/DERBY-3156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540756

Knut Anders Hatlen commented on DERBY-3156:

Thanks for updating the patch, Vemund.

I tried to run the test standalone, but then all test cases failed with errors like this one:

1) testDefault(org.apache.derbyTesting.functionTests.tests.engine.ErrorStreamTest)java.io.FileNotFoundException:
/method-1.log (No such file or directory)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
        at org.apache.derbyTesting.functionTests.tests.engine.ErrorStreamTest$9.run(ErrorStreamTest.java:502)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.derbyTesting.functionTests.tests.engine.ErrorStreamTest.newFileOutputStream(ErrorStreamTest.java:499)
        at org.apache.derbyTesting.functionTests.tests.engine.ErrorStreamTest.openStreams(ErrorStreamTest.java:360)
        at org.apache.derbyTesting.functionTests.tests.engine.ErrorStreamTest.setUp(ErrorStreamTest.java:100)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:95)

If I first run another test and don't delete the 'system' directory, it works fine. Seems
like openStreams() requires that the database directory exists.


The method deleteFileOnExit() is now unused and can be deleted.

Perhaps the assert methods that throw IOException would have been simpler if they had thrown
Exception instead? Then we could skip the try/catch+cast. The PrivilegedActionException will
be linked to the IOException, so we will still get the stack trace, and if someone changes
the code so that we can get other exceptions than IOException, we get the original exception
instead of a ClassCastException.

> Convert testing of derby error stream to JUnit
> ----------------------------------------------
>                 Key: DERBY-3156
>                 URL: https://issues.apache.org/jira/browse/DERBY-3156
>             Project: Derby
>          Issue Type: Test
>          Components: Test
>            Reporter: Vemund Østgaard
>            Assignee: Vemund Østgaard
>            Priority: Minor
>         Attachments: 3156-diff, 3156-diff.stat, 3156-diffv2, 3156-diffv2.stat, 3156-diffv3,
> Convert the tests that are related to derby error stream properties and functionality.
> Seems to be these two tests:
> lang/logStream.java 
> lang/errorStream.java

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message