Package org.mockejb.jms

Examples of org.mockejb.jms.MockQueue


        final StatusConsoleListener l = new StatusConsoleListener(Level.ERROR);
        StatusLogger.getLogger().registerListener(l);
        MockContextFactory.setAsInitial();
        context = new InitialContext();
        context.rebind(FACTORY_NAME, new QueueConnectionFactoryImpl() );
        context.rebind(QUEUE_NAME, new MockQueue(QUEUE_NAME));
        ((LoggerContext) LogManager.getContext()).reconfigure();
        receiver = new JMSQueueReceiver(FACTORY_NAME, QUEUE_NAME, null, null);
    }
View Full Code Here


    }
   
    public void executeSessionQueueBrowserRetry(final boolean wsmq)
        throws Exception
    {
        final Queue queue = new MockQueue(QUEUE_NAME) ;
        final JmsConnectionPool pool = new JmsConnectionPool(getPoolEnv()) ;
        final JmsSession session = pool.getSession() ;
        Assert.assertEquals("Session class", JmsSession.class, session.getClass()) ;
       
        final QueueBrowser queueBrowser = session.createBrowser(queue) ;
View Full Code Here

    }
   
    public void executeSessionMessageConsumerRetry(final boolean wsmq)
        throws Exception
    {
        final Queue queue = new MockQueue(QUEUE_NAME) ;
        final JmsConnectionPool pool = new JmsConnectionPool(getPoolEnv()) ;
        final JmsSession session = pool.getSession() ;
        Assert.assertEquals("Session class", JmsSession.class, session.getClass()) ;
       
        final MessageConsumer messageConsumer = session.createConsumer(queue) ;
View Full Code Here

    }
   
    public void executeSessionMessageProducerRetry(final boolean wsmq)
        throws Exception
    {
        final Queue queue = new MockQueue(QUEUE_NAME) ;
        final JmsConnectionPool pool = new JmsConnectionPool(getPoolEnv()) ;
        final JmsSession session = pool.getSession() ;
        Assert.assertEquals("Session class", JmsSession.class, session.getClass()) ;
       
        final MessageProducer messageProducer = session.createProducer(queue) ;
View Full Code Here

    {
        final TransactionStrategy transactionStrategy = TransactionStrategy.getTransactionStrategy(true) ;
        TransactionStrategy.setTransactionStrategy(new MockActiveTransactionStrategy()) ;
        try
        {
            final Queue queue = new MockQueue(QUEUE_NAME) ;
            final JmsConnectionPool pool = new JmsConnectionPool(getPoolEnv()) ;
            final JmsSession session = pool.getSession() ;
            Assert.assertEquals("Session class", JmsXASession.class, session.getClass()) ;
           
            final QueueBrowser queueBrowser = session.createBrowser(queue) ;
View Full Code Here

    {
        final TransactionStrategy transactionStrategy = TransactionStrategy.getTransactionStrategy(true) ;
        TransactionStrategy.setTransactionStrategy(new MockActiveTransactionStrategy()) ;
        try
        {
            final Queue queue = new MockQueue(QUEUE_NAME) ;
            final JmsConnectionPool pool = new JmsConnectionPool(getPoolEnv()) ;
            final JmsSession session = pool.getSession() ;
            Assert.assertEquals("Session class", JmsXASession.class, session.getClass()) ;
           
            final MessageConsumer messageConsumer = session.createConsumer(queue) ;
View Full Code Here

    {
        final TransactionStrategy transactionStrategy = TransactionStrategy.getTransactionStrategy(true) ;
        TransactionStrategy.setTransactionStrategy(new MockActiveTransactionStrategy()) ;
        try
        {
            final Queue queue = new MockQueue(QUEUE_NAME) ;
            final JmsConnectionPool pool = new JmsConnectionPool(getPoolEnv()) ;
            final JmsSession session = pool.getSession() ;
            Assert.assertEquals("Session class", JmsXASession.class, session.getClass()) ;
           
            final MessageProducer messageProducer = session.createProducer(queue) ;
View Full Code Here

       
        final Context ctx = NamingContextPool.getNamingContext(null);
        try
        {
            ctx.rebind(CONNECTION_FACTORY, new MockQueueConnectionFactory());
            ctx.rebind(QUEUE_NAME, new MockQueue(QUEUE_NAME));
        }
        finally
        {
            NamingContextPool.releaseNamingContext(ctx) ;
        }
View Full Code Here

  }

  @Test
  public void process_with_JMSReplyTo() throws JMSException, IOException, URISyntaxException, MessageDeliverException {
    objectMsg.setObject( messageContent );
    MockQueue jmsReplyToQueue = new SerializableMockQueue( "/queue/mockReplyToQueueName");
    objectMsg.setJMSReplyTo( jmsReplyToQueue );

    Message message = packer.process( objectMsg );

    Destination replyTo = (Destination) message.getProperties().getProperty( JMSPropertiesSetter.JMS_REPLY_TO );
View Full Code Here

  @Test
  public void setPropertiesFromJMSMessageReplyTo() throws JMSException
  {
    final String destinationName = "/queue/testDest";
    final MockQueue queue = new SerializableMockQueue( destinationName );
    fromJMSTextMessage.setJMSReplyTo( queue );
    strategy.setPropertiesFromJMSMessage( fromJMSTextMessage , toESBMessage );

    final Object object = toESBMessage.getProperties().getProperty( JMSPropertiesSetter.JMS_REPLY_TO );
    assertNotNull( object );
View Full Code Here

TOP

Related Classes of org.mockejb.jms.MockQueue

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.