Examples of ContextBase


Examples of ch.qos.logback.core.ContextBase

  }
 
  @Test
  public void testOK() {
    PatternLayoutBase<Object> plb = getPatternLayoutBase();
    Context context = new ContextBase();
    plb.setContext(context);
    plb.setPattern("x%OTT");
    plb.start();
    String s = plb.doLayout(new Object());
    //System.out.println(s);

Examples of ch.qos.logback.core.ContextBase

  }

  @Test
  public void testEscapeClosingParentheses() {
    PatternLayoutBase<Object> plb = getPatternLayoutBase();
    Context context = new ContextBase();
    plb.setContext(context);
    plb.setPattern("x(%OTT\\)y");
    plb.start();
    String s = plb.doLayout(new Object());
    assertEquals("x(123)y", s);

Examples of ch.qos.logback.core.ContextBase

  }
 
  @Test
  public void testEscapeBothParentheses() {
    PatternLayoutBase<Object> plb = getPatternLayoutBase();
    Context context = new ContextBase();
    plb.setContext(context);
    plb.setPattern("x\\(%OTT\\)y");
    plb.start();
    String s = plb.doLayout(new Object());
    assertEquals("x(123)y", s);

Examples of ch.qos.logback.core.ContextBase

  }

  @Test
  public void testPercentAsLiteral() {
    PatternLayoutBase<Object> plb = getPatternLayoutBase();
    Context context = new ContextBase();
    plb.setContext(context);
    plb.setPattern("hello \\% world");
    plb.start();
    String s = plb.doLayout(new Object());
    assertEquals("hello % world", s);

Examples of ch.qos.logback.core.ContextBase

    this.fruit = fruit;
  }

  public Fruit buildFruit() {
   
    Context context = new ContextBase();
    this.fruit = null;
    context.putProperty("fruitKey", "orange-"+count);
    // for next round
    count++;
    FruitConfigurator fruitConfigurator = new FruitConfigurator(this);
    fruitConfigurator.setContext(context);
    try {

Examples of ch.qos.logback.core.ContextBase

//      Converter<Object> head = p.compile(t, converterMap);
//      String result = write(head, new Object());
//      assertEquals("ABC", result);
//    }
    {
      Context c = new ContextBase();
      Parser<Object> p = new Parser<Object>("%(ABC %hello)");
      p.setContext(c);
      Node t = p.parse();
      Converter<Object> head = p.compile(t, converterMap);
      String result = write(head, new Object());

Examples of ch.qos.logback.core.ContextBase

  abstract public Context getContext();
 
  @Test
  public void testUnStarted() {
    PatternLayoutBase<E> plb = getPatternLayoutBase();
    Context context = new ContextBase();
    plb.setContext(context);
    String s = plb.doLayout(getEventObject());
    assertEquals("", s);
    StatusManager sm = context.getStatusManager();
    StatusPrinter.print(sm);
  }

Examples of ch.qos.logback.core.ContextBase

  }

  @Test
  public void testStarted() {
    PatternLayoutBase<E> plb = getPatternLayoutBase();
    Context context = new ContextBase();
    plb.setContext(context);
    String s = plb.doLayout(getEventObject());
    assertEquals("", s);
    StatusManager sm = context.getStatusManager();
    StatusPrinter.print(sm);
  }

Examples of ch.qos.logback.core.ContextBase

  @Test
  public void testNullPattern() {
    //System.out.println("testNullPattern");
    PatternLayoutBase<E> plb = getPatternLayoutBase();
    Context context = new ContextBase();
    plb.setContext(context);
    plb.setPattern(null);
    plb.start();
    String s = plb.doLayout(getEventObject());
    assertEquals("", s);
    StatusChecker checker = new StatusChecker(context.getStatusManager());
    //StatusPrinter.print(context);
    checker.assertContainsMatch("Empty or null pattern.");
  }

Examples of ch.qos.logback.core.ContextBase

  @Test
  public void testEmptyPattern() {
    //System.out.println("testNullPattern");
    PatternLayoutBase<E> plb = getPatternLayoutBase();
    Context context = new ContextBase();
    plb.setContext(context);
    plb.setPattern("");
    plb.start();
    String s = plb.doLayout(getEventObject());
    assertEquals("", s);
    StatusChecker checker = new StatusChecker(context.getStatusManager());
    //StatusPrinter.print(context);
    checker.assertContainsMatch("Empty or null pattern.");
  }
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.