db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vemund Ostgaard <Vemund.Ostga...@Sun.COM>
Subject Re: test harness and jvmoptions
Date Fri, 02 Jun 2006 13:02:16 GMT
Myrna van Lunteren wrote:

> On 5/31/06, Vemund Ostgaard <Vemund.Ostgaard@sun.com> wrote:
>
>> Hello,
>>
>> I am trying to get the test harness to specify a flag to the jvm when
>> new jvms are started to execute tests/testsuites, but I have got it
>> wrong somehow. I want to supply either -d32 or -d64 option to the Sun
>> jvm (on linux or solaris) to force tests to run in either 32-bit or
>> 64-bit environment. Based on reading the testing readme, I concluded
>> that setting the 'jvmflags' systemproperty was the correct way to do 
>> this.
>>
>> What I have tried is:
>>
>> java -d32 -Djvmflags="-d32"
>> org.apache.derbyTesting.functionTests.harness.RunSuite derbytools
>>
>> The result is that all tests fail with:
>>
>> Exception in thread "main" java.lang.NoClassDefFoundError: "-d32"
>>
>> Anyone got any advice on how to correctly get the test harness to use a
>> specific flag/argument when starting new jvms?
>>
>>
>> Thanks,
>> Vemund
>>
> :-(
> The jvmflag passing is broken (not sure how well it ever worked).
> See also DERBY-1091.
> I intend to work on that this week...But it's a big can of worms.
>
> But try without the quotes...

With or without quotes (both single and double) seems to behave the same 
way for me. I see from the harness log that the tests are executed in 
the same way in any case, with double quotes around the jvmflags value 
"-d32":

Top suite: derbytools
Suite to run: derbytools:derbytools
Now do RunList
Now run the suite's tests
Run the tests...
Execute command: java -DjavaCmd=java -Djvmflags="-d32" 
-Doutputdir=/export/home/tmp/jagtmp/vo136787derbytools/derbytools_0/log/derbytools/derbytools

-Dtopsuitedir=/export/home/tmp/jagtmp/vo136787derbytools/derbytools_0/log/derbytools 
-Dtopreportdir=/export/home/tmp/jagtmp/vo136787derbytools/derbytools_0/log/derbytools 
-Drundir=/export/home/tmp/jagtmp/vo136787derbytools/derbytools_0/log 
-DtestSpecialProps=hostName=localhost -Dsuitename=derbytools:derbytools 
-Dtopsuitename=derbytools 
org.apache.derbyTesting.functionTests.harness.RunTest tools/dblook_test.java

The description of suns java launcher says: "By default, the first 
non-option argument is the name of the class to be invoked."
Since I get a NoClassDefFoundError, it seems as if my -d32 option is 
considered as the java class to invoke and not as an option, possibly 
because of the quotes around it? I don't really understand why the 
harness passes the -d32 option to the jvm with the double quotes around it.

>
> Otherwise, if your need is temporary and urgent and you can make
> (temporary) changes to the source you can see if you can add the flag
> in the jvm subclass for the jvm you're using (e.g.
> org/apache/derbyTesting/functionTests/harness/jdk16.java)

I looked a little at this code, and RunTest, RunList etc. Seems to me 
that RunList places double quotes around the jvmflags, wether you have 
done so or not, before passing it on to RunTest, where it is eventually 
executed with Runtime.exec. If Runtime.exec had executed a command shell 
(which again executed java) I guess the quotes would be removed, but 
since it executes java directly they are not.

I thought maybe the reason this didn't work for me was because I used a 
non-standard option only supported by some jvms/versions, and that other 
standard options where handled specifically by the harness, but trying 
this with a regular -D option gave me the same behavior.

Vemund


Mime
View raw message