Package org.mockejb.jms

Examples of org.mockejb.jms.MockTopic


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


    }
   
    public void executeSessionTopicSubscriberRetry(final boolean wsmq)
        throws Exception
    {
        final Topic topic = new MockTopic(TOPIC_NAME) ;
        final JmsConnectionPool pool = new JmsConnectionPool(getPoolEnv()) ;
        final JmsSession session = pool.getSession() ;
        Assert.assertEquals("Session class", JmsSession.class, session.getClass()) ;
       
        final TopicSubscriber topicSubscriber = session.createDurableSubscriber(topic, "testSessionTopicSubscriberRetry") ;
View Full Code Here

    {
        final TransactionStrategy transactionStrategy = TransactionStrategy.getTransactionStrategy(true) ;
        TransactionStrategy.setTransactionStrategy(new MockActiveTransactionStrategy()) ;
        try
        {
            final Topic topic = new MockTopic(TOPIC_NAME) ;
            final JmsConnectionPool pool = new JmsConnectionPool(getPoolEnv()) ;
            final JmsSession session = pool.getSession() ;
            Assert.assertEquals("Session class", JmsXASession.class, session.getClass()) ;
           
            final TopicSubscriber topicSubscriber = session.createDurableSubscriber(topic, "testSessionTopicSubscriberRetry") ;
View Full Code Here

   
    topicEl.setAttribute(NotifyJMS.ATT_DEST_NAME, topicName);
  }

  private MockTopic createAndBindTopic(String topicName) throws NamingException, NamingContextException {
    MockTopic mockTopic = new MockTopic(topicName);
   
    final Context ctx = NamingContextPool.getNamingContext(null) ;
    try
    {
        ctx.rebind(topicName, mockTopic);
View Full Code Here

    return mockQueue;
  }

  @SuppressWarnings("unused")
  private MockTopic createAndBindTopic(String topicName) throws NamingException, NamingContextException {
    MockTopic mockTopic = new MockTopic(topicName);
   
    final Context ctx = NamingContextPool.getNamingContext(null);
    try
    {
        ctx.rebind(topicName, mockTopic);
View Full Code Here

        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

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

    @Test
    public void testReconnect() throws Exception {
        context.rebind(TOPIC_NAME, new MockTopic(TOPIC_NAME));
        final AbstractJMSReceiver receiver = new JMSTopicReceiver(FACTORY_NAME, TOPIC_NAME, null, null);
        ThreadContext.put("appender", "Failover");
        final Logger logger = LogManager.getLogger(JMSTopicFailoverTest.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 TopicConnectionFactoryImpl() );
        context.rebind(TOPIC_NAME, new MockTopic(TOPIC_NAME) );
        ((LoggerContext) LogManager.getContext()).reconfigure();
        receiver = new JMSTopicReceiver(FACTORY_NAME, TOPIC_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 TopicConnectionFactoryImpl() );
        context.rebind(TOPIC_NAME, new MockTopic(TOPIC_NAME) );
        ((LoggerContext) LogManager.getContext()).reconfigure();
        receiver = new JMSTopicReceiver(FACTORY_NAME, TOPIC_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(TOPIC_NAME, new MockTopic(TOPIC_NAME));
        final AbstractJMSReceiver receiver = new JMSTopicReceiver(FACTORY_NAME, TOPIC_NAME, null, null);
        ThreadContext.put("appender", "Failover");
        final Logger logger = LogManager.getLogger(JMSTopicFailoverTest.class);
        logger.debug("Test Message");
        final List<LogEvent> events = app.getEvents();
View Full Code Here

TOP

Related Classes of org.mockejb.jms.MockTopic

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.