Code example for ConsoleHandler

Methods: closepublish

0
		Properties p = new Properties();
		p.put("java.util.logging.ConsoleHandler.formatter", className
				+ "$MockFormatter"); 
		LogManager.getLogManager().readConfiguration(
				EnvironmentHelper.PropertiesToInputStream(p));
		ConsoleHandler h = new ConsoleHandler();
		h.publish(new LogRecord(Level.SEVERE,
				"testClose_SufficientPrivilege_NormalClose msg")); 
		h.close();
		assertEquals("flush", CallVerificationStack.getInstance()
				.getCurrentSourceMethod()); 
		assertNull(CallVerificationStack.getInstance().pop());
		h.close();
	} 
 
	/* 
	 * Test close() when having sufficient privilege, and an output stream that 
	 * always throws exceptions. 
	 */ 
	public void testClose_SufficientPrivilege_Exception() throws Exception { 
		Properties p = new Properties();