Re: Does anyone know how to use the maven DBUnit plugin?

2006-08-24 Thread mraible



Ray Tsang wrote:
 
 i'm using dbunit ant task to load initial data.. i have something like
 the following in profiles section of the pom.xml.  it will execute
 when `mvn -DloadData=true`
 
 profile
   iddbunit-load-data/id
   activation
 property
   nameloadData/name
   valuetrue/value
 /property
   /activation
   build
 plugins
   plugin
 artifactIdmaven-antrun-plugin/artifactId
 executions
   execution
 idprocess-classes/id
 phaseprocess-classes/phase
 goals
   goalrun/goal
 /goals
 configuration
   tasks
 property value=CLEAN_INSERT name=operation /
 property value=src/test/sql/test-data.xml
 name=file /
 taskdef name=dbunit
   classname=org.dbunit.ant.DbUnitTask /
 dbunit driver=${database.driver}
   url=${database.url}
   userid=${database.username}
   password=${database.password}
   supportBatchStatement=false
   operation type=${operation}
 src=${file} format=xml /
 /dbunit
   /tasks
 /configuration
   /execution
 /executions
 dependencies
   dependency
 groupId${database.dependency.groupId}/groupId
 artifactId${database.dependency.artifactId}/artifactId
 version${database.dependency.version}/version
   /dependency
   dependency
 groupIddbunit/groupId
 artifactIddbunit/artifactId
 version2.1/version
   /dependency
   dependency
 groupIdant/groupId
 artifactIdant-nodeps/artifactId
 version1.6.5/version
 scopecompile/scope
   /dependency
   dependency
 groupIdcom.sun/groupId
 artifactIdtools/artifactId
 version1.5/version
 scopesystem/scope
 systemPath${java.home}/../lib/tools.jar/systemPath
   /dependency
 /dependencies
   /plugin
 /plugins
   /build
 /profile
 

I'm using a similar setup (see XML below), but having a couple of issues. 

1. Is it possible to have the task invoked at the beginning of the test
phase?  Using phasetest/phase invokes it after running all the tests.  I
want it to run before. Using phasetest-compile/phase works, but seems to
be one phase behind what I want. 

2. How do I load a properties file in to set the ${...} properties?  It
tried property
file=${project.build.sourceResources}/database.properties/ and it doesn't
work.I get the following error:

Embedded error: Class Not Found: JDBC driver ${jdbc.driverClassName} could
not be loaded


plugin
artifactIdmaven-antrun-plugin/artifactId
version1.1/version
executions
execution
phasetest-compile/phase
configuration
tasks
property
file=${project.build.sourceResources}/database.properties/
condition property=operation
value=MSSQL_CLEAN_INSERT else=CLEAN_INSERT
equals arg1=${database.type}
arg2=sqlserver/
/condition

property name=file
value=resources/dbunit/sample-data.xml/
taskdef name=dbunit
classname=org.dbunit.ant.DbUnitTask/
dbunit driver=${jdbc.driverClassName}
supportBatchStatement=false
url=${jdbc.url}
userid=${jdbc.username}
password=${jdbc.password}
operation type=${operation}
src=${file} format=xml/
/dbunit
/tasks
/configuration
goals
goalrun/goal
/goals
/execution
/executions
dependencies
dependency
groupIddbunit/groupId
artifactIddbunit/artifactId
version2.1/version
/dependency
/dependencies
/plugin

Thanks,

Matt

P.S. Anyone know if a DbUnit plugin that's being developed for M2?
-- 
View this message in context: 
http://www.nabble.com/Does-anyone-know-how-to-use-the-maven-DBUnit-plugin--tf1857895.html#a5969492
Sent from the Maven - Users forum at Nabble.com.



Re: Does anyone know how to use the maven DBUnit plugin?

2006-06-28 Thread Marco Mistroni

HI Rick,
 have written an example using EJB3/TestNG.. it uses dbunit for clearing db
tables...
it's here

http://docs.codehaus.org/display/MAVENUSER/Examples


i usedno plugin at alli just wrote a test that handle database will
this help?

hth
marco

On 6/27/06, Rick [EMAIL PROTECTED] wrote:




A sample pom.xml would be cool. I've used the DBUnit ant tasks and am
looking for some sample for Maven2 and DBUnit.





I looked around but there seem to be no DBUnit maven task documents.



http://jroller.com/page/RickHigh?entry=getting_dbunit_to_work_with









RE: Does anyone know how to use the maven DBUnit plugin?

2006-06-28 Thread Rick
Thanks Marco.
I will take a look.

-Original Message-
From: Marco Mistroni [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 28, 2006 12:43 AM
To: Maven Users List
Subject: Re: Does anyone know how to use the maven DBUnit plugin?

HI Rick,
  have written an example using EJB3/TestNG.. it uses dbunit for clearing db
tables...
it's here

http://docs.codehaus.org/display/MAVENUSER/Examples


i usedno plugin at alli just wrote a test that handle database will
this help?

hth
 marco

On 6/27/06, Rick [EMAIL PROTECTED] wrote:



 A sample pom.xml would be cool. I've used the DBUnit ant tasks and am
 looking for some sample for Maven2 and DBUnit.





 I looked around but there seem to be no DBUnit maven task documents.



 http://jroller.com/page/RickHigh?entry=getting_dbunit_to_work_with









-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Does anyone know how to use the maven DBUnit plugin?

2006-06-27 Thread Ray Tsang

i'm using dbunit ant task to load initial data.. i have something like
the following in profiles section of the pom.xml.  it will execute
when `mvn -DloadData=true`

profile
 iddbunit-load-data/id
 activation
   property
 nameloadData/name
 valuetrue/value
   /property
 /activation
 build
   plugins
 plugin
   artifactIdmaven-antrun-plugin/artifactId
   executions
 execution
   idprocess-classes/id
   phaseprocess-classes/phase
   goals
 goalrun/goal
   /goals
   configuration
 tasks
   property value=CLEAN_INSERT name=operation /
   property value=src/test/sql/test-data.xml name=file /
   taskdef name=dbunit
 classname=org.dbunit.ant.DbUnitTask /
   dbunit driver=${database.driver}
 url=${database.url}
 userid=${database.username}
 password=${database.password}
 supportBatchStatement=false
 operation type=${operation}
   src=${file} format=xml /
   /dbunit
 /tasks
   /configuration
 /execution
   /executions
   dependencies
 dependency
   groupId${database.dependency.groupId}/groupId
   artifactId${database.dependency.artifactId}/artifactId
   version${database.dependency.version}/version
 /dependency
 dependency
   groupIddbunit/groupId
   artifactIddbunit/artifactId
   version2.1/version
 /dependency
 dependency
   groupIdant/groupId
   artifactIdant-nodeps/artifactId
   version1.6.5/version
   scopecompile/scope
 /dependency
 dependency
   groupIdcom.sun/groupId
   artifactIdtools/artifactId
   version1.5/version
   scopesystem/scope
   systemPath${java.home}/../lib/tools.jar/systemPath
 /dependency
   /dependencies
 /plugin
   /plugins
 /build
   /profile

On 6/27/06, Rick Hightower [EMAIL PROTECTED] wrote:

A sample pom.xml would be cool. I've used the DBUnit ant tasks and am
looking for some sample for Maven2 and DBUnit.





I looked around but there seem to be no DBUnit maven task documents.



http://jroller.com/page/RickHigh?entry=getting_dbunit_to_work_with









-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Does anyone know how to use the maven DBUnit plugin?

2006-06-27 Thread Rick
Thanks Ray. I found out the DBUnit Maven plugin is not done yet. This will
come in handy. 



-Original Message-
From: Ray Tsang [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 27, 2006 2:16 PM
To: Maven Users List
Subject: Re: Does anyone know how to use the maven DBUnit plugin?

i'm using dbunit ant task to load initial data.. i have something like
the following in profiles section of the pom.xml.  it will execute
when `mvn -DloadData=true`

profile
  iddbunit-load-data/id
  activation
property
  nameloadData/name
  valuetrue/value
/property
  /activation
  build
plugins
  plugin
artifactIdmaven-antrun-plugin/artifactId
executions
  execution
idprocess-classes/id
phaseprocess-classes/phase
goals
  goalrun/goal
/goals
configuration
  tasks
property value=CLEAN_INSERT name=operation /
property value=src/test/sql/test-data.xml name=file
/
taskdef name=dbunit
  classname=org.dbunit.ant.DbUnitTask /
dbunit driver=${database.driver}
  url=${database.url}
  userid=${database.username}
  password=${database.password}
  supportBatchStatement=false
  operation type=${operation}
src=${file} format=xml /
/dbunit
  /tasks
/configuration
  /execution
/executions
dependencies
  dependency
groupId${database.dependency.groupId}/groupId
artifactId${database.dependency.artifactId}/artifactId
version${database.dependency.version}/version
  /dependency
  dependency
groupIddbunit/groupId
artifactIddbunit/artifactId
version2.1/version
  /dependency
  dependency
groupIdant/groupId
artifactIdant-nodeps/artifactId
version1.6.5/version
scopecompile/scope
  /dependency
  dependency
groupIdcom.sun/groupId
artifactIdtools/artifactId
version1.5/version
scopesystem/scope
systemPath${java.home}/../lib/tools.jar/systemPath
  /dependency
/dependencies
  /plugin
/plugins
  /build
/profile

On 6/27/06, Rick Hightower [EMAIL PROTECTED] wrote:
 A sample pom.xml would be cool. I've used the DBUnit ant tasks and am
 looking for some sample for Maven2 and DBUnit.





 I looked around but there seem to be no DBUnit maven task documents.



 http://jroller.com/page/RickHigh?entry=getting_dbunit_to_work_with








-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Does anyone know how to use the maven DBUnit plugin?

2006-06-27 Thread Ray Tsang

no problems rick.  i was hoping that some useful plugins can be
released... e.g. dbunit, hibernate3... but in the mean time, the only
way i know of executing them are through ant tasks like that.

ray,

On 6/27/06, Rick [EMAIL PROTECTED] wrote:

Thanks Ray. I found out the DBUnit Maven plugin is not done yet. This will
come in handy.



-Original Message-
From: Ray Tsang [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 27, 2006 2:16 PM
To: Maven Users List
Subject: Re: Does anyone know how to use the maven DBUnit plugin?

i'm using dbunit ant task to load initial data.. i have something like
the following in profiles section of the pom.xml.  it will execute
when `mvn -DloadData=true`

profile
  iddbunit-load-data/id
  activation
property
  nameloadData/name
  valuetrue/value
/property
  /activation
  build
plugins
  plugin
artifactIdmaven-antrun-plugin/artifactId
executions
  execution
idprocess-classes/id
phaseprocess-classes/phase
goals
  goalrun/goal
/goals
configuration
  tasks
property value=CLEAN_INSERT name=operation /
property value=src/test/sql/test-data.xml name=file
/
taskdef name=dbunit
  classname=org.dbunit.ant.DbUnitTask /
dbunit driver=${database.driver}
  url=${database.url}
  userid=${database.username}
  password=${database.password}
  supportBatchStatement=false
  operation type=${operation}
src=${file} format=xml /
/dbunit
  /tasks
/configuration
  /execution
/executions
dependencies
  dependency
groupId${database.dependency.groupId}/groupId
artifactId${database.dependency.artifactId}/artifactId
version${database.dependency.version}/version
  /dependency
  dependency
groupIddbunit/groupId
artifactIddbunit/artifactId
version2.1/version
  /dependency
  dependency
groupIdant/groupId
artifactIdant-nodeps/artifactId
version1.6.5/version
scopecompile/scope
  /dependency
  dependency
groupIdcom.sun/groupId
artifactIdtools/artifactId
version1.5/version
scopesystem/scope
systemPath${java.home}/../lib/tools.jar/systemPath
  /dependency
/dependencies
  /plugin
/plugins
  /build
/profile

On 6/27/06, Rick Hightower [EMAIL PROTECTED] wrote:
 A sample pom.xml would be cool. I've used the DBUnit ant tasks and am
 looking for some sample for Maven2 and DBUnit.





 I looked around but there seem to be no DBUnit maven task documents.



 http://jroller.com/page/RickHigh?entry=getting_dbunit_to_work_with








-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Does anyone know how to use the maven DBUnit plugin?

2006-06-27 Thread Wendy Smoak

On 6/27/06, Rick [EMAIL PROTECTED] wrote:


Thanks Ray. I found out the DBUnit Maven plugin is not done yet. This will
come in handy.


I added a Wiki page with a link to this thread... please feel free to
improve it with a complete example. :)

* http://docs.codehaus.org/display/MAVENUSER/DBUnit+Plugin

--
Wendy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Does anyone know how to use the maven DBUnit plugin?

2006-06-27 Thread Johann Reyes
Hello Ray

Actually before the crash the hibernate3 plugin was going to be released,
but the server crashed. Now after the crash I can't deploy a hibernate3
snapshot, I believe is a specific bug in cargo for me to deploy a successful
snapshot, so I'm waiting for it to be fixed. As soon as I can successfully
deploy again, I'll take it up to vote again and then release it. 

Regards

Johann Reyes

-Original Message-
From: Ray Tsang [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 27, 2006 7:21 PM
To: Maven Users List
Subject: Re: Does anyone know how to use the maven DBUnit plugin?

no problems rick.  i was hoping that some useful plugins can be
released... e.g. dbunit, hibernate3... but in the mean time, the only
way i know of executing them are through ant tasks like that.

ray,

On 6/27/06, Rick [EMAIL PROTECTED] wrote:
 Thanks Ray. I found out the DBUnit Maven plugin is not done yet. This will
 come in handy.



 -Original Message-
 From: Ray Tsang [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 27, 2006 2:16 PM
 To: Maven Users List
 Subject: Re: Does anyone know how to use the maven DBUnit plugin?

 i'm using dbunit ant task to load initial data.. i have something like
 the following in profiles section of the pom.xml.  it will execute
 when `mvn -DloadData=true`

 profile
   iddbunit-load-data/id
   activation
 property
   nameloadData/name
   valuetrue/value
 /property
   /activation
   build
 plugins
   plugin
 artifactIdmaven-antrun-plugin/artifactId
 executions
   execution
 idprocess-classes/id
 phaseprocess-classes/phase
 goals
   goalrun/goal
 /goals
 configuration
   tasks
 property value=CLEAN_INSERT name=operation /
 property value=src/test/sql/test-data.xml
name=file
 /
 taskdef name=dbunit
   classname=org.dbunit.ant.DbUnitTask /
 dbunit driver=${database.driver}
   url=${database.url}
   userid=${database.username}
   password=${database.password}
   supportBatchStatement=false
   operation type=${operation}
 src=${file} format=xml /
 /dbunit
   /tasks
 /configuration
   /execution
 /executions
 dependencies
   dependency
 groupId${database.dependency.groupId}/groupId
 artifactId${database.dependency.artifactId}/artifactId
 version${database.dependency.version}/version
   /dependency
   dependency
 groupIddbunit/groupId
 artifactIddbunit/artifactId
 version2.1/version
   /dependency
   dependency
 groupIdant/groupId
 artifactIdant-nodeps/artifactId
 version1.6.5/version
 scopecompile/scope
   /dependency
   dependency
 groupIdcom.sun/groupId
 artifactIdtools/artifactId
 version1.5/version
 scopesystem/scope
 systemPath${java.home}/../lib/tools.jar/systemPath
   /dependency
 /dependencies
   /plugin
 /plugins
   /build
 /profile

 On 6/27/06, Rick Hightower [EMAIL PROTECTED] wrote:
  A sample pom.xml would be cool. I've used the DBUnit ant tasks and am
  looking for some sample for Maven2 and DBUnit.
 
 
 
 
 
  I looked around but there seem to be no DBUnit maven task documents.
 
 
 
  http://jroller.com/page/RickHigh?entry=getting_dbunit_to_work_with
 
 
 
 
 
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]