easysoa / EasySOA

A light, collaborative platform to make Service Oriented Architecture simple.
http://www.easysoa.org
35 stars 8 forks source link

Problem closing Jetty HTTP binding component, forbids tests in CI #37

Closed JGuillemotte closed 12 years ago

JGuillemotte commented 12 years ago

This is very annoying because it forbids using Continuous Integration (Sonar tests analysis), ex. see TemplateTest in jenkins/job/easysoa-sonar/91/consoleFull where http://localhost:8090//runManager's binding.http (velocity) has already been started once but then was not able to stop.

In HttpDIscoveryProxy, using 2 test classes : one for the discovery mode and on for the validated mode. Each class work only with mocks. Several composite files are used, one for the main proxy and 3 others for the mocks. The conposite files are loaded with FraSCAti.processComposite() method and unloaded with FraSCAti.close() method. The used composite works with HTTP binding and WS binding.

The tests works very well separatelly in Eclipse.

Problem :

when a maven build is launched, the 2 tests are executed one after the other. The first test works well but the second hang on an HTTP service. It seems that a composite file cannot be successfully loaded in the second test. Jetty process stay with a 'STARTING' status during the start of the HTTP component.

How to reproduce :

See the special test class FraSCAtiBindingHttpCloseBugTest.java. Open ithe HttpDiscoveryProxy project in Eclipse and run this class a JUnit test.

Origin of the problem :

In the class org.ow2.frascati.servlet.manager.JettyServletManager, in the method unregisterServlet(final String uri), there is still a TODO tag : jettyServer.removeServant(URL url). It seems that the portion of code we try to use is not yet implemented.

Issue declared also in FraSCAti JIRA : http://jira.ow2.org/browse/FRASCATI-70

cmunilla commented 12 years ago

A new method in NuxeoFraSCAti (FraSCAtiServiceItf implementation), "unregisterServlet(URL)", allow to close Jetty HTTP binding components. The method has been tested in nuxeo-frascati-test with Servlets and WebService bindings.

mdutoo commented 12 years ago

Note : apparently the above was done using the following code (however not yet in FraSCAti itself) :

org.apache.cxf.Bus bus = org.apache.cxf.BusFactory.getDefaultBus(); org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory factory = bus.getExtension( org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory.class) factory.destroyForPort();

cmunilla commented 12 years ago

The FraSCAti's code has been completed allowing to unregister a servlet which has been previously registered