Package java.util.logging

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


    assertSame(r, CallVerificationStack.getInstance().pop());
    assertEquals("", this.errSubstituteStream.toString());

    r.setLevel(Level.OFF);
    h.setLevel(Level.OFF);
    h.publish(r);
    assertNull(CallVerificationStack.getInstance().pop());
    assertEquals("", this.errSubstituteStream.toString());
    assertTrue(CallVerificationStack.getInstance().empty());
  }
View Full Code Here


    p.put("java.util.logging.ConsoleHandler.formatter", className
        + "$MockFormatter");
    LogManager.getLogManager().readConfiguration(
        EnvironmentHelper.PropertiesToInputStream(p));
    ConsoleHandler h = new ConsoleHandler();
    h.publish(null);
  }

  /*
   * Test publish(), a log record with empty msg, having output stream
   */
 
View Full Code Here

        + "$MockFormatter");
    LogManager.getLogManager().readConfiguration(
        EnvironmentHelper.PropertiesToInputStream(p));
    ConsoleHandler h = new ConsoleHandler();
    LogRecord r = new LogRecord(Level.INFO, "");
    h.publish(r);
    h.flush();
    assertEquals("MockFormatter_Head", this.errSubstituteStream.toString());
  }

  /*
 
View Full Code Here

        + "$MockFormatter");
    LogManager.getLogManager().readConfiguration(
        EnvironmentHelper.PropertiesToInputStream(p));
    ConsoleHandler h = new ConsoleHandler();
    LogRecord r = new LogRecord(Level.INFO, null);
    h.publish(r);
    h.flush();
    // assertEquals("MockFormatter_Head",
    // this.errSubstituteStream.toString());
  }
View Full Code Here

      ConsoleHandler h = new ConsoleHandler();
      assertSame(h.getLevel(), Level.FINE);
      LogRecord r1 = new LogRecord(Level.INFO, "testPublish_Record1");
      LogRecord r2 = new LogRecord(Level.INFO, "testPublish_Record2");
      assertTrue(h.isLoggable(r1));
      h.publish(r1);
      assertTrue(bos.toString().indexOf("testPublish_Record1") >= 0);
      h.close();
      // assertFalse(h.isLoggable(r));
      assertTrue(h.isLoggable(r2));
      h.publish(r2);
View Full Code Here

      h.publish(r1);
      assertTrue(bos.toString().indexOf("testPublish_Record1") >= 0);
      h.close();
      // assertFalse(h.isLoggable(r));
      assertTrue(h.isLoggable(r2));
      h.publish(r2);
      assertTrue(bos.toString().indexOf("testPublish_Record2") >= 0);
      h.flush();
      // assertEquals("MockFormatter_Head",
      // this.errSubstituteStream.toString());
    } catch (IOException e) {
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.