Package ch.qos.logback.core.status

Examples of ch.qos.logback.core.status.StatusChecker


    compressor.setContext(context);
    compressor.compress(CoreTestConstants.TEST_SRC_PREFIX
        + "input/compress1.txt", CoreTestConstants.OUTPUT_DIR_PREFIX
        + "compress1.txt.gz", null);

    StatusChecker checker = new StatusChecker(context);
    assertTrue(checker.isErrorFree(0));
    assertTrue(Compare.gzCompare(CoreTestConstants.OUTPUT_DIR_PREFIX
        + "compress1.txt.gz", CoreTestConstants.TEST_SRC_PREFIX
        + "witness/compress1.txt.gz"));
  }
View Full Code Here


    compressor.setContext(context);
    compressor.compress(CoreTestConstants.TEST_SRC_PREFIX
        + "input/compress2.txt", CoreTestConstants.OUTPUT_DIR_PREFIX
        + "compress2.txt", null);

    StatusChecker checker = new StatusChecker(context);
    assertTrue(checker.isErrorFree(0));

    assertTrue(Compare.gzCompare(CoreTestConstants.OUTPUT_DIR_PREFIX
        + "compress2.txt.gz", CoreTestConstants.TEST_SRC_PREFIX
        + "witness/compress2.txt.gz"));
  }
View Full Code Here

    Compressor compressor = new Compressor(CompressionMode.ZIP);
    compressor.setContext(context);
    compressor.compress(CoreTestConstants.TEST_SRC_PREFIX
        + "input/compress3.txt", CoreTestConstants.OUTPUT_DIR_PREFIX
        + "compress3.txt", "compress3.txt");
    StatusChecker checker = new StatusChecker(context);
    assertTrue(checker.isErrorFree(0));

    // we don't know how to compare .zip files
    // assertTrue(Compare.compare(CoreTestConstants.OUTPUT_DIR_PREFIX
    // + "compress3.txt.zip", CoreTestConstants.TEST_SRC_PREFIX
    // + "witness/compress3.txt.zip"));
View Full Code Here

   
    house.setCharset(null);
    setter.setProperty("charset", "UTF");
    assertNull(house.getCharset());

    StatusChecker checker = new StatusChecker(context);
    checker.containsException(UnsupportedCharsetException.class);
  }
View Full Code Here

    configure(TeztConstants.TEST_DIR_PREFIX + "input/joran/conditional/conditionalConsole.xml");

    ConsoleAppender consoleAppender = (ConsoleAppender) context.getAppender("CON");
    assertNull(consoleAppender);

    StatusChecker checker = new StatusChecker(context);
    assertTrue(checker.isErrorFree(0));
  }
View Full Code Here

    assertTrue(appender.isAppend());

    StatusManager sm = context.getStatusManager();
    //StatusPrinter.print(context);
    StatusChecker statusChecker = new StatusChecker(context);
    assertEquals(Status.WARN, statusChecker.getHighestLevel(0));
    List<Status> statusList = sm.getCopyOfStatusList();
    assertTrue("Expecting status list size to be 2 or larger, but was "
        + statusList.size(), statusList.size() >= 2);
    String msg1 = statusList.get(1).getMessage();
View Full Code Here

    ca.setContext(context);
    ca.setTarget("foo");
    ca.setEncoder(encoder);
    ca.start();
    ca.doAppend("a");
    StatusChecker checker = new StatusChecker(context);
    //21:28:01,246 + WARN in ch.qos.logback.core.ConsoleAppender[null] - [foo] should be one of [SystemOut, SystemErr]
    //21:28:01,246   |-WARN in ch.qos.logback.core.ConsoleAppender[null] - Using previously set target, System.out by default.
//    StatusPrinter.print(context);

    checker.assertContainsMatch(Status.WARN, "\\[foo\\] should be one of \\[SystemOut, SystemErr\\]");

  }
View Full Code Here

    Appender<E> appender = getAppender();
    appender.setContext(context);
    appender.setName("doh");
    // is null OK?
    appender.doAppend(null);
    StatusChecker checker = new StatusChecker(context.getStatusManager());
    StatusPrinter.print(context);
    checker.assertContainsMatch("Attempted to append to non started appender \\[doh\\].");
  }
View Full Code Here

      Node t = p.parse();
      fail("where the is exception?");
    } catch (ScanException ise) {
      assertEquals("Expecting RIGHT_PARENTHESIS token but got null", ise.getMessage());
    }
    StatusChecker sc = new StatusChecker(context);
    sc.assertContainsMatch("Expecting RIGHT_PARENTHESIS");
    sc.assertContainsMatch("See also " + Parser.MISSING_RIGHT_PARENTHESIS);
  }
View Full Code Here

  public void testUnknownWord() throws Exception {
    Parser<Object> p = new Parser<Object>("%unknown");
    p.setContext(context);
    Node t = p.parse();
    p.compile(t, converterMap);
    StatusChecker checker = new StatusChecker(context.getStatusManager());
    checker
            .assertContainsMatch("\\[unknown] is not a valid conversion word");
  }
View Full Code Here

TOP

Related Classes of ch.qos.logback.core.status.StatusChecker

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.