Hi,
would it not be "best practice" to use standard unit tests
completely independent of CXF for testing (1) the business logic
(i.e. verifying that indeed 2*2=4).
In the other cases (2) and (3) you're testing the SOAP engine, which
should not really be your concern as application developer.
Nonetheless, the war-file approach seems best for this, as it mimics the
final deployment and can be considered a proper integration test.
Best regards,
Bernd.
Glen Mazza wrote:
I'd like to add JUnit test cases to the Maven version of my "DoubleIt"
web service provider[1]. The types of things I'd like to test are (1)
that an integer fed is actually doubled in the response, (2) not
well-formed SOAP requests are rejected, and (3) non-schema valid SOAP
requests are rejected.
I can think of two main ways of doing this:
1.) Write test cases the standard Maven way, i.e., create a test folder
that it is sibling of the service/src/main folder and write the test
cases there. That would require having an embedded Tomcat or Jetty
instance that reads the either the WAR file in target (or, equivalently,
the exploded war also in target), and makes a servlet out of that so the
test cases can work. I'm not sure if embedded Tomcat/Jetty can handle
this though--most/all of our CXF test cases don't work with WAR-file
hosted web service providers.
or
2.) Create a separate "systests" project that doesn't test anything
until the WAR is (manually) deployed on a non-embedded servlet
container--*then* run the tests. CXF also has this type of test--but
I'm unsure how appropriate it would be for the types of tests I'm
thinking of here.
Any suggestions which is best? What have others done for web service
provider testing?
Thanks,
Glen
[1] http://www.jroller.com/gmazza/date/20080417
--
Dr. Bernd Schuller | mail: [EMAIL PROTECTED]
| phone: +49 2461 61-8736 (fax: -6656)
Distributed Systems and Grid Computing | personal blog:
Juelich Supercomputing Centre | http://www.jroller.com/page/gridhaus
http://www.fz-juelich.de/jsc |
-------------------------------------------------------------------
-------------------------------------------------------------------
Forschungszentrum Jülich GmbH
52425 Jülich
Sitz der Gesellschaft: Jülich
Eingetragen im Handelsregister des Amtsgerichts Düren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Bärbel Brumme-Bothe
Geschäftsführung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr. Harald Bolt,
Dr. Sebastian M. Schmidt
-------------------------------------------------------------------
-------------------------------------------------------------------