cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tully, Gary" <>
Subject Small problem with testutil-common post move to Junit4
Date Fri, 16 Mar 2007 12:36:23 GMT

I have found a small problem with the default initialization of the
member variable 'bus', in AbstractBusClientServerTestBase. The result is
that an @After annotated method shuts down 'bus' if it is not null. This
means that if a @BeforeClass initialises the staticBus, after the first
test run, it will be shutdown leaving nothing for the @AfterClass method
and ensuring that a new default bus is created by the runtime for
subsequent tests, which is contrary to the use of a static bus. The
staticBus can be resolved via BusFactory because it is set as the
defaultBus, so there does not seem to be a need for the default
initialisation of 'bus'.

The fix below sorts out the problem. All tests pass with this change.

Can someone commit the for me?


svn diff
testutils/src/main/java/org/apache/cxf/testutil/common/AbstractBusClient (revision 518934)
testutils/src/main/java/org/apache/cxf/testutil/common/AbstractBusClient (working copy)
@@ -44,7 +44,7 @@
     protected static Bus staticBus;

     protected String configFileName = defaultConfigFileName;
-    protected Bus bus = staticBus;
+    protected Bus bus;

     public void createBus(String config) throws Exception {
         configFileName = config;

View raw message