Examples of toMessage()


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

        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

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

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

        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

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

        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

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

        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

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

    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

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

    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

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

    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

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

        return byteArrayInputStream.read((byte[]) invocation.getArguments()[0]);
      }
    });

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

    verify(message).writeBytes(content);
  }
View Full Code Here

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

    given(message.getMapNames()).willReturn(Collections.enumeration(content.keySet()));
    given(message.getObject("key1")).willReturn("value1");
    given(message.getObject("key2")).willReturn("value2");

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

    verify(message).setObject("key1", "value1");
    verify(message).setObject("key2", "value2");
  }
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.