activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r734194 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/xbean/ test/java/org/apache/activemq/config/ test/java/org/apache/activemq/memory/ test/java/org/apache/activemq/transport/failover/
Date Tue, 13 Jan 2009 17:42:12 GMT
Author: gtully
Date: Tue Jan 13 09:41:50 2009
New Revision: 734194

URL: http://svn.apache.org/viewvc?rev=734194&view=rev
Log:
resolve https://issues.apache.org/activemq/browse/AMQ-2064 - persistence Adapter and temp
store are now associated with the simple xbean system usage in the default activemq.xml

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerService.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/config/ConfigTest.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/memory/MemoryPropertyTest.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverTimeoutTest.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerService.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerService.java?rev=734194&r1=734193&r2=734194&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerService.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerService.java
Tue Jan 13 09:41:50 2009
@@ -16,7 +16,10 @@
  */
 package org.apache.activemq.xbean;
 
+import java.io.IOException;
+
 import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.usage.SystemUsage;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.DisposableBean;
 import org.springframework.beans.factory.InitializingBean;
@@ -48,6 +51,7 @@
     }
 
     public void afterPropertiesSet() throws Exception {
+        ensureSystemUsageHasStore();
         if (start) {
             start();
         }
@@ -62,6 +66,16 @@
         }
     }
 
+    private void ensureSystemUsageHasStore() throws IOException {
+        SystemUsage usage = getSystemUsage();
+        if (usage.getStoreUsage().getStore() == null) {
+            usage.getStoreUsage().setStore(getPersistenceAdapter());
+        }
+        if (usage.getTempUsage().getStore() == null) {
+            usage.getTempUsage().setStore(getTempDataStore());
+        }
+    }
+
     public void destroy() throws Exception {
         stop();
     }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/config/ConfigTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/config/ConfigTest.java?rev=734194&r1=734193&r2=734194&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/config/ConfigTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/config/ConfigTest.java
Tue Jan 13 09:41:50 2009
@@ -104,6 +104,8 @@
             // System.out.print("Checking persistence adapter factory
             // settings... ");
             broker.getPersistenceAdapter();
+            
+            assertTrue(broker.getSystemUsage().getStoreUsage().getStore() instanceof JournalPersistenceAdapter);
 
             LOG.info("Success");
         } finally {
@@ -240,6 +242,9 @@
             assertEquals("SystemUsage Config Error (TempUsage.limit)", 1024 * 1024 * 100,
systemUsage.getTempUsage().getLimit());
             assertEquals("SystemUsage Config Error (StoreUsage.limit)", 1024 * 1024 * 1024,
systemUsage.getStoreUsage().getLimit());
             assertEquals("SystemUsage Config Error (StoreUsage.name)", "foo", systemUsage.getStoreUsage().getName());
+            
+            assertNotNull(systemUsage.getStoreUsage().getStore());
+            assertTrue(systemUsage.getStoreUsage().getStore() instanceof MemoryPersistenceAdapter);
                         
             LOG.info("Success");
 

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/memory/MemoryPropertyTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/memory/MemoryPropertyTest.java?rev=734194&r1=734193&r2=734194&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/memory/MemoryPropertyTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/memory/MemoryPropertyTest.java
Tue Jan 13 09:41:50 2009
@@ -75,6 +75,9 @@
         assertEquals(1024, broker.getSystemUsage().getMemoryUsage().getLimit());
         assertEquals(34, broker.getSystemUsage().getMemoryUsage().getPercentUsageMinDelta());
         
+        assertNotNull(broker.getSystemUsage().getStoreUsage().getStore());
+        // non persistent broker so no temp storage
+        assertNull(broker.getSystemUsage().getTempUsage().getStore());
     }
 
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverTimeoutTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverTimeoutTest.java?rev=734194&r1=734193&r2=734194&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverTimeoutTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverTimeoutTest.java
Tue Jan 13 09:41:50 2009
@@ -40,7 +40,6 @@
 		try {
 			producer.send(message);
 		} catch (JMSException jmse) {
-			jmse.printStackTrace();
 			assertEquals("Failover timeout of " + timeout + " ms reached.", jmse.getMessage());
 		}
 		



Mime
View raw message