Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Running jUnit from and with eclipse front-end
Running jUnit from and with eclipse front-end [message #144928] Tue, 24 February 2004 14:47 Go to next message
Jiri Mares is currently offline Jiri MaresFriend
Messages: 18
Registered: July 2009
Junior Member
Hi,

I would like to ask, is there any way how to run jUnit tests from ant
task with eclipse frontent to jUnit.

Why? I would like to use aspectj before running tests and I don't know
how to run automatically aspectJ compiler from eclipse - just from ant :-(

Thanks for any hits or tips.

Jirka
Re: Running jUnit from and with eclipse front-end [message #145124 is a reply to message #144928] Wed, 25 February 2004 00:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rtayek.no.spam.freightgate.com

"Ji
Re: Running jUnit from and with eclipse front-end [message #145128 is a reply to message #144928] Wed, 25 February 2004 00:37 Go to previous messageGo to next message
Darin Swanson is currently offline Darin SwansonFriend
Messages: 2386
Registered: July 2009
Senior Member
You could do the Ant build to run the aspectJ compiler within Eclipse?
Another option would be to set up an external tool builder that would invoke
your Ant build file to automatically run the aspectJ compiler whenever you
modified the resources you need to have the aspectJ compiler compile.

HTH
Darins

"Ji
Re: Running jUnit from and with eclipse front-end [message #145194 is a reply to message #145124] Wed, 25 February 2004 11:42 Go to previous message
Jiri Mares is currently offline Jiri MaresFriend
Messages: 18
Registered: July 2009
Junior Member
It's not exacly what I'm looking for, but it's good base for my
investigation

Ray Tayek wrote:
> "Jiří Mareš" <Jiri.Mares@svt.cz> wrote in message
> news:c1fnri$bds$1@eclipse.org...
>
>>Hi,
>>
>>I would like to ask, is there any way how to run jUnit tests from ant
>>task with eclipse frontent to jUnit.
>
>
> not sure if this is what you want, but you can run junit tests from ant from
> within eclipse. (see below)
>
>
>>Why? I would like to use aspectj before running tests and I don't know
>>how to run automatically aspectJ compiler from eclipse - just from ant :-(
>>...
>
>
> hth
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project basedir="." default="all" name="mappingtools">
> <property environment="env"/>
> <property file="${user.home}/build.properties"/>
> <property file="build.properties"/>
> <!-- may want to set out own build compiler -->
> <target name="checkforeclipse" if="eclipse.running">
> <property name="build.compiler"
> value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
> <echo message="junit.home=${junit.home}"/>
> <property name="junit.jar"
> value="${eclipse.home}\plugins\org.junit_3.8.1\junit.jar"/ >
> </target>
> <target name="init" depends="checkforeclipse">
> <echo message="user.home=${user.home}"/>
> <echo message="ant.home=${ant.home}"/>
> <property name="junit.jar" value="${ant.home}/lib/junit.jar"/><!-- usually
> one hangs out here -->
> <echo message="junit.jar=${junit.jar}"/><!-- this has /'s and \'s on
> windoze xp! -->
> <fail unless="junit.jar">no ant.home!</fail>
> <mkdir dir="build"/>
> </target>
> <target name="clean" depends="init" description="clean">
> <delete dir="dist"/>
> <delete dir="build"/>
> <delete dir="doc/apidoc"/>
> <delete dir="deleted"/>
> </target>
> <target name="compile" depends="init" description="compile">
> <mkdir dir="build"/>
> <mkdir dir="build/classes"/>
> <mkdir dir="build/classes/srcobj"/>
> <javac debug="true" deprecation="true" destdir="build/classes/srcobj"
> srcdir="src">
> <classpath>
> <pathelement location="lib/ostermillerutils_1_02_21.jar"/>
> </classpath>
> </javac>
> </target>
> <target name="compiletst" depends="init,compile" description="compile
> tests">
> <mkdir dir="build/classes/tstobj"/>
> <javac debug="true" deprecation="true" destdir="build/classes/tstobj"
> srcdir="tst">
> <classpath>
> <pathelement location="lib/ostermillerutils_1_02_21.jar"/>
> <pathelement location="${junit.jar}"/>
> <pathelement location="build/classes/srcobj"/>
> </classpath>
> </javac>
> <mkdir dir="build/classes/tstobj/com/ediidea/mappingtools/testfiles "/>
> <copy todir="build/classes/tstobj/com/ediidea/mappingtools/testfiles ">
> <fileset dir="tst/com/ediidea/mappingtools/testfiles" includes="*.*"
> excludes="*.nbattrs"/>
> </copy>
> </target>
> <target name="jar" depends="init,compile" description="jar">
> <mkdir dir="build/lib"/>
> <jar basedir="build/classes/srcobj" compress="true"
> jarfile="build/lib/mappingtools.jar">
> <exclude name="**/deleted/**"/>
> <exclude name="**/RCS/**"/>
> <exclude name="*.class"/><!-- exclude default package classes-->
> </jar>
> </target>
> <target name="all" depends="init,junit">
> </target>
> <!-- figure out how (where) to deliver stuff -->
> <target name="deliver" depends="init,jar" description="deliver">
> <property name="delivery.dir" value="${user.home}/java/tmp/rel"/>
> <mkdir dir="${delivery.dir}"/>
> <mkdir dir="${delivery.dir}/lib"/>
> <copy todir="${delivery.dir}/lib">
> <fileset dir="build/lib" includes="*.jar"/>
> </copy>
> <mkdir dir="${delivery.dir}/bin"/>
> <copy todir="${delivery.dir}/bin">
> <fileset dir="sh" includes="checkcsv,csvtocsv,fast,fuv,splitcsv,"/>
> </copy>
> </target>
> <target name="test" depends="init,compiletst" description="test">
> <java classname="com.ediidea.mappingtools.MappingToolsTestCase"
> failonerror="true" fork="true">
> <classpath>
> <pathelement location="${ant.home}/lib/xercesImpl.jar"/>
> <pathelement location="lib/xalan.jar"/>
> <pathelement location="lib/ostermillerutils_1_02_21.jar"/>
> <pathelement location="${junit.jar}"/>
> <pathelement location="build/classes/srcobj"/>
> <pathelement location="build/classes/tstobj"/>
> </classpath>
> </java>
> </target>
> <target name="testjar" depends="init,jar,compiletst" description="test
> jar">
> <java classname="com.ediidea.mappingtools.MappingToolsTestCase"
> failonerror="true" fork="true">
> <classpath>
> <pathelement location="${ant.home}/lib/xercesImpl.jar"/>
> <pathelement location="lib/xalan.jar"/>
> <pathelement location="lib/ostermillerutils_1_02_21.jar"/>
> <pathelement location="${junit.jar}"/>
> <pathelement location="build/lib/mappingtools.jar"/>
> <pathelement location="build/classes/tstobj"/>
> </classpath>
> </java>
> </target>
> <target name="junit" depends="init,jar,compiletst" description="test jar
> using junit">
> <junit printsummary="true" haltonfailure="true">
> <formatter type="plain" usefile="false"/>
> <test name="com.ediidea.mappingtools.MappingToolsTestCase"/>
> <classpath>
> <pathelement location="lib/xalan.jar"/>
> <pathelement location="lib/ostermillerutils_1_02_21.jar"/>
> <pathelement location="build/lib/mappingtools.jar"/>
> <pathelement location="build/classes/tstobj"/>
> </classpath>
> </junit>
> </target>
> <target name="javadoc" depends="init" description="javadoc">
> <mkdir dir="doc/apidoc"/>
> <javadoc destdir="doc/apidoc" packagenames="com.ediidea.mappingtools.*">
> <sourcepath>
> <pathelement location="src"/>
> </sourcepath>
> <classpath>
> <pathelement location="${junit.jar}"/>
> <pathelement location="lib/xalan.jar"/>
> <pathelement location="lib/ostermillerutils_1_02_21.jar"/>
> <pathelement location="build/classes/srcobj"/>
> </classpath>
> </javadoc>
> </target>
> </project>
>
>
Previous Topic:How to look up a constant (final) value?
Next Topic:Eclipse 3.0 M7 getting worse ???
Goto Forum:
  


Current Time: Mon Dec 30 16:46:12 GMT 2024

Powered by FUDForum. Page generated in 0.03136 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top