Repository: activemq-openwire Updated Branches: refs/heads/master 0c90d2e3d -> 71efcd78a
http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/71efcd78/openwire-core/src/test/java/org/apache/activemq/openwire/commands/OpenWireObjectMessageTest.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/test/java/org/apache/activemq/openwire/commands/OpenWireObjectMessageTest.java b/openwire-core/src/test/java/org/apache/activemq/openwire/commands/OpenWireObjectMessageTest.java index 5363df8..895aeec 100644 --- a/openwire-core/src/test/java/org/apache/activemq/openwire/commands/OpenWireObjectMessageTest.java +++ b/openwire-core/src/test/java/org/apache/activemq/openwire/commands/OpenWireObjectMessageTest.java @@ -19,33 +19,25 @@ package org.apache.activemq.openwire.commands; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; import java.io.IOException; -import javax.jms.JMSException; -import javax.jms.MessageNotWriteableException; - -import org.apache.activemq.openwire.commands.OpenWireObjectMessage; import org.junit.Test; -/** - * - */ public class OpenWireObjectMessageTest { @Test - public void testBytes() throws JMSException, IOException { + public void testBytes() throws Exception, IOException { OpenWireObjectMessage msg = new OpenWireObjectMessage(); String str = "testText"; msg.setObject(str); - msg = (OpenWireObjectMessage) msg.copy(); + msg = msg.copy(); assertEquals(msg.getObject(), str); } @Test - public void testSetObject() throws JMSException { + public void testSetObject() throws Exception { OpenWireObjectMessage msg = new OpenWireObjectMessage(); String str = "testText"; msg.setObject(str); @@ -53,16 +45,12 @@ public class OpenWireObjectMessageTest { } @Test - public void testClearBody() throws JMSException { + public void testClearBody() throws Exception { OpenWireObjectMessage objectMessage = new OpenWireObjectMessage(); - try { - objectMessage.setObject("String"); - objectMessage.clearBody(); - assertNull(objectMessage.getObject()); - objectMessage.setObject("String"); - objectMessage.getObject(); - } catch (MessageNotWriteableException mnwe) { - fail("should be writeable"); - } + objectMessage.setObject("String"); + objectMessage.clearBody(); + assertNull(objectMessage.getObject()); + objectMessage.setObject("String"); + objectMessage.getObject(); } } http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/71efcd78/openwire-core/src/test/java/org/apache/activemq/openwire/commands/OpenWireTextMessageTest.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/test/java/org/apache/activemq/openwire/commands/OpenWireTextMessageTest.java b/openwire-core/src/test/java/org/apache/activemq/openwire/commands/OpenWireTextMessageTest.java index d4a3811..45a4487 100644 --- a/openwire-core/src/test/java/org/apache/activemq/openwire/commands/OpenWireTextMessageTest.java +++ b/openwire-core/src/test/java/org/apache/activemq/openwire/commands/OpenWireTextMessageTest.java @@ -19,15 +19,10 @@ package org.apache.activemq.openwire.commands; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; import java.io.DataOutputStream; import java.io.IOException; -import javax.jms.JMSException; -import javax.jms.MessageNotReadableException; -import javax.jms.MessageNotWriteableException; - import org.apache.activemq.openwire.utils.MarshallingSupport; import org.fusesource.hawtbuf.Buffer; import org.fusesource.hawtbuf.ByteArrayOutputStream; @@ -45,7 +40,7 @@ public class OpenWireTextMessageTest { } @Test - public void testShallowCopy() throws JMSException { + public void testShallowCopy() throws Exception { OpenWireTextMessage msg = new OpenWireTextMessage(); String string = "str"; msg.setText(string); @@ -60,13 +55,13 @@ public class OpenWireTextMessageTest { try { msg.setText(str); assertEquals(msg.getText(), str); - } catch (JMSException e) { + } catch (Exception e) { e.printStackTrace(); } } @Test - public void testGetBytes() throws JMSException, IOException { + public void testGetBytes() throws Exception, IOException { OpenWireTextMessage msg = new OpenWireTextMessage(); String str = "testText"; msg.setText(str); @@ -80,19 +75,13 @@ public class OpenWireTextMessageTest { } @Test - public void testClearBody() throws JMSException, IOException { + public void testClearBody() throws Exception, IOException { OpenWireTextMessage textMessage = new OpenWireTextMessage(); textMessage.setText("string"); textMessage.clearBody(); assertNull(textMessage.getText()); - try { - textMessage.setText("String"); - textMessage.getText(); - } catch (MessageNotWriteableException mnwe) { - fail("should be writeable"); - } catch (MessageNotReadableException mnre) { - fail("should be readable"); - } + textMessage.setText("String"); + textMessage.getText(); } @Test http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/71efcd78/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 5135a68..85b0bec 100644 --- a/pom.xml +++ b/pom.xml @@ -144,11 +144,6 @@ <version>${reflections-version}</version> </dependency> <dependency> - <groupId>org.apache.geronimo.specs</groupId> - <artifactId>geronimo-jms_1.1_spec</artifactId> - <version>1.1.1</version> - </dependency> - <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${junit-version}</version>