From a quick look (and based on your observation), the xml file ends up in the wrong place. It is
probably better to set the resourcedir in your profile to test/resources and add an includes
directive to include the shared directory, instead of specifying the directory shared being the
resources directory.
So instead of :
(this is in your default profile)
build
directorytarget/test/directory
finalName${artifactId}-${version}-test/finalName
resources
resource
directorysrc/main/resources/shared/directory
excludes
exclude**/_svn/**/exclude
/excludes
/resource
try something like this :
resource
directorysrc/main/resources/directory
includes
includeshared/**/include
/includes
excludesblahdieblah/excludes
/resource
Mvgr,
Martin
devillina wrote:
Hi i have a project with some Junit tests, when i run these in eclipse
(clicking on them -- run as -- Junittest) thing work fine. No failed
tests.
When i run mvn test, all my DBunit tests fail (the junit tests that are not
dbunit test work fine)
i see the following error in my log:
---
Test set:
be.delaware.samples.jpetstore.source.dao.ibatis.SqlMapAccountDaoTest
---
Tests run: 5, Failures: 0, Errors: 5, Skipped: 0, Time elapsed: 0.1 sec
FAILURE!
testGetAccountString(be.delaware.samples.jpetstore.source.dao.ibatis.SqlMapAccountDaoTest)
Time elapsed: 0.01 sec ERROR!
org.dbunit.dataset.DataSetException: java.net.MalformedURLException
at
org.dbunit.dataset.xml.FlatXmlProducer.produce(FlatXmlProducer.java:169)
at org.dbunit.dataset.CachedDataSet.init(CachedDataSet.java:71)
at org.dbunit.dataset.xml.FlatXmlDataSet.init(FlatXmlDataSet.java:200)
at org.dbunit.dataset.xml.FlatXmlDataSet.init(FlatXmlDataSet.java:187)
at
be.delaware.samples.jpetstore.source.dao.ibatis.SqlMapAccountDaoTest.getDataSet(SqlMapAccountDaoTest.java:45)
at
org.dbunit.DatabaseTestCase.executeOperation(DatabaseTestCase.java:87)
at org.dbunit.DatabaseTestCase.setUp(DatabaseTestCase.java:104)
at
be.delaware.samples.jpetstore.source.dao.ibatis.SqlMapAccountDaoTest.setUp(SqlMapAccountDaoTest.java:24)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:210)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:135)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:122)
at org.apache.maven.surefire.Surefire.run(Surefire.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:225)
at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:747)
java.net.MalformedURLException
at java.net.URL.init(Unknown Source)
at java.net.URL.init(Unknown Source)
at java.net.URL.init(Unknown Source)
at
org.apache.xerces.impl.XMLEntityManager.startEntity(XMLEntityManager.java:796)
at
org.apache.xerces.impl.XMLEntityManager.startDocumentEntity(XMLEntityManager.java:741)
at
org.apache.xerces.impl.XMLDocumentScannerImpl.setInputSource(XMLDocumentScannerImpl.java:260)
at
org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:498)
at
org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:580)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
at
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1169)
at
org.dbunit.dataset.xml.FlatXmlProducer.produce(FlatXmlProducer.java:145)
at org.dbunit.dataset.CachedDataSet.init(CachedDataSet.java:71)
at org.dbunit.dataset.xml.FlatXmlDataSet.init(FlatXmlDataSet.java:200)
at