Examples of ILoggingEvent


Examples of ch.qos.logback.classic.spi.ILoggingEvent


  @Test
  public void testAppendMultipleEvents() throws SQLException {
    for (int i = 0; i < 10; i++) {
      ILoggingEvent event = createLoggingEvent();
      appender.append(event);
    }

    Statement stmt = connectionSource.getConnection().createStatement();
    ResultSet rs = null;
View Full Code Here

Examples of ch.qos.logback.classic.spi.ILoggingEvent

  public void testConvertWithOneEntry() {
    String k = "MDCConverterTest_k"+diff;
    String v = "MDCConverterTest_v"+diff;

    MDC.put(k, v);
    ILoggingEvent le = createLoggingEvent();
    String result = converter.convert(le);
    assertEquals(k+"="+v, result);
  }
View Full Code Here

Examples of ch.qos.logback.classic.spi.ILoggingEvent

  @Test
  public void testConvertWithMultipleEntries() {
    MDC.put("testKey", "testValue");
    MDC.put("testKey2", "testValue2");
    ILoggingEvent le = createLoggingEvent();
    String result = converter.convert(le);
    boolean isConform = result.matches("testKey2?=testValue2?, testKey2?=testValue2?");
    assertTrue(result + " is not conform", isConform);
  }
View Full Code Here

Examples of ch.qos.logback.classic.spi.ILoggingEvent

  @Test
  public void testRelativeTime() throws Exception {
    DynamicConverter<ILoggingEvent> converter = new RelativeTimeConverter();
    StringBuilder buf0 = new StringBuilder();
    StringBuilder buf1 = new StringBuilder();
    ILoggingEvent e0 = makeLoggingEvent(null);
    ILoggingEvent e1 = makeLoggingEvent(null);
    converter.write(buf0, e0);
    converter.write(buf1, e1);
    assertEquals(buf0.toString(), buf1.toString());
  }
View Full Code Here

Examples of ch.qos.logback.classic.spi.ILoggingEvent

    this.optionList.clear();
    this.optionList.add("MAIL");
    converter.setOptionList(this.optionList);
    converter.start();

    ILoggingEvent event = makeLoggingEvent(null);

    StringBuilder buf = new StringBuilder();
    converter.write(buf, event);

    String expected = "<"
View Full Code Here

Examples of ch.qos.logback.classic.spi.ILoggingEvent

    this.optionList.clear();
    this.optionList.add("someKey");
    converter.setOptionList(optionList);
    converter.start();

    ILoggingEvent event = makeLoggingEvent(null);

    String result = converter.convert(event);
    assertEquals("someValue", result);
  }
View Full Code Here

Examples of ch.qos.logback.classic.spi.ILoggingEvent

    LoggerContext lcOther = new LoggerContext();
    lcOther.setName("another");
    converter.setContext(lcOther);
   
    lc.setName("aValue");
    ILoggingEvent event = makeLoggingEvent(null);

    String result = converter.convert(event);
    assertEquals("aValue", result);
  }
View Full Code Here

Examples of ch.qos.logback.classic.spi.ILoggingEvent

    ol.add("k");
    converter.setOptionList(ol);
    converter.start();
    lc.setName("aValue");
    lc.putProperty("k", "v");
    ILoggingEvent event = makeLoggingEvent(null);

    String result = converter.convert(event);
    assertEquals("v", result);
  }
View Full Code Here

Examples of ch.qos.logback.classic.spi.ILoggingEvent

  @Test
  public void testAppendOk() {
    appender.start();

    ILoggingEvent le = createLoggingEvent();
    appender.append(le);
   
    MockTopicPublisher tp = (MockTopicPublisher)appender.topicPublisher;
    assertEquals(1, tp.getMessageList().size());
    ObjectMessage message = (ObjectMessage) tp.getMessageList().get(0);
View Full Code Here

Examples of ch.qos.logback.classic.spi.ILoggingEvent

    appender.start();
   
    //make sure the append method does not work
    appender.topicPublisher = null;
   
    ILoggingEvent le = createLoggingEvent();
    for (int i = 1; i <= 3; i++) {
      appender.append(le);
      assertEquals(i, context.getStatusManager().getCount());
      assertTrue(appender.isStarted());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.