You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Michael Owen <mi...@hotmail.com> on 2005/07/18 12:50:08 UTC

[M2] Marmalade script using JUnit

Hi,

As surefire in Maven2 doesn't create HTML reports yet, I'm trying to 
temporary get around the problem by writing a Marmalade plugin script that 
uses Ant tasks to do this. So far I'm just trying to get JUnit working 
through the Marmalade. This is the execute part of my script so far:

  	<execute>

	    <ant:javac srcdir="${classes}" destdir="${junit-classes}" 
classpath="${lib}" fork="yes" nowarn="on" debug="on" />

	    <ant:delete dir="${junit-results}" />
	   	<ant:mkdir dir="${junit-results}" />

	  	<ant:junit fork="yes" haltonfailure="no" timeout="${junit-timeout}">

	        <ant:sysproperty key="basedir" value="${basedir}" />

	   		<ant:formatter type="xml" />

	   		<ant:classpath path="${lib}" />

	   		<ant:classpath>
	   			<ant:pathelement path="${lib}" />
	   		</ant:classpath>

	  		<ant:batchtest todir="${junit-results}">
	    		<ant:fileset dir="${junit-classes}" includes="**/*Test.class" />
	    	</ant:batchtest>

	  	</ant:junit>

	</execute>


Using this I'm receiving the problem error:

Exception in thread "main" java.lang.NoClassDefFoundError: 
org/apache/tools/ant/launch/Locator
    at 
org.apache.tools.ant.util.LoaderUtils.getResourceSource(LoaderUtils.java:109)

   etc. etc.


Just wondering if anybody out there has done a similar thing, or knows why 
such a error is occurring? I've double checked the basic things, like the 
variables used are fine etc.

Thanks,

Mike



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [M2] Marmalade script using JUnit

Posted by Michael Owen <mi...@hotmail.com>.
That's great. Thanks for your help. Seems obvious now you say. :-)

I'm using Ant 1.6.2 so I have the dependency for ant-launcher 1.6.2 ie:

		<dependency>
			<groupId>ant</groupId>
			<artifactId>ant-launcher</artifactId>
			<version>1.6.2</version>
		</dependency>

I'm now getting:

    java.lang.ClassCastException
        
at.org.codehaus.marmalade.compat.ant.model.AntAdapterTag.buildAntObject(AntAdapterTag.java:138)

etc. etc.

Any ideas? Sorry, I'm new to Maven, and I'm not finding the error messages 
useful yet. :)

Mike


<br><br><br>&gt;From: Kenney Westerhof 
&lt;forge@neonics.com&gt;<br>&gt;Reply-To: &quot;Maven Users List&quot; 
&lt;users@maven.apache.org&gt;<br>&gt;To: Maven Users List 
&lt;users@maven.apache.org&gt;<br>&gt;Subject: Re: [M2] Marmalade script 
using JUnit<br>&gt;Date: Mon, 18 Jul 2005 13:03:11 +0200 
(CEST)<br>&gt;<br>&gt;On Mon, 18 Jul 2005, Michael Owen 
wrote:<br>&gt;<br>&gt;You need to include ant-launcher as a 
dependency.<br>&gt;<br>&gt;Btw, you might find that ${a-b} is evaluated as 
an expression (not sure if<br>&gt;this is an issue in Marmalade, but this 
was a problem with jelly - just<br>&gt;thought i might warn 
you).<br>&gt;<br>&gt; &gt; Hi,<br>&gt; &gt;<br>&gt; &gt; As surefire in 
Maven2 doesn't create HTML reports yet, I'm trying to<br>&gt; &gt; temporary 
get around the problem by writing a Marmalade plugin script that<br>&gt; 
&gt; uses Ant tasks to do this. So far I'm just trying to get JUnit 
working<br>&gt; &gt; through the Marmalade. This is the execute part of my 
script so far:<br>&gt; &gt;<br>&gt; &gt;   	&lt;execute&gt;<br>&gt; 
&gt;<br>&gt; &gt; 	    &lt;ant:javac srcdir=&quot;${classes}&quot; 
destdir=&quot;${junit-classes}&quot;<br>&gt; &gt; 
classpath=&quot;${lib}&quot; fork=&quot;yes&quot; nowarn=&quot;on&quot; 
debug=&quot;on&quot; /&gt;<br>&gt; &gt;<br>&gt; &gt; 	    &lt;ant:delete 
dir=&quot;${junit-results}&quot; /&gt;<br>&gt; &gt; 	   	&lt;ant:mkdir 
dir=&quot;${junit-results}&quot; /&gt;<br>&gt; &gt;<br>&gt; &gt; 	  
	&lt;ant:junit fork=&quot;yes&quot; haltonfailure=&quot;no&quot; 
timeout=&quot;${junit-timeout}&quot;&gt;<br>&gt; &gt;<br>&gt; &gt; 	        
&lt;ant:sysproperty key=&quot;basedir&quot; value=&quot;${basedir}&quot; 
/&gt;<br>&gt; &gt;<br>&gt; &gt; 	   		&lt;ant:formatter type=&quot;xml&quot; 
/&gt;<br>&gt; &gt;<br>&gt; &gt; 	   		&lt;ant:classpath 
path=&quot;${lib}&quot; /&gt;<br>&gt; &gt;<br>&gt; &gt; 	   
		&lt;ant:classpath&gt;<br>&gt; &gt; 	   			&lt;ant:pathelement 
path=&quot;${lib}&quot; /&gt;<br>&gt; &gt; 	   
		&lt;/ant:classpath&gt;<br>&gt; &gt;<br>&gt; &gt; 	  		&lt;ant:batchtest 
todir=&quot;${junit-results}&quot;&gt;<br>&gt; &gt; 	    		&lt;ant:fileset 
dir=&quot;${junit-classes}&quot; includes=&quot;**/*Test.class&quot; 
/&gt;<br>&gt; &gt; 	    	&lt;/ant:batchtest&gt;<br>&gt; &gt;<br>&gt; &gt; 	  
	&lt;/ant:junit&gt;<br>&gt; &gt;<br>&gt; &gt; 	&lt;/execute&gt;<br>&gt; 
&gt;<br>&gt; &gt;<br>&gt; &gt; Using this I'm receiving the problem 
error:<br>&gt; &gt;<br>&gt; &gt; Exception in thread &quot;main&quot; 
java.lang.NoClassDefFoundError:<br>&gt; &gt; 
org/apache/tools/ant/launch/Locator<br>&gt; &gt;     at<br>&gt; &gt; 
org.apache.tools.ant.util.LoaderUtils.getResourceSource(LoaderUtils.java:109)<br>&gt; 
&gt;<br>&gt; &gt;    etc. etc.<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; Just 
wondering if anybody out there has done a similar thing, or knows 
why<br>&gt; &gt; such a error is occurring? I've double checked the basic 
things, like the<br>&gt; &gt; variables used are fine etc.<br>&gt; 
&gt;<br>&gt; &gt; Thanks,<br>&gt; &gt;<br>&gt; &gt; Mike<br>&gt; 
&gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; 
---------------------------------------------------------------------<br>&gt; 
&gt; To unsubscribe, e-mail: users-unsubscribe@maven.apache.org<br>&gt; &gt; 
For additional commands, e-mail: users-help@maven.apache.org<br>&gt; 
&gt;<br>&gt;<br>&gt;--<br>&gt;Kenney 
Westerhof<br>&gt;http://www.neonics.com<br>&gt;GPG public key: 
http://www.gods.nl/~forge/kenneyw.key<br>&gt;<br>&gt;---------------------------------------------------------------------<br>&gt;To 
unsubscribe, e-mail: users-unsubscribe@maven.apache.org<br>&gt;For 
additional commands, e-mail: users-help@maven.apache.org<br>&gt;<br>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [M2] Marmalade script using JUnit

Posted by Kenney Westerhof <fo...@neonics.com>.
On Mon, 18 Jul 2005, Michael Owen wrote:

You need to include ant-launcher as a dependency.

Btw, you might find that ${a-b} is evaluated as an expression (not sure if
this is an issue in Marmalade, but this was a problem with jelly - just
thought i might warn you).

> Hi,
>
> As surefire in Maven2 doesn't create HTML reports yet, I'm trying to
> temporary get around the problem by writing a Marmalade plugin script that
> uses Ant tasks to do this. So far I'm just trying to get JUnit working
> through the Marmalade. This is the execute part of my script so far:
>
>   	<execute>
>
> 	    <ant:javac srcdir="${classes}" destdir="${junit-classes}"
> classpath="${lib}" fork="yes" nowarn="on" debug="on" />
>
> 	    <ant:delete dir="${junit-results}" />
> 	   	<ant:mkdir dir="${junit-results}" />
>
> 	  	<ant:junit fork="yes" haltonfailure="no" timeout="${junit-timeout}">
>
> 	        <ant:sysproperty key="basedir" value="${basedir}" />
>
> 	   		<ant:formatter type="xml" />
>
> 	   		<ant:classpath path="${lib}" />
>
> 	   		<ant:classpath>
> 	   			<ant:pathelement path="${lib}" />
> 	   		</ant:classpath>
>
> 	  		<ant:batchtest todir="${junit-results}">
> 	    		<ant:fileset dir="${junit-classes}" includes="**/*Test.class" />
> 	    	</ant:batchtest>
>
> 	  	</ant:junit>
>
> 	</execute>
>
>
> Using this I'm receiving the problem error:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/tools/ant/launch/Locator
>     at
> org.apache.tools.ant.util.LoaderUtils.getResourceSource(LoaderUtils.java:109)
>
>    etc. etc.
>
>
> Just wondering if anybody out there has done a similar thing, or knows why
> such a error is occurring? I've double checked the basic things, like the
> variables used are fine etc.
>
> Thanks,
>
> Mike
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org