Examples of EmptyMessageImpl


Examples of net.timewalker.ffmq3.common.message.EmptyMessageImpl

    try { msg.getDoubleProperty("prop");  fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
  }
 
  public void testShortConversion() throws Exception
  {
    Message msg = new EmptyMessageImpl();
   
    msg.setShortProperty("prop", (short)1234);
   
    assertEquals(1234,msg.getShortProperty("prop"));
    assertEquals(1234,msg.getIntProperty("prop"));
    assertEquals(1234,msg.getLongProperty("prop"));
    assertEquals("1234",msg.getStringProperty("prop"));
   
    try { msg.getBooleanProperty("prop"); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getByteProperty("prop");    fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getFloatProperty("prop");   fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getDoubleProperty("prop");  fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
  }
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.EmptyMessageImpl

    try { msg.getDoubleProperty("prop");  fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
  }
 
  public void testIntConversion() throws Exception
  {
    Message msg = new EmptyMessageImpl();
   
    msg.setIntProperty("prop", 165535);
   
    assertEquals(165535,msg.getIntProperty("prop"));
    assertEquals(165535,msg.getLongProperty("prop"));
    assertEquals("165535",msg.getStringProperty("prop"));
   
    try { msg.getBooleanProperty("prop"); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getByteProperty("prop");    fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getShortProperty("prop");   fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getFloatProperty("prop");   fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getDoubleProperty("prop");  fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
  }
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.EmptyMessageImpl

    try { msg.getDoubleProperty("prop");  fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
  }
 
  public void testLongConversion() throws Exception
  {
    Message msg = new EmptyMessageImpl();
   
    msg.setLongProperty("prop", 92111222333l);
   
    assertEquals(92111222333l,msg.getLongProperty("prop"));
    assertEquals("92111222333",msg.getStringProperty("prop"));
   
    try { msg.getBooleanProperty("prop"); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getByteProperty("prop");    fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getShortProperty("prop");   fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getIntProperty("prop");     fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getFloatProperty("prop");   fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getDoubleProperty("prop");  fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
  }
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.EmptyMessageImpl

    try { msg.getDoubleProperty("prop");  fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
  }
 
  public void testFloatConversion() throws Exception
  {
    Message msg = new EmptyMessageImpl();
   
    msg.setFloatProperty("prop", 1.23f);
   
    assertEquals(1.23f,msg.getFloatProperty("prop"),0);
    assertEquals(1.23,msg.getDoubleProperty("prop"),0.0000001);
    assertEquals("1.23",msg.getStringProperty("prop"));
   
    try { msg.getBooleanProperty("prop"); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getByteProperty("prop");    fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getShortProperty("prop");   fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getIntProperty("prop");     fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getLongProperty("prop");    fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
  }
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.EmptyMessageImpl

    try { msg.getLongProperty("prop");    fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
  }
 
  public void testDoubleConversion() throws Exception
  {
    Message msg = new EmptyMessageImpl();
   
    msg.setDoubleProperty("prop", 1.23);

    assertEquals(1.23,msg.getDoubleProperty("prop"),0);
    assertEquals("1.23",msg.getStringProperty("prop"));
   
    try { msg.getBooleanProperty("prop"); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getByteProperty("prop");    fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getShortProperty("prop");   fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getIntProperty("prop");     fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getLongProperty("prop");    fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getFloatProperty("prop");   fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
  }
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.EmptyMessageImpl

    try { msg.getFloatProperty("prop");   fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
  }
 
  public void testStringConversion() throws Exception
  {
    Message msg = new EmptyMessageImpl();
   
    msg.setStringProperty("prop", "foobar");
    assertEquals("foobar", msg.getStringProperty("prop"));
    assertFalse(msg.getBooleanProperty("prop"));
    try { msg.getByteProperty("prop");   fail("Should have failed"); } catch (NumberFormatException e) { /* OK */ }
    try { msg.getShortProperty("prop");  fail("Should have failed"); } catch (NumberFormatException e) { /* OK */ }
    try { msg.getIntProperty("prop");    fail("Should have failed"); } catch (NumberFormatException e) { /* OK */ }
    try { msg.getLongProperty("prop");   fail("Should have failed"); } catch (NumberFormatException e) { /* OK */ }
    try { msg.getFloatProperty("prop");  fail("Should have failed"); } catch (NumberFormatException e) { /* OK */ }
    try { msg.getDoubleProperty("prop"); fail("Should have failed"); } catch (NumberFormatException e) { /* OK */ }
   
    msg.setStringProperty("prop", "123");
    assertEquals("123", msg.getStringProperty("prop"));
    assertFalse(msg.getBooleanProperty("prop"));
    assertEquals(123,msg.getByteProperty("prop"));
    assertEquals(123,msg.getShortProperty("prop"));
    assertEquals(123,msg.getIntProperty("prop"));
    assertEquals(123,msg.getLongProperty("prop"));
    assertEquals(123,msg.getFloatProperty("prop"),0);
    assertEquals(123,msg.getDoubleProperty("prop"),0);
  }
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.EmptyMessageImpl

    assertEquals(123,msg.getDoubleProperty("prop"),0);
  }
 
  public void testNullConversion() throws Exception
  {
    Message msg = new EmptyMessageImpl();
   
    assertNull(msg.getStringProperty("prop"));
    assertFalse(msg.getBooleanProperty("prop"));
    try { msg.getByteProperty("prop");   fail("Should have failed"); } catch (NumberFormatException e) { /* OK */ }
    try { msg.getShortProperty("prop");  fail("Should have failed"); } catch (NumberFormatException e) { /* OK */ }
    try { msg.getIntProperty("prop");    fail("Should have failed"); } catch (NumberFormatException e) { /* OK */ }
    try { msg.getLongProperty("prop");   fail("Should have failed"); } catch (NumberFormatException e) { /* OK */ }
    try { msg.getFloatProperty("prop");  fail("Should have failed"); } catch (NullPointerException e) { /* OK */ }
    try { msg.getDoubleProperty("prop"); fail("Should have failed"); } catch (NullPointerException e) { /* OK */ }
  }
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.EmptyMessageImpl

    try { msg.getDoubleProperty("prop"); fail("Should have failed"); } catch (NullPointerException e) { /* OK */ }
  }
 
  public void testObjectProperty() throws Exception
  {
    Message msg = new EmptyMessageImpl();
   
    msg.setObjectProperty("prop", new Boolean(true));
    assertEquals(Boolean.TRUE,msg.getObjectProperty("prop"));
   
    msg.setObjectProperty("prop", new Byte((byte)123));
    assertEquals(new Byte((byte)123),msg.getObjectProperty("prop"));
   
    msg.setObjectProperty("prop", new Short((short)123));
    assertEquals(new Short((short)123),msg.getObjectProperty("prop"));
   
    msg.setObjectProperty("prop", new Integer(123));
    assertEquals(new Integer(123),msg.getObjectProperty("prop"));
   
    msg.setObjectProperty("prop", new Long(123));
    assertEquals(new Long(123),msg.getObjectProperty("prop"));
   
    msg.setObjectProperty("prop", new Float(123));
    assertEquals(new Float(123),msg.getObjectProperty("prop"));
   
    msg.setObjectProperty("prop", new Double(123));
    assertEquals(new Double(123),msg.getObjectProperty("prop"));
   
    msg.setObjectProperty("prop", "foobar");
    assertEquals("foobar",msg.getObjectProperty("prop"));
   
    try { msg.setObjectProperty("prop", new Object()); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.setObjectProperty("prop", new BigInteger("1000")); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
   
   
    assertNull(msg.getObjectProperty("invalid"));
  }
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.EmptyMessageImpl

    assertNull(msg.getObjectProperty("invalid"));
  }
 
  public void testJMSProperties() throws Exception
  {
    Message msg = new EmptyMessageImpl();
   
    msg.setStringProperty("JMSMessageID", "foo");
  }
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.EmptyMessageImpl

    msg.setStringProperty("JMSMessageID", "foo");
  }
 
  public void testClearBody() throws Exception
  {
    Message msg = new EmptyMessageImpl();
    msg.clearBody();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.