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 David Van Couvering <Da...@Sun.COM> on 2006/05/09 02:25:48 UTC

Confounded by jdbc40 test suite

Hi, all.  I am switching over to Solaris x86, and although I can run 
jdbc40 fine on XP, on Solaris I get the same behavior I get on Linux: it 
happily runs along and skips all tests.

I explicitly run the jdk 1.6 version of the java interpreter:

/usr/jdk/jdk1.6.0/bin/java 
org.apache.derbyTesting.functionTests.harness.RunSuite jdbc40

but in the report it says it is running JDK 1.4:

------------------ Java Information ------------------
Java Version:    1.4.2_06
Java Vendor:     Sun Microsystems Inc.
Java home:       /usr/j2se/jre
[cut]
Test Run Started: 2006-05-08 17:13:16.0
Test Run Duration: 00:00:06

0 Tests Run
  0% Pass (0 tests passed)
  0% Fail (0 tests failed)
0 Suites skipped


My JAVA_HOME also points to jdk 1.6

How do I stop RunSuite from pointing to /usr/j2se/jre?

Thanks!

David

Re: Confounded by jdbc40 test suite

Posted by David Van Couvering <Da...@Sun.COM>.
Great, thanks for all the great tips!

David

Knut Anders Hatlen wrote:
> Kristian Waagan <Kr...@Sun.COM> writes:
> 
>> Andrew McIntyre wrote:
>>
>>> On 5/8/06, David Van Couvering <Da...@sun.com> wrote:
>>>
>>>> Hi, all.  I am switching over to Solaris x86, and although I can run
>>>> jdbc40 fine on XP, on Solaris I get the same behavior I get on Linux: it
>>>> happily runs along and skips all tests.
>>>>
>>>> I explicitly run the jdk 1.6 version of the java interpreter:
>>>>
>>>> /usr/jdk/jdk1.6.0/bin/java
>>>> org.apache.derbyTesting.functionTests.harness.RunSuite jdbc40
>>>>
>>>> My JAVA_HOME also points to jdk 1.6
>>>>
>>>> How do I stop RunSuite from pointing to /usr/j2se/jre?
>>>
>>> RunTest spawns new processes with Runtime.exec(), which inherits your
>>> current environment (which presumably has /usr/j2se/jre in the PATH).
>>> The test harness just calls "java ..." which ends up being the one in
>>> /usr/j2se/jre in the forked process.
>>>
>>> So, put it in your path. If you really want to call it explicitly and
>>> not put it in your path for some reason, then you need to also pass
>>> the full path in as the javaCmd property:
>>>
>>> java -DjavaCmd=/usr/jdk/jdk1.6.0/bin/java
>>> org.apache.derby.functionTests...
>>
>> FYI, this also works (in bash):
>> PATH=/usr/jdk/jdk1.6.0/bin/:${PATH} java
>> org.apache.derbyTesting.functionTests.harness.RunSuite jdbc40
>>
>> I use this in my test scripts, mostly because I set several other
>> enviroment variables as well.
> 
> You can also create a script called java and put it first in your
> PATH:
> 
> ----
> #!/bin/sh
> 
> exec $JAVA_HOME/bin/java "$@"
> ----
> 
> Then you always get the JVM pointed to by JAVA_HOME. You could create
> a similar script for javac. I use this so that I can easily switch
> between different JVMs.
> 

Re: Confounded by jdbc40 test suite

Posted by Knut Anders Hatlen <Kn...@Sun.COM>.
Kristian Waagan <Kr...@Sun.COM> writes:

> Andrew McIntyre wrote:
>
>> On 5/8/06, David Van Couvering <Da...@sun.com> wrote:
>>
>>> Hi, all.  I am switching over to Solaris x86, and although I can run
>>> jdbc40 fine on XP, on Solaris I get the same behavior I get on Linux: it
>>> happily runs along and skips all tests.
>>>
>>> I explicitly run the jdk 1.6 version of the java interpreter:
>>>
>>> /usr/jdk/jdk1.6.0/bin/java
>>> org.apache.derbyTesting.functionTests.harness.RunSuite jdbc40
>>>
>>> My JAVA_HOME also points to jdk 1.6
>>>
>>> How do I stop RunSuite from pointing to /usr/j2se/jre?
>>
>>
>> RunTest spawns new processes with Runtime.exec(), which inherits your
>> current environment (which presumably has /usr/j2se/jre in the PATH).
>> The test harness just calls "java ..." which ends up being the one in
>> /usr/j2se/jre in the forked process.
>>
>> So, put it in your path. If you really want to call it explicitly and
>> not put it in your path for some reason, then you need to also pass
>> the full path in as the javaCmd property:
>>
>> java -DjavaCmd=/usr/jdk/jdk1.6.0/bin/java
>> org.apache.derby.functionTests...
>
>
> FYI, this also works (in bash):
> PATH=/usr/jdk/jdk1.6.0/bin/:${PATH} java
> org.apache.derbyTesting.functionTests.harness.RunSuite jdbc40
>
> I use this in my test scripts, mostly because I set several other
> enviroment variables as well.

You can also create a script called java and put it first in your
PATH:

----
#!/bin/sh

exec $JAVA_HOME/bin/java "$@"
----

Then you always get the JVM pointed to by JAVA_HOME. You could create
a similar script for javac. I use this so that I can easily switch
between different JVMs.

-- 
Knut Anders

Re: Confounded by jdbc40 test suite

Posted by Kristian Waagan <Kr...@Sun.COM>.
Andrew McIntyre wrote:

> On 5/8/06, David Van Couvering <Da...@sun.com> wrote:
>
>> Hi, all.  I am switching over to Solaris x86, and although I can run
>> jdbc40 fine on XP, on Solaris I get the same behavior I get on Linux: it
>> happily runs along and skips all tests.
>>
>> I explicitly run the jdk 1.6 version of the java interpreter:
>>
>> /usr/jdk/jdk1.6.0/bin/java
>> org.apache.derbyTesting.functionTests.harness.RunSuite jdbc40
>>
>> My JAVA_HOME also points to jdk 1.6
>>
>> How do I stop RunSuite from pointing to /usr/j2se/jre?
>
>
> RunTest spawns new processes with Runtime.exec(), which inherits your
> current environment (which presumably has /usr/j2se/jre in the PATH).
> The test harness just calls "java ..." which ends up being the one in
> /usr/j2se/jre in the forked process.
>
> So, put it in your path. If you really want to call it explicitly and
> not put it in your path for some reason, then you need to also pass
> the full path in as the javaCmd property:
>
> java -DjavaCmd=/usr/jdk/jdk1.6.0/bin/java 
> org.apache.derby.functionTests...


FYI, this also works (in bash):
PATH=/usr/jdk/jdk1.6.0/bin/:${PATH} java 
org.apache.derbyTesting.functionTests.harness.RunSuite jdbc40

I use this in my test scripts, mostly because I set several other 
enviroment variables as well.


--
Kristian

>
> andrew



Re: Confounded by jdbc40 test suite

Posted by Andrew McIntyre <mc...@gmail.com>.
On 5/8/06, David Van Couvering <Da...@sun.com> wrote:
> Hi, all.  I am switching over to Solaris x86, and although I can run
> jdbc40 fine on XP, on Solaris I get the same behavior I get on Linux: it
> happily runs along and skips all tests.
>
> I explicitly run the jdk 1.6 version of the java interpreter:
>
> /usr/jdk/jdk1.6.0/bin/java
> org.apache.derbyTesting.functionTests.harness.RunSuite jdbc40
>
> My JAVA_HOME also points to jdk 1.6
>
> How do I stop RunSuite from pointing to /usr/j2se/jre?

RunTest spawns new processes with Runtime.exec(), which inherits your
current environment (which presumably has /usr/j2se/jre in the PATH).
The test harness just calls "java ..." which ends up being the one in
/usr/j2se/jre in the forked process.

So, put it in your path. If you really want to call it explicitly and
not put it in your path for some reason, then you need to also pass
the full path in as the javaCmd property:

java -DjavaCmd=/usr/jdk/jdk1.6.0/bin/java org.apache.derby.functionTests...

andrew