ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "1800 tbsfunny" <1800tbsfu...@gmail.com>
Subject Re: Methods inside Java ant task
Date Thu, 08 Jun 2006 17:14:21 GMT
Thanks Antonie.

I created a wrapper class.

public class TestSingletonInitializer
{
    public static void main(String[] args)
    {
        TestSingleton.initialize();
    }
}

This still doesnt run very well. But when I use my initialize method inside
of the junit tests. ex.

<junit>
TestSingleton.initialize()
..
run tests
..
TestSingleton.shutdown()
</junit>

It works fine. Any clues why the initialize method runs succesffully inside
the junit taask but not a seperate java task?




On 6/8/06, Antoine Levy-Lambert <antoine@gmx.de> wrote:
>
> Hello,
>
> you need to write a main method which calls the method you want to run.
> May be add a main method to util.runtime.TestSingleton.
>
> The only method which can be invoked by <java/> is static void main
> (String [] args).
>
> Regards,
>
> Antoine
> > -------- Original-Nachricht --------
> > Datum: Thu, 8 Jun 2006 12:54:04 -0400
> > Von: 1800 tbsfunny <1800tbsfunny@gmail.com>
> > An: user@ant.apache.org
> > Betreff: Methods inside Java ant task
> >
> > Hi Ant gurus,
> >
> > I am trying to write an Ant task that looks something like that -
> >
> > <target name="startcss" description="starting CSS" depends="setup">
> >         <java classname="util.runtime.TestSingleton.initialize()"
> > fork="no"
> > failonerror="no">
> >             <classpath refid="testrunning.classpath"/>
> >         </java>
> >     </target>
> >
> > This fails on me because we cannot run methods directly. Any
> suggesstions?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message