ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Munz" <mm...@apelon.com>
Subject RE: forked JVM's classpath not clean when using JUnit task
Date Wed, 23 Jan 2002 19:54:58 GMT
Vlad and list,

> Is the JVM really forked as you made me think? Otherwise all ANT classes
> have access to crimson classes because it is seen by AntClassLoader....

I have indicated that I want it to be forked, and the build output seems to
indicate this.  I can't know however, wether or not it actually does run on
a forked JVM.  I've included the relevant build file snippet (below) in case
it helps in your diagnosis.

In browsing the bug-tracking system for junit-related cases, I've noticed
that the junit task has produced buggy behavior in the past, so it's
possible that the junit task is responsible for this error (rather than the
more commonly used ant code).  Are there any people on this list who are
familiar with the junit task specifically?  If so, I'd love to hear from
them about this.

  Thanks again for your help with this issue.

    <junit fork="true" printsummary="yes" haltonfailure="no"
failureProperty="test-failed">
      <classpath>
        <pathelement path="${test-proj-path}/jars/Test${jar-name}.jar" />
        <pathelement path="${LIB.DIR}/${jar-name}.jar" />
	<pathelement path="${classpath-ext}" />
      </classpath>
      <formatter type="xml" />
      <batchtest fork="true" todir="${reports-dir}">
        <fileset dir="${tests-src-dir}">
          <include name="**/${pkg-path}/**/Test*.java" />
        </fileset>
      </batchtest>
    </junit>

  - Matt

-----Original Message-----
From: vlad@trilogy.com [mailto:vlad@trilogy.com]
Sent: Wednesday, January 23, 2002 2:39 PM
To: Ant Users List
Subject: RE: forked JVM's classpath not clean when using JUnit task


Is the JVM really forked as you made me think? Otherwise all ANT classes
have access to crimson classes because it is seen by AntClassLoader....




Please respond to "Ant Users List" <ant-user@jakarta.apache.org>
To:     "Ant Users List" <ant-user@jakarta.apache.org>
cc:

Subject:        RE: forked JVM's classpath not clean when using JUnit task


Vlad,

Thanks for your reply.

> - if crimson is in your JRE ext directory, removing it from the task's
> classpath won't make a difference.

not the case here

> - are you sure you are not including the crimson classes through one of
> the other jars? How about the CLASSPATH env var?

all of these things do not contain the crimson class files.

Any other ideas?

- Matt

-----Original Message-----
From: vlad@trilogy.com [mailto:vlad@trilogy.com]
Sent: Wednesday, January 23, 2002 12:27 PM
To: Ant Users List
Subject: Re: forked JVM's classpath not clean when using JUnit task


I am not familiar with junit task but I can make these comments:

- if crimson is in your JRE ext directory, removing it from the task's
classpath won't make a difference.
- are you sure you are not including the crimson classes through one of
the other jars? How about the CLASSPATH env var?

Vlad.


Please respond to "Ant Users List" <ant-user@jakarta.apache.org>
To:     <ant-user@jakarta.apache.org>
cc:

Subject:        forked JVM's classpath not clean when using JUnit task


Hi.

I am aware that the answer to this may already be in the archives.  They
are not available at the moment, however, so I thought I'd ask all of you
for your help.  If there is a mirror to the mail archive, or another
resource that covers this issue, I'd be happy to read it.

Problem (w2k., ant 1.4.1):

When building a project that includes a junit task, it is apparent that
crimson.jar is accessible from the JUnitTestRunner.  This is undesireable,
as my test should have no knowledge / access to crimson.jar.  I see this
behavior even when the fork attribute to my junit task is set to true.

As the output (below) shows, the execution of java.exe has the classpath
arg set to a path that does not include crimson.jar.  According to the
docs
for java.exe, this path should override any classpath set in the System's
environment variables.  Nonetheless, the output from my test clearly
indicates that crimson.jar is available to the test runner (and test).

Is there a way to fix this so that I can cleanly (w/o crimson.jar on the
classpath) run my tests?

Output (verbose):

run-test-package:
[junit] Running com.apelonTests.common.dom.TestApelDOMParser
[junit] Executing:
d:\programs\jdk1.3.1_01\jre\..\bin\java.exe -classpath
D:\programs\jakarta-ant-1.4.1\lib\junit.ja
r;D:\programs\jakarta-ant-1.4.1\lib\ant.jar;D:\programs\jakarta-ant-1.4.1\li
b\jakarta-ant-1.4.1-optional.jar;D:\Matt\ape
lon\vss\dev200104\build\tests\ApelonCommon\jars\TestApelonCommon.jar;D:\Matt
\apelon\vss\dev200104\build\dist\lib\ApelonC
ommon.jar;D:\Matt\apelon\vss\dev200104\jars\log4j.jar;D:\Matt\apelon\vss\dev
200104\jars\parser.jar;D:\Matt\apelon\vss\de
v200104\jars\xml.jar
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner
com.apelonTests.common.dom.TestApelDOM
Parser haltOnError=false haltOnFailure=false
formatter=org.apache.tools.ant.taskdefs.optional.junit.SummaryJUnitResultFo
rmatter
formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatt
er,D:\Matt\apelon\vss\dev200104\buil
d\tests\ApelonCommon\reports\TEST-com.apelonTests.common.dom.TestApelDOMPars
er.xml propsfile=D:\Matt\apelon\vss\Dev20010
4\build\tests\junit4486939605375226940.properties
[junit] org.xml.sax.SAXParseException: Element type "s" is not declared.
[junit]     at
org.apache.crimson.parser.Parser2.error(Parser2.java:3086)
[junit]     at
org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1316)
[junit]     at
org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
[junit]     at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
[junit]     at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
[junit]     at
org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
[junit]     at com.apelon.common.dom.ApelDOMParser.parse(Unknown Source)
[junit]     at
com.apelonTests.common.dom.TestApelDOMParser.testParse(Unknown Source)
[junit]     at java.lang.reflect.Method.invoke(Native Method)
[junit]     at junit.framework.TestCase.runTest(TestCase.java:166)
[junit]     at junit.framework.TestCase.runBare(TestCase.java:140)
[junit]     at junit.framework.TestResult$1.protect(TestResult.java:106)
[junit]     at
junit.framework.TestResult.runProtected(TestResult.java:124)
[junit]     at junit.framework.TestResult.run(TestResult.java:109)
[junit]     at junit.framework.TestCase.run(TestCase.java:131)
[junit]     at junit.framework.TestSuite.runTest(TestSuite.java:173)
[junit]     at junit.framework.TestSuite.run(TestSuite.java:168)
[junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRu
nner.java:231)
[junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestR
unner.java:409)

Thanks in advance for any help you can offer.

- Matt Munz (mmunz@apelon.com)





--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>





--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>





--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message