use of java.util.logging.LogRecord in project j2objc by google.
the class LoggerTest method testFiner_Normal.
/*
* Test finer(String) with normal values.
*/
public void testFiner_Normal() {
this.sharedLogger.setLevel(Level.FINER);
this.sharedLogger.finer("finer msg");
LogRecord r = (LogRecord) CallVerificationStack.getInstance().pop();
assertTrue(CallVerificationStack.getInstance().empty());
assertSame(r.getLoggerName(), this.sharedLogger.getName());
assertEquals(r.getMessage(), "finer msg");
assertSame(r.getResourceBundleName(), this.sharedLogger.getResourceBundleName());
assertSame(r.getResourceBundle(), this.sharedLogger.getResourceBundle());
assertSame(r.getSourceClassName(), null);
assertSame(r.getSourceMethodName(), null);
assertSame(r.getLevel(), Level.FINER);
assertNull(r.getParameters());
assertSame(r.getThrown(), null);
this.sharedLogger.setLevel(Level.FINE);
this.sharedLogger.finer("finer again");
assertTrue(CallVerificationStack.getInstance().empty());
}
use of java.util.logging.LogRecord in project j2objc by google.
the class LoggerTest method testFinest_Null.
/*
* Test finest(String) with null values.
*/
public void testFinest_Null() {
Logger child = new MockLogger("childLogger", null);
Logger parent = new MockLogger("parentLogger", VALID_RESOURCE_BUNDLE2);
child.addHandler(new MockHandler());
child.setParent(parent);
child.setLevel(Level.FINEST);
child.finest(null);
LogRecord r = (LogRecord) CallVerificationStack.getInstance().pop();
assertTrue(CallVerificationStack.getInstance().empty());
assertSame(r.getLoggerName(), child.getName());
assertNull(r.getMessage());
assertSame(r.getResourceBundleName(), parent.getResourceBundleName());
assertSame(r.getResourceBundle(), parent.getResourceBundle());
assertSame(r.getSourceClassName(), null);
assertSame(r.getSourceMethodName(), null);
assertSame(r.getLevel(), Level.FINEST);
assertNull(r.getParameters());
assertSame(r.getThrown(), null);
this.sharedLogger.setLevel(Level.FINER);
this.sharedLogger.finest(null);
assertTrue(CallVerificationStack.getInstance().empty());
}
use of java.util.logging.LogRecord in project j2objc by google.
the class LoggerTest method testWarning_Normal.
/*
* Test warning(String) with normal values.
*/
public void testWarning_Normal() {
this.sharedLogger.setLevel(Level.WARNING);
this.sharedLogger.warning("warning msg");
LogRecord r = (LogRecord) CallVerificationStack.getInstance().pop();
assertTrue(CallVerificationStack.getInstance().empty());
assertSame(r.getLoggerName(), this.sharedLogger.getName());
assertEquals(r.getMessage(), "warning msg");
assertSame(r.getResourceBundleName(), this.sharedLogger.getResourceBundleName());
assertSame(r.getResourceBundle(), this.sharedLogger.getResourceBundle());
assertSame(r.getSourceClassName(), null);
assertSame(r.getSourceMethodName(), null);
assertSame(r.getLevel(), Level.WARNING);
assertNull(r.getParameters());
assertSame(r.getThrown(), null);
this.sharedLogger.setLevel(Level.SEVERE);
this.sharedLogger.warning("warning again");
assertTrue(CallVerificationStack.getInstance().empty());
}
use of java.util.logging.LogRecord in project j2objc by google.
the class LoggerTest method testThrowing_Null.
/*
* Test throwing(String, String, Throwable) with null values.
*/
public void testThrowing_Null() {
Logger child = new MockLogger("childLogger", null);
Logger parent = new MockLogger("parentLogger", VALID_RESOURCE_BUNDLE2);
child.addHandler(new MockHandler());
child.setParent(parent);
child.setLevel(Level.FINER);
child.throwing(null, null, null);
LogRecord r = (LogRecord) CallVerificationStack.getInstance().pop();
assertTrue(CallVerificationStack.getInstance().empty());
assertSame(r.getLoggerName(), child.getName());
assertEquals(r.getMessage(), "THROW");
assertSame(r.getResourceBundleName(), parent.getResourceBundleName());
assertSame(r.getResourceBundle(), parent.getResourceBundle());
assertSame(r.getSourceClassName(), null);
assertSame(r.getSourceMethodName(), null);
assertSame(r.getLevel(), Level.FINER);
assertSame(r.getParameters(), null);
assertSame(r.getThrown(), null);
}
use of java.util.logging.LogRecord in project j2objc by google.
the class LoggerTest method testLogrb_LevelStringStringStringObjects_NullMsgObj.
/*
* Test logrb(Level, String, String, String, String, Object[]) with null
* message and object.
*/
public void testLogrb_LevelStringStringStringObjects_NullMsgObj() {
this.sharedLogger.setLevel(Level.INFO);
this.sharedLogger.logrb(Level.INFO, null, null, null, null, (Object[]) null);
LogRecord r = (LogRecord) CallVerificationStack.getInstance().pop();
assertTrue(CallVerificationStack.getInstance().empty());
assertSame(r.getLoggerName(), this.sharedLogger.getName());
assertNull(r.getMessage());
assertSame(r.getResourceBundleName(), null);
assertSame(r.getSourceClassName(), null);
assertSame(r.getSourceMethodName(), null);
assertSame(r.getLevel(), Level.INFO);
assertNull(r.getParameters());
assertSame(r.getThrown(), null);
}
Aggregations