Package java.util.logging

Examples of java.util.logging.FileHandler.publish()


        File file = new File(TEMPPATH + SEP + "log");
        assertTrue(file.list().length <= 2);

        // test unique ids
        FileHandler h8 = new FileHandler("%t/log/%ustring%u.log");
        h8.publish(r);
        FileHandler h9 = new FileHandler("%t/log/%ustring%u.log");
        h9.publish(r);
        h9.close();
        h8.close();
        assertFileContent(TEMPPATH + SEP + "log", "0string0.log", h
View Full Code Here


        // test unique ids
        FileHandler h8 = new FileHandler("%t/log/%ustring%u.log");
        h8.publish(r);
        FileHandler h9 = new FileHandler("%t/log/%ustring%u.log");
        h9.publish(r);
        h9.close();
        h8.close();
        assertFileContent(TEMPPATH + SEP + "log", "0string0.log", h
                .getFormatter());
        assertFileContent(TEMPPATH + SEP + "log", "1string1.log", h
View Full Code Here

    verify(logManager).reset();
    verify(logger).addHandler(handlerCaptor.capture());
    FileHandler fileHandler = (FileHandler) handlerCaptor.getValue();
    assertEquals(UTF_8.name(), fileHandler.getEncoding());
    assertTrue(fileHandler.getFormatter() instanceof SimpleFormatter);
    fileHandler.publish(new LogRecord(INFO, "some message"));
    File logFile = new File(new File(caliperDirectory, "log"),
        ISODateTimeFormat.basicDateTimeNoMillis().print(startTime) + "." + runId + ".log");
    assertTrue(logFile.isFile());
    assertTrue(Files.toString(logFile, UTF_8).contains("some message"));
  }
View Full Code Here

    public void testLock() throws Exception {
        FileOutputStream output = new FileOutputStream(TEMPPATH + SEP + "log"
                + SEP + "java1.test.0");
        FileHandler h = new FileHandler();
        h.publish(r);
        h.close();
        assertFileContent(TEMPPATH + SEP + "log", "java1.test.0", h
                .getFormatter(), "UTF-8");
        output.close();
    }
View Full Code Here

        FileHandler h3 = new FileHandler("%t/log/string");
        FileHandler h4 = new FileHandler("%t/log/string");
        h.publish(r);
        h2.publish(r);
        h3.publish(r);
        h4.publish(r);
        h.close();
        h2.close();
        h3.close();
        h4.close();
        assertFileContent(TEMPPATH + SEP + "log", "string", h.getFormatter(), "UTF-8");
View Full Code Here

        assertFileContent(TEMPPATH + SEP + "log", "string.2", h.getFormatter(), "UTF-8");
        assertFileContent(TEMPPATH + SEP + "log", "string.3", h.getFormatter(), "UTF-8");

        // default is append mode
        FileHandler h6 = new FileHandler("%t/log/string%u.log");
        h6.publish(r);
        h6.close();
        FileHandler h7 = new FileHandler("%t/log/string%u.log");
        h7.publish(r);
        h7.close();
        try {
View Full Code Here

        File file = new File(TEMPPATH + SEP + "log");
        assertTrue(file.list().length <= 2);

        // test unique ids
        FileHandler h8 = new FileHandler("%t/log/%ustring%u.log");
        h8.publish(r);
        FileHandler h9 = new FileHandler("%t/log/%ustring%u.log");
        h9.publish(r);
        h9.close();
        h8.close();
        assertFileContent(TEMPPATH + SEP + "log", "0string0.log", h
View Full Code Here

        // test unique ids
        FileHandler h8 = new FileHandler("%t/log/%ustring%u.log");
        h8.publish(r);
        FileHandler h9 = new FileHandler("%t/log/%ustring%u.log");
        h9.publish(r);
        h9.close();
        h8.close();
        assertFileContent(TEMPPATH + SEP + "log", "0string0.log", h
                .getFormatter(), "UTF-8");
        assertFileContent(TEMPPATH + SEP + "log", "1string1.log", h
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.