db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michelle Caisse <Michelle.Cai...@Sun.COM>
Subject Running a Derby JUnit test using JUnit directly
Date Thu, 31 Aug 2006 16:13:08 GMT
Hi Dan, Susan,

I'm having trouble trying to run a Derby JUnit test outside of the 
harness. I've tried three ways of running a test based on the example 
and other information at 
http://wiki.apache.org/db-derby/DerbyJUnitTesting and in 
java/testing/README.htm. None works.  Here's what I get:

[1]
c:/Program Files/Java/jdk1.6.0/bin/java -Djava.security.manager 
-Djava.security.policy=derby_tests.policy 
-Dderby.system.home=/cygdrive/c/derby/derby/qe/javasrc/webapps/jdbc4 -cp 
c:/derby/derby/qe/javasrc/webapps/jdbc4//build/WEB-INF/classes/;c:/httpunit-1.6/lib/httpunit.jar;c:/db-derby-10.2.1.1/lib/derbyclient.jar;c:/db-derby-10.2.1.1/lib/derbynet.jar;c:/db-derby-10.2.1.1/lib/derby.jar;c:/db-derby-10.2.1.1/test/derbyTesting.jar;c:/junit3.8.1/junit.jar

junit.textui.TestRunner 
org.apache.derbyTesting.functionTests.tests.jdbcapi.ProcedureTest

Failed to invoke suite():java.lang.ExceptionInInitializerError

[2]
c:/Program Files/Java/jdk1.6.0/bin/java 
-Dderby.system.home=/cygdrive/c/derby/derby/qe/javasrc/webapps/jdbc4 -cp 
c:/derby/derby/qe/javasrc/webapps/jdbc4//build/WEB-INF/classes/;c:/httpunit-1.6/lib/httpunit.jar;c:/db-derby-10.2.1.1/lib/derbyclient.jar;c:/db-derby-10.2.1.1/lib/derbynet.jar;c:/db-derby-10.2.1.1/lib/derby.jar;c:/db-derby-10.2.1.1/test/derbyTesting.jar;c:/junit3.8.1/junit.jar

junit.textui.TestRunner 
org.apache.derbyTesting.functionTests.tests.jdbcapi.ProcedureTest

.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.EEE
Time: 6.594
There were 29 errors:
1) 
testExecuteQueryWithNoDynamicResultSets(org.apache.derbyTesting.functionTests.tests.jdbcapi.ProcedureTest)java.sql.SQLException:

Java exception: 'access denied (java.util.PropertyPermission user.dir 
read): java.security.AccessControlException'.
        at 
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown 
Source)
        at 
org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown 
Source)
        at 
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown 
Source)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown 
Source)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown 
Source)
        at org.apache.derby.impl.jdbc.Util.javaException(Unknown Source)
        at 
org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown 
Source)
        at 
org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown 
Source)
        at 
org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown 
Source)
        at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown 
Source)
        at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown 
Source)
        at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
        at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:185)
        at 
org.apache.derbyTesting.junit.TestConfiguration.openConnection(Unknown 
Source)
        at 
org.apache.derbyTesting.junit.TestConfiguration.openDefaultConnection(Unknown 
Source)
        at 
org.apache.derbyTesting.junit.BaseJDBCTestCase.openDefaultConnection(Unknown 
Source)
        at 
org.apache.derbyTesting.junit.BaseJDBCTestCase.getConnection(Unknown Source)
        at 
org.apache.derbyTesting.functionTests.tests.jdbcapi.ProcedureTest.setUp(Unknown 
Source)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(Unknown 
Source)
        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.sql.SQLException: Java exception: 'access denied 
(java.util.PropertyPermission user.dir read): 
java.security.AccessControlException'.
        ... 43 more
...
FAILURES!!!
Tests run: 27,  Failures: 0,  Errors: 29

[3]
c:/Program Files/Java/jdk1.6.0/bin/java -DnoSecurityManager=true 
-Dderby.system.home=/cygdrive/c/derby/derby/qe/javasrc/webapps/jdbc4 -cp 
c:/derby/derby/qe/javasrc/webapps/jdbc4//build/WEB-INF/classes/;c:/httpunit-1.6/lib/httpunit.jar;c:/db-derby-10.2.1.1/lib/derbyclient.jar;c:/db-derby-10.2.1.1/lib/derbynet.jar;c:/db-derby-10.2.1.1/lib/derby.jar;c:/db-derby-10.2.1.1/test/derbyTesting.jar;c:/junit
3.8.1/junit.jar junit.textui.TestRunner 
org.apache.derbyTesting.functionTests.tests.jdbcapi.ProcedureTest

.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.EEE
Time: 2.64
There were 29 errors:
1) 
testExecuteQueryWithNoDynamicResultSets(org.apache.derbyTesting.functionTests.tests.jdbcapi.ProcedureTest)java.sql.SQLException:

Java exception: 'access denied (java.util.PropertyPermission user.dir 
read): java.security.AccessControlException'.
        at 
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown 
Source)
        at 
org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown 
Source)
        at 
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown 
Source)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown 
Source)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown 
Source)
        at org.apache.derby.impl.jdbc.Util.javaException(Unknown Source)
        at 
org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown 
Source)
        at 
org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown 
Source)
        at 
org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown 
Source)
        at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown 
Source)
        at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown 
Source)
        at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
        at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:185)
        at 
org.apache.derbyTesting.junit.TestConfiguration.openConnection(Unknown 
Source)
        at 
org.apache.derbyTesting.junit.TestConfiguration.openDefaultConnection(Unknown 
Source)
        at 
org.apache.derbyTesting.junit.BaseJDBCTestCase.openDefaultConnection(Unknown 
Source)
        at 
org.apache.derbyTesting.junit.BaseJDBCTestCase.getConnection(Unknown Source)
        at 
org.apache.derbyTesting.functionTests.tests.jdbcapi.ProcedureTest.setUp(Unknown 
Source)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(Unknown 
Source)
        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.sql.SQLException: Java exception: 'access denied 
(java.util.PropertyPermission user.dir read): 
java.security.AccessControlException'.
        ... 43 more
Caused by: java.sql.SQLException: Java exception: 'access denied 
(java.util.PropertyPermission user.dir read): 
java.security.AccessControlException'.
        ... 28 more

FAILURES!!!
Tests run: 27,  Failures: 0,  Errors: 29

Any ideas?

Thanks,
Michelle


Mime
View raw message