Package org.springframework.jms.support.converter

Examples of org.springframework.jms.support.converter.SimpleMessageConverter.toMessage()


        messageControl.setReturnValue(content, 1);
        sessionControl.replay();
        messageControl.replay();

        SimpleMessageConverter converter = new SimpleMessageConverter();
        Message msg = converter.toMessage(content, session);
        assertEquals(content, converter.fromMessage(msg));

        sessionControl.verify();
        messageControl.verify();
    }
View Full Code Here


        messageControl.setReturnValue(content.length, 1);
        sessionControl.replay();
        messageControl.replay();

        SimpleMessageConverter converter = new SimpleMessageConverter();
        Message msg = converter.toMessage(content, session);
        assertEquals(content.length, ((byte[]) converter.fromMessage(msg)).length);

        sessionControl.verify();
        messageControl.verify();
    }
View Full Code Here

        sessionControl.replay();
        messageControl.replay();

        SimpleMessageConverter converter = new SimpleMessageConverter();
        Message msg = converter.toMessage(content, session);
        assertEquals(content, converter.fromMessage(msg));

        sessionControl.verify();
        messageControl.verify();
    }
View Full Code Here

        messageControl.setReturnValue(content, 1);
        sessionControl.replay();
        messageControl.replay();

        SimpleMessageConverter converter = new SimpleMessageConverter();
        Message msg = converter.toMessage(content, session);
        assertEquals(content, converter.fromMessage(msg));

        sessionControl.verify();
        messageControl.verify();
    }
View Full Code Here

        sessionControl.replay();
        messageControl.replay();

        SimpleMessageConverter converter = new SimpleMessageConverter();
        Message msg = converter.toMessage(message, session);
        assertSame(message, msg);

        sessionControl.verify();
        messageControl.verify();
    }
View Full Code Here

        content.put(new Integer(1), "value1");

        final SimpleMessageConverter converter = new SimpleMessageConverter();
        new AssertThrows(MessageConversionException.class) {
            public void test() throws Exception {
                converter.toMessage(content, session);
            }
        }.runTest();

        sessionControl.verify();
    }
View Full Code Here

        content.put(null, "value1");

        final SimpleMessageConverter converter = new SimpleMessageConverter();
        new AssertThrows(MessageConversionException.class) {
            public void test() throws Exception {
                converter.toMessage(content, session);
            }
        }.runTest();

        sessionControl.verify();
    }
View Full Code Here

    final Map<Integer, String> content = new HashMap<Integer, String>(1);
    content.put(1, "value1");

    final SimpleMessageConverter converter = new SimpleMessageConverter();
    try {
      converter.toMessage(content, session);
      fail("expected MessageConversionException");
    } catch (MessageConversionException ex) { /* expected */ }
  }

  @Test
View Full Code Here

    final Map<Object, String> content = new HashMap<Object, String>(1);
    content.put(null, "value1");

    final SimpleMessageConverter converter = new SimpleMessageConverter();
    try {
      converter.toMessage(content, session);
      fail("expected MessageConversionException");
    } catch (MessageConversionException ex) { /* expected */ }
  }

}
View Full Code Here

    given(session.createTextMessage(content)).willReturn(message);
    given(message.getText()).willReturn(content);

    SimpleMessageConverter converter = new SimpleMessageConverter();
    Message msg = converter.toMessage(content, session);
    assertEquals(content, converter.fromMessage(msg));
  }

  @Test
  public void testByteArrayConversion() throws JMSException {
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.