DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22249>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22249

Jetty doesn't stop after Cactus test run in Eclipse

           Summary: Jetty doesn't stop after Cactus test run in Eclipse
           Product: Cactus
           Version: 1.5-beta1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Eclipse Integration
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


The class 'org.apache.cactus.extension.jetty.JettyTestSetup' is used to start Jetty 
when running a 
Cactus test in Eclipse.  Jetty starts properly but isn't shutdown when the test is 
completed.  This 
is a problem if a TestSuite contains two JettyTestSetup tests.  In our company we have 
an 
AllTests class in each package which runs all of the tests in the package and 
subpackages.  Hence 
we have many cases where a TestSuite runs more than one JettyTestSetup test.  The 
server fails 
to start for subsequent JettyTestSetup tests and no further tests are run. 
 
The fix is to make two changes.  The first is to make the server a class variable.  
The lines: 
 
        // Create a Jetty Server object and configure a listener 
        Object server = createServer(baseConfig); 
 
should be 
 
        // Create a Jetty Server object and configure a listener 
        server = createServer(baseConfig); 
 
with 'Object server' declared with the other class variables. 
 
The second change is to stop Jetty in the tearDown method as such: 
 
        protected void tearDown() throws Exception { 
                super.tearDown(); 
                if (server != null) { 
                        server.getClass().getMethod("stop", null).invoke(server, 
null); 
                } 
        }

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to