Package org.mockejb.jms

Examples of org.mockejb.jms.MockQueue


  }
 
  @Test
  public void setPropertiesFromJMSMessageReplyToNull() throws JMSException
  {
    final MockQueue queue = null;
    fromJMSTextMessage.setJMSReplyTo( queue );
    strategy.setPropertiesFromJMSMessage( fromJMSTextMessage , toESBMessage );

    final String replyTo = (String) toESBMessage.getProperties().getProperty( JMSPropertiesSetter.JMS_REPLY_TO );
    assertNull( replyTo );
View Full Code Here


    queueEl.setAttribute( NotifyJMS.TIME_TO_LIVE_ATTR, "600");
    queueEl.setAttribute(NotifyJMS.ATT_DEST_NAME, queueName);
  }

  private MockQueue createAndBindQueue(String queueName) throws NamingException, NamingContextException {
    MockQueue mockQueue = new MockQueue(queueName);
       
                final Context ctx = NamingContextPool.getNamingContext(null);
                try
                {
                    ctx.rebind(queueName, mockQueue);
View Full Code Here

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

        {
            MockContextFactory.setAsInitial();
            Context context = new InitialContext();
            MockContextFactory.setDelegateContext( context );
       
            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();
View Full Code Here

        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));
        System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
        receiver = new JMSQueueReceiver(FACTORY_NAME, QUEUE_NAME, null, null);
    }
View Full Code Here

        assertTrue("Incorrect event", "Test Message".equals(events.get(0).getMessage().getFormattedMessage()));
    }

    @Test
    public void testReconnect() throws Exception {
        context.rebind(QUEUE_NAME, new MockQueue(QUEUE_NAME));
        receiver = new JMSQueueReceiver(FACTORY_NAME, QUEUE_NAME, null, null);
        ThreadContext.put("appender", "Failover");
        final Logger logger = LogManager.getLogger(JMSQueueFailoverTest.class);
        logger.debug("Test Message");
        final List<LogEvent> events = app.getEvents();
View Full Code Here

        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

        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

        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));
        System.setProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
        receiver = new JMSQueueReceiver(FACTORY_NAME, QUEUE_NAME, null, null);
    }
View Full Code Here

        assertTrue("Incorrect event", "Test Message".equals(events.get(0).getMessage().getFormattedMessage()));
    }

    @Test
    public void testReconnect() throws Exception {
        context.rebind(QUEUE_NAME, new MockQueue(QUEUE_NAME));
        receiver = new JMSQueueReceiver(FACTORY_NAME, QUEUE_NAME, null, null);
        ThreadContext.put("appender", "Failover");
        final Logger logger = LogManager.getLogger(JMSQueueFailoverTest.class);
        logger.debug("Test Message");
        final List<LogEvent> events = app.getEvents();
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.