Deal of the Day

Home » Main » Manning Forums » 2002 » Java Development with Ant

Thread: Problems with junit.

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 1 - Pages: 1 - Last Post: Dec 28, 2006 7:17 PM by: dmahendarkar
dmahendarkar


Posts: 13
Registered: 11/28/05
Problems with junit.
Posted: Dec 27, 2006 2:26 PM
  Click to reply to this thread Reply

Hi,
I am just following the junit example in the book. I was able to go through most of it easily thanks for great explanation in book. But I seem to have hit wall. can you please comment. I am posting the ant with -v
=========================
Apache Ant version 1.7.0 compiled on December 13 2006
Buildfile: C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\build.xml
parsing buildfile C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\build.xml with URI = file:/C:/Documents%20and%20Settings/Deepak/ewtp/maniksoftinc/WebContent/build.xml
Project base dir set to: C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent
[antlib:org.apache.tools.ant] Could not load definitions from resource org/apache/tools/ant/antlib.xml. It could not be found.
[property] Loading C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\build.properties
Override ignored for property "javac.debug"
Override ignored for property "build.src.dir"
Override ignored for property "dist.dir"
Build sequence for target(s) `test-domain' is [clean, compile-domain, test-domain]
Complete build sequence is [clean, compile-domain, test-domain, cleanOutPut, build-war, notify, tables-create, ]
clean:
[delete] Deleting directory C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\build
[delete] Deleting directory C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\build
[delete] Deleting directory C:\Documents and Settings\Deepak\ewtp\maniksoftinc\dist
[delete] Deleting directory C:\Documents and Settings\Deepak\ewtp\maniksoftinc\dist
[mkdir] Created dir: C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\build
[mkdir] Created dir: C:\Documents and Settings\Deepak\ewtp\maniksoftinc\dist
[mkdir] Skipping C:\Documents and Settings\Deepak\ewtp\maniksoftinc\report because it already exists.
[echo] Apache Ant version 1.7.0 compiled on December 13 2006
[echo] Java version 1.5
compile-domain:
[javac] MessageResources.properties skipped - don't know how to handle it
[javac] com\maniksoft\actions\CreateNewsletterAction.java omitted as C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\WEB-INF\classes\com\maniksoft\actions\CreateNewsletterAction.class is up to date.
[javac] com\maniksoft\actions\ReadNewsletterAction.java omitted as C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\WEB-INF\classes\com\maniksoft\actions\ReadNewsletterAction.class is up to date.
[javac] com\maniksoft\beans\Newsletter.hbm.xml skipped - don't know how to handle it
[javac] com\maniksoft\beans\Newsletter.java omitted as C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\WEB-INF\classes\com\maniksoft\beans\Newsletter.class is up to date.
[javac] com\maniksoft\buiness\BusinessFacade.java omitted as C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\WEB-INF\classes\com\maniksoft\buiness\BusinessFacade.class is up to date.
[javac] com\maniksoft\exceptions\DataAccessLayerException.java omitted as C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\WEB-INF\classes\com\maniksoft\exceptions\DataAccessLayerException.class is up to date.
[javac] com\maniksoft\exceptions\PersistenceSystemException.java omitted as C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\WEB-INF\classes\com\maniksoft\exceptions\PersistenceSystemException.class is up to date.
[javac] com\maniksoft\exceptions\UnableToClosefactoryException.java omitted as C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\WEB-INF\classes\com\maniksoft\exceptions\UnableToClosefactoryException.class is up to date.
[javac] com\maniksoft\exceptions\UnableToCreateFactoryException.java omitted as C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\WEB-INF\classes\com\maniksoft\exceptions\UnableToCreateFactoryException.class is up to date.
[javac] com\maniksoft\exceptions\UnableToCreatePropertiesException.java omitted as C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\WEB-INF\classes\com\maniksoft\exceptions\UnableToCreatePropertiesException.class is up to date.
[javac] com\maniksoft\exceptions\UnableToReadException.java omitted as C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\WEB-INF\classes\com\maniksoft\exceptions\UnableToReadException.class is up to date.
[javac] com\maniksoft\forms\NewsletterForm.java omitted as C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\WEB-INF\classes\com\maniksoft\forms\NewsletterForm.class is up to date.
[javac] com\maniksoft\mail\FormMail.java omitted as C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\WEB-INF\classes\com\maniksoft\mail\FormMail.class is up to date.
[javac] com\maniksoft\persistence\AbstractDAO.java omitted as C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\WEB-INF\classes\com\maniksoft\persistence\AbstractDAO.class is up to date.
[javac] com\maniksoft\persistence\BusinessFacadeFactory.java omitted as C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\WEB-INF\classes\com\maniksoft\persistence\BusinessFacadeFactory.class is up to date.
[javac] com\maniksoft\persistence\DAOFactory.java omitted as C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\WEB-INF\classes\com\maniksoft\persistence\DAOFactory.class is up to date.
[javac] com\maniksoft\persistence\NewsletterDAO.java omitted as C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\WEB-INF\classes\com\maniksoft\persistence\NewsletterDAO.class is up to date.
[javac] com\maniksoft\persistence\PersistenceCache.java omitted as C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\WEB-INF\classes\com\maniksoft\persistence\PersistenceCache.class is up to date.
[javac] com\maniksoft\strutstestcase\mocktest\TestPositive.java omitted as C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\WEB-INF\classes\com\maniksoft\strutstestcase\mocktest\TestPositive.class is up to date.
[javac] factory.properties skipped - don't know how to handle it
[javac] hibernate.cfg.xml skipped - don't know how to handle it
[javac] hibernate.properties skipped - don't know how to handle it
[javac] log4j.properties skipped - don't know how to handle it
[copydir] DEPRECATED - The copydir task is deprecated. Use copy instead.
[copydir] DEPRECATED - The copydir task is deprecated. Use copy instead.
test-domain:
[junit] Implicitly adding C:\Documents and Settings\Deepak\My Documents\tools\apache-ant-1.7.0\lib\ant-launcher.jar;C:\Documents and Settings\Deepak\My Documents\tools\apache-ant-1.7.0\lib\ant.jar;C:\Documents and Settings\Deepak\My Documents\tools\apache-ant-1.7.0\lib\ant-junit.jar to CLASSPATH
[junit] Executing 'C:\Program Files\Java\jre1.5.0_10\bin\java.exe' with arguments:
[junit] '-classpath'
[junit] 'C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\WEB-INF\lib\junit.jar;C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent;C:\Program Files\Java\jre1.5.0_10\lib\ext\QTJava.zip;C:\Documents and Settings\Deepak\My Documents\tools\mysql-connector-java-5.0.4\mysql-connector-java-5.0.4-bin.jar;C:\Documents and Settings\Deepak\My Documents\tools\apache-ant-1.7.0\lib\ant-launcher.jar;C:\Documents and Settings\Deepak\My Documents\tools\apache-ant-1.7.0\lib\ant.jar;C:\Documents and Settings\Deepak\My Documents\tools\apache-ant-1.7.0\lib\ant-junit.jar'
[junit] 'org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner'
[junit] 'com.maniksoft.strutstestcase.mocktest.TestPositive'
[junit] 'filtertrace=true'
[junit] 'haltOnError=false'
[junit] 'haltOnFailure=true'
[junit] 'formatter=org.apache.tools.ant.taskdefs.optional.junit.SummaryJUnitResultFormatter'
[junit] 'showoutput=false'
[junit] 'outputtoformatters=true'
[junit] 'logtestlistenerevents=true'
[junit] 'formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter,C:\Documents and Settings\Deepak\ewtp\maniksoftinc\report\TEST-com.maniksoft.strutstestcase.mocktest.TestPositive.txt'
[junit] 'crashfile=C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\junitvmwatcher1416113731.properties'
[junit] 'propsfile=C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\junit231937731.properties'
[junit]
[junit] The ' characters around the executable and arguments are
[junit] not part of the command.
[junit] Running com.maniksoft.strutstestcase.mocktest.TestPositive
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec

BUILD FAILED
C:\Documents and Settings\Deepak\ewtp\maniksoftinc\WebContent\build.xml:89: Test com.maniksoft.strutstestcase.mocktest.TestPositive failed
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.actOnTestResult(JUnitTask.java:1712)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:820)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeOrQueue(JUnitTask.java:1657)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:764)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)

Total time: 1 second

dmahendarkar


Posts: 13
Registered: 11/28/05
Re: Problems with junit.
Posted: Dec 28, 2006 7:17 PM   in response to: dmahendarkar in response to: dmahendarkar
  Click to reply to this thread Reply

Figured it out.
I overlooked adding my test classes to path. Rather silly :-(
~Deepak

Legend
Gold: 300 + pts
Silver: 100 - 299 pts
Bronze: 25 - 99 pts
Manning Author
Manning Staff
Manning Developmental Editor