A quick tip to show you ApplicationComposer of OpenEJB can be used to test WebServices too.
In standalone to get the small OpenEJB http layer and be able to test webservices you simply need to add the property openejb.embedded.remotable to true to your properties.
Since last release of OpenEJB you can do the same! Just add this property in your @Configuration.
@Configuration public Properties config() { return new Properties() {{ setProperty(OpenEjbContainer.OPENEJB_EMBEDDED_REMOTABLE, "true"); }}; }
Then to avoid to build the whole application manually you can simply return the classes you want to deploy:
@Module public static Class<?>[] myApp() throws Exception { return new Class<?>[] { Foo.class, Bar.class, MyWebService.class }; }
Then simply add some test methods:
The default base url will be: http://127.0.0.1:4204/<your test simple name>
For instance: http://127.0.0.1:4204/MySuperWebServiceTest
If you want to customize the context simply add to @Configuration properties the property <your test simple name>.moduleId.
What if my restful web service has an EJB injected?
while it is in the list of classes to deploy it will work