You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Jean Morissette <je...@gmail.com> on 2005/12/22 06:13:01 UTC

How to specify the classpath in test harness

Hi devs,
   I try to figure how the test harness works, however I don't
understand how the classpath is set.  It seems to be set from a system
property named "classpath".  However, running the class RunTest in
debug mode, the property "classpath" is null!  So the execution fail.

Also, if I change the property name for "java.class.path" instead of
"classpath", the test classpath is set to that of the running JVM. 
However, this also don't work because there are some whitespaces (by
exemple, C:\Program Files\...) in the classpath that the
jvm.getCommandLine() method doesn't expect (because this method
tokenizes with whitespace).

So, my question is how to specify the classpath to run a test?  Am I
missing something?
I use version 10.1.2.0

Thanks for your help,
-Jean

Re: How to specify the classpath in test harness

Posted by Rick Hillegas <Ri...@Sun.COM>.
Hi Jean,

I find that I have to wire in  the following:

o All of the jar files in trunk/tools/java
o The compiled Derby class tree
o The DB2JCC jar and license file

I'm attaching a script which I use to setup the classpath.

Regards,
-Rick

Jean Morissette wrote:

>Hi devs,
>   I try to figure how the test harness works, however I don't
>understand how the classpath is set.  It seems to be set from a system
>property named "classpath".  However, running the class RunTest in
>debug mode, the property "classpath" is null!  So the execution fail.
>
>Also, if I change the property name for "java.class.path" instead of
>"classpath", the test classpath is set to that of the running JVM. 
>However, this also don't work because there are some whitespaces (by
>exemple, C:\Program Files\...) in the classpath that the
>jvm.getCommandLine() method doesn't expect (because this method
>tokenizes with whitespace).
>
>So, my question is how to specify the classpath to run a test?  Am I
>missing something?
>I use version 10.1.2.0
>
>Thanks for your help,
>-Jean
>  
>


Re: How to specify the classpath in test harness

Posted by Andrew McIntyre <mc...@gmail.com>.
On Dec 21, 2005, at 9:13 PM, Jean Morissette wrote:

> I try to figure how the test harness works, however I don't
> understand how the classpath is set.  It seems to be set from a system
> property named "classpath".  However, running the class RunTest in
> debug mode, the property "classpath" is null!  So the execution fail.
>
> Also, if I change the property name for "java.class.path" instead of
> "classpath", the test classpath is set to that of the running JVM.
> However, this also don't work because there are some whitespaces (by
> exemple, C:\Program Files\...) in the classpath that the
> jvm.getCommandLine() method doesn't expect (because this method
> tokenizes with whitespace).
>
> So, my question is how to specify the classpath to run a test?

Hi Jean,

The test harness uses the classpath for the JVM which executes  
RunTest or RunSuite. I had thought that paths with spaces would be  
acceptable, but if not, you will need to alter your classpath to use  
canonical paths for Windows, such as "C:\Progra~1\MyDir~1\derby.jar"

In case you didn't find it, please also see the testing readme file at:

http://svn.apache.org/repos/asf/db/derby/code/trunk/java/testing/ 
README.htm

and let us know if you continue to have difficulty running the tests.

Thanks,
andrew