activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1431002 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/HealthViewMBeanTest.java
Date Wed, 09 Jan 2013 18:26:27 GMT
Author: tabish
Date: Wed Jan  9 18:26:27 2013
New Revision: 1431002

URL: http://svn.apache.org/viewvc?rev=1431002&view=rev
Log:
Fix test so it doesn't fail if the disk is a bit full 

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/HealthViewMBeanTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/HealthViewMBeanTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/HealthViewMBeanTest.java?rev=1431002&r1=1431001&r2=1431002&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/HealthViewMBeanTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/HealthViewMBeanTest.java
Wed Jan  9 18:26:27 2013
@@ -39,7 +39,6 @@ public class HealthViewMBeanTest extends
     protected MBeanServer mbeanServer;
     protected String domain = "org.apache.activemq";
 
-
     protected void setUp() throws Exception {
         bindAddress = "tcp://localhost:0";
         useTopic = false;
@@ -48,8 +47,6 @@ public class HealthViewMBeanTest extends
     }
 
     protected void tearDown() throws Exception {
-
-
         super.tearDown();
     }
 
@@ -63,9 +60,9 @@ public class HealthViewMBeanTest extends
         answer.setPersistent(true);
         answer.setDeleteAllMessagesOnStartup(true);
         answer.getSystemUsage().getTempUsage().setLimit(1024 * 1024 * 64);
+        answer.getSystemUsage().getStoreUsage().setLimit(1024 * 1024 * 64);
         answer.setUseJmx(true);
 
-
         // allow options to be visible via jmx
 
         answer.addConnector(bindAddress);
@@ -73,29 +70,32 @@ public class HealthViewMBeanTest extends
     }
 
     public void testHealthView() throws Exception{
-            Connection connection = connectionFactory.createConnection();
+        Connection connection = connectionFactory.createConnection();
 
-            connection.start();
-            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-            destination = createDestination();
-            MessageProducer producer = session.createProducer(destination);
-            producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-
-            for (int i = 0; i < 60; i++) {
-                BytesMessage message = session.createBytesMessage();
-                message.writeBytes(new byte[1024 *1024]);
-                producer.send(message);
-            }
-            Thread.sleep(1000);
+        connection.start();
+        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+        destination = createDestination();
+        MessageProducer producer = session.createProducer(destination);
+        producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+
+        for (int i = 0; i < 60; i++) {
+            BytesMessage message = session.createBytesMessage();
+            message.writeBytes(new byte[1024 *1024]);
+            producer.send(message);
+        }
+        Thread.sleep(1000);
 
         String objectNameStr = broker.getBrokerObjectName().toString();
         objectNameStr += ",service=Health";
-        ObjectName brokerName = assertRegisteredObjectName(objectNameStr
-        );
+        ObjectName brokerName = assertRegisteredObjectName(objectNameStr);
         HealthViewMBean health =  MBeanServerInvocationHandler.newProxyInstance(mbeanServer,
brokerName, HealthViewMBean.class, true);
         List<HealthStatus> list = health.healthList();
-        assertEquals(2,list.size());
 
+        for (HealthStatus status : list) {
+            LOG.info("Health status: {}", status);
+        }
+
+        assertEquals(2, list.size());
     }
 
     protected ObjectName assertRegisteredObjectName(String name) throws MalformedObjectNameException,
NullPointerException {



Mime
View raw message