Aleksei,

Very nice tutorial.  I see the Hifaces20 testing library in there
as an easy way to run an embedded Jetty.  I'll try to get that working
but I'm still wondering if there is another way to get this working
without a servlet container.

Brian

----- Original message -----
From: "Aleksei Valikov" <[email protected]>
To: [email protected]
Date: Mon, 10 May 2010 23:50:22 +0200
Subject: Re: testing without web container?

Hi,

> I have a web application with a web service (JAX-WS) defined with
> the JAX-WS and Spring annotations.
> I can deploy it to glassfish 2.1.1 and it works like a champ.
> Pretty much like the standard examples (except that I have
> multiple versions of the webservices running through a single
> service impl.).
>
> I have a test class that creates a client via Spring using the
> JaxWsProxyFactoryBean class, but that assumes that the glassfish
> web container is up and running.  What I'm wondering is if its
> possible to write my JUnit test so that it creates the server
> (without glassfish or jetty) and client beans (in that order,
> since the client needs the generated wsdl).
>
> I'm running on Java6 and tried doing an Endpoint.publish but that
> doesn't do the Spring injection work.
> I'm now looking at the jaxws:server component and if I have to
> will fall back to creating a jetty instance but I'm not clear how
> that looks in JUnit - I'm assuming that the server will create
> its own thread pool.
>
> I can't find any examples anywhere of a Spring/JUnit-based
> integration test that starts up a server as well as a client. Is
> this possible? Any clues on what to look at first?
>
> Also, I'm not running this through maven.  I'd like to run the
> JUnit-based integration tests from my IDE (eclipse).

You can start Jetty programmatically within the test. Here's a
complete example I did for the tutorial:

Apache CXF Tutorial - Building JAX-WS, JAXB and JPA-based web service
with Apache CXF, Spring and Hyperjaxb3
http://confluence.highsource.org/x/r4BM

I start Jetty with CXF server-side and create a client within one
integration test. It's JUnit-based, works from both Eclipse and Maven.
No external Jetty needed.

Bye.
/lexi

---
Brian Repko
LearnThinkCode, Inc.
email: [email protected]
phone: +1 612 229 6779

Reply via email to