You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jack Woehr <ja...@purematrix.com> on 2001/08/23 19:40:04 UTC

Conditional

Have 1.4beta2 now.

Docs are improved! Thanx.

<conditional> is nice but one still has to write a lot of targets.

I  suggest you still need some new attributes for two elements

   * expr for property
        o <property name="answer.to.life.universe.and.everything" expr="41 + ${one}"/>
   * if,then,else for antcall
        o <antcall if="${my.conditional}" then="my.true.target" else="my.false.target"/>

unless I've missed something very simple here.

--
Jack J. Woehr     # "I never worry that all hell will break loose.
Senior Consultant #  I worry that half hell will break loose, which
Purematrix, Inc.  #  is much harder to detect." - George Carlin



Re: Conditional

Posted by Matthew Inger <ma...@sedonacorp.com>.
Diane Holt wrote:

>--- Matthew Inger <ma...@sedonacorp.com> wrote:
>
>>I'd like to see the "if" and "unless" attributes on sequential.
>>[...]
>>any opposition to this if i submit a patch?
>>
>
>It'd be unlikely to go through, since if/unless at the task level is
>generally not accepted. (Ie., Why not just have a target that has the
><sequential> task in it and use the if/unless of <target>?)
>
>Diane
>
>=====
>(holtdl@yahoo.com)
>
>
>
>__________________________________________________
>Do You Yahoo!?
>Make international calls for as low as $.04/minute with Yahoo! Messenger
>http://phonecard.yahoo.com/
>
the difference is the annoyance of having to have yet another target 
just to do a simple
conditional like that.  What it ends up doing is polluting the file with 
lots of unecessary
targets.


-- 
Matt Inger (matt.inger@sedonacorp.com)
Sedona Corporation
455 S. Gulph Road, Suite 300
King of Prussia, PA 19406
(484) 679-2213
"Self-respect - the secure feeling that no one,
 as yet, is suspicious." -H.L. Mencken 




Re: junit report

Posted by Erik Hatcher <er...@earthlink.net>.
If you want to use JUnit's Swing UI, you'll have to use the <java> task to
run your unit tests.   The <junit> task does not run 'main' where typically
the JUnit UI is called.   Having a UI pop up while running Ant is not really
the recommended way to do it (but certainly is possible if you desire).

The best way to get nice output from the <junit> task is to use the XML
formatter and the <junitreport> task to consolidate the output into HTML
documents.

Does that answer your questions?

    Erik


----- Original Message -----
From: "Jonathan Carlson" <jo...@yahoo.com>
To: <an...@jakarta.apache.org>
Sent: Thursday, August 30, 2001 7:19 AM
Subject: Re: junit report


> I'm new to this mailing list so I apologize if this has been answered
> before.  Will Ant 1.4 allow us to specify the jUnit GUI for the
> reporting output?  We here at my company are under the impression that
> it can't be done in 1.3 and we really need the batching capability of
> the jUnit task.
>
> Jonathan Carlson
> joncrlsn@users.sf.net
>
> Erik Hatcher wrote:
>
> >I recommend you upgrade to Ant 1.4beta2 (Ant 1.4 release isn't far off
> >either).   Many improvements with the <junitreport> have happened and
> >chances are that it'll solve this problem for you.
> >
> >    Erik
> >
> >
> >----- Original Message -----
> >From: "Satish Kumar" <ma...@yahoo.com>
> >To: <an...@jakarta.apache.org>
> >Sent: Thursday, August 30, 2001 4:00 AM
> >Subject: junit report
> >
> >
> >>Hi,
> >>    I have a problem running junit report task under
> >>Ant 1.3 (Windows NT ).It gives me the following error
> >>after i added xalan1compat.jar ..Can somebody help
> >>
> >>E:\Temp\build.xml:51: java.lang.VerifyError: (class:
> >>org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer,
> >>method: getXSLStreamSource signature:
> >>(Ljava/lang/String;)Lorg/apache/xalan/xslt/XSLTInputSource;)
> >>Incompatible object argument for function call
> >>--- Nested Exception ---
> >>java.lang.VerifyError: (class:
> >>org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer,
> >>method: getXSLStreamSource signature:
> >>(Ljava/lang/String;)Lorg/apache/xalan/xslt/XSLTInputSource;)
> >>Incompatible object argument for function call
> >>        at
> >>
>
>org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator.createRepo
r
> >t(XMLResultAggregator.java:114)
> >
> >>        at java.lang.reflect.Method.invoke(Native
> >>Method)
> >>        at
> >>
>
>org.apache.tools.ant.IntrospectionHelper$1.create(IntrospectionHelper.java:
1
> >67)
> >
> >>        at
> >>
>
>org.apache.tools.ant.IntrospectionHelper.createElement(IntrospectionHelper.
j
> >ava:275)
> >
> >>        at
> >>
>
>org.apache.tools.ant.ProjectHelper$NestedElementHandler.init(ProjectHelper.
j
> >ava:535)
> >
> >>        at
> >>
>
>org.apache.tools.ant.ProjectHelper$TaskHandler.startElement(ProjectHelper.j
a
> >va:499)
> >
> >>        at
> >>com.sun.xml.parser.Parser.maybeElement(Parser.java:1391)
> >>        at
> >>com.sun.xml.parser.Parser.content(Parser.java:1499)
> >>        at
> >>com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
> >>        at
> >>com.sun.xml.parser.Parser.content(Parser.java:1499)
> >>        at
> >>com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
> >>        at
> >>com.sun.xml.parser.Parser.content(Parser.java:1499)
> >>        at
> >>com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
> >>        at
> >>com.sun.xml.parser.Parser.parseInternal(Parser.java:492)
> >>        at
> >>com.sun.xml.parser.Parser.parse(Parser.java:284)
> >>        at
> >>javax.xml.parsers.SAXParser.parse(SAXParser.java:155)
> >>        at
> >>org.apache.tools.ant.ProjectHelper.parse(ProjectHelper.java:117)
> >>        at
>
>>org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:85)
> >>        at
> >>org.apache.tools.ant.Main.runBuild(Main.java:403)
> >>        at
> >>org.apache.tools.ant.Main.main(Main.java:149)
> >>
> >>
> >>__________________________________________________
> >>Do You Yahoo!?
> >>Get email alerts & NEW webcam video instant messaging with Yahoo!
> >>
> >Messenger
> >
> >>http://im.yahoo.com
> >>
> >
>
>


Re: junit report

Posted by Jonathan Carlson <jo...@yahoo.com>.
I'm new to this mailing list so I apologize if this has been answered 
before.  Will Ant 1.4 allow us to specify the jUnit GUI for the 
reporting output?  We here at my company are under the impression that 
it can't be done in 1.3 and we really need the batching capability of 
the jUnit task.

Jonathan Carlson
joncrlsn@users.sf.net

Erik Hatcher wrote:

>I recommend you upgrade to Ant 1.4beta2 (Ant 1.4 release isn't far off
>either).   Many improvements with the <junitreport> have happened and
>chances are that it'll solve this problem for you.
>
>    Erik
>
>
>----- Original Message -----
>From: "Satish Kumar" <ma...@yahoo.com>
>To: <an...@jakarta.apache.org>
>Sent: Thursday, August 30, 2001 4:00 AM
>Subject: junit report
>
>
>>Hi,
>>    I have a problem running junit report task under
>>Ant 1.3 (Windows NT ).It gives me the following error
>>after i added xalan1compat.jar ..Can somebody help
>>
>>E:\Temp\build.xml:51: java.lang.VerifyError: (class:
>>org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer,
>>method: getXSLStreamSource signature:
>>(Ljava/lang/String;)Lorg/apache/xalan/xslt/XSLTInputSource;)
>>Incompatible object argument for function call
>>--- Nested Exception ---
>>java.lang.VerifyError: (class:
>>org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer,
>>method: getXSLStreamSource signature:
>>(Ljava/lang/String;)Lorg/apache/xalan/xslt/XSLTInputSource;)
>>Incompatible object argument for function call
>>        at
>>
>org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator.createRepor
>t(XMLResultAggregator.java:114)
>
>>        at java.lang.reflect.Method.invoke(Native
>>Method)
>>        at
>>
>org.apache.tools.ant.IntrospectionHelper$1.create(IntrospectionHelper.java:1
>67)
>
>>        at
>>
>org.apache.tools.ant.IntrospectionHelper.createElement(IntrospectionHelper.j
>ava:275)
>
>>        at
>>
>org.apache.tools.ant.ProjectHelper$NestedElementHandler.init(ProjectHelper.j
>ava:535)
>
>>        at
>>
>org.apache.tools.ant.ProjectHelper$TaskHandler.startElement(ProjectHelper.ja
>va:499)
>
>>        at
>>com.sun.xml.parser.Parser.maybeElement(Parser.java:1391)
>>        at
>>com.sun.xml.parser.Parser.content(Parser.java:1499)
>>        at
>>com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
>>        at
>>com.sun.xml.parser.Parser.content(Parser.java:1499)
>>        at
>>com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
>>        at
>>com.sun.xml.parser.Parser.content(Parser.java:1499)
>>        at
>>com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
>>        at
>>com.sun.xml.parser.Parser.parseInternal(Parser.java:492)
>>        at
>>com.sun.xml.parser.Parser.parse(Parser.java:284)
>>        at
>>javax.xml.parsers.SAXParser.parse(SAXParser.java:155)
>>        at
>>org.apache.tools.ant.ProjectHelper.parse(ProjectHelper.java:117)
>>        at
>>org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:85)
>>        at
>>org.apache.tools.ant.Main.runBuild(Main.java:403)
>>        at
>>org.apache.tools.ant.Main.main(Main.java:149)
>>
>>
>>__________________________________________________
>>Do You Yahoo!?
>>Get email alerts & NEW webcam video instant messaging with Yahoo!
>>
>Messenger
>
>>http://im.yahoo.com
>>
>


Re: junit report

Posted by Erik Hatcher <er...@earthlink.net>.
I recommend you upgrade to Ant 1.4beta2 (Ant 1.4 release isn't far off
either).   Many improvements with the <junitreport> have happened and
chances are that it'll solve this problem for you.

    Erik


----- Original Message -----
From: "Satish Kumar" <ma...@yahoo.com>
To: <an...@jakarta.apache.org>
Sent: Thursday, August 30, 2001 4:00 AM
Subject: junit report


> Hi,
>     I have a problem running junit report task under
> Ant 1.3 (Windows NT ).It gives me the following error
> after i added xalan1compat.jar ..Can somebody help
>
> E:\Temp\build.xml:51: java.lang.VerifyError: (class:
> org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer,
> method: getXSLStreamSource signature:
> (Ljava/lang/String;)Lorg/apache/xalan/xslt/XSLTInputSource;)
> Incompatible object argument for function call
> --- Nested Exception ---
> java.lang.VerifyError: (class:
> org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer,
> method: getXSLStreamSource signature:
> (Ljava/lang/String;)Lorg/apache/xalan/xslt/XSLTInputSource;)
> Incompatible object argument for function call
>         at
>
org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator.createRepor
t(XMLResultAggregator.java:114)
>         at java.lang.reflect.Method.invoke(Native
> Method)
>         at
>
org.apache.tools.ant.IntrospectionHelper$1.create(IntrospectionHelper.java:1
67)
>         at
>
org.apache.tools.ant.IntrospectionHelper.createElement(IntrospectionHelper.j
ava:275)
>         at
>
org.apache.tools.ant.ProjectHelper$NestedElementHandler.init(ProjectHelper.j
ava:535)
>         at
>
org.apache.tools.ant.ProjectHelper$TaskHandler.startElement(ProjectHelper.ja
va:499)
>         at
> com.sun.xml.parser.Parser.maybeElement(Parser.java:1391)
>         at
> com.sun.xml.parser.Parser.content(Parser.java:1499)
>         at
> com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
>         at
> com.sun.xml.parser.Parser.content(Parser.java:1499)
>         at
> com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
>         at
> com.sun.xml.parser.Parser.content(Parser.java:1499)
>         at
> com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
>         at
> com.sun.xml.parser.Parser.parseInternal(Parser.java:492)
>         at
> com.sun.xml.parser.Parser.parse(Parser.java:284)
>         at
> javax.xml.parsers.SAXParser.parse(SAXParser.java:155)
>         at
> org.apache.tools.ant.ProjectHelper.parse(ProjectHelper.java:117)
>         at
> org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:85)
>         at
> org.apache.tools.ant.Main.runBuild(Main.java:403)
>         at
> org.apache.tools.ant.Main.main(Main.java:149)
>
>
> __________________________________________________
> Do You Yahoo!?
> Get email alerts & NEW webcam video instant messaging with Yahoo!
Messenger
> http://im.yahoo.com


junit report

Posted by Satish Kumar <ma...@yahoo.com>.
Hi,
    I have a problem running junit report task under
Ant 1.3 (Windows NT ).It gives me the following error
after i added xalan1compat.jar ..Can somebody help

E:\Temp\build.xml:51: java.lang.VerifyError: (class:
org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer,
method: getXSLStreamSource signature:
(Ljava/lang/String;)Lorg/apache/xalan/xslt/XSLTInputSource;)
Incompatible object argument for function call
--- Nested Exception ---
java.lang.VerifyError: (class:
org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer,
method: getXSLStreamSource signature:
(Ljava/lang/String;)Lorg/apache/xalan/xslt/XSLTInputSource;)
Incompatible object argument for function call
        at
org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator.createReport(XMLResultAggregator.java:114)
        at java.lang.reflect.Method.invoke(Native
Method)
        at
org.apache.tools.ant.IntrospectionHelper$1.create(IntrospectionHelper.java:167)
        at
org.apache.tools.ant.IntrospectionHelper.createElement(IntrospectionHelper.java:275)
        at
org.apache.tools.ant.ProjectHelper$NestedElementHandler.init(ProjectHelper.java:535)
        at
org.apache.tools.ant.ProjectHelper$TaskHandler.startElement(ProjectHelper.java:499)
        at
com.sun.xml.parser.Parser.maybeElement(Parser.java:1391)
        at
com.sun.xml.parser.Parser.content(Parser.java:1499)
        at
com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
        at
com.sun.xml.parser.Parser.content(Parser.java:1499)
        at
com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
        at
com.sun.xml.parser.Parser.content(Parser.java:1499)
        at
com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
        at
com.sun.xml.parser.Parser.parseInternal(Parser.java:492)
        at
com.sun.xml.parser.Parser.parse(Parser.java:284)
        at
javax.xml.parsers.SAXParser.parse(SAXParser.java:155)
        at
org.apache.tools.ant.ProjectHelper.parse(ProjectHelper.java:117)
        at
org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:85)
        at
org.apache.tools.ant.Main.runBuild(Main.java:403)
        at
org.apache.tools.ant.Main.main(Main.java:149)


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

Re: Conditional

Posted by Diane Holt <ho...@yahoo.com>.
--- Matthew Inger <ma...@sedonacorp.com> wrote:
> I'd like to see the "if" and "unless" attributes on sequential.
> [...]
> any opposition to this if i submit a patch?

It'd be unlikely to go through, since if/unless at the task level is
generally not accepted. (Ie., Why not just have a target that has the
<sequential> task in it and use the if/unless of <target>?)

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

Re: Conditional

Posted by Matthew Inger <ma...@sedonacorp.com>.
Jack Woehr wrote:

> Have 1.4beta2 now.
>
> Docs are improved! Thanx.
>
> <conditional> is nice but one still has to write a lot of targets.
>
> I  suggest you still need some new attributes for two elements
>
>     * expr for property
>           * <property name="answer.to.life.universe.and.everything"
>             expr="41 + ${one}"/>
>     * if,then,else for antcall
>           * <antcall if="${my.conditional}" then="my.true.target"
>             else="my.false.target"/>
>
> unless I've missed something very simple here.
>
>-- 
>Jack J. Woehr     # "I never worry that all hell will break loose.
>Senior Consultant #  I worry that half hell will break loose, which
>Purematrix, Inc.  #  is much harder to detect." - George Carlin
>
>  

I'd like to see the "if" and "unless" attributes on sequential.  That would
be extremely helpful:

    <condition property="do.it"> ... </condition>

    <sequential if="do.it">
    ...
   </sequential>

   <sequential unless="do.it">
   ...
   </sequential>


 a little more wordy than what you suggest, but i think it would cut 
down hugely on the
number of targets that you would need to make.

any opposition to this if i submit a patch?

-- 
Matt Inger (matt.inger@sedonacorp.com)
Sedona Corporation
455 S. Gulph Road, Suite 300
King of Prussia, PA 19406
(484) 679-2213
"Self-respect - the secure feeling that no one,
 as yet, is suspicious." -H.L. Mencken