Package ch.qos.logback.classic.util

Examples of ch.qos.logback.classic.util.MockInitialContext


    appender.tcfBindingName = "topicCnxFactory";
    appender.topicBindingName = "testTopic";
    appender.setProviderURL("url");
    appender.setInitialContextFactoryName(MockInitialContextFactory.class.getName());
   
    MockInitialContext mic = MockInitialContextFactory.getContext();
    mic.map.put(appender.tcfBindingName, new MockTopicConnectionFactory());
    mic.map.put(appender.topicBindingName, new MockTopic(appender.topicBindingName));

  }
View Full Code Here


    System.setProperty(ClassicConstants.LOGBACK_CONTEXT_SELECTOR, "JNDI");

    contextDetachingSCL = new ContextDetachingSCL();
   
    MockInitialContextFactory.initialize();
    MockInitialContext mic = MockInitialContextFactory.getContext();
    mic.map.put(ClassicConstants.JNDI_CONTEXT_NAME, "toto");
   
    //The property must be set after we setup the Mock
    System.setProperty(INITIAL_CONTEXT_KEY, MockInitialContextFactory.class.getName());
View Full Code Here

  }
 

  @Test
  public void testDetachWithMissingContext() {
    MockInitialContext mic = MockInitialContextFactory.getContext();
    mic.map.put(ClassicConstants.JNDI_CONTEXT_NAME, "tata");
    ContextJNDISelector selector = (ContextJNDISelector) ContextSelectorStaticBinder.getSingleton().getContextSelector();
    assertEquals("tata", selector.getLoggerContext().getName());

    mic.map.put(ClassicConstants.JNDI_CONTEXT_NAME, "titi");
View Full Code Here

   
    System.setProperty(ClassicConstants.LOGBACK_CONTEXT_SELECTOR, "JNDI");
    StaticLoggerBinderFriend.reset();
   
    MockInitialContextFactory.initialize();
    MockInitialContext mic = MockInitialContextFactory.getContext();
    mic.map.put(ClassicConstants.JNDI_CONTEXT_NAME, "toto");
   
    //The property must be set after we setup the Mock
    System.setProperty(INITIAL_CONTEXT_KEY, MockInitialContextFactory.class.getName());
   
View Full Code Here

    assertEquals("toto", context.getName());
  }
 
  @Test
  public void testCreateContext() {
    MockInitialContext mic = MockInitialContextFactory.getContext();
    mic.map.put(ClassicConstants.JNDI_CONTEXT_NAME, "tata");
   
    LoggerFactory.getLogger(ContextDetachingSCLTest.class);
   
    ContextJNDISelector selector = (ContextJNDISelector)ContextSelectorStaticBinder.getSingleton().getContextSelector();
View Full Code Here

    assertEquals(2, selector.getCount());
  }
 
  @Test
  public void defaultContext() {
    MockInitialContext mic = MockInitialContextFactory.getContext();
    mic.map.put(ClassicConstants.JNDI_CONTEXT_NAME, null);

    ContextJNDISelector selector = (ContextJNDISelector)ContextSelectorStaticBinder.getSingleton().getContextSelector();
    Context context = selector.getLoggerContext();
   
View Full Code Here

    appender.qcfBindingName = "queueCnxFactory";
    appender.queueBindingName = "testQueue";
    appender.setProviderURL("url");
    appender.setInitialContextFactoryName(MockInitialContextFactory.class.getName());
   
    MockInitialContext mic = MockInitialContextFactory.getContext();
    mic.map.put(appender.qcfBindingName, new MockQueueConnectionFactory());
    mic.map.put(appender.queueBindingName, new MockQueue(appender.queueBindingName));
   
    super.setUp();
  }
View Full Code Here

TOP

Related Classes of ch.qos.logback.classic.util.MockInitialContext

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.