servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r708639 - in /servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src: main/java/org/apache/servicemix/jbi/monitoring/StatisticsService.java test/java/org/apache/servicemix/jbi/monitoring/StatisticsServiceTest.java
Date Tue, 28 Oct 2008 19:20:09 GMT
Author: gertv
Date: Tue Oct 28 12:20:09 2008
New Revision: 708639

URL: http://svn.apache.org/viewvc?rev=708639&view=rev
Log:
SM-1456: NPE in StatisticsService.initEndpointListener()

Modified:
    servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/monitoring/StatisticsService.java
    servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/monitoring/StatisticsServiceTest.java

Modified: servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/monitoring/StatisticsService.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/monitoring/StatisticsService.java?rev=708639&r1=708638&r2=708639&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/monitoring/StatisticsService.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/monitoring/StatisticsService.java
Tue Oct 28 12:20:09 2008
@@ -203,7 +203,7 @@
         };
         container.addListener(endpointListener);
         // add endpoints that were registered before we added the listener
-        for (Endpoint mbean : container.getDefaultBroker().getRegistry().getEndpointRegistry().getEndpointMBeans())
{
+        for (Endpoint mbean : container.getRegistry().getEndpointRegistry().getEndpointMBeans())
{
             AbstractServiceEndpoint endpoint = 
                 (AbstractServiceEndpoint) container.getEndpoint(container.getComponent(mbean.getComponentName()).getContext(),

                                                                 mbean.getServiceName(), mbean.getEndpointName());

Modified: servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/monitoring/StatisticsServiceTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/monitoring/StatisticsServiceTest.java?rev=708639&r1=708638&r2=708639&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/monitoring/StatisticsServiceTest.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/monitoring/StatisticsServiceTest.java
Tue Oct 28 12:20:09 2008
@@ -25,6 +25,7 @@
 import org.apache.servicemix.jbi.container.ActivationSpec;
 import org.apache.servicemix.jbi.container.JBIContainer;
 import org.apache.servicemix.jbi.framework.ComponentContextImpl;
+import org.apache.servicemix.jbi.management.BaseSystemService;
 import org.apache.servicemix.jbi.messaging.DeliveryChannelImplTest.TestComponent;
 import org.apache.servicemix.jbi.servicedesc.EndpointSupport;
 
@@ -75,6 +76,17 @@
         assertNotNull(service.getComponentStats().get(COMPONENT));
         assertNotNull(service.getEndpointStats().get(EndpointSupport.getUniqueKey(endpoint)));
     }
+    
+    public void testInitByContainer() throws Exception {
+        JBIContainer con = new JBIContainer();
+        con.setEmbedded(true);
+        BaseSystemService[] services = new BaseSystemService[] {new StatisticsService()};
+        con.setServices(services);
+        con.init();
+        for (BaseSystemService srv : services) {
+            assertTrue(srv.isInitialized());
+        }
+    }
 
     private ServiceEndpoint registerEndpoint() throws JBIException {
         TestComponent component = new TestComponent(SERVICE, ENDPOINT);



Mime
View raw message