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" <[EMAIL PROTECTED]>
To:     "Ant Users List" <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
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" <[EMAIL PROTECTED]>
To:     <[EMAIL PROTECTED]>
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 ([EMAIL PROTECTED])





--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>





--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>





--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to