You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by "Tully, Gary" <Ga...@iona.com> on 2007/03/16 13:36:23 UTC

Small problem with testutil-common post move to Junit4

Hi,
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?

Thanks,
Gary.


svn diff
testutils\src\main\java\org\apache\cxf\testutil\common\AbstractBusClient
ServerTestBase.java
Index:
testutils/src/main/java/org/apache/cxf/testutil/common/AbstractBusClient
ServerTestBase.java
===================================================================
---
testutils/src/main/java/org/apache/cxf/testutil/common/AbstractBusClient
ServerTestBase.java (revision 518934)
+++
testutils/src/main/java/org/apache/cxf/testutil/common/AbstractBusClient
ServerTestBase.java (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;

RE: Small problem with testutil-common post move to Junit4

Posted by "Tully, Gary" <Ga...@iona.com>.
Thank You,
Gary. 

> -----Original Message-----
> From: Glynn, Eoghan [mailto:eoghan.glynn@iona.com] 
> Sent: 16 March 2007 14:02
> To: cxf-dev@incubator.apache.org
> Subject: RE: Small problem with testutil-common post move to Junit4
> 
> 
> Thanks Gary, I've just committed this ...
> 
> /Eoghan 
> 
> > -----Original Message-----
> > From: Tully, Gary [mailto:Gary.Tully@iona.com]
> > Sent: 16 March 2007 12:36
> > To: cxf-dev@incubator.apache.org
> > Subject: Small problem with testutil-common post move to Junit4
> > 
> > 
> > Hi,
> > 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?
> > 
> > Thanks,
> > Gary.
> > 
> > 
> > svn diff
> > testutils\src\main\java\org\apache\cxf\testutil\common\Abstrac
> > tBusClient
> > ServerTestBase.java
> > Index:
> > testutils/src/main/java/org/apache/cxf/testutil/common/Abstrac
> > tBusClient
> > ServerTestBase.java
> > ===================================================================
> > ---
> > testutils/src/main/java/org/apache/cxf/testutil/common/Abstrac
> > tBusClient
> > ServerTestBase.java (revision 518934)
> > +++
> > testutils/src/main/java/org/apache/cxf/testutil/common/Abstrac
> > tBusClient
> > ServerTestBase.java (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;
> > 
> 

RE: Small problem with testutil-common post move to Junit4

Posted by "Glynn, Eoghan" <eo...@iona.com>.
Thanks Gary, I've just committed this ...

/Eoghan 

> -----Original Message-----
> From: Tully, Gary [mailto:Gary.Tully@iona.com] 
> Sent: 16 March 2007 12:36
> To: cxf-dev@incubator.apache.org
> Subject: Small problem with testutil-common post move to Junit4
> 
> 
> Hi,
> 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?
> 
> Thanks,
> Gary.
> 
> 
> svn diff
> testutils\src\main\java\org\apache\cxf\testutil\common\Abstrac
> tBusClient
> ServerTestBase.java
> Index:
> testutils/src/main/java/org/apache/cxf/testutil/common/Abstrac
> tBusClient
> ServerTestBase.java
> ===================================================================
> ---
> testutils/src/main/java/org/apache/cxf/testutil/common/Abstrac
> tBusClient
> ServerTestBase.java (revision 518934)
> +++
> testutils/src/main/java/org/apache/cxf/testutil/common/Abstrac
> tBusClient
> ServerTestBase.java (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;
>