You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by da...@apache.org on 2013/11/13 15:14:22 UTC

git commit: AMQ-3580: Added unit test

Updated Branches:
  refs/heads/trunk a7895ae34 -> e1a363f96


AMQ-3580: Added unit test


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/e1a363f9
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/e1a363f9
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/e1a363f9

Branch: refs/heads/trunk
Commit: e1a363f96e35a1b8054e0c6abc3d154198b7b689
Parents: a7895ae
Author: Claus Ibsen <cl...@gmail.com>
Authored: Wed Nov 13 15:15:42 2013 +0100
Committer: Claus Ibsen <cl...@gmail.com>
Committed: Wed Nov 13 15:15:42 2013 +0100

----------------------------------------------------------------------
 .../spring/SpringBrokerFactoryTest.java         | 38 ++++++++++++++++++++
 .../spring/activemq-embedded-factory.xml        | 28 +++++++++++++++
 2 files changed, 66 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/e1a363f9/activemq-spring/src/test/java/org/apache/activemq/spring/SpringBrokerFactoryTest.java
----------------------------------------------------------------------
diff --git a/activemq-spring/src/test/java/org/apache/activemq/spring/SpringBrokerFactoryTest.java b/activemq-spring/src/test/java/org/apache/activemq/spring/SpringBrokerFactoryTest.java
new file mode 100644
index 0000000..b283b65
--- /dev/null
+++ b/activemq-spring/src/test/java/org/apache/activemq/spring/SpringBrokerFactoryTest.java
@@ -0,0 +1,38 @@
+/**
+ * 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.spring;
+
+import junit.framework.TestCase;
+import org.apache.activemq.broker.BrokerService;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class SpringBrokerFactoryTest extends TestCase {
+
+    public void testEmbeddedBroker() throws Exception {
+        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring/activemq-embedded-factory.xml");
+        context.start();
+
+        BrokerService broker = (BrokerService) context.getBean("broker");
+        assertNotNull(broker);
+
+        assertEquals("test", broker.getBrokerName());
+
+        broker.stop();
+        context.stop();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1a363f9/activemq-spring/src/test/resources/spring/activemq-embedded-factory.xml
----------------------------------------------------------------------
diff --git a/activemq-spring/src/test/resources/spring/activemq-embedded-factory.xml b/activemq-spring/src/test/resources/spring/activemq-embedded-factory.xml
new file mode 100644
index 0000000..550c288
--- /dev/null
+++ b/activemq-spring/src/test/resources/spring/activemq-embedded-factory.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<beans
+    xmlns="http://www.springframework.org/schema/beans"
+    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.xsd">
+
+  <bean id="broker" class="org.apache.activemq.xbean.BrokerFactoryBean">
+    <property name="config" value="classpath:spring/spring.xml"/>
+    <property name="start" value="true"/>
+  </bean>
+
+</beans>
\ No newline at end of file