You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by Thomas Fischer <tf...@apache.org> on 2005/09/07 01:48:51 UTC
Torque test (ex runtimetest)
Hi,
I have added into svn two suggestions how to reorganize the old
runtimetest. The problem with the old runtimetest were the following:
- one had to build the generator and the templates separately before
running the test
- it was testing the ant version of the generator and not the
maven-plugin.
- it had problems with the junit task definition, if it was called
with -Dmaven.jest.skip=true
- it was not a runtimetest, but instead it was testing the whole of
torque, and therefore should not be in the runtime part of the
project but reside in an extra location.
These problems have been solved with the two suggestions for the new test
(the functionality and test cases stay the same). They can be found if an
update is made on the trunks subdirectory of the torque svn. There, a new
external svn reference called "test" was added for the suggestions.
The first suggestion puts the test into a maven plugin. The plugin can be
found in the directory test/torque-test-maven-plugin.
The second suggestion creates a test project for the test, and does not
need a plugin. It can be found in the directory test/test-project.
The data needed to test the different databases can be found in the
test/profile directory. At the moment, only an example for mysql is added.
The directory test/base contains some additional scripts which enable one
to build all Torque subprojects before the test is started. For the second
suggestion (test project), this directory could also be merged with the
test project.
To try the first suggestion using the maven plugin, change into the
directory trunks/test/profile/mysql. Adjust the project.properties and
project.xml to fit your setting. Then, run the command
maven torque-test:build-run-plugin
which should install the test plugin and run the test.
At the moment, the plugin remains installed after the test. I did try to
uninstall the plugin automatically, but somehow this crashes at the next
installation of the plugin. I did not try this very hard, no idea whether
this could be brought to work.
To try the second suggestion using the test project, change into the
directory trunks/test/profile/mysql. Adjust the project.xml to contain
your db driver, put your generator settings into project.properties and
the runtime settings in Torque.properties. Then, change into the directory
trunks/test/test-project and run the command
maven -Dtorque.test.profile=mysql torque-test:build-run-project
These suggestions are not meant as a final stage. Documentation is
missing, as well as some licence headers, and some formatting issues are
open.
I'd like to hear your opinion about which test setup suits you better. If
you prefer none of the two scenarios but wish to stay with the old
runtimetest, I'd be interested in ideas how to solve the problems with
the old runtimetest. If you have problems in trying the suggestions, email
to the dev list.
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Torque test (ex runtimetest)
Posted by Thomas Fischer <tf...@apache.org>.
Hi,
Sorry, the automatic installation of the plugin only works the second
time maven torque-test:build-run-plugin is called. For reasons unclear to
me, the target looks for something to delete (which it does not find at
the first install and thus fails).
Thomas
On Tue, 6 Sep 2005, Thomas Fischer wrote:
> Hi,
>
> I have added into svn two suggestions how to reorganize the old runtimetest.
> The problem with the old runtimetest were the following:
> - one had to build the generator and the templates separately before
> running the test
> - it was testing the ant version of the generator and not the
> maven-plugin.
> - it had problems with the junit task definition, if it was called
> with -Dmaven.jest.skip=true
> - it was not a runtimetest, but instead it was testing the whole of
> torque, and therefore should not be in the runtime part of the
> project but reside in an extra location.
>
> These problems have been solved with the two suggestions for the new test
> (the functionality and test cases stay the same). They can be found if an
> update is made on the trunks subdirectory of the torque svn. There, a new
> external svn reference called "test" was added for the suggestions.
>
> The first suggestion puts the test into a maven plugin. The plugin can be
> found in the directory test/torque-test-maven-plugin.
>
> The second suggestion creates a test project for the test, and does not need
> a plugin. It can be found in the directory test/test-project.
>
> The data needed to test the different databases can be found in the
> test/profile directory. At the moment, only an example for mysql is added.
>
> The directory test/base contains some additional scripts which enable one to
> build all Torque subprojects before the test is started. For the second
> suggestion (test project), this directory could also be merged with the test
> project.
>
> To try the first suggestion using the maven plugin, change into the directory
> trunks/test/profile/mysql. Adjust the project.properties and project.xml to
> fit your setting. Then, run the command
> maven torque-test:build-run-plugin
> which should install the test plugin and run the test.
> At the moment, the plugin remains installed after the test. I did try to
> uninstall the plugin automatically, but somehow this crashes at the next
> installation of the plugin. I did not try this very hard, no idea whether
> this could be brought to work.
>
> To try the second suggestion using the test project, change into the
> directory trunks/test/profile/mysql. Adjust the project.xml to contain your
> db driver, put your generator settings into project.properties and the
> runtime settings in Torque.properties. Then, change into the directory
> trunks/test/test-project and run the command
> maven -Dtorque.test.profile=mysql torque-test:build-run-project
>
> These suggestions are not meant as a final stage. Documentation is missing,
> as well as some licence headers, and some formatting issues are
> open.
>
> I'd like to hear your opinion about which test setup suits you better. If you
> prefer none of the two scenarios but wish to stay with the old runtimetest,
> I'd be interested in ideas how to solve the problems with the old
> runtimetest. If you have problems in trying the suggestions, email to the dev
> list.
>
> Thomas
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Torque test (ex runtimetest)
Posted by Thomas Vandahl <th...@tewisoft.de>.
Henning P. Schmiedehausen wrote:
> We might want to build a jar from the current trunk and check whether
> Torque actually still runs with the most recent JCS code.
I can confirm that it does. I'm running with JCS 1.2.6.6 on Torque
3.2-dev and all appears to be fine. Aaron provides pre-built jars in the
tempbuild directory on svn, so I took one of them to try.
Bye, Thomas.
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Torque test (ex runtimetest)
Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
Thomas Vandahl <th...@tewisoft.de> writes:
>> Also: Henning and I are pushing for a JCS release so we can update the
>> version used for Torque 3.2.
>God bless you. It is about time. :-)
We might want to build a jar from the current trunk and check whether
Torque actually still runs with the most recent JCS code.
Best regards
Henning
--
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen INTERMETA GmbH
hps@intermeta.de +49 9131 50 654 0 http://www.intermeta.de/
RedHat Certified Engineer -- Jakarta Turbine Development -- hero for hire
Linux, Java, perl, Solaris -- Consulting, Training, Development
4 - 8 - 15 - 16 - 23 - 42
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Torque test (ex runtimetest)
Posted by Thomas Fischer <fi...@seitenbau.net>.
Thomas Vandahl <th...@tewisoft.de> schrieb am 09.09.2005 16:28:58:
> Scott Eade wrote:
> > The second time I run the test using PostgreSQL I am getting:
> >
> > [junit] org.apache.torque.TorqueException:
> > org.postgresql.util.PSQLException: ERROR: duplicate key violates unique
> > constraint "null_value_table_pkey"
> > [junit]
> > [junit] at
> > org.apache.torque.util.BasePeer.throwTorqueException(BasePeer.java:103)
> > [junit] at
> > org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:626)
> > [junit] at
> > org.apache.torque.util.BasePeer.doInsert(BasePeer.java:516)
> > [junit] at
> > org.apache.torque.test.BaseNullValueTablePeer.
> doInsert(BaseNullValueTablePeer.java:228)
> [...]
> > I doubt if this is showing up in MySQL.
>
> In fact it is. The problem obviously has something to do with the tests
> dumping and restoring data. For the problem to go away it is sufficient
> to remove the sql files from the target directory. Hope that helps a bit.
>
Thanks for the hint. I'll fix it today evening.
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Torque test (ex runtimetest)
Posted by Thomas Vandahl <th...@tewisoft.de>.
Scott Eade wrote:
> The second time I run the test using PostgreSQL I am getting:
>
> [junit] org.apache.torque.TorqueException:
> org.postgresql.util.PSQLException: ERROR: duplicate key violates unique
> constraint "null_value_table_pkey"
> [junit]
> [junit] at
> org.apache.torque.util.BasePeer.throwTorqueException(BasePeer.java:103)
> [junit] at
> org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:626)
> [junit] at
> org.apache.torque.util.BasePeer.doInsert(BasePeer.java:516)
> [junit] at
> org.apache.torque.test.BaseNullValueTablePeer.doInsert(BaseNullValueTablePeer.java:228)
[...]
> I doubt if this is showing up in MySQL.
In fact it is. The problem obviously has something to do with the tests
dumping and restoring data. For the problem to go away it is sufficient
to remove the sql files from the target directory. Hope that helps a bit.
> Also: Henning and I are pushing for a JCS release so we can update the
> version used for Torque 3.2.
God bless you. It is about time. :-)
Bye, Thomas.
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Torque test (ex runtimetest)
Posted by Scott Eade <se...@backstagetech.com.au>.
The second time I run the test using PostgreSQL I am getting:
[junit] org.apache.torque.TorqueException:
org.postgresql.util.PSQLException: ERROR: duplicate key violates unique
constraint "null_value_table_pkey"
[junit]
[junit] at
org.apache.torque.util.BasePeer.throwTorqueException(BasePeer.java:103)
[junit] at
org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:626)
[junit] at
org.apache.torque.util.BasePeer.doInsert(BasePeer.java:516)
[junit] at
org.apache.torque.test.BaseNullValueTablePeer.doInsert(BaseNullValueTablePeer.java:228)
[junit] at
org.apache.torque.test.BaseNullValueTablePeer.doInsert(BaseNullValueTablePeer.java:592)
[junit] at
org.apache.torque.test.BaseNullValueTable.save(BaseNullValueTable.java:519)
[junit] at
org.apache.torque.test.BaseNullValueTable.save(BaseNullValueTable.java:483)
[junit] at
org.apache.torque.test.BaseNullValueTable.save(BaseNullValueTable.java:463)
[junit] at
org.apache.torque.DataTest.testDataDump(DataTest.java:247)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[junit] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[junit] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[junit] Caused by: org.postgresql.util.PSQLException: ERROR:
duplicate key violates unique constraint "null_value_table_pkey"
I suspected it might be caused by a missing:
autoIncrement="true"
in the schema for the table NULL_VALUE_TABLE, but apparently this is not
the case.
If I run maven clean I can execute the test again.
Sorry I have no solution for you - I spent enough time today getting up
to speed with the new structure.
I doubt if this is showing up in MySQL.
BTW: Recall the confusion over whether or not Torque will create the DB
for you with PostgreSQL... well it does, but the userid needs to be
granted permission to create them.
Also: Henning and I are pushing for a JCS release so we can update the
version used for Torque 3.2.
Scott
--
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au
Thomas Fischer wrote:
> Hi,
>
> I have added into svn two suggestions how to reorganize the old
> runtimetest. The problem with the old runtimetest were the following:
> - one had to build the generator and the templates separately before
> running the test
> - it was testing the ant version of the generator and not the
> maven-plugin.
> - it had problems with the junit task definition, if it was called
> with -Dmaven.jest.skip=true
> - it was not a runtimetest, but instead it was testing the whole of
> torque, and therefore should not be in the runtime part of the
> project but reside in an extra location.
>
> These problems have been solved with the two suggestions for the new
> test (the functionality and test cases stay the same). They can be
> found if an update is made on the trunks subdirectory of the torque
> svn. There, a new external svn reference called "test" was added for
> the suggestions.
>
> The first suggestion puts the test into a maven plugin. The plugin can
> be found in the directory test/torque-test-maven-plugin.
>
> The second suggestion creates a test project for the test, and does
> not need a plugin. It can be found in the directory test/test-project.
>
> The data needed to test the different databases can be found in the
> test/profile directory. At the moment, only an example for mysql is
> added.
>
> The directory test/base contains some additional scripts which enable
> one to build all Torque subprojects before the test is started. For
> the second suggestion (test project), this directory could also be
> merged with the test project.
>
> To try the first suggestion using the maven plugin, change into the
> directory trunks/test/profile/mysql. Adjust the project.properties and
> project.xml to fit your setting. Then, run the command
> maven torque-test:build-run-plugin
> which should install the test plugin and run the test.
> At the moment, the plugin remains installed after the test. I did try
> to uninstall the plugin automatically, but somehow this crashes at the
> next installation of the plugin. I did not try this very hard, no idea
> whether this could be brought to work.
>
> To try the second suggestion using the test project, change into the
> directory trunks/test/profile/mysql. Adjust the project.xml to contain
> your db driver, put your generator settings into project.properties
> and the runtime settings in Torque.properties. Then, change into the
> directory
> trunks/test/test-project and run the command
> maven -Dtorque.test.profile=mysql torque-test:build-run-project
>
> These suggestions are not meant as a final stage. Documentation is
> missing, as well as some licence headers, and some formatting issues are
> open.
>
> I'd like to hear your opinion about which test setup suits you better.
> If you prefer none of the two scenarios but wish to stay with the old
> runtimetest, I'd be interested in ideas how to solve the problems with
> the old runtimetest. If you have problems in trying the suggestions,
> email to the dev list.
>
> Thomas
>
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org