Code example for ConsoleHandler

Methods: publishsetLevelflush

0
		Properties p = new Properties();
		p.put("java.util.logging.ConsoleHandler.formatter", className
				+ "$MockFormatter"); 
		LogManager.getLogManager().readConfiguration(
				EnvironmentHelper.PropertiesToInputStream(p));
		ConsoleHandler h = new ConsoleHandler();
 
		LogRecord r = new LogRecord(Level.INFO, "testPublish_NoFilter");
		h.setLevel(Level.INFO);
		h.publish(r);
		h.flush();
		assertEquals("MockFormatter_Head" + "testPublish_NoFilter",
				this.errSubstituteStream.toString());
 
		h.setLevel(Level.WARNING);
		h.publish(r);
		h.flush();
		assertEquals("MockFormatter_Head" + "testPublish_NoFilter",
				this.errSubstituteStream.toString());
 
		h.setLevel(Level.CONFIG);
		h.publish(r);
		h.flush();
		assertEquals("MockFormatter_Head" + "testPublish_NoFilter"
				+ "testPublish_NoFilter", this.errSubstituteStream.toString());
 
		r.setLevel(Level.OFF);
		h.setLevel(Level.OFF);
		h.publish(r);
		h.flush();
		assertEquals("MockFormatter_Head" + "testPublish_NoFilter"
				+ "testPublish_NoFilter", this.errSubstituteStream.toString());
	} 
 
	/*