Thats really helpful thanks Anton. I now know that the root of the problem
is a LinkageError. So without wishing to wander OT  or push my luck do you
(or anyone else) have any idea what might cause this? I've tried a few
different Xerces jars without solving the problem. ant -debug -verbose
output follows...

Dan



Apache Ant version 1.5.3 compiled on April 16 2003
Apache Ant version 1.5.3 compiled on April 16 2003
Buildfile: build.xml
Detected Java version: 1.3 in: C:\java\jdk1.3.1_08\jre
Detected OS: Windows NT
parsing buildfile build.xml with URI = file:C:/dev/java/trash/build.xml
Project base dir set to: C:\dev\java\trash
Build sequence for target `test-server2' is [test-server2]
Complete build sequence is [test-server2, test-server]

test-server2:
    [junit] Using System properties {java.runtime.name=Java(TM) 2 Runtime
Environment, Standard Edition,
sun.boot.library.path=C:\java\jdk1.3.1_08\jre\bin,
java.vm.version=1.3.1_08-b03, java.vm.vendor=Sun Microsystems Inc.,
java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java
HotSpot(TM) Client VM, file.encoding.pkg=sun.io,
java.vm.specification.name=Java Virtual Machine Specification,
user.dir=C:\dev\java\trash, java.runtime.version=1.3.1_08-b03,
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, os.arch=x86,
java.io.tmpdir=C:\TEMP\, line.separator=
    [junit] , java.vm.specification.vendor=Sun Microsystems Inc.,
java.awt.fonts=, os.name=Windows NT, ant.home=C:\java\apache-ant-1.5.3-1,
java.library.path=C:\java\jdk1.3.1_08\bin;.;C:\WINNT\System32;C:\WINNT;C:\ja
va\apache-ant-1.5.3-1\bin;C:\Program
Files\Microsoft.NET\FrameworkSDK\Bin\;C:\Program Files\Microsoft Visual
Studio
.NET\Common7\IDE\;C:\WINNT\Microsoft.NET\Framework\v1.0.3705\;C:\Program
Files\Microsoft Visual Studio
.NET\Vc7\bin\;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\WBEM;c:\sqlnkwin;
c:\sybase11\bin;c:\sybase11\dll;C:\MSSQL7\BINN;C:\java\jakarta-ant-1.5.1\bin
;C:\java\jdk1.3.1_08\bin;C:\Progra~1\GNU\WinCvs~1.2;c:\java\jad;C:\SQLNKWIN,
java.specification.name=Java Platform API Specification,
java.class.version=47.0, os.version=4.0, user.home=C:\WINNT\Profiles\TulkdT,
user.timezone=Europe/London,
java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252,
java.specification.version=1.3, user.name=TulkdT,
java.class.path=C:\java\jdk1.3.1_08\lib\tools.jar;C:\java\apache-ant-1.5.3-1
\lib\xml-apis.jar;C:\java\apache-ant-1.5.3-1\lib\xercesImpl.jar;C:\java\apac
he-ant-1.5.3-1\lib\optional.jar;C:\java\apache-ant-1.5.3-1\lib\ant.jar;C:\ja
va\jdk1.3.1_08\lib\rt.jar;C:\java\jdk1.3.1_08\lib\tools.jar;C:\java\junit3.8
.1\junit.jar, java.vm.specification.version=1.0,
java.home=C:\java\jdk1.3.1_08\jre, user.language=en,
java.specification.vendor=Sun Microsystems Inc.,
awt.toolkit=sun.awt.windows.WToolkit, java.vm.info=mixed mode,
java.version=1.3.1_08, java.ext.dirs=C:\java\jdk1.3.1_08\jre\lib\ext,
sun.boot.class.path=C:\java\jdk1.3.1_08\jre\lib\rt.jar;C:\java\jdk1.3.1_08\j
re\lib\i18n.jar;C:\java\jdk1.3.1_08\jre\lib\sunrsasign.jar;C:\java\jdk1.3.1_
08\jre\classes, java.vendor=Sun Microsystems Inc., file.separator=\,
java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi,
sun.cpu.endian=little, sun.io.unicode.encoding=UnicodeLittle,
user.region=GB, sun.cpu.isalist=}
    [junit] Implicitly adding
C:\java\junit3.8.1\junit.jar;C:\java\apache-ant-1.5.3-1\lib\ant.jar;C:\java\
apache-ant-1.5.3-1\lib\optional.jar to CLASSPATH
    [junit] Using CLASSPATH
C:\dev\java\trash\bin;C:\java\jakarta\avalon\Avalon-4.1.4\avalon-framework-4
.1.4.jar;C:\java\jakarta\avalon\phoenix-4.0.4\lib\xercesImpl-2.0.2.jar;C:\ja
va\jakarta\avalon\phoenix-4.0.4\lib\xml-apis.jar;C:\java\junit3.8.1\junit.ja
r;C:\java\apache-ant-1.5.3-1\lib\ant.jar;C:\java\apache-ant-1.5.3-1\lib\opti
onal.jar
    [junit] Testsuite: trash.TrashTest
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.032 sec
    [junit] ------------- Standard Output ---------------
    [junit] testDummy() - called
    [junit] testDummy() -
configBuilder.class=org.apache.avalon.framework.configuration.DefaultConfigu
rationBuilder
    [junit] ------------- ---------------- ---------------

    [junit] Testcase: testDummy took 0.032 sec
    [junit]     Caused an ERROR
    [junit] loader constraints violated when linking org/xml/sax/XMLReader
class
    [junit] java.lang.LinkageError: loader constraints violated when linking
org/xml/sax/XMLReader class
    [junit]     at
org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImp
l.java:95)
    [junit]     at
org.apache.avalon.framework.configuration.DefaultConfigurationBuilder.<init>
(DefaultConfigurationBuilder.java:142)
    [junit]     at
org.apache.avalon.framework.configuration.DefaultConfigurationBuilder.<init>
(DefaultConfigurationBuilder.java:118)
    [junit]     at java.lang.Class.newInstance0(Native Method)
    [junit]     at java.lang.Class.newInstance(Class.java:232)
    [junit]     at trash.TrashTest.testDummy(TrashTest.java:24)

    [junit] Testcase: testDummy

BUILD SUCCESSFUL
Total time: 0 seconds

-----Original Message-----
From: Anton Tagunov [mailto:[EMAIL PROTECTED]
Sent: 29 May 2003 10:40
To: Avalon framework users
Subject: Re[4]: Ant, JUnit and Avalon - Have I lost the plot?


Now its clear as day:

1) don't call Exception in your test, just
   do it

   public void testDummy() throws Exception

   fyi: all fail() does is throw an exception!

   It's all set up to catch those exception for
   you and provide a report

2) you don't see your own stack trace because
   you haven't enabled output to console in
   your JUnit task. Read docs on <junit>
   and you'll find how turn on viewing console
   output of you test (currently it is being swallowed)

   okay, maybe I got something wrong, but here's my
   own junit task

        <junit printsummary="off">
            <formatter type="plain" usefile="false"/>
            <formatter type="xml"/> <!-- your shouldn't need this -->
            <classpath>
                <pathelement path="${java.api.compiled}"/>
                <pathelement path="${java.impl.compiled}"/>
                <pathelement path="${java.test.compiled}"/>
                <path refid="runtimecp"/>
            </classpath>
            <batchtest todir="${test.reports.dir}">
                <fileset dir="${java.test.prepr}">
                    <include name="**/test/*TestCase.java"/>
                    <exclude name="**/Abstract*"/>
                </fileset>
            </batchtest>
        </junit>
   
I've just copied if from Fortress and set up for my own needs.
This task does show the output written via System.out and System.err

-Anton


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


********************************************************************
      Visit our Internet site at http://www.rbsmarkets.com

This e-mail is intended only for the addressee named above.
As this e-mail may contain confidential or privileged information,
if you are not the named addressee, you are not authorised to
retain, read, copy or disseminate this message or any part of it.
The Royal Bank of Scotland plc is registered in Scotland No 90312
Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB
Regulated by the Financial Services Authority
********************************************************************

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

Reply via email to