You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Heritier Arnaud <ah...@axway.com> on 2004/06/17 20:59:30 UTC
RE : jelly if statement headache
Did you try this ???
<j:if test = "${var1.equals(var2)} >
Arnaud
> -----Message d'origine-----
> De : Dan Tran [mailto:danttran@hotmail.com]
> Envoyé : jeudi 17 juin 2004 21:02
> À : Maven Users List
> Objet : jelly if statement headache
>
>
> Hi I have 2 jelly variables that i want to compare in jelly if stament
>
> <j:if test = "${ var1 == var2 } >
> <!-- do some thing-->
> </j:if >
>
> it is not working for me. is it the right syntax?
>
> and I also search on lots plugin.jelly sources to find some
> similarity, none shows up so far
>
> Help is greatly appreciated.
>
> -Dan
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: RE : jelly if statement headache
Posted by Dan Tran <da...@hotmail.com>.
super thanks to both Vijay and Heritier
it works
-Dan
----- Original Message -----
From: "Vijay V" <vi...@oracle.com>
To: "Maven Users List" <us...@maven.apache.org>
Sent: Thursday, June 17, 2004 12:44 PM
Subject: Re: RE : jelly if statement headache
>
> Heritier example should work.
> Simple check is given below.
>
> <ant:property name="srcx" value="src" />
> <ant:property name="ano" value="src" />
> <j:if test="${srcx.equals(ano)}" >
> <ant:echo message="works fine :.............." />
> </j:if>
>
> Heritier Arnaud wrote:
>
> >Did you try this ???
> >
> ><j:if test = "${var1.equals(var2)} >
> >
> >
> >Arnaud
> >
> >
> >
> >>-----Message d'origine-----
> >>De : Dan Tran [mailto:danttran@hotmail.com]
> >>Envoyé : jeudi 17 juin 2004 21:02
> >>À : Maven Users List
> >>Objet : jelly if statement headache
> >>
> >>
> >>Hi I have 2 jelly variables that i want to compare in jelly if stament
> >>
> >> <j:if test = "${ var1 == var2 } >
> >> <!-- do some thing-->
> >> </j:if >
> >>
> >>it is not working for me. is it the right syntax?
> >>
> >>and I also search on lots plugin.jelly sources to find some
> >>similarity, none shows up so far
> >>
> >>Help is greatly appreciated.
> >>
> >>-Dan
> >>
> >>
> >>
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: RE : jelly if statement headache
Posted by Vijay V <vi...@oracle.com>.
Heritier example should work.
Simple check is given below.
<ant:property name="srcx" value="src" />
<ant:property name="ano" value="src" />
<j:if test="${srcx.equals(ano)}" >
<ant:echo message="works fine :.............." />
</j:if>
Heritier Arnaud wrote:
>Did you try this ???
>
><j:if test = "${var1.equals(var2)} >
>
>
>Arnaud
>
>
>
>>-----Message d'origine-----
>>De : Dan Tran [mailto:danttran@hotmail.com]
>>Envoyé : jeudi 17 juin 2004 21:02
>>À : Maven Users List
>>Objet : jelly if statement headache
>>
>>
>>Hi I have 2 jelly variables that i want to compare in jelly if stament
>>
>> <j:if test = "${ var1 == var2 } >
>> <!-- do some thing-->
>> </j:if >
>>
>>it is not working for me. is it the right syntax?
>>
>>and I also search on lots plugin.jelly sources to find some
>>similarity, none shows up so far
>>
>>Help is greatly appreciated.
>>
>>-Dan
>>
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: junit tests and resources
Posted by Brett Porter <br...@gmail.com>.
SomeTest.class.getResourceAsStream (or
getClass().getResourceAsStream()) would work just as effectively. This
is how I would do it whether I was using Maven or not.
This is not a "weird thing" - Maven doesn't shove everything onto the
system classloader, it builds up its own.
- Brett
On Fri, 18 Jun 2004 11:49:13 -0700 (PDT), Webb Morris
<we...@yahoo.com> wrote:
>
> In case anyone is following this thread or finds it while solving their own problem in the future,
> here is what I ended up having to do:
>
> InputStream is =
> Thread.currentThread().getContextClassLoader()
> .getResourceAsStream(testResource);
>
> Apparently there are some weird things going on with the JUnit ClassLoader. Also, if you are
> attempting to access a resource in the root directory (directly under test-classes) then be sure
> to prefix your resource with a "/" (i.e. "/text.xml").
>
> Thanks to those who tried to help!
>
> WM
>
>
>
> --- Webb Morris <we...@yahoo.com> wrote:
> > Yes, the call simply returns null. It really doesn't make much sense. When I run maven with the
> > -X option I can see the path being included, but when I try to access the resource, I get null.
> >
> > WM
> >
> > --- Dion Gillard <di...@gmail.com> wrote:
> > > The resources aren't on the system classloader?
> > >
> > > On Thu, 17 Jun 2004 12:39:04 -0700 (PDT), Webb Morris
> > > <we...@yahoo.com> wrote:
> > > >
> > > > I have set up some resources for my unit tests in the unittest/resources area of my
> > > project.xml.
> > > > These resources are being correctly copied to the target/test-classes directory. However,
> > when
> > > I
> > > > try to access these resources using:
> > > >
> > > > ClassLoader.getSystemResourceAsStream(myresource)
> > > >
> > > > The resource can not be found.
> > > >
> > > > Any ideas?
> > > >
> > > > WM
> > > >
> > > > __________________________________
> > > > Do you Yahoo!?
> > > > Yahoo! Mail - You care about security. So do we.
> > > > http://promotions.yahoo.com/new_mail
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: users-help@maven.apache.org
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Take Yahoo! Mail with you! Get it on your mobile phone.
> > http://mobile.yahoo.com/maildemo
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - You care about security. So do we.
> http://promotions.yahoo.com/new_mail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: junit tests and resources
Posted by Webb Morris <we...@yahoo.com>.
In case anyone is following this thread or finds it while solving their own problem in the future,
here is what I ended up having to do:
InputStream is =
Thread.currentThread().getContextClassLoader()
.getResourceAsStream(testResource);
Apparently there are some weird things going on with the JUnit ClassLoader. Also, if you are
attempting to access a resource in the root directory (directly under test-classes) then be sure
to prefix your resource with a "/" (i.e. "/text.xml").
Thanks to those who tried to help!
WM
--- Webb Morris <we...@yahoo.com> wrote:
> Yes, the call simply returns null. It really doesn't make much sense. When I run maven with the
> -X option I can see the path being included, but when I try to access the resource, I get null.
>
> WM
>
> --- Dion Gillard <di...@gmail.com> wrote:
> > The resources aren't on the system classloader?
> >
> > On Thu, 17 Jun 2004 12:39:04 -0700 (PDT), Webb Morris
> > <we...@yahoo.com> wrote:
> > >
> > > I have set up some resources for my unit tests in the unittest/resources area of my
> > project.xml.
> > > These resources are being correctly copied to the target/test-classes directory. However,
> when
> > I
> > > try to access these resources using:
> > >
> > > ClassLoader.getSystemResourceAsStream(myresource)
> > >
> > > The resource can not be found.
> > >
> > > Any ideas?
> > >
> > > WM
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > Yahoo! Mail - You care about security. So do we.
> > > http://promotions.yahoo.com/new_mail
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Take Yahoo! Mail with you! Get it on your mobile phone.
> http://mobile.yahoo.com/maildemo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: junit tests and resources
Posted by Webb Morris <we...@yahoo.com>.
Yes, the call simply returns null. It really doesn't make much sense. When I run maven with the
-X option I can see the path being included, but when I try to access the resource, I get null.
WM
--- Dion Gillard <di...@gmail.com> wrote:
> The resources aren't on the system classloader?
>
> On Thu, 17 Jun 2004 12:39:04 -0700 (PDT), Webb Morris
> <we...@yahoo.com> wrote:
> >
> > I have set up some resources for my unit tests in the unittest/resources area of my
> project.xml.
> > These resources are being correctly copied to the target/test-classes directory. However, when
> I
> > try to access these resources using:
> >
> > ClassLoader.getSystemResourceAsStream(myresource)
> >
> > The resource can not be found.
> >
> > Any ideas?
> >
> > WM
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Mail - You care about security. So do we.
> > http://promotions.yahoo.com/new_mail
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: junit tests and resources
Posted by Dion Gillard <di...@gmail.com>.
The resources aren't on the system classloader?
On Thu, 17 Jun 2004 12:39:04 -0700 (PDT), Webb Morris
<we...@yahoo.com> wrote:
>
> I have set up some resources for my unit tests in the unittest/resources area of my project.xml.
> These resources are being correctly copied to the target/test-classes directory. However, when I
> try to access these resources using:
>
> ClassLoader.getSystemResourceAsStream(myresource)
>
> The resource can not be found.
>
> Any ideas?
>
> WM
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - You care about security. So do we.
> http://promotions.yahoo.com/new_mail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
junit tests and resources
Posted by Webb Morris <we...@yahoo.com>.
I have set up some resources for my unit tests in the unittest/resources area of my project.xml.
These resources are being correctly copied to the target/test-classes directory. However, when I
try to access these resources using:
ClassLoader.getSystemResourceAsStream(myresource)
The resource can not be found.
Any ideas?
WM
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org