Package java.util.logging

Examples of java.util.logging.XMLFormatter.format()


    //break.
    TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
    rec.setMillis(1234567);
    rec.setSequenceNumber(42);
    rec.setThreadID(21);
    h.check(formatter.format(rec),
            EXPECTED_PREFIX
            + "  <thread>21</thread>\n"
            + "  <message>foobar</message>\n"
            + "</record>\n");
View Full Code Here


    // Check #3.
    rec.setSourceClassName(
      "FakeClass");
    rec.setSourceMethodName("test(fake)");
    h.check(formatter.format(rec),
            EXPECTED_PREFIX
            + "  <class>FakeClass</class>\n"
            + "  <method>test(fake)</method>\n"
            + "  <thread>21</thread>\n"
            + "  <message>foobar</message>\n"
View Full Code Here


    // Check #4.
    rec.setMessage("foobar {1}-{0}");
    rec.setParameters(new String[] { "peace", "love" });
    h.check(formatter.format(rec),
            EXPECTED_PREFIX
            + "  <class>FakeClass</class>\n"
            + "  <method>test(fake)</method>\n"
            + "  <thread>21</thread>\n"
            + "  <message>foobar love-peace</message>\n"
View Full Code Here


    // Check #5.
    rec.setThrown(new TestException("non-localized message"));
    rec.setMessage("mauve is a beautiful color");
    h.check(deleteFrames(formatter.format(rec)),
            EXPECTED_PREFIX
            + "  <class>FakeClass</class>\n"
            + "  <method>test(fake)</method>\n"
            + "  <thread>21</thread>\n"
            + "  <message>mauve is a beautiful color</message>\n"
View Full Code Here

    // Check #6.
    rec.setMessage("ENTRY {0}");
    rec.setParameters(new String[] { "foo.bar" });
    rec.setResourceBundleName(TestResourceBundle.class.getName());
    rec.setThrown(null);
    h.check(formatter.format(rec),
            EXPECTED_PREFIX
            + "  <class>FakeClass</class>\n"
            + "  <method>test(fake)</method>\n"
            + "  <thread>21</thread>\n"
            + "  <message>ENTRY foo.bar</message>\n"
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.