@Test
public void testMessageFromString() {

    Message message = null;
    boolean badMessage = false;
    try {
        message = new Message("8=FIX.4.2\0019=12\00135=A\001108=30\00110=036\001");
    } catch (final InvalidMessage e) {
        badMessage = true;
    }
    assertTrue("Message should be invalid", badMessage);
    try {
        message = new Message("8=FIX.4.2\0019=12\00135=A\001108=30\00110=026\001");
    } catch (final InvalidMessage e) {
        assertTrue("Message should be valid (" + e.getMessage() + ")", false);
    }
    assertEquals("8=FIX.4.2\0019=12\00135=A\001108=30\00110=026\001", message.toString());
}