You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Mark Whitlock <ma...@uk.ibm.com> on 2002/11/25 17:19:14 UTC

[WSIF] Re: compiling and running unit tests

Hi Alek,
When you run many of the tests, the JMS2HTTPBridge is started automatically
to forward Soap/Jms requests onto a soap server. The JMS2HTTPBridge doesn't
read the WSDL so it has to get passed the JNDI information (and other bits)
as input parameters. This JNDI information was hard-coded in TestUtilities
but today I've moved this information into wsif.test.properties (which is
how it should have been all along). Please configure the
wsif.jms2httpbridge.* properties in wsif.test.properties to get the JMS
tests working. Hopefully these properties have sensible defaults.
Alternatively if you do not wish to run the JMS tests set
wsif.test.components=jms=off. There are batch files wsifjmssetup.bat,
wsifmqsetup.bat, wsiftestjmssetup.bat amd wsiftestmqsetup.bat to help you
configure JNDI and MQSeries, if you are using MQSeries as your JMS
implementation. Maybe the MQ-specific batch files shouldn't be part of
Apache WSIF, since they are IBM-specific and rely on software that is not
open source.
I hope this helps,
Mark
Mark Whitlock, IBM Hursley, Web Services

----- Forwarded by Mark Whitlock/UK/IBM on 25/11/02 15:55 -----

                      Aleksander

                      Slominski                To:
"axis-dev@xml.apache.org" <ax...@xml.apache.org>

                      <aslom@cs.indiana        cc:

                      .edu>                    Subject:  [WSIF] compiling
and running unit tests

                      25/11/02 06:31

                      Please respond to

                      axis-dev






hi,

it seems that we have good start on tests documentation in doc\run.htm

however it does not explain how to compile tests and it seems that there
is no tests target in build.xml. i have added tests target to build.xml
together with junit dependency check.

building tests target may need to be refined to do dependency
checks - i did not feel very confident about doing it but i excluded
shop/**.java if EJB is not present (building will require more testing
for those that have EJB env set and running).

also i am not sure about it but i think that tests should not have
dependency
on samples (currently for example tests need class
addressbook.wsifservice.AddressBook from samples)
so to make them run i have made sure that samples are compiled
before compiling tests.

finally i have added junit target to run tests conveniently from ant
but had no luck to pass *any* test:

     junit:
         [junit]
         [junit] path 'xml-axis-wsif' does not exist!
     BUILD FAILED
     C:\Forge\xml-axis-wsif\java\build.xml:327: Test util.WSIFTestRunner
failed
     Total time: 5 seconds

so i tried to run it from command line and using system property wsif.path
and still no luck ...

     C:\Forge\xml-axis-wsif\java>classpath set

build\classes;build\samples;build\tests;lib\soaprmi11\soaprmi11.jar;lib\saaj\saaj_1_1.jar;lib\jaxrpc



\jaxrpc_1_1.jar;lib\commons_logging\commons-logging.jar;lib\commons_discovery\commons-discovery.jar;



lib\axis\axis_1_0.jar;lib\axis\axis_1_0-ant.jar;lib\activation\activation-1.0.1.jar;lib\javamail\mai



l.jar;lib\apache_soap\soap.jar;lib\jms_api\jms_1_1.jar;lib\xerces2\xmlParserAPIs_2_2_0.jar;lib\xerce



s2\xercesImpl_2_2_0.jar;lib\log4j\log4j.jar-;lib\log4j\log4j-1.2.4.jar;lib\wsdl4j\wsdl4j-20021124.ja


     r;lib\wsdl4j\qname-from-wsdl4j-20021124.jar;lib\junit\junit.jar;
     C:\Forge\xml-axis-wsif\java>java -Dwsif.path=c:\\Forge\xml-axis-wsif
util.WSIFTestRunner
     Starting AddressBook JMS2HTTPBridge
     Starting Stockquote JMS2HTTPBridge
     Starting the JMS2HTTPBridge with
     Initial Context Factory = com.sun.jndi.fscontext.RefFSContextFactory
     JNDI URL = file:///JNDI-Directory
     Queue Connection Factory  = WSIFSampleQCF
     JNDI Read Queue = SoapJmsAddressBookQueue
     HTTP URL = http://localhost:8080/soap/servlet/rpcrouter
     Start Type = cold
     Verbose = false
     Starting the JMS2HTTPBridge with
     Initial Context Factory = com.sun.jndi.fscontext.RefFSContextFactory
     JNDI URL = file:///JNDI-Directory
     Queue Connection Factory  = WSIFSampleQCF
     JNDI Read Queue = SoapJmsStockquoteQueue
     HTTP URL = http://localhost:8080/soap/servlet/rpcrouter
     Start Type = cold
     Verbose = false
     Caught JMS2HTTPBridge exception org.apache.wsif.WSIFException:
WSIFJMSFinderForJndi caught
     'javax.na
     ming.NoInitialContextException: Cannot instantiate class:
     com.sun.jndi.fscontext.RefFSContextFactory
      [Root exception is java.lang.ClassNotFoundException:
     com.sun.jndi.fscontext.RefFSContextFactory]'.
     InitialContextFactory was 'com.sun.jndi.fscontext.RefFSContextFactory'
ProviderUrl was
     'file:///JNDI
     -Directory'. Port=<null>org.apache.wsif.WSIFException:
WSIFJMSFinderForJndi caught
     'javax.naming.NoI
     nitialContextException: Cannot instantiate class:
com.sun.jndi.fscontext.RefFSContextFactory [Root
     e
     xception is java.lang.ClassNotFoundException:
com.sun.jndi.fscontext.RefFSContextFactory]'.
     InitialC
     ontextFactory was 'com.sun.jndi.fscontext.RefFSContextFactory'
ProviderUrl was
     'file:///JNDI-Directo
     ry'. Port=<null>
             at
org.apache.wsif.util.jms.WSIFJMSFinderForJndi.<init>(Unknown Source)
             at
org.apache.wsif.util.jms.NativeJMSRequestListener.<init>(Unknown Source)
             at util.TestUtilities.startListeners(Unknown Source)
             at util.TestUtilities.startListeners(Unknown Source)
             at util.WSIFTestRunner.main(Unknown Source)
     Caught JMS2HTTPBridge exception org.apache.wsif.WSIFException:
WSIFJMSFinderForJndi caught
     'javax.na
     ming.NoInitialContextException: Cannot instantiate class:
     com.sun.jndi.fscontext.RefFSContextFactory
      [Root exception is java.lang.ClassNotFoundException:
     com.sun.jndi.fscontext.RefFSContextFactory]'.
     InitialContextFactory was 'com.sun.jndi.fscontext.RefFSContextFactory'
ProviderUrl was
     'file:///JNDI
     -Directory'. Port=<null>
     org.apache.wsif.WSIFException: WSIFJMSFinderForJndi caught
     'javax.naming.NoInitialContextException:
     Cannot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory
[Root exception is
     java.lang.Cl
     assNotFoundException: com.sun.jndi.fscontext.RefFSContextFactory]'.
InitialContextFactory was
     'com.s
     un.jndi.fscontext.RefFSContextFactory' ProviderUrl was
'file:///JNDI-Directory'. Port=<null>
             at
org.apache.wsif.util.jms.WSIFJMSFinderForJndi.<init>(Unknown Source)
             at org.apache.wsif.util.jms.JMSAsyncListener.<init>(Unknown
Source)
             at util.TestUtilities.startListeners(Unknown Source)
             at util.TestUtilities.startListeners(Unknown Source)
             at util.WSIFTestRunner.main(Unknown Source)
     .
     path 'xml-axis-wsif' does not exist!

i am not sure what i should set for xml-axis-wsif and where - is it
documented somewhere ?

aslo how come that c:///JNDI-Directory is showing up during test - why not
use some temporary directoy inside build/tests?

so in general tests can be now compiled OK but it requires
more work to make running tests without requiring setting system
property wsif.path and to skip running tests that are not supported
in current user environment (if no EJB jars or AXIS etc....)
to make it more straightforward than setting wsif.test.components
and to remove other dependencies (for example to allow testing
with other than MQSeries JMS providers and not require HTTP
server or AXIS service running ...)

so at minimum we need step-by-step recipe on how to run all tests
possibly in separate doc/tests.html - maybe somebody who is successful
in running unit tests could write it down ...

thanks,

alek
--
The ancestor of every action is a thought. - Ralph Waldo Emerson