http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/LostScheduledMessagesTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/LostScheduledMessagesTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/LostScheduledMessagesTest.java index 7b31771..180cb05 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/LostScheduledMessagesTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/LostScheduledMessagesTest.java @@ -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, @@ -17,13 +17,6 @@ package org.apache.activemq.broker.scheduler; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.io.File; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicLong; - import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.Message; @@ -31,6 +24,9 @@ import javax.jms.MessageConsumer; import javax.jms.MessageListener; import javax.jms.MessageProducer; import javax.jms.Session; +import java.io.File; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.ScheduledMessage; @@ -41,6 +37,9 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + public class LostScheduledMessagesTest { private BrokerService broker;
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/SchedulerDBVersionTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/SchedulerDBVersionTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/SchedulerDBVersionTest.java index db2d9ed..fac5545 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/SchedulerDBVersionTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/SchedulerDBVersionTest.java @@ -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, @@ -16,15 +16,6 @@ */ package org.apache.activemq.broker.scheduler; -import static org.junit.Assert.assertEquals; - -import java.io.File; -import java.io.IOException; -import java.security.ProtectionDomain; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; - import javax.jms.Connection; import javax.jms.Message; import javax.jms.MessageConsumer; @@ -33,6 +24,12 @@ import javax.jms.MessageProducer; import javax.jms.Queue; import javax.jms.Session; import javax.jms.TextMessage; +import java.io.File; +import java.io.IOException; +import java.security.ProtectionDomain; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.ScheduledMessage; @@ -45,6 +42,8 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static org.junit.Assert.assertEquals; + public class SchedulerDBVersionTest { static String basedir; @@ -53,8 +52,7 @@ public class SchedulerDBVersionTest { try { ProtectionDomain protectionDomain = SchedulerDBVersionTest.class.getProtectionDomain(); basedir = new File(new File(protectionDomain.getCodeSource().getLocation().getPath()), "../..").getCanonicalPath(); - } - catch (IOException e) { + } catch (IOException e) { basedir = "."; } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemeoryJmsSchedulerTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemeoryJmsSchedulerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemeoryJmsSchedulerTest.java index 8d72dfb..e67d799 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemeoryJmsSchedulerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemeoryJmsSchedulerTest.java @@ -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, http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJmsCronSchedulerTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJmsCronSchedulerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJmsCronSchedulerTest.java index bad8368..e3ec990 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJmsCronSchedulerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJmsCronSchedulerTest.java @@ -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, http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerJmxManagementTests.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerJmxManagementTests.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerJmxManagementTests.java index 2bd923e..b2c2c36 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerJmxManagementTests.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerJmxManagementTests.java @@ -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, http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerManagementTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerManagementTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerManagementTest.java index d305321..bd7becd 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerManagementTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerManagementTest.java @@ -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, http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerStoreTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerStoreTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerStoreTest.java index 6bf8b0f..fbc11b1 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerStoreTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerStoreTest.java @@ -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, @@ -16,8 +16,6 @@ */ package org.apache.activemq.broker.scheduler.memory; -import static org.junit.Assert.assertEquals; - import java.io.File; import java.util.ArrayList; import java.util.List; @@ -30,6 +28,8 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static org.junit.Assert.assertEquals; + /** * */ http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerTest.java index 0cce465..3a9fe3e 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerTest.java @@ -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, http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerTxTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerTxTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerTxTest.java index ab9e809..b1bb119 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerTxTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/memory/InMemoryJobSchedulerTxTest.java @@ -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, http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/store/DefaultStoreBrokerTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/store/DefaultStoreBrokerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/store/DefaultStoreBrokerTest.java index 49d5bd5..a3587ad 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/store/DefaultStoreBrokerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/store/DefaultStoreBrokerTest.java @@ -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, http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/store/DefaultStoreRecoveryBrokerTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/store/DefaultStoreRecoveryBrokerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/store/DefaultStoreRecoveryBrokerTest.java index 7aa2d13..a7e0c32 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/store/DefaultStoreRecoveryBrokerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/store/DefaultStoreRecoveryBrokerTest.java @@ -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, http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/store/LoadTester.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/store/LoadTester.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/store/LoadTester.java index 212c955..56eac03 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/store/LoadTester.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/store/LoadTester.java @@ -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, @@ -16,16 +16,15 @@ */ package org.apache.activemq.broker.store; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - import javax.jms.BytesMessage; import javax.jms.ConnectionFactory; import javax.jms.DeliveryMode; import javax.jms.MessageConsumer; import javax.jms.MessageProducer; import javax.jms.Session; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; import junit.framework.Test; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/store/RecoverExpiredMessagesTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/store/RecoverExpiredMessagesTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/store/RecoverExpiredMessagesTest.java index 16b0cf6..91ca430 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/store/RecoverExpiredMessagesTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/store/RecoverExpiredMessagesTest.java @@ -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, http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/DestinationsPluginTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/DestinationsPluginTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/DestinationsPluginTest.java index 9f65a3c..79af861 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/DestinationsPluginTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/DestinationsPluginTest.java @@ -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, @@ -24,7 +24,7 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; public class DestinationsPluginTest { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/PluginBrokerTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/PluginBrokerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/PluginBrokerTest.java index cc4b36a..45abf36 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/PluginBrokerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/PluginBrokerTest.java @@ -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, @@ -16,10 +16,9 @@ */ package org.apache.activemq.broker.util; -import java.net.URI; - import javax.jms.JMSException; import javax.jms.Message; +import java.net.URI; import org.apache.activemq.broker.BrokerFactory; import org.apache.activemq.broker.BrokerService; @@ -68,12 +67,10 @@ public class PluginBrokerTest extends JmsTopicSendReceiveTest { if (index == 7) { // check custom expiration assertTrue("expiration is in range, depends on two distinct calls to System.currentTimeMillis", 1500 < amqMsg.getExpiration() - amqMsg.getTimestamp()); - } - else if (index == 9) { + } else if (index == 9) { // check ceiling assertTrue("expiration ceeling is in range, depends on two distinct calls to System.currentTimeMillis", 59500 < amqMsg.getExpiration() - amqMsg.getTimestamp()); - } - else { + } else { // check default expiration assertEquals(1000, amqMsg.getExpiration() - amqMsg.getTimestamp()); } @@ -84,11 +81,9 @@ public class PluginBrokerTest extends JmsTopicSendReceiveTest { protected void sendMessage(int index, Message message) throws Exception { if (index == 7) { producer.send(producerDestination, message, Message.DEFAULT_DELIVERY_MODE, Message.DEFAULT_PRIORITY, 2000); - } - else if (index == 9) { + } else if (index == 9) { producer.send(producerDestination, message, Message.DEFAULT_DELIVERY_MODE, Message.DEFAULT_PRIORITY, 200000); - } - else { + } else { super.sendMessage(index, message); } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/RedeliveryPluginTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/RedeliveryPluginTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/RedeliveryPluginTest.java index 06e3ab8..62832d8 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/RedeliveryPluginTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/RedeliveryPluginTest.java @@ -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, @@ -50,8 +50,7 @@ public class RedeliveryPluginTest extends TestCase { try { underTest.installPlugin(broker); fail("expect exception on no scheduler support"); - } - catch (Exception expected) { + } catch (Exception expected) { LOG.info("expected: " + expected); } @@ -59,8 +58,7 @@ public class RedeliveryPluginTest extends TestCase { try { underTest.installPlugin(broker); fail("expect exception on small initial delay"); - } - catch (Exception expected) { + } catch (Exception expected) { LOG.info("expected: " + expected); } @@ -70,8 +68,7 @@ public class RedeliveryPluginTest extends TestCase { try { underTest.installPlugin(broker); fail("expect exception on small redelivery delay"); - } - catch (Exception expected) { + } catch (Exception expected) { LOG.info("expected: " + expected); } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/TimeStampingBrokerPluginTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/TimeStampingBrokerPluginTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/TimeStampingBrokerPluginTest.java index d14caaa..b43b05e 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/TimeStampingBrokerPluginTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/TimeStampingBrokerPluginTest.java @@ -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, http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/TraceBrokerPathPluginTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/TraceBrokerPathPluginTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/TraceBrokerPathPluginTest.java index cd55d4d..7171ddd 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/TraceBrokerPathPluginTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/util/TraceBrokerPathPluginTest.java @@ -6,14 +6,13 @@ * (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, * 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.broker.util; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQBytesMessageTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQBytesMessageTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQBytesMessageTest.java index 7551258..ca20489 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQBytesMessageTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQBytesMessageTest.java @@ -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, @@ -64,15 +64,13 @@ public class ActiveMQBytesMessageTest extends TestCase { for (int i = 0; i < len; i++) { msg.writeLong(5L); } - } - catch (JMSException ex) { + } catch (JMSException ex) { ex.printStackTrace(); } try { msg.reset(); assertTrue(msg.getBodyLength() == (len * 8)); - } - catch (Throwable e) { + } catch (Throwable e) { e.printStackTrace(); assertTrue(false); } @@ -84,8 +82,7 @@ public class ActiveMQBytesMessageTest extends TestCase { msg.writeBoolean(true); msg.reset(); assertTrue(msg.readBoolean()); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { jmsEx.printStackTrace(); assertTrue(false); } @@ -97,8 +94,7 @@ public class ActiveMQBytesMessageTest extends TestCase { msg.writeByte((byte) 2); msg.reset(); assertTrue(msg.readByte() == 2); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { jmsEx.printStackTrace(); assertTrue(false); } @@ -110,8 +106,7 @@ public class ActiveMQBytesMessageTest extends TestCase { msg.writeByte((byte) 2); msg.reset(); assertTrue(msg.readUnsignedByte() == 2); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { jmsEx.printStackTrace(); assertTrue(false); } @@ -123,8 +118,7 @@ public class ActiveMQBytesMessageTest extends TestCase { msg.writeShort((short) 3000); msg.reset(); assertTrue(msg.readShort() == 3000); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { jmsEx.printStackTrace(); assertTrue(false); } @@ -136,8 +130,7 @@ public class ActiveMQBytesMessageTest extends TestCase { msg.writeShort((short) 3000); msg.reset(); assertTrue(msg.readUnsignedShort() == 3000); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { jmsEx.printStackTrace(); assertTrue(false); } @@ -149,8 +142,7 @@ public class ActiveMQBytesMessageTest extends TestCase { msg.writeChar('a'); msg.reset(); assertTrue(msg.readChar() == 'a'); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { jmsEx.printStackTrace(); assertTrue(false); } @@ -162,8 +154,7 @@ public class ActiveMQBytesMessageTest extends TestCase { msg.writeInt(3000); msg.reset(); assertTrue(msg.readInt() == 3000); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { jmsEx.printStackTrace(); assertTrue(false); } @@ -175,8 +166,7 @@ public class ActiveMQBytesMessageTest extends TestCase { msg.writeLong(3000); msg.reset(); assertTrue(msg.readLong() == 3000); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { jmsEx.printStackTrace(); assertTrue(false); } @@ -188,8 +178,7 @@ public class ActiveMQBytesMessageTest extends TestCase { msg.writeFloat(3.3f); msg.reset(); assertTrue(msg.readFloat() == 3.3f); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { jmsEx.printStackTrace(); assertTrue(false); } @@ -201,8 +190,7 @@ public class ActiveMQBytesMessageTest extends TestCase { msg.writeDouble(3.3d); msg.reset(); assertTrue(msg.readDouble() == 3.3d); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { jmsEx.printStackTrace(); assertTrue(false); } @@ -215,8 +203,7 @@ public class ActiveMQBytesMessageTest extends TestCase { msg.writeUTF(str); msg.reset(); assertTrue(msg.readUTF().equals(str)); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { jmsEx.printStackTrace(); assertTrue(false); } @@ -239,8 +226,7 @@ public class ActiveMQBytesMessageTest extends TestCase { for (int i = 0; i < test.length; i++) { assertTrue(test[i] == i); } - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { jmsEx.printStackTrace(); assertTrue(false); } @@ -259,15 +245,13 @@ public class ActiveMQBytesMessageTest extends TestCase { msg.writeObject(new Float(3.3f)); msg.writeObject(new Double(3.3)); msg.writeObject(new byte[3]); - } - catch (MessageFormatException mfe) { + } catch (MessageFormatException mfe) { fail("objectified primitives should be allowed"); } try { msg.writeObject(new Object()); fail("only objectified primitives are allowed"); - } - catch (MessageFormatException mfe) { + } catch (MessageFormatException mfe) { } } @@ -280,10 +264,8 @@ public class ActiveMQBytesMessageTest extends TestCase { assertFalse(bytesMessage.isReadOnlyBody()); bytesMessage.writeInt(1); bytesMessage.readInt(); - } - catch (MessageNotReadableException mnwe) { - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotReadableException mnwe) { + } catch (MessageNotWriteableException mnwe) { assertTrue(false); } } @@ -293,8 +275,7 @@ public class ActiveMQBytesMessageTest extends TestCase { try { message.writeDouble(24.5); message.writeLong(311); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { fail("should be writeable"); } message.reset(); @@ -302,15 +283,13 @@ public class ActiveMQBytesMessageTest extends TestCase { assertTrue(message.isReadOnlyBody()); assertEquals(message.readDouble(), 24.5, 0); assertEquals(message.readLong(), 311); - } - catch (MessageNotReadableException mnre) { + } catch (MessageNotReadableException mnre) { fail("should be readable"); } try { message.writeInt(33); fail("should throw exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } } @@ -331,8 +310,7 @@ public class ActiveMQBytesMessageTest extends TestCase { message.writeShort((short) 1); message.writeShort((short) 1); message.writeUTF("utfstring"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { fail("Should be writeable"); } message.reset(); @@ -351,81 +329,68 @@ public class ActiveMQBytesMessageTest extends TestCase { message.readShort(); message.readUnsignedShort(); message.readUTF(); - } - catch (MessageNotReadableException mnwe) { + } catch (MessageNotReadableException mnwe) { fail("Should be readable"); } try { message.writeBoolean(true); fail("Should have thrown exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { message.writeByte((byte) 1); fail("Should have thrown exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { message.writeBytes(new byte[1]); fail("Should have thrown exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { message.writeBytes(new byte[3], 0, 2); fail("Should have thrown exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { message.writeChar('a'); fail("Should have thrown exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { message.writeDouble(1.5); fail("Should have thrown exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { message.writeFloat((float) 1.5); fail("Should have thrown exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { message.writeInt(1); fail("Should have thrown exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { message.writeLong(1); fail("Should have thrown exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { message.writeObject("stringobj"); fail("Should have thrown exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { message.writeShort((short) 1); fail("Should have thrown exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { message.writeUTF("utfstring"); fail("Should have thrown exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } } @@ -447,93 +412,78 @@ public class ActiveMQBytesMessageTest extends TestCase { message.writeShort((short) 1); message.writeShort((short) 1); message.writeUTF("utfstring"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { fail("Should be writeable"); } try { message.readBoolean(); fail("Should have thrown exception"); - } - catch (MessageNotReadableException mnwe) { + } catch (MessageNotReadableException mnwe) { } try { message.readByte(); fail("Should have thrown exception"); - } - catch (MessageNotReadableException e) { + } catch (MessageNotReadableException e) { } try { message.readUnsignedByte(); fail("Should have thrown exception"); - } - catch (MessageNotReadableException e) { + } catch (MessageNotReadableException e) { } try { message.readBytes(new byte[1]); fail("Should have thrown exception"); - } - catch (MessageNotReadableException e) { + } catch (MessageNotReadableException e) { } try { message.readBytes(new byte[2], 2); fail("Should have thrown exception"); - } - catch (MessageNotReadableException e) { + } catch (MessageNotReadableException e) { } try { message.readChar(); fail("Should have thrown exception"); - } - catch (MessageNotReadableException e) { + } catch (MessageNotReadableException e) { } try { message.readDouble(); fail("Should have thrown exception"); - } - catch (MessageNotReadableException e) { + } catch (MessageNotReadableException e) { } try { message.readFloat(); fail("Should have thrown exception"); - } - catch (MessageNotReadableException e) { + } catch (MessageNotReadableException e) { } try { message.readInt(); fail("Should have thrown exception"); - } - catch (MessageNotReadableException e) { + } catch (MessageNotReadableException e) { } try { message.readLong(); fail("Should have thrown exception"); - } - catch (MessageNotReadableException e) { + } catch (MessageNotReadableException e) { } try { message.readUTF(); fail("Should have thrown exception"); - } - catch (MessageNotReadableException e) { + } catch (MessageNotReadableException e) { } try { message.readShort(); fail("Should have thrown exception"); - } - catch (MessageNotReadableException e) { + } catch (MessageNotReadableException e) { } try { message.readUnsignedShort(); fail("Should have thrown exception"); - } - catch (MessageNotReadableException e) { + } catch (MessageNotReadableException e) { } try { message.readUTF(); fail("Should have thrown exception"); - } - catch (MessageNotReadableException e) { + } catch (MessageNotReadableException e) { } } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQDestinationTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQDestinationTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQDestinationTest.java index 4864c31..41616d7 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQDestinationTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQDestinationTest.java @@ -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, @@ -16,6 +16,11 @@ */ package org.apache.activemq.command; +import javax.jms.JMSException; +import javax.jms.Queue; +import javax.jms.TemporaryQueue; +import javax.jms.TemporaryTopic; +import javax.jms.Topic; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; @@ -24,12 +29,6 @@ import java.util.Map; import java.util.SortedSet; import java.util.TreeSet; -import javax.jms.JMSException; -import javax.jms.Queue; -import javax.jms.TemporaryQueue; -import javax.jms.TemporaryTopic; -import javax.jms.Topic; - import junit.framework.Test; public class ActiveMQDestinationTest extends DataStructureTestSupport { @@ -98,14 +97,12 @@ public class ActiveMQDestinationTest extends DataStructureTestSupport { try { ActiveMQDestination.transform(new CombyDest(null, null)); fail("expect ex as cannot disambiguate"); - } - catch (JMSException expected) { + } catch (JMSException expected) { } try { ActiveMQDestination.transform(new CombyDest("Q", "T")); fail("expect ex as cannot disambiguate"); - } - catch (JMSException expected) { + } catch (JMSException expected) { } } @@ -121,8 +118,7 @@ public class ActiveMQDestinationTest extends DataStructureTestSupport { try { new ActiveMQQueue(""); fail("Should have thrown IllegalArgumentException"); - } - catch (IllegalArgumentException e) { + } catch (IllegalArgumentException e) { } } @@ -131,8 +127,7 @@ public class ActiveMQDestinationTest extends DataStructureTestSupport { try { new ActiveMQTopic(""); fail("Should have thrown IllegalArgumentException"); - } - catch (IllegalArgumentException e) { + } catch (IllegalArgumentException e) { } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMapMessageTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMapMessageTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMapMessageTest.java index 4725279..0fda067 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMapMessageTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMapMessageTest.java @@ -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, @@ -16,17 +16,16 @@ */ package org.apache.activemq.command; +import javax.jms.JMSException; +import javax.jms.MessageFormatException; +import javax.jms.MessageNotReadableException; +import javax.jms.MessageNotWriteableException; import java.io.IOException; import java.util.Arrays; import java.util.Collections; import java.util.Enumeration; import java.util.List; -import javax.jms.JMSException; -import javax.jms.MessageFormatException; -import javax.jms.MessageNotReadableException; -import javax.jms.MessageNotWriteableException; - import junit.framework.TestCase; import org.slf4j.Logger; @@ -135,8 +134,7 @@ public class ActiveMQMapMessageTest extends TestCase { msg.setShort(this.name, (short) 1); msg = (ActiveMQMapMessage) msg.copy(); assertTrue(msg.getShort(this.name) == (short) 1); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { jmsEx.printStackTrace(); assertTrue(false); } @@ -148,8 +146,7 @@ public class ActiveMQMapMessageTest extends TestCase { msg.setChar(this.name, 'a'); msg = (ActiveMQMapMessage) msg.copy(); assertTrue(msg.getChar(this.name) == 'a'); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { jmsEx.printStackTrace(); assertTrue(false); } @@ -161,8 +158,7 @@ public class ActiveMQMapMessageTest extends TestCase { msg.setInt(this.name, 1); msg = (ActiveMQMapMessage) msg.copy(); assertTrue(msg.getInt(this.name) == 1); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { jmsEx.printStackTrace(); assertTrue(false); } @@ -174,8 +170,7 @@ public class ActiveMQMapMessageTest extends TestCase { msg.setLong(this.name, 1); msg = (ActiveMQMapMessage) msg.copy(); assertTrue(msg.getLong(this.name) == 1); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { jmsEx.printStackTrace(); assertTrue(false); } @@ -187,8 +182,7 @@ public class ActiveMQMapMessageTest extends TestCase { msg.setFloat(this.name, 1.5f); msg = (ActiveMQMapMessage) msg.copy(); assertTrue(msg.getFloat(this.name) == 1.5f); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { jmsEx.printStackTrace(); assertTrue(false); } @@ -200,8 +194,7 @@ public class ActiveMQMapMessageTest extends TestCase { msg.setDouble(this.name, 1.5); msg = (ActiveMQMapMessage) msg.copy(); assertTrue(msg.getDouble(this.name) == 1.5); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { jmsEx.printStackTrace(); assertTrue(false); } @@ -214,8 +207,7 @@ public class ActiveMQMapMessageTest extends TestCase { msg.setString(this.name, str); msg = (ActiveMQMapMessage) msg.copy(); assertEquals(msg.getString(this.name), str); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { jmsEx.printStackTrace(); assertTrue(false); } @@ -232,8 +224,7 @@ public class ActiveMQMapMessageTest extends TestCase { msg = (ActiveMQMapMessage) msg.copy(); assertTrue(Arrays.equals(msg.getBytes(this.name), bytes1)); assertEquals(msg.getBytes(this.name + "2").length, bytes2.length); - } - catch (JMSException jmsEx) { + } catch (JMSException jmsEx) { jmsEx.printStackTrace(); assertTrue(false); } @@ -263,8 +254,7 @@ public class ActiveMQMapMessageTest extends TestCase { msg.setObject("long", longValue); msg.setObject("short", shortValue); msg.setObject("string", stringValue); - } - catch (MessageFormatException mfe) { + } catch (MessageFormatException mfe) { LOG.warn("Caught: " + mfe); mfe.printStackTrace(); fail("object formats should be correct"); @@ -307,8 +297,7 @@ public class ActiveMQMapMessageTest extends TestCase { try { msg.setObject("object", new Object()); fail("should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } } @@ -405,81 +394,68 @@ public class ActiveMQMapMessageTest extends TestCase { msg.getObject("object"); msg.getShort("short"); msg.getString("string"); - } - catch (MessageNotReadableException mnre) { + } catch (MessageNotReadableException mnre) { fail("should be readable"); } try { msg.setBoolean("boolean", true); fail("should throw exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { msg.setByte("byte", (byte) 1); fail("should throw exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { msg.setBytes("bytes", new byte[1]); fail("should throw exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { msg.setBytes("bytes2", new byte[3], 0, 2); fail("should throw exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { msg.setChar("char", 'a'); fail("should throw exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { msg.setDouble("double", 1.5); fail("should throw exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { msg.setFloat("float", 1.5f); fail("should throw exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { msg.setInt("int", 1); fail("should throw exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { msg.setLong("long", 1); fail("should throw exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { msg.setObject("object", "stringObj"); fail("should throw exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { msg.setShort("short", (short) 1); fail("should throw exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } try { msg.setString("string", "string"); fail("should throw exception"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMessageTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMessageTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMessageTest.java index 4bca7eb..f1143af 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMessageTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMessageTest.java @@ -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, @@ -16,15 +16,14 @@ */ package org.apache.activemq.command; -import java.io.IOException; -import java.util.Enumeration; -import java.util.Map; - import javax.jms.DeliveryMode; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageFormatException; import javax.jms.MessageNotWriteableException; +import java.io.IOException; +import java.util.Enumeration; +import java.util.Map; import junit.framework.TestCase; @@ -113,11 +112,9 @@ public class ActiveMQMessageTest extends TestCase { boolean test = false; try { msg.setIntProperty("test", 1); - } - catch (MessageNotWriteableException me) { + } catch (MessageNotWriteableException me) { test = true; - } - catch (JMSException e) { + } catch (JMSException e) { e.printStackTrace(System.err); test = false; } @@ -452,21 +449,18 @@ public class ActiveMQMessageTest extends TestCase { msg.setObjectProperty(name, Double.valueOf("1.1")); msg.setObjectProperty(name, Boolean.TRUE); msg.setObjectProperty(name, null); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { fail("should accept object primitives and String"); } try { msg.setObjectProperty(name, new byte[5]); fail("should accept only object primitives and String"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.setObjectProperty(name, new Object()); fail("should accept only object primitives and String"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } } @@ -546,8 +540,7 @@ public class ActiveMQMessageTest extends TestCase { try { msg.setStringProperty(null, "Cheese"); fail("Should have thrown exception"); - } - catch (IllegalArgumentException e) { + } catch (IllegalArgumentException e) { LOG.info("Worked, caught: " + e); } } @@ -558,8 +551,7 @@ public class ActiveMQMessageTest extends TestCase { try { msg.setStringProperty("", "Cheese"); fail("Should have thrown exception"); - } - catch (IllegalArgumentException e) { + } catch (IllegalArgumentException e) { LOG.info("Worked, caught: " + e); } } @@ -589,38 +581,32 @@ public class ActiveMQMessageTest extends TestCase { try { msg.getByteProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getShortProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getIntProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getLongProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getFloatProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getDoubleProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } } @@ -638,20 +624,17 @@ public class ActiveMQMessageTest extends TestCase { try { msg.getBooleanProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getFloatProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getDoubleProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } } @@ -668,26 +651,22 @@ public class ActiveMQMessageTest extends TestCase { try { msg.getBooleanProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getByteProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getFloatProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getDoubleProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } } @@ -703,32 +682,27 @@ public class ActiveMQMessageTest extends TestCase { try { msg.getBooleanProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getByteProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getShortProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getFloatProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getDoubleProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } } @@ -743,38 +717,32 @@ public class ActiveMQMessageTest extends TestCase { try { msg.getBooleanProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getByteProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getShortProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getIntProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getFloatProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getDoubleProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } } @@ -789,32 +757,27 @@ public class ActiveMQMessageTest extends TestCase { try { msg.getBooleanProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getByteProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getShortProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getIntProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getLongProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } } @@ -828,38 +791,32 @@ public class ActiveMQMessageTest extends TestCase { try { msg.getBooleanProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getByteProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getShortProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getIntProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getLongProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getFloatProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } } @@ -889,38 +846,32 @@ public class ActiveMQMessageTest extends TestCase { try { msg.getByteProperty(propertyName); fail("Should have thrown exception"); - } - catch (NumberFormatException e) { + } catch (NumberFormatException e) { } try { msg.getShortProperty(propertyName); fail("Should have thrown exception"); - } - catch (NumberFormatException e) { + } catch (NumberFormatException e) { } try { msg.getIntProperty(propertyName); fail("Should have thrown exception"); - } - catch (NumberFormatException e) { + } catch (NumberFormatException e) { } try { msg.getLongProperty(propertyName); fail("Should have thrown exception"); - } - catch (NumberFormatException e) { + } catch (NumberFormatException e) { } try { msg.getFloatProperty(propertyName); fail("Should have thrown exception"); - } - catch (NumberFormatException e) { + } catch (NumberFormatException e) { } try { msg.getDoubleProperty(propertyName); fail("Should have thrown exception"); - } - catch (NumberFormatException e) { + } catch (NumberFormatException e) { } assertFalse(msg.getBooleanProperty(propertyName)); } @@ -933,56 +884,47 @@ public class ActiveMQMessageTest extends TestCase { ((org.apache.activemq.command.Message) msg).setProperty(propertyName, obj); // bypass // object // check - } - catch (IOException e) { + } catch (IOException e) { } try { msg.getStringProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getBooleanProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getByteProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getShortProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getIntProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getLongProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getFloatProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } try { msg.getDoubleProperty(propertyName); fail("Should have thrown exception"); - } - catch (MessageFormatException e) { + } catch (MessageFormatException e) { } } @@ -995,56 +937,47 @@ public class ActiveMQMessageTest extends TestCase { try { msg.setObjectProperty(propertyName, new Object()); fail("Should have thrown exception"); - } - catch (MessageNotWriteableException e) { + } catch (MessageNotWriteableException e) { } try { msg.setStringProperty(propertyName, "test"); fail("Should have thrown exception"); - } - catch (MessageNotWriteableException e) { + } catch (MessageNotWriteableException e) { } try { msg.setBooleanProperty(propertyName, true); fail("Should have thrown exception"); - } - catch (MessageNotWriteableException e) { + } catch (MessageNotWriteableException e) { } try { msg.setByteProperty(propertyName, (byte) 1); fail("Should have thrown exception"); - } - catch (MessageNotWriteableException e) { + } catch (MessageNotWriteableException e) { } try { msg.setShortProperty(propertyName, (short) 1); fail("Should have thrown exception"); - } - catch (MessageNotWriteableException e) { + } catch (MessageNotWriteableException e) { } try { msg.setIntProperty(propertyName, 1); fail("Should have thrown exception"); - } - catch (MessageNotWriteableException e) { + } catch (MessageNotWriteableException e) { } try { msg.setLongProperty(propertyName, 1); fail("Should have thrown exception"); - } - catch (MessageNotWriteableException e) { + } catch (MessageNotWriteableException e) { } try { msg.setFloatProperty(propertyName, (float) 1.5); fail("Should have thrown exception"); - } - catch (MessageNotWriteableException e) { + } catch (MessageNotWriteableException e) { } try { msg.setDoubleProperty(propertyName, 1.5); fail("Should have thrown exception"); - } - catch (MessageNotWriteableException e) { + } catch (MessageNotWriteableException e) { } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQObjectMessageTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQObjectMessageTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQObjectMessageTest.java index 94f0d93..1203fbc 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQObjectMessageTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQObjectMessageTest.java @@ -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, @@ -16,11 +16,10 @@ */ package org.apache.activemq.command; -import java.io.IOException; - import javax.jms.JMSException; import javax.jms.MessageNotReadableException; import javax.jms.MessageNotWriteableException; +import java.io.IOException; import junit.framework.TestCase; @@ -84,8 +83,7 @@ public class ActiveMQObjectMessageTest extends TestCase { assertNull(objectMessage.getObject()); objectMessage.setObject("String"); objectMessage.getObject(); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { fail("should be writeable"); } } @@ -96,15 +94,13 @@ public class ActiveMQObjectMessageTest extends TestCase { msg.setReadOnlyBody(true); try { msg.getObject(); - } - catch (MessageNotReadableException e) { + } catch (MessageNotReadableException e) { fail("should be readable"); } try { msg.setObject("test"); fail("should throw exception"); - } - catch (MessageNotWriteableException e) { + } catch (MessageNotWriteableException e) { } } @@ -114,8 +110,7 @@ public class ActiveMQObjectMessageTest extends TestCase { try { msg.setObject("test"); msg.getObject(); - } - catch (MessageNotReadableException e) { + } catch (MessageNotReadableException e) { fail("should be readable"); } msg.setReadOnlyBody(true); @@ -123,11 +118,9 @@ public class ActiveMQObjectMessageTest extends TestCase { msg.getObject(); msg.setObject("test"); fail("should throw exception"); - } - catch (MessageNotReadableException e) { + } catch (MessageNotReadableException e) { fail("should be readable"); - } - catch (MessageNotWriteableException mnwe) { + } catch (MessageNotWriteableException mnwe) { } }
