db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Siddharth Srivastava (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-4249) Create a simple store recovery test in JUnit
Date Sat, 30 Jul 2011 14:36:09 GMT

     [ https://issues.apache.org/jira/browse/DERBY-4249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Siddharth Srivastava updated DERBY-4249:
----------------------------------------

    Attachment: derby4249.diff

Hi

Thanks for your suggestions Dag, Knut, Kathey.
I have incorporated all the suggestions 

As far as Security Manager is concerned, I expected a FilePermissions issue. Without disabling
the security issue, following error is thrown:

.java.security.AccessControlException: access denied (java.io.FilePermission C:\
Program Files\Java\jre6\bin\java execute)
        at java.security.AccessControlContext.checkPermission(Unknown Source)
        at java.security.AccessController.checkPermission(Unknown Source)
        at java.lang.SecurityManager.checkPermission(Unknown Source)
        at java.lang.SecurityManager.checkExec(Unknown Source)
        at java.lang.ProcessBuilder.start(Unknown Source)
        at java.lang.Runtime.exec(Unknown Source)
        at java.lang.Runtime.exec(Unknown Source)
        at org.apache.derbyTesting.junit.BaseTestCase$8.run(BaseTestCase.java:56
6)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.derbyTesting.junit.BaseTestCase.execJavaCmd(BaseTestCase.j
ava:562)
        at org.apache.derbyTesting.junit.BaseTestCase.assertLaunchedJUnitFixture
(BaseTestCase.java:832)
        at org.apache.derbyTesting.functionTests.tests.store.RecoveryTest.testBa
sicRecovery(RecoveryTest.java:67)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at junit.framework.TestCase.runTest(TestCase.java:164)
        at junit.framework.TestCase.runBare(TestCase.java:130)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:
106)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:120)
        at junit.framework.TestSuite.runTest(TestSuite.java:230)
        at junit.framework.TestSuite.run(TestSuite.java:225)
        at junit.framework.TestSuite.runTest(TestSuite.java:230)
        at junit.framework.TestSuite.run(TestSuite.java:225)
        at junit.textui.TestRunner.doRun(TestRunner.java:121)
        at junit.textui.TestRunner.start(TestRunner.java:185)
        at junit.textui.TestRunner.main(TestRunner.java:143)
F
Time: 13.915
There was 1 failure:
1) testBasicRecovery(org.apache.derbyTesting.functionTests.tests.store.RecoveryT
est)junit.framework.AssertionFailedError: Unexpected row count: expected:<1> but
 was:<0>
        at org.apache.derbyTesting.junit.JDBC.assertFullResultSetMinion(JDBC.jav
a:1020)
        at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:935)

        at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:892)

        at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:850)

        at org.apache.derbyTesting.functionTests.tests.store.RecoveryTest.assert
Database(RecoveryTest.java:111)
        at org.apache.derbyTesting.functionTests.tests.store.RecoveryTest.testBa
sicRecovery(RecoveryTest.java:68)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:
106)

FAILURES!!!
Tests run: 1,  Failures: 1,  Errors: 0


I am executing it with Administrative privileges and have revoked read only permissions from
the concerned java directory. 
So Is this issue faced only by me (hoping that my platform specific issues are not back again)


> Create a simple store recovery test in JUnit
> --------------------------------------------
>
>                 Key: DERBY-4249
>                 URL: https://issues.apache.org/jira/browse/DERBY-4249
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.6.1.0
>            Reporter: Kathey Marsden
>            Assignee: Siddharth Srivastava
>            Priority: Minor
>         Attachments: d4249.diff, d4249_1.diff, d4249_2.diff, d4249_3.diff, derby4249.diff
>
>
> It would be good to be able to start converting the store  recovery tests  or at least
be able to write new recovery tests in JUnit.   We could start by writing a simple recovery
test just to establish the framework.  The test should.
> -  Connect, create a table, commit and shutdown the database.
> -  fork a jvm, add one row, commit, add another row, exit  the jvm.
> -  Reconnect with the first jvm and verify that the first row is there and the second
is not.
> I guess the main thing to decide is how to spawn the second jvm and check results.  
 I tend to think the second jvm should actually execute another JUnit test, verify the exit
code (assuming a failed test has a non-zero exit code) and then put the output in the fail
assertion if it fails so it shows up in the report at the end of the Suite execution.   I
think we could create a test runner that takes a class and a specific test to run instead
of the whole suite, so we could keep our methods consolidated in a single class for the test,
but all pure conjecture at this point.  I'll have to give it a try, but wanted to first see
if folks thought this was a reasonable approach.
>  

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

        

Mime
View raw message