activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r610502 - in /activemq/trunk: ./ activemq-core/src/test/java/org/apache/activemq/memory/ activemq-core/src/test/resources/org/apache/activemq/memory/
Date Wed, 09 Jan 2008 18:44:36 GMT
Author: chirino
Date: Wed Jan  9 10:44:34 2008
New Revision: 610502

URL: http://svn.apache.org/viewvc?rev=610502&view=rev
Log:
Upgrade to xbean 3.3-SNAPSHOT to pull in the fix for:
http://issues.apache.org/jira/browse/XBEAN-101
PropertyPlaceholderConfigurer can not be used to resolve values assigned to xbean properties
that have a custom PropertyEditor


Added:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/memory/MemoryPropertyTest.java
  (with props)
    activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/memory/
    activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/memory/activemq.xml
  (with props)
    activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/memory/usage.properties
  (with props)
Modified:
    activemq/trunk/pom.xml

Added: 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=610502&view=auto
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/memory/MemoryPropertyTest.java
(added)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/memory/MemoryPropertyTest.java
Wed Jan  9 10:44:34 2008
@@ -0,0 +1,80 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.memory;
+
+import java.io.File;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.broker.BrokerFactory;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.xbean.BrokerFactoryBean;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+
+import junit.framework.TestCase;
+
+public class MemoryPropertyTest extends TestCase {
+
+    private static final transient Log LOG = LogFactory.getLog(MemoryPropertyTest.class);
+    BrokerService broker;
+
+    
+    /**
+     * Sets up a test where the producer and consumer have their own connection.
+     * 
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception {
+        // Create broker from resource
+        LOG.info("Creating broker... ");
+        broker = createBroker("xbean:org/apache/activemq/memory/activemq.xml");
+        LOG.info("Success");
+        super.setUp();
+    }
+    
+    protected BrokerService createBroker(String resource) throws Exception {
+        return BrokerFactory.createBroker(resource);
+    }
+
+
+    /*
+     * Stops the Broker
+     * 
+     * @see junit.framework.TestCase#tearDown()
+     */
+    protected void tearDown() throws Exception {
+        LOG.info("Closing Broker");
+        if (broker != null) {
+            broker.stop();
+        }
+        LOG.info("Broker closed...");
+    }
+
+
+
+    public void testBrokerInitialized() {
+        assertTrue("We should have a broker", broker != null);
+
+        assertEquals("test-broker", broker.getBrokerName());
+        assertEquals(1024, broker.getSystemUsage().getMemoryUsage().getLimit());
+        assertEquals(34, broker.getSystemUsage().getMemoryUsage().getPercentUsageMinDelta());
+        
+    }
+
+}

Propchange: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/memory/MemoryPropertyTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/memory/MemoryPropertyTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/memory/activemq.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/memory/activemq.xml?rev=610502&view=auto
==============================================================================
--- activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/memory/activemq.xml
(added)
+++ activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/memory/activemq.xml
Wed Jan  9 10:44:34 2008
@@ -0,0 +1,51 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+   
+    http://www.apache.org/licenses/LICENSE-2.0
+   
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<!-- START SNIPPET: example -->
+<beans
+  xmlns="http://www.springframework.org/schema/beans"
+  xmlns:amq="http://activemq.org/config/1.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+  http://activemq.org/config/1.0 http://activemq.apache.org/schema/activemq-core.xsd
+  http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
+
+  <!-- Allows us to use system properties as variables in this configuration file -->
+  <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+	<property name="location" value="org/apache/activemq/memory/usage.properties"/> 
+  </bean>  
+
+  <broker xmlns="http://activemq.org/config/1.0" brokerName="${name}" persistent="false">
+   
+    <!-- Use the following to set the broker memory limit -->
+	<systemUsage>
+	    <systemUsage>
+			<memoryUsage>
+		    	<memoryUsage limit="${limit}" percentUsageMinDelta="${delta}"/>
+			</memoryUsage>
+			<tempUsage>	
+		    	<tempUsage limit="100 mb"/>
+			</tempUsage>
+			<storeUsage>
+		    	<storeUsage limit="1 gb" name="foo"/>
+			</storeUsage>
+	    </systemUsage>
+	</systemUsage>
+
+  </broker>
+
+</beans>
+<!-- END SNIPPET: example -->

Propchange: activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/memory/activemq.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/memory/activemq.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/memory/usage.properties
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/memory/usage.properties?rev=610502&view=auto
==============================================================================
--- activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/memory/usage.properties
(added)
+++ activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/memory/usage.properties
Wed Jan  9 10:44:34 2008
@@ -0,0 +1,19 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+## 
+## http://www.apache.org/licenses/LICENSE-2.0
+## 
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+limit=1k
+name=test-broker
+delta=34
\ No newline at end of file

Propchange: activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/memory/usage.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/memory/usage.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/memory/usage.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: activemq/trunk/pom.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/pom.xml?rev=610502&r1=610501&r2=610502&view=diff
==============================================================================
--- activemq/trunk/pom.xml (original)
+++ activemq/trunk/pom.xml Wed Jan  9 10:44:34 2008
@@ -73,7 +73,7 @@
     <xmlbeans-version>2.0.0-beta1</xmlbeans-version>
     <xmlpull-version>1.1.3.4d_b4_min</xmlpull-version>
     <xstream-version>1.1.2</xstream-version>
-    <xbean-version>3.2-SNAPSHOT</xbean-version>
+    <xbean-version>3.3-SNAPSHOT</xbean-version>
     <felix-version>1.0.0</felix-version>
     <dist-repo-url>scpexe://people.apache.org/www/people.apache.org/repo/m2-incubating-repository</dist-repo-url>
     <m1-dist-repo-url>scpexe://people.apache.org/www/people.apache.org/repo/m1-snapshot-repository</m1-dist-repo-url>



Mime
View raw message