Code example for ConsoleHandler

Methods: publishgetEncodinggetFiltergetFormattergetLevel

0
 
		assertEquals(LogManager.getLogManager().getProperty(
				"java.util.logging.ConsoleHandler.level"), INVALID_LEVEL);
		assertEquals(LogManager.getLogManager().getProperty(
				"java.util.logging.ConsoleHandler.encoding"), "XXXX"); 
		ConsoleHandler h = new ConsoleHandler();
		assertSame(h.getLevel(), Level.INFO);
		assertTrue(h.getFormatter() instanceof SimpleFormatter);
		assertNull(h.getFilter());
		assertNull(h.getEncoding());
		h.publish(new LogRecord(Level.SEVERE, "test"));
		assertNull(h.getEncoding());
	} 
 
	/* 
	 * Test close() when having sufficient privilege, and a record has been 
	 * written to the output stream. 
	 */ 
	public void testClose_SufficientPrivilege_NormalClose() throws Exception { 
		Properties p = new Properties();
		p.put("java.util.logging.ConsoleHandler.formatter", className