Code example for LogRecord

Methods: getResourceBundle, getResourceBundleName

0
		log.log(Level.INFO, "testLog_NullResNoParent");
		LogRecord r = (LogRecord) CallVerificationStack.getInstance().pop();
		assertTrue(CallVerificationStack.getInstance().empty());
		assertNull(log.getResourceBundle());
		assertNull(log.getResourceBundleName());
		assertNull(r.getResourceBundle());
		assertNull(r.getResourceBundleName());
	} 
 
	/* 
	 * Test that a logger inherits its parent resource bundle when its resource 
	 * bundle is null. 
	 */ 
	public void testLog_NullResHasParent() { 
		Logger child = new MockLogger("childLogger", null);
		Logger parent = new MockLogger("parentLogger", VALID_RESOURCE_BUNDLE2);
		child.addHandler(new MockHandler());
		child.setParent(parent);
		parent.setLevel(Level.FINER);
		assertNull(child.getResourceBundle());
		assertNull(child.getResourceBundleName());