You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2012/07/28 18:26:36 UTC
svn commit: r1366703 - in
/activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire:
./ test/
Author: chirino
Date: Sat Jul 28 16:26:35 2012
New Revision: 1366703
URL: http://svn.apache.org/viewvc?rev=1366703&view=rev
Log:
move openwire tests into test package
Added:
activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/
activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/DestinationWildcardTest.scala
- copied, changed from r1366677, activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/DestinationWildcardTest.scala
activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/DurableSubscriberTest.scala
- copied, changed from r1366677, activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/DurableSubscriberTest.scala
activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/ExclusiveConsumerTest.scala
- copied, changed from r1366677, activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/ExclusiveConsumerTest.scala
activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/OpenwireTestSupport.scala
- copied, changed from r1366677, activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/OpenwireTestSupport.scala
activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/QueueTest.scala
- copied, changed from r1366677, activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/QueueTest.scala
activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/SecurityTest.scala
- copied, changed from r1366677, activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/SecurityTest.scala
activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/SslSecurityTest.scala
- copied, changed from r1366677, activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/SslSecurityTest.scala
activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/TempDestinationTest.scala
- copied, changed from r1366677, activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/TempDestinationTest.scala
activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/TopicTest.scala
- copied, changed from r1366677, activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/TopicTest.scala
activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/TransactionTest.scala
- copied, changed from r1366677, activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/TransactionTest.scala
Removed:
activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/DestinationWildcardTest.scala
activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/DurableSubscriberTest.scala
activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/ExclusiveConsumerTest.scala
activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/OpenwireTestSupport.scala
activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/QueueTest.scala
activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/SecurityTest.scala
activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/SslSecurityTest.scala
activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/TempDestinationTest.scala
activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/TopicTest.scala
activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/TransactionTest.scala
Copied: activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/DestinationWildcardTest.scala (from r1366677, activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/DestinationWildcardTest.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/DestinationWildcardTest.scala?p2=activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/DestinationWildcardTest.scala&p1=activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/DestinationWildcardTest.scala&r1=1366677&r2=1366703&rev=1366703&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/DestinationWildcardTest.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/DestinationWildcardTest.scala Sat Jul 28 16:26:35 2012
@@ -6,7 +6,7 @@
* (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
+ * 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,
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.activemq.apollo.openwire
+package org.apache.activemq.apollo.openwire.test
import javax.jms.{MessageConsumer, MessageProducer, TextMessage, Session}
@@ -31,23 +31,23 @@ class DestinationWildcardTest extends Op
val producer1 = session.createProducer(queue(prefix + "A"))
val producer2 = session.createProducer(queue(prefix + "B"))
val producer3 = session.createProducer(queue("bar.A"))
- def put(producer:MessageProducer, id:Int) {
- producer.send(session.createTextMessage("message:"+id))
+ def put(producer: MessageProducer, id: Int) {
+ producer.send(session.createTextMessage("message:" + id))
}
- List(1,2,3).foreach(put(producer1, _))
+ List(1, 2, 3).foreach(put(producer1, _))
producer3.send(session.createTextMessage("This one shouldn't get consumed."))
- List(1,2,3).foreach(put(producer2, _))
+ List(1, 2, 3).foreach(put(producer2, _))
val consumer = session.createConsumer(queue(prefix + "*"))
- def get(id:Int) {
+ def get(id: Int) {
val m = consumer.receive().asInstanceOf[TextMessage]
- m.getText should equal ("message:"+id)
+ m.getText should equal("message:" + id)
}
- List(1,2,3).foreach(get _)
- List(1,2,3).foreach(get _)
+ List(1, 2, 3).foreach(get _)
+ List(1, 2, 3).foreach(get _)
consumer.receive(1000) should be(null)
}
@@ -64,38 +64,38 @@ class DestinationWildcardTest extends Op
val producer2 = session.createProducer(topic(prefix2 + "B"))
val producer3 = session.createProducer(topic(prefix3 + "C"))
- def put(producer:MessageProducer, id:Int) {
- producer.send(session.createTextMessage("message:"+id))
+ def put(producer: MessageProducer, id: Int) {
+ producer.send(session.createTextMessage("message:" + id))
}
val consumer1 = session.createConsumer(topic(prefix1 + "*"))
val consumer2 = session.createConsumer(topic(prefix2 + "*"))
val consumer3 = session.createConsumer(topic(prefix3 + "*"))
- def get(consumer:MessageConsumer, id:Int) {
+ def get(consumer: MessageConsumer, id: Int) {
val m = consumer.receive(2000).asInstanceOf[TextMessage]
- m should not be(null)
- m.getText should equal ("message:"+id)
+ m should not be (null)
+ m.getText should equal("message:" + id)
}
// They only consumer one should see these.
- List(1,2,3).foreach(put(producer1, _))
+ List(1, 2, 3).foreach(put(producer1, _))
- List(1,2,3).foreach(get(consumer1, _))
+ List(1, 2, 3).foreach(get(consumer1, _))
consumer2.receive(2000) should be(null)
consumer3.receive(2000) should be(null)
// They only consumer two should see these.
- List(1,2,3).foreach(put(producer2, _))
+ List(1, 2, 3).foreach(put(producer2, _))
- List(1,2,3).foreach(get(consumer2, _))
+ List(1, 2, 3).foreach(get(consumer2, _))
consumer1.receive(2000) should be(null)
consumer3.receive(2000) should be(null)
// They only consumer two should see these.
- List(1,2,3).foreach(put(producer3, _))
+ List(1, 2, 3).foreach(put(producer3, _))
- List(1,2,3).foreach(get(consumer3, _))
+ List(1, 2, 3).foreach(get(consumer3, _))
consumer1.receive(2000) should be(null)
consumer2.receive(2000) should be(null)
}
Copied: activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/DurableSubscriberTest.scala (from r1366677, activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/DurableSubscriberTest.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/DurableSubscriberTest.scala?p2=activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/DurableSubscriberTest.scala&p1=activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/DurableSubscriberTest.scala&r1=1366677&r2=1366703&rev=1366703&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/DurableSubscriberTest.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/DurableSubscriberTest.scala Sat Jul 28 16:26:35 2012
@@ -6,7 +6,7 @@
* (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
+ * 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,
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.activemq.apollo.openwire
+package org.apache.activemq.apollo.openwire.test
import javax.jms.{TextMessage, Session}
@@ -43,21 +43,21 @@ class DurableSubscriberTest extends Open
default_connection.start()
val session = default_connection.createSession(false, Session.AUTO_ACKNOWLEDGE)
val producer = session.createProducer(topic("example"))
- def put(id:Int) {
- producer.send(session.createTextMessage("message:"+id))
+ def put(id: Int) {
+ producer.send(session.createTextMessage("message:" + id))
}
- List(1,2,3).foreach(put _)
+ List(1, 2, 3).foreach(put _)
val subscriber = session.createDurableSubscriber(topic("example"), "test")
- def get(id:Int) {
+ def get(id: Int) {
val m = subscriber.receive().asInstanceOf[TextMessage]
m.getJMSDestination should equal(topic("example"))
- m.getText should equal ("message:"+id)
+ m.getText should equal("message:" + id)
}
- List(1,2,3).foreach(get _)
+ List(1, 2, 3).foreach(get _)
}
}
\ No newline at end of file
Copied: activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/ExclusiveConsumerTest.scala (from r1366677, activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/ExclusiveConsumerTest.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/ExclusiveConsumerTest.scala?p2=activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/ExclusiveConsumerTest.scala&p1=activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/ExclusiveConsumerTest.scala&r1=1366677&r2=1366703&rev=1366703&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/ExclusiveConsumerTest.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/ExclusiveConsumerTest.scala Sat Jul 28 16:26:35 2012
@@ -6,7 +6,7 @@
* (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
+ * 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,
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.activemq.apollo.openwire
+package org.apache.activemq.apollo.openwire.test
import javax.jms.{TextMessage, Session}
@@ -41,7 +41,7 @@ class ExclusiveConsumerSelectedWhenCreat
Thread.sleep(100)
// Verify exclusive consumer receives the message.
- exclusiveConsumer.receive(100) should not be(null)
+ exclusiveConsumer.receive(100) should not be (null)
fallbackConsumer.receive(100) should be(null)
}
}
@@ -65,7 +65,7 @@ class ExclusiveConsumerSelectedWhenCreat
Thread.sleep(100)
// Verify exclusive consumer receives the message.
- exclusiveConsumer.receive(100) should not be(null)
+ exclusiveConsumer.receive(100) should not be (null)
fallbackConsumer.receive(100) should be(null)
}
}
@@ -91,7 +91,7 @@ class FailoverToAnotherExclusiveConsumer
Thread.sleep(100)
// Verify exclusive consumer receives the message.
- exclusiveConsumer1.receive(100) should not be(null)
+ exclusiveConsumer1.receive(100) should not be (null)
exclusiveConsumer2.receive(100) should be(null)
fallbackConsumer.receive(100) should be(null)
@@ -102,7 +102,7 @@ class FailoverToAnotherExclusiveConsumer
producer.send(senderSession.createTextMessage("Failover To Another Exclusive Consumer Created First - 2"))
producer.send(senderSession.createTextMessage("Failover To Another Exclusive Consumer Created First - 3"))
- exclusiveConsumer2.receive(100) should not be(null)
+ exclusiveConsumer2.receive(100) should not be (null)
fallbackConsumer.receive(100) should be(null)
}
}
@@ -128,7 +128,7 @@ class FailoverToAnotherExclusiveConsumer
Thread.sleep(100)
// Verify exclusive consumer receives the message.
- exclusiveConsumer1.receive(100) should not be(null)
+ exclusiveConsumer1.receive(100) should not be (null)
exclusiveConsumer2.receive(100) should be(null)
fallbackConsumer.receive(100) should be(null)
@@ -139,7 +139,7 @@ class FailoverToAnotherExclusiveConsumer
producer.send(senderSession.createTextMessage("Failover To Another Exclusive Consumer Created After - 2"))
producer.send(senderSession.createTextMessage("Failover To Another Exclusive Consumer Created After - 3"))
- exclusiveConsumer2.receive(100) should not be(null)
+ exclusiveConsumer2.receive(100) should not be (null)
fallbackConsumer.receive(100) should be(null)
}
}
@@ -165,7 +165,7 @@ class FailoverToNonExclusiveConsumer ext
Thread.sleep(100)
// Verify exclusive consumer receives the message.
- exclusiveConsumer.receive(100) should not be(null)
+ exclusiveConsumer.receive(100) should not be (null)
fallbackConsumer.receive(100) should be(null)
// Close the exclusive consumer to verify the non-exclusive consumer
@@ -173,7 +173,7 @@ class FailoverToNonExclusiveConsumer ext
exclusiveConsumer.close()
producer.send(senderSession.createTextMessage("Failover To NonExclusive Consumer - 2"))
- fallbackConsumer.receive(100) should not be(null)
+ fallbackConsumer.receive(100) should not be (null)
fallbackConsumer.close()
}
}
@@ -196,7 +196,7 @@ class FallbackToAnotherExclusiveConsumer
Thread.sleep(100)
// Verify exclusive consumer receives the message.
- exclusiveConsumer.receive(200) should not be(null)
+ exclusiveConsumer.receive(200) should not be (null)
fallbackConsumer.receive(200) should be(null)
Thread.sleep(100)
@@ -206,7 +206,7 @@ class FallbackToAnotherExclusiveConsumer
exclusiveConsumer.close()
producer.send(senderSession.createTextMessage("Fallback To Exclusive Consumer - 2"))
- fallbackConsumer.receive(100) should not be(null)
+ fallbackConsumer.receive(100) should not be (null)
// Create exclusive consumer to determine if it will start receiving
// the messages.
@@ -215,7 +215,7 @@ class FallbackToAnotherExclusiveConsumer
producer.send(senderSession.createTextMessage("Fallback To Exclusive Consumer - 3"))
// Verify exclusive consumer receives the message.
- exclusiveConsumer.receive(100) should not be(null)
+ exclusiveConsumer.receive(100) should not be (null)
fallbackConsumer.receive(100) should be(null)
}
Copied: activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/OpenwireTestSupport.scala (from r1366677, activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/OpenwireTestSupport.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/OpenwireTestSupport.scala?p2=activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/OpenwireTestSupport.scala&p1=activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/OpenwireTestSupport.scala&r1=1366677&r2=1366703&rev=1366703&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/OpenwireTestSupport.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/OpenwireTestSupport.scala Sat Jul 28 16:26:35 2012
@@ -6,7 +6,7 @@
* (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
+ * 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,
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.activemq.apollo.openwire
+package org.apache.activemq.apollo.openwire.test
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.BeforeAndAfterEach
@@ -28,10 +28,11 @@ import org.apache.activemq.apollo.broker
class OpenwireTestSupport extends BrokerFunSuiteSupport with ShouldMatchers with BeforeAndAfterEach {
override def broker_config_uri = "xml:classpath:apollo-openwire.xml"
+
val transport_scheme = "tcp"
val transport_host = "localhost"
- var default_connection:Connection = _
+ var default_connection: Connection = _
var connections = List[Connection]()
override protected def afterEach() {
@@ -41,20 +42,24 @@ class OpenwireTestSupport extends Broker
default_connection = null
}
-// def connection_uri = transportScheme + "://localhost:%d?wireFormat.maxInactivityDuration=1000000&wireFormat.maxInactivityDurationInitalDelay=1000000".format(port)
- def connection_uri(uri_options:String="") = (transport_scheme + "://" + transport_host + ":%d" + uri_options).format(port)
- def create_connection_factory(uri_options:String="") = new ActiveMQConnectionFactory(connection_uri(uri_options))
- def create_connection(uri_options:String=""): Connection = create_connection_factory(uri_options).createConnection
- def queue(value:String) = new ActiveMQQueue(value);
- def topic(value:String) = new ActiveMQTopic(value);
+ // def connection_uri = transportScheme + "://localhost:%d?wireFormat.maxInactivityDuration=1000000&wireFormat.maxInactivityDurationInitalDelay=1000000".format(port)
+ def connection_uri(uri_options: String = "") = (transport_scheme + "://" + transport_host + ":%d" + uri_options).format(port)
+
+ def create_connection_factory(uri_options: String = "") = new ActiveMQConnectionFactory(connection_uri(uri_options))
+
+ def create_connection(uri_options: String = ""): Connection = create_connection_factory(uri_options).createConnection
+
+ def queue(value: String) = new ActiveMQQueue(value);
+
+ def topic(value: String) = new ActiveMQTopic(value);
- def connect(uri_options:String="", start:Boolean=true) = {
+ def connect(uri_options: String = "", start: Boolean = true) = {
val connection = create_connection(uri_options)
connections ::= connection
- if(default_connection==null) {
+ if (default_connection == null) {
default_connection = connection
}
- if( start ) {
+ if (start) {
connection.start()
}
connection
Copied: activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/QueueTest.scala (from r1366677, activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/QueueTest.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/QueueTest.scala?p2=activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/QueueTest.scala&p1=activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/QueueTest.scala&r1=1366677&r2=1366703&rev=1366703&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/QueueTest.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/QueueTest.scala Sat Jul 28 16:26:35 2012
@@ -6,7 +6,7 @@
* (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
+ * 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,
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.activemq.apollo.openwire
+package org.apache.activemq.apollo.openwire.test
import javax.jms.{DeliveryMode, Message, TextMessage, Session}
@@ -30,22 +30,22 @@ class BDBQueueTest extends OpenwireTestS
val session = default_connection.createSession(false, Session.CLIENT_ACKNOWLEDGE)
val producer = session.createProducer(queue("prefetch"))
producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT)
- def put(id:Int) {
+ def put(id: Int) {
val msg = session.createBytesMessage()
- msg.writeBytes(new Array[Byte](1024*4))
+ msg.writeBytes(new Array[Byte](1024 * 4))
producer.send(msg)
}
- for(i <- 1 to 1000) {
+ for (i <- 1 to 1000) {
put(i)
}
val consumer = session.createConsumer(queue("prefetch"))
- def get(id:Int) {
+ def get(id: Int) {
val m = consumer.receive()
- expect(true, "Did not get message: "+id)(m!=null)
+ expect(true, "Did not get message: " + id)(m != null)
}
- for(i <- 1 to 1000) {
+ for (i <- 1 to 1000) {
get(i)
}
default_connection.close()
@@ -56,11 +56,11 @@ class BDBQueueTest extends OpenwireTestS
connect()
val session2 = default_connection.createSession(false, Session.CLIENT_ACKNOWLEDGE)
val consumer2 = session2.createConsumer(queue("prefetch"))
- def get2(id:Int) {
+ def get2(id: Int) {
val m = consumer2.receive()
- expect(true, "Did not get message: "+id)(m!=null)
+ expect(true, "Did not get message: " + id)(m != null)
}
- for(i <- 1 to 1000) {
+ for (i <- 1 to 1000) {
get2(i)
}
@@ -69,28 +69,28 @@ class BDBQueueTest extends OpenwireTestS
}
class QueueTest extends OpenwireTestSupport {
-
+
test("Queue Message Cached") {
connect("?wireFormat.cacheEnabled=false&wireFormat.tightEncodingEnabled=false")
val session = default_connection.createSession(false, Session.AUTO_ACKNOWLEDGE)
val producer = session.createProducer(queue("example"))
- def put(id:Int) {
- producer.send(session.createTextMessage("message:"+id))
+ def put(id: Int) {
+ producer.send(session.createTextMessage("message:" + id))
}
- List(1,2,3).foreach(put _)
+ List(1, 2, 3).foreach(put _)
val consumer = session.createConsumer(queue("example"))
- def get(id:Int) {
+ def get(id: Int) {
val m = consumer.receive().asInstanceOf[TextMessage]
m.getJMSDestination should equal(queue("example"))
- m.getText should equal ("message:"+id)
+ m.getText should equal("message:" + id)
}
- List(1,2,3).foreach(get _)
+ List(1, 2, 3).foreach(get _)
}
test("Queue order preserved") {
@@ -99,21 +99,21 @@ class QueueTest extends OpenwireTestSupp
val session = default_connection.createSession(false, Session.AUTO_ACKNOWLEDGE)
val producer = session.createProducer(queue("example"))
- def put(id:Int) {
- producer.send(session.createTextMessage("message:"+id))
+ def put(id: Int) {
+ producer.send(session.createTextMessage("message:" + id))
}
- List(1,2,3).foreach(put _)
+ List(1, 2, 3).foreach(put _)
val consumer = session.createConsumer(queue("example"))
- def get(id:Int) {
+ def get(id: Int) {
val m = consumer.receive().asInstanceOf[TextMessage]
m.getJMSDestination should equal(queue("example"))
- m.getText should equal ("message:"+id)
+ m.getText should equal("message:" + id)
}
- List(1,2,3).foreach(get _)
+ List(1, 2, 3).foreach(get _)
}
test("Test that messages are consumed ") {
@@ -128,7 +128,7 @@ class QueueTest extends OpenwireTestSupp
// Consume the message...
var consumer = session.createConsumer(queue)
var msg = consumer.receive(1000)
- msg should not be(null)
+ msg should not be (null)
Thread.sleep(1000)
@@ -146,7 +146,7 @@ class QueueTest extends OpenwireTestSupp
val session = default_connection.createSession(false, Session.AUTO_ACKNOWLEDGE)
val producer = session.createProducer(queue("example"))
- def put(id:Int, color:String) {
+ def put(id: Int, color: String) {
val message = session.createTextMessage("message:" + id)
message.setStringProperty("color", color)
producer.send(message)
@@ -158,10 +158,10 @@ class QueueTest extends OpenwireTestSupp
val consumer = session.createConsumer(queue("example"), "color='red'")
- def get(id:Int) {
+ def get(id: Int) {
val m = consumer.receive().asInstanceOf[TextMessage]
m.getJMSDestination should equal(queue("example"))
- m.getText should equal ("message:"+id)
+ m.getText should equal("message:" + id)
}
get(1)
@@ -177,8 +177,8 @@ class QueueTest extends OpenwireTestSupp
var consumer = session.createConsumer(queue("BROWSER.TEST.RB"))
val outbound = List(session.createTextMessage("First Message"),
- session.createTextMessage("Second Message"),
- session.createTextMessage("Third Message"))
+ session.createTextMessage("Second Message"),
+ session.createTextMessage("Third Message"))
// lets consume any outstanding messages from previous test runs
while (consumer.receive(1000) != null) {
@@ -206,8 +206,8 @@ class QueueTest extends OpenwireTestSupp
// There should be no more.
var tooMany = false;
while (enumeration.hasMoreElements) {
- debug("Got extra message: %s", enumeration.nextElement());
- tooMany = true;
+ debug("Got extra message: %s", enumeration.nextElement());
+ tooMany = true;
}
tooMany should be(false)
browser.close()
@@ -229,8 +229,8 @@ class QueueTest extends OpenwireTestSupp
val producer = session.createProducer(queue("BROWSER.TEST.BR"))
val outbound = List(session.createTextMessage("First Message"),
- session.createTextMessage("Second Message"),
- session.createTextMessage("Third Message"))
+ session.createTextMessage("Second Message"),
+ session.createTextMessage("Third Message"))
producer.send(outbound(0))
@@ -249,59 +249,59 @@ class QueueTest extends OpenwireTestSupp
consumer.receive(100) should be(outbound(0))
}
-// test("Queue Browser With 2 Consumers") {
-// val numMessages = 1000;
-//
-// connect()
-//
-// default_connection.setAlwaysSyncSend(false);
-//
-// val session = default_connection.createSession(false, Session.AUTO_ACKNOWLEDGE)
-//
-// val destination = queue("BROWSER.TEST")
-//
-// val destinationPrefetch10 = queue("TEST?jms.prefetchSize=10")
-// val destinationPrefetch1 = queue("TEST?jms.prefetchsize=1")
-//
-// val connection2 = create_connection
-// connection2.start()
-// connections.add(connection2)
-// val session2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE)
-//
-// val producer = session.createProducer(destination)
-// val consumer = session.createConsumer(destinationPrefetch10)
-//
-// for (i <- 1 to 10) {
-// val message = session.createTextMessage("Message: " + i)
-// producer.send(message)
-// }
-//
-// val browser = session2.createBrowser(destinationPrefetch1)
-// val browserView = browser.getEnumeration()
-//
-// val messages = List[Message]
-// for (i <- 0toInt numMessages) {
-// val m1 = consumer.receive(5000)
-// m1 shoulld not be(null)
-// messages += m1
-// }
-//
-// val i = 0;
-// for (;i < numMessages && browserView.hasMoreElements(); i++) {
-// Message m1 = messages.get(i);
-// Message m2 = browserView.nextElement();
-// assertNotNull("m2 is null for index: " + i, m2);
-// assertEquals(m1.getJMSMessageID(), m2.getJMSMessageID());
-// }
-//
-// // currently browse max page size is ignored for a queue browser consumer
-// // only guarantee is a page size - but a snapshot of pagedinpending is
-// // used so it is most likely more
-// assertTrue("got at least our expected minimum in the browser: ", i > BaseDestination.MAX_PAGE_SIZE);
-//
-// assertFalse("nothing left in the browser", browserView.hasMoreElements());
-// assertNull("consumer finished", consumer.receiveNoWait());
-// }
+ // test("Queue Browser With 2 Consumers") {
+ // val numMessages = 1000;
+ //
+ // connect()
+ //
+ // default_connection.setAlwaysSyncSend(false);
+ //
+ // val session = default_connection.createSession(false, Session.AUTO_ACKNOWLEDGE)
+ //
+ // val destination = queue("BROWSER.TEST")
+ //
+ // val destinationPrefetch10 = queue("TEST?jms.prefetchSize=10")
+ // val destinationPrefetch1 = queue("TEST?jms.prefetchsize=1")
+ //
+ // val connection2 = create_connection
+ // connection2.start()
+ // connections.add(connection2)
+ // val session2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE)
+ //
+ // val producer = session.createProducer(destination)
+ // val consumer = session.createConsumer(destinationPrefetch10)
+ //
+ // for (i <- 1 to 10) {
+ // val message = session.createTextMessage("Message: " + i)
+ // producer.send(message)
+ // }
+ //
+ // val browser = session2.createBrowser(destinationPrefetch1)
+ // val browserView = browser.getEnumeration()
+ //
+ // val messages = List[Message]
+ // for (i <- 0toInt numMessages) {
+ // val m1 = consumer.receive(5000)
+ // m1 shoulld not be(null)
+ // messages += m1
+ // }
+ //
+ // val i = 0;
+ // for (;i < numMessages && browserView.hasMoreElements(); i++) {
+ // Message m1 = messages.get(i);
+ // Message m2 = browserView.nextElement();
+ // assertNotNull("m2 is null for index: " + i, m2);
+ // assertEquals(m1.getJMSMessageID(), m2.getJMSMessageID());
+ // }
+ //
+ // // currently browse max page size is ignored for a queue browser consumer
+ // // only guarantee is a page size - but a snapshot of pagedinpending is
+ // // used so it is most likely more
+ // assertTrue("got at least our expected minimum in the browser: ", i > BaseDestination.MAX_PAGE_SIZE);
+ //
+ // assertFalse("nothing left in the browser", browserView.hasMoreElements());
+ // assertNull("consumer finished", consumer.receiveNoWait());
+ // }
test("Browse Close") {
connect()
@@ -309,8 +309,8 @@ class QueueTest extends OpenwireTestSupp
val destination = queue("BROWSER.TEST.BC")
val outbound = List(session.createTextMessage("First Message"),
- session.createTextMessage("Second Message"),
- session.createTextMessage("Third Message"))
+ session.createTextMessage("Second Message"),
+ session.createTextMessage("Third Message"))
val producer = session.createProducer(destination)
producer.send(outbound(0))
Copied: activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/SecurityTest.scala (from r1366677, activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/SecurityTest.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/SecurityTest.scala?p2=activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/SecurityTest.scala&p1=activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/SecurityTest.scala&r1=1366677&r2=1366703&rev=1366703&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/SecurityTest.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/SecurityTest.scala Sat Jul 28 16:26:35 2012
@@ -6,7 +6,7 @@
* (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
+ * 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,
@@ -15,9 +15,9 @@
* limitations under the License.
*/
-package org.apache.activemq.apollo.openwire
+package org.apache.activemq.apollo.openwire.test
-import javax.jms.{Session,JMSException,MessageProducer}
+import javax.jms.{Session, JMSException, MessageProducer}
abstract class SecurityTest extends OpenwireTestSupport {
@@ -28,7 +28,7 @@ abstract class SecurityTest extends Open
val login_file = new java.io.File(getClass.getClassLoader.getResource("login.config").getFile())
System.setProperty("java.security.auth.login.config", login_file.getCanonicalPath)
} catch {
- case x:Throwable => x.printStackTrace
+ case x: Throwable => x.printStackTrace
}
super.beforeAll
}
@@ -212,6 +212,6 @@ class SubscribeFailsForConnectionOnlyAut
intercept[JMSException] {
val consumer = session.createConsumer(queue("secure"))
consumer.receive();
- }
+ }
}
}
Copied: activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/SslSecurityTest.scala (from r1366677, activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/SslSecurityTest.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/SslSecurityTest.scala?p2=activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/SslSecurityTest.scala&p1=activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/SslSecurityTest.scala&r1=1366677&r2=1366703&rev=1366703&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/SslSecurityTest.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/SslSecurityTest.scala Sat Jul 28 16:26:35 2012
@@ -6,7 +6,7 @@
* (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
+ * 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,
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.activemq.apollo.openwire
+package org.apache.activemq.apollo.openwire.test
import javax.jms.{TextMessage, Session}
@@ -36,7 +36,7 @@ class SslSecurityTest extends OpenwireTe
System.setProperty("javax.net.ssl.keyStorePassword", "password");
System.setProperty("javax.net.ssl.keyStoreType", "jks");
} catch {
- case x:Throwable => x.printStackTrace
+ case x: Throwable => x.printStackTrace
}
super.beforeAll
}
@@ -47,8 +47,8 @@ class SslSecurityTest extends OpenwireTe
val session = default_connection.createSession(false, Session.AUTO_ACKNOWLEDGE)
val producer = session.createProducer(topic("example"))
- def put(id:Int) {
- producer.send(session.createTextMessage("message:"+id))
+ def put(id: Int) {
+ producer.send(session.createTextMessage("message:" + id))
}
put(1)
@@ -58,13 +58,13 @@ class SslSecurityTest extends OpenwireTe
put(2)
put(3)
- def get(id:Int) {
+ def get(id: Int) {
val m = consumer.receive().asInstanceOf[TextMessage]
m.getJMSDestination should equal(topic("example"))
- m.getText should equal ("message:"+id)
+ m.getText should equal("message:" + id)
}
- List(2,3).foreach(get _)
+ List(2, 3).foreach(get _)
}
Copied: activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/TempDestinationTest.scala (from r1366677, activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/TempDestinationTest.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/TempDestinationTest.scala?p2=activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/TempDestinationTest.scala&p1=activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/TempDestinationTest.scala&r1=1366677&r2=1366703&rev=1366703&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/TempDestinationTest.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/TempDestinationTest.scala Sat Jul 28 16:26:35 2012
@@ -1,4 +1,4 @@
-package org.apache.activemq.apollo.openwire
+package org.apache.activemq.apollo.openwire.test
import javax.jms._
@@ -10,7 +10,7 @@ import javax.jms._
* (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
+ * 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,
@@ -21,14 +21,14 @@ import javax.jms._
class TempDestinationTest extends OpenwireTestSupport {
test("Temp Queue Destinations") {
- test_temp_destination((session:Session) => session.createTemporaryQueue())
+ test_temp_destination((session: Session) => session.createTemporaryQueue())
}
test("Temp Topic Destinations") {
- test_temp_destination((session:Session) => session.createTemporaryTopic())
+ test_temp_destination((session: Session) => session.createTemporaryTopic())
}
- def test_temp_destination(func:(Session)=>Destination) = {
+ def test_temp_destination(func: (Session) => Destination) = {
connect()
val connection2 = connect("", true)
@@ -40,30 +40,30 @@ class TempDestinationTest extends Openwi
val producer2 = session2.createProducer(dest)
- def put(id:Int) = producer2.send(session.createTextMessage("message:"+id))
- def get(id:Int) = {
+ def put(id: Int) = producer2.send(session.createTextMessage("message:" + id))
+ def get(id: Int) = {
val m = consumer.receive().asInstanceOf[TextMessage]
m.getJMSDestination should equal(dest)
- m.getText should equal ("message:"+id)
+ m.getText should equal("message:" + id)
}
Thread.sleep(1000);
- List(1,2,3).foreach(put _)
- List(1,2,3).foreach(get _)
+ List(1, 2, 3).foreach(put _)
+ List(1, 2, 3).foreach(get _)
// A different connection should not be able to consume from it.
try {
session2.createConsumer(dest)
fail("expected jms exception")
} catch {
- case e:JMSException => println(e)
+ case e: JMSException => println(e)
}
// delete the temporary destination.
consumer.close()
dest match {
- case dest:TemporaryQueue=> dest.delete()
- case dest:TemporaryTopic=> dest.delete()
+ case dest: TemporaryQueue => dest.delete()
+ case dest: TemporaryTopic => dest.delete()
}
// The producer should no longer be able to send to it.
@@ -72,7 +72,7 @@ class TempDestinationTest extends Openwi
put(4)
fail("expected jms exception")
} catch {
- case e:JMSException => println(e)
+ case e: JMSException => println(e)
}
}
Copied: activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/TopicTest.scala (from r1366677, activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/TopicTest.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/TopicTest.scala?p2=activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/TopicTest.scala&p1=activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/TopicTest.scala&r1=1366677&r2=1366703&rev=1366703&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/TopicTest.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/TopicTest.scala Sat Jul 28 16:26:35 2012
@@ -6,7 +6,7 @@
* (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
+ * 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,
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.activemq.apollo.openwire
+package org.apache.activemq.apollo.openwire.test
import javax.jms.{TextMessage, Session}
@@ -24,8 +24,8 @@ class TopicTest extends OpenwireTestSupp
connect()
val session = default_connection.createSession(false, Session.AUTO_ACKNOWLEDGE)
val producer = session.createProducer(topic("example"))
- def put(id:Int) {
- producer.send(session.createTextMessage("message:"+id))
+ def put(id: Int) {
+ producer.send(session.createTextMessage("message:" + id))
}
put(1)
@@ -35,13 +35,13 @@ class TopicTest extends OpenwireTestSupp
put(2)
put(3)
- def get(id:Int) {
+ def get(id: Int) {
val m = consumer.receive().asInstanceOf[TextMessage]
m.getJMSDestination should equal(topic("example"))
- m.getText should equal ("message:"+id)
+ m.getText should equal("message:" + id)
}
- List(2,3).foreach(get _)
+ List(2, 3).foreach(get _)
}
}
\ No newline at end of file
Copied: activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/TransactionTest.scala (from r1366677, activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/TransactionTest.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/TransactionTest.scala?p2=activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/TransactionTest.scala&p1=activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/TransactionTest.scala&r1=1366677&r2=1366703&rev=1366703&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/TransactionTest.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/TransactionTest.scala Sat Jul 28 16:26:35 2012
@@ -6,7 +6,7 @@
* (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
+ * 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,
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.activemq.apollo.openwire
+package org.apache.activemq.apollo.openwire.test
import javax.jms.{TextMessage, Message, MessageListener, Session}
@@ -23,7 +23,7 @@ import javax.jms.{TextMessage, Message,
*
*/
class TransactionTest extends OpenwireTestSupport {
-
+
test("Simple JMS Transaction Test") {
connect()
val producer_session = default_connection.createSession(false, Session.AUTO_ACKNOWLEDGE)
@@ -38,22 +38,22 @@ class TransactionTest extends OpenwireTe
val m = consumer.receive(1000).asInstanceOf[TextMessage]
m should not be (null)
- m.getText should equal (messages(0).getText)
+ m.getText should equal(messages(0).getText)
consumer_session.commit
var m2 = consumer.receive(1000).asInstanceOf[TextMessage]
m2 should not be (null)
- m2.getText should equal (messages(1).getText)
+ m2.getText should equal(messages(1).getText)
consumer_session.rollback
m2 = consumer.receive(2000).asInstanceOf[TextMessage]
m2 should not be (null)
- m2.getText should equal (messages(1).getText)
+ m2.getText should equal(messages(1).getText)
consumer_session.commit
val m3 = consumer.receive(1000).asInstanceOf[TextMessage]
m3 should not be (null)
- m3.getText should equal (messages(2).getText)
+ m3.getText should equal(messages(2).getText)
consumer_session.commit
}