Hi,
I am trying to run a simple JUnit test inside JBoss server

My environment:
JBoss : 3.0.2
Ant    : 1.5
JDK  : 1.4.0_01
JUnit :3.8.1


Now my testcase has a simple test which tries to talk to the local interface of a 
session bean running inside JBoss. I am aware of the fact that to be able to do this, 
the test has to be running in the same VM as the server! Hence i set the "fork" option 
in the Junit task to "off". And tried running the test. Test.jar gets successfully 
deployed into jboss, but then i get the following error message when it tries to run 
the actual test.

test:
    [junit] Running com.yambay.nps.istesting.MessagingTestCase

BUILD FAILED
java.lang.LinkageError: loader constraints violated when linking org/w3c/dom/Document 
class
        at 
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(DocumentBuilderFactoryImpl.java:88)
        at 
org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.getDocumentBuilder(XMLJUnitResultFormatter.java:93)
        at 
org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.startTestSuite(XMLJUnitResultFormatter.java:138)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.fireStartTestSuite(JUnitTestRunner.java:433)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:279)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM(JUnitTask.java:804)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:551)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:527)
        at org.apache.tools.ant.Task.perform(Task.java:317)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:334)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
        at org.apache.tools.ant.Main.runBuild(Main.java:610)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)

Has anyone seen this error before? Almost seems like the Junit task does not like the 
fork option set to "off".If i set this option to true, everything works fine. If the 
fork option is set to off, it dosen't even get to the point of running the test.


This is what my test looks like!

public void testSendMessageToClient()
        {
                try
                {
                        System.out.println("Hello!");
                        Context context = new InitialContext();
                        MessageProducerBeanLocalHome lHome =
                                (MessageProducerBeanLocalHome) 
context.lookup("session/MessageProducerBeanLocal");
                        MessageProducerBeanLocal lSession = (MessageProducerBeanLocal) 
lHome.create();
                        System.out.println("MessageProducerBean lookup successful");

                }


How can i make sure that my test runs inside the same VM as the App server? or is this 
something to do with the versions that I am using. Any help would be much appreciated.

TIA

Dushy   
______________________
DUSHYANT SHRIVASTAVA
Software Engineer

YAMBAY

tel      +61 (0) 8 9323 6999
mob  +61 (0) 402 902 652
fax     +61 (0) 8 9325 2688
web   www.yambay.com

Yambay Technologies Pty Ltd
7th Floor, The Victoria, 14-16 Victoria Ave, Perth. WA, 6000, Australia
_________________________________________________________________________________________________

This message and any files transmitted with it are confidential and are intended 
solely for the use of those persons to
whom the message is addressed. If you have received this message in error, please 
destroy and delete this
message from your computer. Any unauthorised form of reproduction of this message or 
any files transmitted with
it is strictly prohibited. yambay does not make any warranty concerning the security 
of any information electronically
transmitted and disclaims all liability for the proper and complete transmission of 
any information contained or purportedly
contained in this message, nor for any delay in its receipt. If you receive this 
message in error please notify the sender.
_________________________________________________________________________________________________


Reply via email to