@@ -0,0 +1,1318 @@
+package org.projectodd.stilts.stomp.protocol;%0A%0Aimport static org.junit.Assert.*;%0A%0Aimport java.nio.charset.Charset;%0A%0Aimport org.jboss.netty.handler.codec.embedder.EncoderEmbedder;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.projectodd.stilts.stomp.StompMessage;%0Aimport org.projectodd.stilts.stomp.StompMessages;%0Aimport org.projectodd.stilts.stomp.protocol.StompFrame.Header;%0A%0Apublic class StompMessageEncoderTest %7B%0A%0A    private EncoderEmbedder%3CStompContentFrame%3E encoder;%0A%0A    @Before%0A    public void setUp() %7B%0A        this.encoder = new EncoderEmbedder%3CStompContentFrame%3E( new StompMessageEncoder() );%0A    %7D%0A%0A    @Test%0A    public void testNonMessage() throws Exception %7B%0A        boolean result = this.encoder.offer( %22Howdy%22 );%0A        assertFalse( result );%0A    %7D%0A%0A    @Test%0A    public void testMessage() throws Exception %7B%0A        StompMessage message = StompMessages.createStompMessage( %22/queues/one%22, %22sasquatch!%22 );%0A        boolean result = this.encoder.offer( message );%0A        assertTrue( result );%0A        %0A        StompContentFrame frame = this.encoder.poll();%0A        assertNotNull( frame );%0A        %0A        assertEquals( %22/queues/one%22, frame.getHeader( Header.DESTINATION ) );%0A        assertEquals( %22sasquatch!%22, frame.getContent().toString( Charset.forName( %22UTF-8%22 ) ) );%0A        %0A    %7D%0A%7D%0A

Test message encoding to frames.