I seem to have had to build the target "derbytestingjar" first. This is mentioned in the document (on my system):
file:///Users/brett/Development/derby/10.8/java/testing/README.htm#intro but it is mentioned after the Quickstart and Running Test section. I am also a little confused about this as it says: In the trunk codeline (10.3 and later) Derby is migrating testing using JUnit. All new tests are being written using JUnit and a number of the older harness based tests have been converted. Since the conversion is ongoing the current JUnit state is not represented in this file, sections 1 onwards apply to running tests using the old harness which still applies to a significant number of tests. Currently to run the complete set of tests two runs are required, run the harness based tests decribed in this document and then running all the JUnit bases tests. I guess if I followed that last sentence, I would have built the "derbytestingjar" target and then by the time I got around to building the 'junit-all" target, it would have been okay. ________________________________________ From: Rick Hillegas [[email protected]] Sent: Wednesday, August 03, 2011 8:59 AM To: [email protected] Subject: Re: Need help in running tests Hi Brett, You can also run the tests outside of ant. Here's what I do: 1) Set up my classpath to include the following: - the jars in tools/java (including the junit jar) - the derby jars which I have built - the xalan jars 2) Then issue the following command: java -XX:MaxPermSize=128M -Xmx512m -Dderby.system.durability=test -Dderby.tests.ThreadsMinutes=2x1 junit.textui.TestRunner org.apache.derbyTesting.functionTests.suites.All As an experiment, I tried running junit-all. Seemed to work for me. I saw the following output (then I killed the run): Buildfile: build.xml junit-init-nocp: [mkdir] Created dir: /Users/rh161140/derby/mainline/trunk/junit_20110803_0545/testout junit-init: emit-junit-classpath-jars: [echo] Running with jars: /Users/rh161140/derby/mainline/trunk/jars/sane [echo] CLASSPATH (environment variable): ${env.CLASSPATH} emit-junit-classpath: junit-core: [junit] Running org.apache.derbyTesting.junit.EnvTest [junit] Tests run: 9, Failures: 0, Errors: 0, Time elapsed: 1.581 sec [junit] Running org.apache.derbyTesting.functionTests.tests.jdbcapi.AutoloadTest [junit] Tests run: 15, Failures: 0, Errors: 0, Time elapsed: 44.52 sec [junit] Running org.apache.derbyTesting.functionTests.tests.jdbcapi.JDBCDriversEmbeddedTest [junit] Tests run: 14, Failures: 0, Errors: 0, Time elapsed: 1.611 sec [junit] Running org.apache.derbyTesting.functionTests.tests.jdbcapi.JDBCDriversClientTest [junit] Tests run: 15, Failures: 0, Errors: 0, Time elapsed: 42.37 sec [junit] Running org.apache.derbyTesting.functionTests.tests.jdbcapi.JDBCDriversAllTest What are you seeing on the console when you run the junit-all target? Thanks, -Rick On 8/2/11 6:55 PM, Bergquist, Brett wrote: > I am trying to run the current test using the ant target "junit-all", but all > tests fail. Obviously I have not setup something in my environment. For > example in one test, I see the following: > > <error message="org.apache.derbyTesting.functionTests.tests.demo._Suite" > type="java.lang.ClassNotFoundException">java.lang.ClassNotFoundException: > org.apache.derbyTesting.functionTests.tests.demo._Suite > at java.net.URLClassLoader$1.run(URLClassLoader.java:202) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:190) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) > at java.lang.ClassLoader.loadClass(ClassLoader.java:247) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:169) > </error> > > Probably a classpath issue but I have looked through the various wiki pages > and have not found the one I need to specify the environment. Note that I do > have junit.jar in tools/java. > > Can someone point me to where I need to look to for the proper setup. I wan > to write the JUnit test for the changed functionality that this JIRA issue > covers. > > Thanks. > > Brett > ________________________________________ > From: Rick Hillegas (JIRA) [[email protected]] > Sent: Tuesday, August 02, 2011 2:02 PM > To: [email protected] > Subject: [jira] [Commented] (DERBY-5370) The toSQL method of the > org.apache.derby.vti.Restriction class does not output correct constants for > VARCHAR, Timestamp, Date, Time, or CHAR FOR BIT DATA types > > [ > https://issues.apache.org/jira/browse/DERBY-5370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13078316#comment-13078316 > ] > > Rick Hillegas commented on DERBY-5370: > -------------------------------------- > > Thanks for that quick response, Brett. In case you haven't stumbled across > this material yet, a good place to start is > http://wiki.apache.org/db-derby/DerbyTesting . RestrictedVTITest is a JUnit > test so the material on JUnit testing is particularly relevant. > >> The toSQL method of the org.apache.derby.vti.Restriction class does not >> output correct constants for VARCHAR, Timestamp, Date, Time, or CHAR FOR BIT >> DATA types >> --------------------------------------------------------------------------------------------------------------------------------------------------------------- >> >> Key: DERBY-5370 >> URL: https://issues.apache.org/jira/browse/DERBY-5370 >> Project: Derby >> Issue Type: Bug >> Components: SQL >> Affects Versions: 10.8.1.2 >> Reporter: Brett Bergquist >> Attachments: derby-5370.diff >> >> >> The toSQL method of the org.apache.derby.vti.Restriction class does not >> output correct constants for VARCHAR, Timestamp, Date, Time, or CHAR FOR BIT >> DATA types. This method is useful for building the WHERE clause when >> implementing a Restricted Table Function. The result of calling the toSQL >> method with restrictions on columns of these types does not produce valid >> SQL constants. For example with a VARCHAR column being restricted the >> single quote characters are not placed round the string constant. > -- > This message is automatically generated by JIRA. > For more information on JIRA, see: http://www.atlassian.com/software/jira > > > > >
