Package org.mockejb.jms

Examples of org.mockejb.jms.TextMessageImpl


    assertEquals ( hashMap, actualMap );
  }

  @Test
  public void process_TextMessage() throws JMSException, IOException, URISyntaxException, MessageDeliverException {
    TextMessageImpl textMessage = new TextMessageImpl();
    textMessage.setText( messageContent );
    Message message = packer.process( textMessage );

    assertThatByteArrayHasBeenSet( message );

    Object object = message.getBody().get();
View Full Code Here


    /**
     * Creates a mockejb.jms.TextMessageImpl
     */
    public TextMessage createTextMessage( String text ) throws JMSException
    {
      return new TextMessageImpl ( text );
    }
View Full Code Here

        }

        @Override
        protected javax.jms.Message createJMSMessageWithObjectType( Object objectFromBody ) throws JMSException
        {
            TextMessageImpl textMessage = new TextMessageImpl();
            textMessage.setText( new String ((byte[])objectFromBody) );
            return textMessage;
        }
View Full Code Here

    }
 
  @Before
  public void before() throws JMSException, NamingException
  {
    toJMSMessage = new TextMessageImpl();
    toJMSMessage.setText( bodyContent );
    fromESBMessage = MessageFactory.getInstance().getMessage();
    strategy = new DefaultJMSPropertiesSetter();
   
    MockContextFactory.setAsInitial();
View Full Code Here

    }
 
  @Before
  public void setup()
  {
    fromJMSTextMessage = new TextMessageImpl();
    toESBMessage = MessageFactory.getInstance().getMessage();
    strategy = new DefaultESBPropertiesSetter();
  }
View Full Code Here

  private MockQueue queue;

  @Test
  public void setJMSReplyToQueue() throws JMSException, URISyntaxException, ConfigurationException, NamingException, ConnectionException, NamingContextException, NotificationException
  {
    TextMessageImpl inBoundJmsMessage = new TextMessageImpl();
    inBoundJmsMessage.setJMSReplyTo( queue );

    Message esbMessage = MessageFactory.getInstance().getMessage();
    new DefaultESBPropertiesSetter().setPropertiesFromJMSMessage( inBoundJmsMessage, esbMessage );
       
    NotifyJMS notifyJMS = new NotifyQueues( new ConfigTree("test" ) );
   
    TextMessageImpl outBoundJmsMessage = new TextMessageImpl();
    notifyJMS.setJMSReplyTo( outBoundJmsMessage, esbMessage );
   
    Destination replyTo = outBoundJmsMessage.getJMSReplyTo();
    assertTrue( replyTo instanceof Queue );
  }
View Full Code Here

            final MockQueue queue = new SerializableMockQueue( QUEUE_NAME );
       
            context.rebind( QUEUE_NAME, queue );

            // inbound is to simulate a jms message arriving at a gateway endpoint.
            TextMessageImpl inBoundJmsMessage = new TextMessageImpl();
            inBoundJmsMessage.setJMSReplyTo( queue );
            new DefaultESBPropertiesSetter().setPropertiesFromJMSMessage( inBoundJmsMessage, msg );
       
            JMSRouter router = new JMSRouter( createConfigTree() );
           
            // outbound is to simulate a new jms message that is about to leave the ESB.
            TextMessageImpl outBoundJmsMessage = new TextMessageImpl();
            router.setJMSReplyTo( outBoundJmsMessage,  msg );
        }
        finally
        {
            MockContextFactory.revertSetAsInitial();
View Full Code Here

    public void test1() throws Exception {
        Message message = new BytesMessageImpl();
        message.setStringProperty("contentType", "application/xml");
        assertContentTypeInfo("contentType", "application/xml", message);
       
        assertContentTypeInfo(null, "text/plain", new TextMessageImpl());
        assertContentTypeInfo(null, "application/octet-stream", new BytesMessageImpl());
        assertEquals(null, ruleSet.getContentTypeInfo(new ObjectMessageImpl()));
    }
View Full Code Here

    public void test2() throws Exception {
        Message message = new BytesMessageImpl();
        message.setStringProperty("contentType", "application/xml");
        assertContentTypeInfo("contentType", "application/xml", message);
       
        message = new TextMessageImpl();
        message.setStringProperty("ctype", "application/xml");
        assertContentTypeInfo("ctype", "application/xml", message);

        assertContentTypeInfo(null, "text/xml", new TextMessageImpl());
        assertContentTypeInfo(null, "text/xml", new BytesMessageImpl());
    }
View Full Code Here

TOP

Related Classes of org.mockejb.jms.TextMessageImpl

Copyright © 2018 www.massapicom. 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.