cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r680958 [2/2] - in /cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample: ./ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/cocoon/ src/main/java/org/apache/cocoon/acting/ src/main/java/org/apache/cocoon/jm...
Date Wed, 30 Jul 2008 10:18:05 GMT
Added: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/java/org/apache/cocoon/beans/TestTopicMessageListener.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/java/org/apache/cocoon/beans/TestTopicMessageListener.java?rev=680958&view=auto
==============================================================================
--- cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/java/org/apache/cocoon/beans/TestTopicMessageListener.java
(added)
+++ cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/java/org/apache/cocoon/beans/TestTopicMessageListener.java
Wed Jul 30 03:18:02 2008
@@ -0,0 +1,55 @@
+/*
+ * 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.cocoon.beans;
+
+import javax.jms.Destination;
+import javax.jms.Topic;
+
+/**
+ * This test verifies correct startup of various components (Spring beans).
+ */
+public class TestTopicMessageListener extends BaseMessageListenerTest {
+
+    /**
+     * Spring config file.
+     */
+    private static final String SPRING_CONFIG_FILE = "spring-activemq-topic.xml";
+
+    /**
+     * Spring {@link Topic} bean name.
+     */
+    private static final String TOPIC_BEAN = "topic";
+
+    /**
+     * Returns a {@link Topic} to use for JMS message transport.
+     * 
+     * @return A Spring {@link Topic}.
+     */
+    protected Destination getDestination() {
+        return (Topic) factory.getBean(TOPIC_BEAN);
+    }
+
+    /**
+     * Returns the Spring config file name.
+     * 
+     * @return Config file name.
+     * @see org.apache.cocoon.beans.BaseMessageListenerTest#getSpringConfigFile()
+     */
+    protected String getSpringConfigFile() {
+        return SPRING_CONFIG_FILE;
+    }
+}

Propchange: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/java/org/apache/cocoon/beans/TestTopicMessageListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/java/org/apache/cocoon/beans/TestTopicMessageListener.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/java/org/apache/cocoon/beans/TestTopicMessageListener.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/java/org/apache/cocoon/beans/TestTopicMessagePublisher.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/java/org/apache/cocoon/beans/TestTopicMessagePublisher.java?rev=680958&view=auto
==============================================================================
--- cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/java/org/apache/cocoon/beans/TestTopicMessagePublisher.java
(added)
+++ cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/java/org/apache/cocoon/beans/TestTopicMessagePublisher.java
Wed Jul 30 03:18:02 2008
@@ -0,0 +1,55 @@
+/*
+ * 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.cocoon.beans;
+
+import javax.jms.Destination;
+import javax.jms.Topic;
+
+/**
+ * This test verifies correct startup of various components (Spring beans).
+ */
+public class TestTopicMessagePublisher extends BaseMessagePublisherTest {
+
+    /**
+     * Spring config file.
+     */
+    private static final String SPRING_CONFIG_FILE = "spring-activemq-topic.xml";
+
+    /**
+     * Spring {@link Topic} bean name.
+     */
+    private static final String TOPIC_BEAN = "topic";
+
+    /**
+     * Returns a {@link Topic} to use for JMS message transport.
+     * 
+     * @return A Spring {@link Topic}.
+     */
+    protected Destination getDestination() {
+        return (Topic) factory.getBean(TOPIC_BEAN);
+    }
+
+    /**
+     * Returns the Spring config file name.
+     * 
+     * @return Config file name.
+     * @see org.apache.cocoon.beans.BaseMessageListenerTest#getSpringConfigFile()
+     */
+    protected String getSpringConfigFile() {
+        return SPRING_CONFIG_FILE;
+    }
+}

Propchange: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/java/org/apache/cocoon/beans/TestTopicMessagePublisher.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/java/org/apache/cocoon/beans/TestTopicMessagePublisher.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/java/org/apache/cocoon/beans/TestTopicMessagePublisher.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/ddl/hsql.sql
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/ddl/hsql.sql?rev=680958&view=auto
==============================================================================
--- cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/ddl/hsql.sql (added)
+++ cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/ddl/hsql.sql Wed Jul
30 03:18:02 2008
@@ -0,0 +1,20 @@
+--  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.
+
+DROP TABLE user IF EXISTS;
+
+CREATE TABLE user (
+    id    INTEGER NOT NULL PRIMARY KEY
+);

Propchange: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/ddl/hsql.sql
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/ddl/hsql.sql
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/ddl/hsql.sql
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/org/apache/cocoon/beans/spring-activemq-queue.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/org/apache/cocoon/beans/spring-activemq-queue.xml?rev=680958&view=auto
==============================================================================
--- cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/org/apache/cocoon/beans/spring-activemq-queue.xml
(added)
+++ cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/org/apache/cocoon/beans/spring-activemq-queue.xml
Wed Jul 30 03:18:02 2008
@@ -0,0 +1,65 @@
+<?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:amq="http://activemq.apache.org/schema/core"
+  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.5.xsd
+  http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core-5.1.0.xsd">
+
+  <!--  lets create an embedded ActiveMQ Broker -->
+  <amq:broker useJmx="false" persistent="false">
+    <amq:transportConnectors>
+      <amq:transportConnector uri="tcp://localhost:0" />
+    </amq:transportConnectors>
+  </amq:broker>
+
+  <amq:queue id="queue" physicalName="org.apache.activemq.spring.Test.spring.embedded"
/>
+
+  <!-- JMS ConnectionFactory to use, configuring the embedded broker using XML -->
+
+  <amq:connectionFactory id="jmsFactory" brokerURL="vm://localhost" />
+
+  <!-- Spring JMS Template -->
+  <bean id="myJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
+    <property name="connectionFactory">
+      <!-- lets wrap in a pool to avoid creating a connection per send -->
+      <bean class="org.springframework.jms.connection.SingleConnectionFactory">
+        <property name="targetConnectionFactory">
+          <ref local="jmsFactory" />
+        </property>
+      </bean>
+    </property>
+  </bean>
+
+  <bean id="consumerJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
+    <property name="connectionFactory" ref="jmsFactory" />
+  </bean>
+
+  <bean id="simpleProducer" class="org.apache.cocoon.jms.SimpleTextMessagePublisher">
+    <property name="template" ref="myJmsTemplate" />
+    <property name="destination" ref="queue" />
+  </bean>
+
+  <bean id="simpleConsumer" class="org.apache.cocoon.jms.SimpleMessageListener"
+    init-method="init" destroy-method="destroy">
+    <property name="template" ref="consumerJmsTemplate" />
+    <property name="subscriptionId" value="queueconsumer" />
+    <property name="destination" ref="queue" />
+  </bean>
+
+</beans>

Propchange: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/org/apache/cocoon/beans/spring-activemq-queue.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/org/apache/cocoon/beans/spring-activemq-queue.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/org/apache/cocoon/beans/spring-activemq-queue.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/org/apache/cocoon/beans/spring-activemq-topic.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/org/apache/cocoon/beans/spring-activemq-topic.xml?rev=680958&view=auto
==============================================================================
--- cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/org/apache/cocoon/beans/spring-activemq-topic.xml
(added)
+++ cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/org/apache/cocoon/beans/spring-activemq-topic.xml
Wed Jul 30 03:18:02 2008
@@ -0,0 +1,65 @@
+<?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:amq="http://activemq.apache.org/schema/core"
+  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.5.xsd
+  http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core-5.1.0.xsd">
+
+  <!--  lets create an embedded ActiveMQ Broker -->
+  <amq:broker useJmx="false" persistent="false">
+    <amq:transportConnectors>
+      <amq:transportConnector uri="tcp://localhost:0" />
+    </amq:transportConnectors>
+  </amq:broker>
+
+  <amq:topic id="topic" physicalName="org.apache.activemq.spring.Test.spring.embedded"
/>
+
+  <!-- JMS ConnectionFactory to use, configuring the embedded broker using XML -->
+
+  <amq:connectionFactory id="jmsFactory" brokerURL="vm://localhost" />
+
+  <!-- Spring JMS Template -->
+  <bean id="myJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
+    <property name="connectionFactory">
+      <!-- lets wrap in a pool to avoid creating a connection per send -->
+      <bean class="org.springframework.jms.connection.SingleConnectionFactory">
+        <property name="targetConnectionFactory">
+          <ref local="jmsFactory" />
+        </property>
+      </bean>
+    </property>
+  </bean>
+
+  <bean id="consumerJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
+    <property name="connectionFactory" ref="jmsFactory" />
+  </bean>
+
+  <bean id="simpleProducer" class="org.apache.cocoon.jms.SimpleTextMessagePublisher">
+    <property name="template" ref="myJmsTemplate" />
+    <property name="destination" ref="topic" />
+  </bean>
+
+  <bean id="simpleConsumer" class="org.apache.cocoon.jms.SimpleMessageListener"
+    init-method="init" destroy-method="destroy">
+    <property name="template" ref="consumerJmsTemplate" />
+    <property name="subscriptionId" value="topicconsumer" />
+    <property name="destination" ref="topic" />
+  </bean>
+
+</beans>

Propchange: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/org/apache/cocoon/beans/spring-activemq-topic.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/org/apache/cocoon/beans/spring-activemq-topic.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/org/apache/cocoon/beans/spring-activemq-topic.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/org/apache/cocoon/beans/spring-hsql.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/org/apache/cocoon/beans/spring-hsql.xml?rev=680958&view=auto
==============================================================================
--- cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/org/apache/cocoon/beans/spring-hsql.xml
(added)
+++ cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/org/apache/cocoon/beans/spring-hsql.xml
Wed Jul 30 03:18:02 2008
@@ -0,0 +1,29 @@
+<?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-2.5.xsd">
+
+  <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
+    <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
+    <property name="url" value="jdbc:hsqldb:file:target/test" />
+    <property name="username" value="sa" />
+    <property name="password" value="" />
+  </bean>
+
+</beans>
\ No newline at end of file

Propchange: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/org/apache/cocoon/beans/spring-hsql.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/org/apache/cocoon/beans/spring-hsql.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/blocks/cocoon-jms/cocoon-jms-sample/src/test/resources/org/apache/cocoon/beans/spring-hsql.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message