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-1903) Convert largedata/LobLimits.java to junit
Date Wed, 20 Jul 2011 20:10:57 GMT

    [ https://issues.apache.org/jira/browse/DERBY-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13068594#comment-13068594
] 

Knut Anders Hatlen commented on DERBY-1903:
-------------------------------------------

To reproduce the NullPointerException, just run the testClobNegative test case by itself.
For example by making this change to LobLimitsLiteTest.suite():

@@ -54,7 +54,7 @@
     public static Test suite() {
         // Right now run just with embeddded.
         Test test = new CleanDatabaseTestSetup(
-                new TestSuite(LobLimitsTest.class)) {
+                new LobLimitsTest("testClobNegative")) {
                     protected void decorateSQL(Statement s)
                             throws SQLException {
                         setupTables(s,_1MB, _100K);

The NPE seems to happen because the reader that is is closed in the finally block is null.
But the actual error, which is hidden by the error in the finally block, is a FileNotFoundException:

1) testClobNegative(org.apache.derbyTesting.functionTests.tests.largedata.LobLimitsTest)java.io.FileNotFoundException:
extinout/charLobLimits.txt (No such file or directory)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:120)
	at java.io.FileReader.<init>(FileReader.java:55)
	at org.apache.derbyTesting.functionTests.util.PrivilegedFileOpsForTests$6.run(PrivilegedFileOpsForTests.java:183)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.derbyTesting.functionTests.util.PrivilegedFileOpsForTests.getFileReader(PrivilegedFileOpsForTests.java:179)
	at org.apache.derbyTesting.functionTests.tests.largedata.LobLimitsTest.insertClob2(LobLimitsTest.java:994)
	at org.apache.derbyTesting.functionTests.tests.largedata.LobLimitsTest.negativeSpaceTruncationTest(LobLimitsTest.java:439)
	at org.apache.derbyTesting.functionTests.tests.largedata.LobLimitsTest.testClobNegative(LobLimitsTest.java:344)

> Convert  largedata/LobLimits.java to junit
> ------------------------------------------
>
>                 Key: DERBY-1903
>                 URL: https://issues.apache.org/jira/browse/DERBY-1903
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Test
>            Reporter: V.Narayanan
>            Assignee: Kathey Marsden
>            Priority: Minor
>              Labels: LOB
>         Attachments: DERBY-1903_liteToAllPackages_diff.txt, derby-1903_addsuites_diff.txt,
derby-1903_client_diff.txt, derby-1903_embeddedp1_diff.txt
>
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message