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 Daniel John Debrunner <dj...@debrunners.com> on 2005/05/05 21:02:33 UTC

running tests with j9?

The README file for the testing implies that the tests should run with
IBM's wsdd5.6 (aka j9). Are there any examples on how to do this?

I tried this, with my classpath just set to include the Derby stuff, but
I get a java.lang.Object not found.


c:/wsdd5.6/ive/bin/j9 -jcl:Max
org.apache.derbyTesting.functionTests.harness.RunTest lang/insert.sql

I see the jvm class in the test harness for j9 adds a -Xbootclass path,
but that would only affect the JVM spawned to run the test. Do I need a
similar -Xbootclasspath for the j9 vm used to start RunTest?

Thanks,
Dan.


Re: running tests with j9?

Posted by Daniel John Debrunner <dj...@debrunners.com>.
Myrna van Lunteren wrote:
> After a night's sleep, I realize you probably need to have a jvm class
> for j9_foundation for wctme5.7. We had such a jvm class in the harness
> dir with earlier cloudscape versions for wsdd5.0 or wsdd5.5, but with
> wsdd5.6 the combo jcl-java.sql was not supported, so I didn't
> contribute that class.
> 
> I should probably make one for wctme5.7 - jcl foundation. Or are you
> working on it already?

I was heading towards it, but I'm sure you could get it done a lot
quicker than I can. So, please go ahead.

Though, I do see this as a flaw with the test harness, that some code
may need to be written to test Derby on a new VM. Creates a barrier to
anyone wanting to test on a new VM, especially outside to confines of
the usual VMs. That's why I would like Derby to move to JUnit.

Thanks,
Dan.


Re: running tests with j9?

Posted by Daniel John Debrunner <dj...@debrunners.com>.
Myrna van Lunteren wrote:

> Well, I have a j9_foundation.java, and only needed 1 tiny change to
> RunTest but when I tried to test, I found that ij still needs
> java.sql.Driver. So I can't actually test this until I/you/someone
> modifies ij...
> 
> So, here is j9_foundation for now, please let me know if it doesn't work...

Thanks, that works great!

I'll commit it with one minor modification, to set the profile flag as
'jcl:foun10' rather than 'jcl:foun'.

I'll work on committing other changes to allow the tests to be run under
J2ME/CDC/Foundation/JSR169 without java.sql.Driver not found errors, etc.


Dan.



Re: running tests with j9?

Posted by Myrna van Lunteren <m....@gmail.com>.
Well, I have a j9_foundation.java, and only needed 1 tiny change to
RunTest but when I tried to test, I found that ij still needs
java.sql.Driver. So I can't actually test this until I/you/someone
modifies ij...

So, here is j9_foundation for now, please let me know if it doesn't work...




Myrna


On 5/13/05, Daniel John Debrunner <dj...@debrunners.com> wrote:
> Myrna van Lunteren wrote:
> 
> >>>>Note that with foundation, with wsdd5.6 there is no support for
> >>>>java.sql.* (you'll get an incompatible library error if you try) and
> >>>>with wctme5.7 foundation you are supposed to use jdbc.jar (again,
> >>>>database_enabler.jar will give incompatible library with jclFoun).
> >>>>Jdbc.jar does not have (for example) java.sql.DriverManager as that
> >>>>class is not in JSR169. So with foundation you have to run the test
> >>>>harness with java.sql.DataSource. I've never tried that.
> >>>
> >>>I have though :-)
> >>
> >>And? Details, please?
> 
> Sorry it took a while, I had to remember how to get the quoting correct
> in a shell script so I could provide a working example.
> BTW the tets harness property jvmflags is not documented in the testing
> read me file.
> 
> The test harness uses the ij properties ij.driver and ij.database (set
> to a JDBC URL) to specify the default connection for the tests. This
> works for .sql tests and .java tests that use the ij utility to start
> the database. However ij also supports similar properties to get the
> default connection via a datasource, and these override
> ij.driver/database :-)
> 
> ij.dataSource=<classname of data source>
> 
> Set the properties with any number of
> ij.dataSource.<bean property>=<value>
> 
> So here is an extract of a script to run tests using the (current :-)
> standard Derby data source
> 
> Dan.
> 
> -------
> 
> ds="-Dij.dataSource=org.apache.derby.jdbc.EmbeddedDataSource
> -Dij.dataSource.databaseName=wombat -Dij.dataSource.createDatabase=create"
> 
> # ensure flags are passed onto the spawned vm
> dsj="-Djvmflags=${ds}"
> 
> ${jre}/bin/java ${ds} "${dsj}"
> org.apache.derbyTesting.functionTests.harness.RunTest $*
> 
>

Re: running tests with j9?

Posted by Daniel John Debrunner <dj...@debrunners.com>.
Myrna van Lunteren wrote:


>>>>Note that with foundation, with wsdd5.6 there is no support for
>>>>java.sql.* (you'll get an incompatible library error if you try) and
>>>>with wctme5.7 foundation you are supposed to use jdbc.jar (again,
>>>>database_enabler.jar will give incompatible library with jclFoun).
>>>>Jdbc.jar does not have (for example) java.sql.DriverManager as that
>>>>class is not in JSR169. So with foundation you have to run the test
>>>>harness with java.sql.DataSource. I've never tried that.
>>>
>>>I have though :-)
>>
>>And? Details, please?

Sorry it took a while, I had to remember how to get the quoting correct
in a shell script so I could provide a working example.
BTW the tets harness property jvmflags is not documented in the testing
read me file.

The test harness uses the ij properties ij.driver and ij.database (set
to a JDBC URL) to specify the default connection for the tests. This
works for .sql tests and .java tests that use the ij utility to start
the database. However ij also supports similar properties to get the
default connection via a datasource, and these override
ij.driver/database :-)

ij.dataSource=<classname of data source>

Set the properties with any number of
ij.dataSource.<bean property>=<value>

So here is an extract of a script to run tests using the (current :-)
standard Derby data source

Dan.

-------

ds="-Dij.dataSource=org.apache.derby.jdbc.EmbeddedDataSource
-Dij.dataSource.databaseName=wombat -Dij.dataSource.createDatabase=create"

# ensure flags are passed onto the spawned vm
dsj="-Djvmflags=${ds}"

${jre}/bin/java ${ds} "${dsj}"
org.apache.derbyTesting.functionTests.harness.RunTest $*


Re: running tests with j9?

Posted by Myrna van Lunteren <m....@gmail.com>.
After a night's sleep, I realize you probably need to have a jvm class
for j9_foundation for wctme5.7. We had such a jvm class in the harness
dir with earlier cloudscape versions for wsdd5.0 or wsdd5.5, but with
wsdd5.6 the combo jcl-java.sql was not supported, so I didn't
contribute that class.

I should probably make one for wctme5.7 - jcl foundation. Or are you
working on it already?

Myrna

On 5/12/05, Myrna van Lunteren <m....@gmail.com> wrote:
> On 5/12/05, Daniel John Debrunner <dj...@debrunners.com> wrote:
> > Myrna van Lunteren wrote:
> >
> > > On 5/12/05, Daniel John Debrunner <dj...@debrunners.com> wrote:
> >
> > >
> > >>One more question, how does the test harness map from the j9 vm to the
> > >>j9_13.java representation of the JVM?
> >
> > Any idea on this question?
> In RunList & RunTest.java the harness checks the value of some java
> system properties. So, if the java.vm.name is j9, it goes into
> checking the minor and major version based on java.vm.version, via the
> class javaVersionHolder, and it figures out that we either want j9_13
> (for everything up to - which means practically just - 2.1, which
> comes with wsdd5.6) or j9_22 (for java.vm.version 2.2- which comes
> with wctme5.7).
> For any subsequent versions we'll have to add more specifics...
> >
> > >>
> > >>Onto CDC/Foundation ...
> > >
> > > Note that with foundation, with wsdd5.6 there is no support for
> > > java.sql.* (you'll get an incompatible library error if you try) and
> > > with wctme5.7 foundation you are supposed to use jdbc.jar (again,
> > > database_enabler.jar will give incompatible library with jclFoun).
> > > Jdbc.jar does not have (for example) java.sql.DriverManager as that
> > > class is not in JSR169. So with foundation you have to run the test
> > > harness with java.sql.DataSource. I've never tried that.
> >
> > I have though :-)
> 
> And? Details, please?
> >
> > Dan.
> >
> >
>

Re: running tests with j9?

Posted by Myrna van Lunteren <m....@gmail.com>.
On 5/12/05, Daniel John Debrunner <dj...@debrunners.com> wrote:
> Myrna van Lunteren wrote:
> 
> > On 5/12/05, Daniel John Debrunner <dj...@debrunners.com> wrote:
> 
> >
> >>One more question, how does the test harness map from the j9 vm to the
> >>j9_13.java representation of the JVM?
> 
> Any idea on this question?
In RunList & RunTest.java the harness checks the value of some java
system properties. So, if the java.vm.name is j9, it goes into
checking the minor and major version based on java.vm.version, via the
class javaVersionHolder, and it figures out that we either want j9_13
(for everything up to - which means practically just - 2.1, which
comes with wsdd5.6) or j9_22 (for java.vm.version 2.2- which comes
with wctme5.7).
For any subsequent versions we'll have to add more specifics...
> 
> >>
> >>Onto CDC/Foundation ...
> >
> > Note that with foundation, with wsdd5.6 there is no support for
> > java.sql.* (you'll get an incompatible library error if you try) and
> > with wctme5.7 foundation you are supposed to use jdbc.jar (again,
> > database_enabler.jar will give incompatible library with jclFoun).
> > Jdbc.jar does not have (for example) java.sql.DriverManager as that
> > class is not in JSR169. So with foundation you have to run the test
> > harness with java.sql.DataSource. I've never tried that.
> 
> I have though :-)

And? Details, please?
> 
> Dan.
> 
>

Re: running tests with j9?

Posted by Daniel John Debrunner <dj...@debrunners.com>.
Myrna van Lunteren wrote:

> On 5/12/05, Daniel John Debrunner <dj...@debrunners.com> wrote:

> 
>>One more question, how does the test harness map from the j9 vm to the
>>j9_13.java representation of the JVM?

Any idea on this question?

>>
>>Onto CDC/Foundation ...
> 
> Note that with foundation, with wsdd5.6 there is no support for
> java.sql.* (you'll get an incompatible library error if you try) and
> with wctme5.7 foundation you are supposed to use jdbc.jar (again,
> database_enabler.jar will give incompatible library with jclFoun).
> Jdbc.jar does not have (for example) java.sql.DriverManager as that
> class is not in JSR169. So with foundation you have to run the test
> harness with java.sql.DataSource. I've never tried that.

I have though :-)

Dan.



Re: running tests with j9?

Posted by Myrna van Lunteren <m....@gmail.com>.
On 5/12/05, Daniel John Debrunner <dj...@debrunners.com> wrote:
> Myrna van Lunteren wrote:
> 
> > Is it possible JAVA_HOME is pointing to another jvm?
> > It would be one situation where you'd get the error you mention.
> 
> Yep that was the problem, unsetting JAVA_HOME in my script fixed the
> problem.
> 
> > And then it is required to add the bootclasspath to the location of
> > the java.sql classes (e.g. database_enabler.jar), which is an
> > additional package, or you'll get java.sql.SQLException not found. If
> > you either specify the other main jvm libraries (classes.zip,
> > charconv.zip) in the bootclasspath, or specify the java.sql jar/dir
> > explicitly in combination with -jcl:max it will work better.
> >
> > So: j9 -jcl:max
> > -Xbootclasspath/p:c:/wsdd5.6/ive/lib/database_enabler.jar
> > -Dbootcp=c:/wsdd5.6/ive/lib/database_enabler.jar
> > org.apache.derbyTesting.functionTests.harness.RunTest ...
> 
> The above worked for me, but in my wsdd5.6 distribution
> database_enabler.jar was under ive/lib/jclMax.
I think when I downloaded wsdd5.6 I actually got a directory with
java.sql.* under jclMax. database_enabler.jar was a separate effort
but supposedly the same.
> 
> In WCTME 5.7, however it is under ive/lib
> 
With wctme5.7 downloading the java package did not give a directory,
like wsdd5.6, but database_enabler.jar (to be used with jclMax). I
think it ended up under features in the tool for me. I never
questioned the packaging.
> One more question, how does the test harness map from the j9 vm to the
> j9_13.java representation of the JVM?
> 
> Onto CDC/Foundation ...
Note that with foundation, with wsdd5.6 there is no support for
java.sql.* (you'll get an incompatible library error if you try) and
with wctme5.7 foundation you are supposed to use jdbc.jar (again,
database_enabler.jar will give incompatible library with jclFoun).
Jdbc.jar does not have (for example) java.sql.DriverManager as that
class is not in JSR169. So with foundation you have to run the test
harness with java.sql.DataSource. I've never tried that.
> 
> Thanks,
> Dan.
> 
> 

Myrna

Re: running tests with j9?

Posted by Daniel John Debrunner <dj...@debrunners.com>.
Myrna van Lunteren wrote:

> Is it possible JAVA_HOME is pointing to another jvm?
> It would be one situation where you'd get the error you mention.

Yep that was the problem, unsetting JAVA_HOME in my script fixed the
problem.

> And then it is required to add the bootclasspath to the location of
> the java.sql classes (e.g. database_enabler.jar), which is an
> additional package, or you'll get java.sql.SQLException not found. If
> you either specify the other main jvm libraries (classes.zip,
> charconv.zip) in the bootclasspath, or specify the java.sql jar/dir
> explicitly in combination with -jcl:max it will work better.
> 
> So: j9 -jcl:max
> -Xbootclasspath/p:c:/wsdd5.6/ive/lib/database_enabler.jar
> -Dbootcp=c:/wsdd5.6/ive/lib/database_enabler.jar
> org.apache.derbyTesting.functionTests.harness.RunTest ...

The above worked for me, but in my wsdd5.6 distribution
database_enabler.jar was under ive/lib/jclMax.

In WCTME 5.7, however it is under ive/lib

One more question, how does the test harness map from the j9 vm to the
j9_13.java representation of the JVM?

Onto CDC/Foundation ...

Thanks,
Dan.




Re: running tests with j9?

Posted by Myrna van Lunteren <m....@gmail.com>.
Is it possible JAVA_HOME is pointing to another jvm?
It would be one situation where you'd get the error you mention.

And then it is required to add the bootclasspath to the location of
the java.sql classes (e.g. database_enabler.jar), which is an
additional package, or you'll get java.sql.SQLException not found. If
you either specify the other main jvm libraries (classes.zip,
charconv.zip) in the bootclasspath, or specify the java.sql jar/dir
explicitly in combination with -jcl:max it will work better.

So: j9 -jcl:max
-Xbootclasspath/p:c:/wsdd5.6/ive/lib/database_enabler.jar
-Dbootcp=c:/wsdd5.6/ive/lib/database_enabler.jar
org.apache.derbyTesting.functionTests.harness.RunTest ...

I can't right now remember if it always finds charconv.zip
automatically, for some of the localization tests this may be required
in the bootclasspath as well.

There are no examples in the testing README because 1. I wanted to
keep the doc focused on more standard jvms and 2 these bootclasspath
details are not necessarily something to do with the test harness, but
more with j9...

Myrna

On 5/5/05, Daniel John Debrunner <dj...@debrunners.com> wrote:
> The README file for the testing implies that the tests should run with
> IBM's wsdd5.6 (aka j9). Are there any examples on how to do this?
> 
> I tried this, with my classpath just set to include the Derby stuff, but
> I get a java.lang.Object not found.
> 
> c:/wsdd5.6/ive/bin/j9 -jcl:Max
> org.apache.derbyTesting.functionTests.harness.RunTest lang/insert.sql
> 
> I see the jvm class in the test harness for j9 adds a -Xbootclass path,
> but that would only affect the JVM spawned to run the test. Do I need a
> similar -Xbootclasspath for the j9 vm used to start RunTest?
> 
> Thanks,
> Dan.
> 
>