You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Eric Dobbs <er...@dobbse.net> on 2001/05/01 21:53:28 UTC

[PATCH] Re: ./build-turbine.sh run-singletest

Thanks, Jeff.  I've included patches to build-turbine.sh
and build-turbine.bat

On Tuesday, May 1, 2001, at 12:23  PM, Brekke, Jeff wrote:

>
> Junit jar is not in the class path when ant starts.
>
>> -----Original Message-----
>> From: Eric Dobbs [mailto:eric@dobbse.net]
>> Sent: Tuesday, May 01, 2001 1:19 PM
>> To: turbine-dev@jakarta.apache.org
>> Subject: ./build-turbine.sh run-singletest
>>
>>
>> What is the magic trick to make the run-singletest target work?


Index: build-turbine.sh
===================================================================
RCS file: /home/cvspublic/jakarta-turbine/build/build-turbine.sh,v
retrieving revision 1.27
diff -u -r1.27 build-turbine.sh
--- build-turbine.sh    2001/02/11 22:47:05     1.27
+++ build-turbine.sh    2001/05/01 19:50:42
@@ -27,11 +27,17 @@
  XERCES_JAR=`ls ../lib/xerces*.jar`
  VELOCITY_JAR=`ls ../lib/velocity*.jar`
  JDOM_JAR=`ls ../../jakarta-site2/lib/jdom*.jar`
+JUNIT_JAR=`ls ../lib/junit*.jar`

  CLASSPATH=${CLASSPATH}:${ANT_JAR}
  CLASSPATH=${CLASSPATH}:${XERCES_JAR}
  CLASSPATH=${CLASSPATH}:${VELOCITY_JAR}
  CLASSPATH=${CLASSPATH}:${JDOM_JAR}
+
+# if junit is present, then add it to the classpath
+if [ -f ${JUNIT_JAR} ] ; then
+    CLASSPATH=${CLASSPATH}:${JUNIT_JAR}
+fi

  # convert the unix path to windows
  if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then



Index: build-turbine.bat
===================================================================
RCS file: /home/cvspublic/jakarta-turbine/build/build-turbine.bat,v
retrieving revision 1.31
diff -u -r1.31 build-turbine.bat
--- build-turbine.bat   2001/03/27 22:07:52     1.31
+++ build-turbine.bat   2001/05/01 19:51:53
@@ -18,6 +18,7 @@
  set CLASSPATH=%CLASSPATH%;..\lib\velocity-1.0b2-dev.jar
  set CLASSPATH=%CLASSPATH%;..\..\jakarta-site2\lib\jdom-b6.jar

+if exist ..\lib\junit-3.2.jar set 
CLASSPATH=%CLASSPATH%;..\lib\junit-3.2.jar

  %JAVA_HOME%\bin\java.exe org.apache.tools.ant.Main -buildfile 
%BUILDFILE% %1 %2 %3 %4 %5 %6 %7 %8 %9

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: [PATCH] Re: ./build-turbine.sh run-singletest

Posted by josh lucas <jo...@stonecottage.com>.
Daniel Rall wrote:
> 
> Jon Stevens <jo...@latchkey.com> writes:
> 
> > The goal is to work away from the .sh/.bat scripts and require people to
> > install Ant instead and use the "ant <target>" command.
> 
> +1!  I just started doing this myself the other day, and was wondering
> why we still need the .sh/.bat scripts.  The only thing that came to
> mind is classpath issues, but I'm sure that can be handled via some
> Ant magic.
> 

The only classpath issue that I found with this was trying to use
DocBook from within an Ant task.  This was back in Ant 1.2 so it might
have been fixed since then but since we know have Anakia, who would want
to use DocBook?  :)

The issue was actually more of a classloader issue.  Docbook expected
the Xalan classes to be found in the System classloader and wouldn't
look for them in the Ant Classloader.


josh

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: [PATCH] Re: ./build-turbine.sh run-singletest

Posted by Daniel Rall <dl...@finemaltcoding.com>.
Jon Stevens <jo...@latchkey.com> writes:

> The goal is to work away from the .sh/.bat scripts and require people to
> install Ant instead and use the "ant <target>" command.

+1!  I just started doing this myself the other day, and was wondering
why we still need the .sh/.bat scripts.  The only thing that came to
mind is classpath issues, but I'm sure that can be handled via some
Ant magic.

Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: [PATCH] Re: ./build-turbine.sh run-singletest

Posted by josh lucas <jo...@stonecottage.com>.
Jon Stevens wrote:
> 
> on 5/1/01 4:07 PM, "Eric Dobbs" <er...@dobbse.net> wrote:
> 
> > On Tuesday, May 1, 2001, at 04:32  PM, Jon Stevens wrote:
> >> No. The junit.jar is added to the classpath by the build-turbine.xml
> >> file:
> >
> > Yep.  And that doesn't make the junit tests work.  As Jeff said:
> > "Junit jar is not in the class path when ant starts."  It's only
> > in the classpath *after* ant has started processing
> > build-turbine.xml.  And for some reason the junit tasks don't
> > work unless junit is in the classpath when ant starts -- not
> > after.  Hence my patches.
> >
> >
> >> I'm not really sure how to solve the problem, but I certainly don't
> >> think it
> >> should be solved by putting the junit.jar file into the classpath in the
> >> .bat/.sh scripts.
> >
> > I'm not invested in my particular solution, I just want the
> > junit tests to work so I can test my code before I send in
> > other patches.
> 
> Well, then maybe figure out why Ant is screwing up before you mess up
> Turbine's build system with these patches. :-) Please don't propagate bad
> code.
> 
> This is clearly an issue with Ant or the way Junit is being used from within
> the build-turbine.xml, so, fix Ant or the build-turbine.xml file. :-)
> 
> The goal is to work away from the .sh/.bat scripts and require people to
> install Ant instead and use the "ant <target>" command.
> 

+1

The one nice thing about the ant rpm I built is that it is really all
you need.  Since ant.jar, optional.jar, jaxp.jar and crimson.jar are
added to your classpath at startup, you can run ant anywhere without
worrying about extra scripts.


josh

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: [PATCH] Re: ./build-turbine.sh run-singletest

Posted by Jon Stevens <jo...@latchkey.com>.
on 5/1/01 4:07 PM, "Eric Dobbs" <er...@dobbse.net> wrote:

> On Tuesday, May 1, 2001, at 04:32  PM, Jon Stevens wrote:
>> No. The junit.jar is added to the classpath by the build-turbine.xml
>> file:
> 
> Yep.  And that doesn't make the junit tests work.  As Jeff said:
> "Junit jar is not in the class path when ant starts."  It's only
> in the classpath *after* ant has started processing
> build-turbine.xml.  And for some reason the junit tasks don't
> work unless junit is in the classpath when ant starts -- not
> after.  Hence my patches.
> 
> 
>> I'm not really sure how to solve the problem, but I certainly don't
>> think it
>> should be solved by putting the junit.jar file into the classpath in the
>> .bat/.sh scripts.
> 
> I'm not invested in my particular solution, I just want the
> junit tests to work so I can test my code before I send in
> other patches.

Well, then maybe figure out why Ant is screwing up before you mess up
Turbine's build system with these patches. :-) Please don't propagate bad
code.

This is clearly an issue with Ant or the way Junit is being used from within
the build-turbine.xml, so, fix Ant or the build-turbine.xml file. :-)

The goal is to work away from the .sh/.bat scripts and require people to
install Ant instead and use the "ant <target>" command.

-jon


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: [PATCH] Re: ./build-turbine.sh run-singletest

Posted by Eric Dobbs <er...@dobbse.net>.
On Tuesday, May 1, 2001, at 04:32  PM, Jon Stevens wrote:
> No. The junit.jar is added to the classpath by the build-turbine.xml 
> file:

Yep.  And that doesn't make the junit tests work.  As Jeff said:
"Junit jar is not in the class path when ant starts."  It's only
in the classpath *after* ant has started processing
build-turbine.xml.  And for some reason the junit tasks don't
work unless junit is in the classpath when ant starts -- not
after.  Hence my patches.


> I'm not really sure how to solve the problem, but I certainly don't 
> think it
> should be solved by putting the junit.jar file into the classpath in the
> .bat/.sh scripts.

I'm not invested in my particular solution, I just want the
junit tests to work so I can test my code before I send in
other patches.

-Eric

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: [PATCH] Re: ./build-turbine.sh run-singletest

Posted by Jon Stevens <jo...@latchkey.com>.
on 5/1/01 12:53 PM, "Eric Dobbs" <er...@dobbse.net> wrote:

> Thanks, Jeff.  I've included patches to build-turbine.sh
> and build-turbine.bat

No. The junit.jar is added to the classpath by the build-turbine.xml file:

    <!-- Build classpath -->
    <path id="classpath">
        <fileset dir=".">
            <include name="**/*.jar"/>
        </fileset>
        <fileset dir="../lib">
            <include name="**/*.jar"/>
        </fileset>
    </path>

...

    <target name="run-singletest" if="testcase" depends="compile-tests">
        <junit printsummary="no" haltonfailure="yes">
            <classpath>
                <pathelement location="${build.dest}"/>
                <path refid="classpath" />
                <pathelement path="${classpath}"/>
            </classpath>

...

I'm not really sure how to solve the problem, but I certainly don't think it
should be solved by putting the junit.jar file into the classpath in the
.bat/.sh scripts.

-jon

-- 
If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<http://jakarta.apache.org/velocity/ymtd/ymtd.html>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org