use of java.util.logging.LogRecord in project j2objc by google.
the class LoggerTest method testLogrb_LevelStringStringString_NullMsg.
/*
* Test logrb(Level, String, String, String, String) with null message.
*/
public void testLogrb_LevelStringStringString_NullMsg() {
this.sharedLogger.setLevel(Level.INFO);
this.sharedLogger.logrb(Level.INFO, null, null, null, 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);
}
use of java.util.logging.LogRecord in project j2objc by google.
the class LoggerTest method testLog_LogRecord_AppropriateLevelNoFilterNoParent.
/*
* Test log(LogRecord) for a normal log record. Meanwhile the logger has an
* appropriate level, no filter, no parent.
*/
public void testLog_LogRecord_AppropriateLevelNoFilterNoParent() {
LogRecord r = new LogRecord(Level.INFO, "testLog_LogRecord_AppropriateLevelNoFilterNoParent");
this.sharedLogger.setLevel(Level.INFO);
this.sharedLogger.log(r);
assertSame(r, CallVerificationStack.getInstance().pop());
assertTrue(CallVerificationStack.getInstance().empty());
assertSame(r.getLoggerName(), null);
assertEquals(r.getMessage(), "testLog_LogRecord_AppropriateLevelNoFilterNoParent");
assertSame(r.getResourceBundleName(), null);
assertSame(r.getSourceClassName(), null);
assertSame(r.getSourceMethodName(), null);
assertSame(r.getLevel(), Level.INFO);
assertNull(r.getParameters());
assertSame(r.getThrown(), null);
}
use of java.util.logging.LogRecord in project j2objc by google.
the class LoggerTest method testLogrb_LevelStringStringStringObject_NullMsgObj.
/*
* Test logrb(Level, String, String, String, String, Object) with null
* message and object.
*/
public void testLogrb_LevelStringStringStringObject_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);
assertEquals(1, r.getParameters().length);
assertNull(r.getParameters()[0]);
assertSame(r.getThrown(), null);
}
use of java.util.logging.LogRecord in project j2objc by google.
the class LoggerTest method testLog_LevelString_Normal.
/*
* Test log(Level, String) with normal values.
*/
public void testLog_LevelString_Normal() {
this.sharedLogger.setLevel(Level.INFO);
this.sharedLogger.log(Level.INFO, "log(Level, String) msg");
LogRecord r = (LogRecord) CallVerificationStack.getInstance().pop();
assertTrue(CallVerificationStack.getInstance().empty());
assertSame(r.getLoggerName(), this.sharedLogger.getName());
assertEquals(r.getMessage(), "log(Level, String) 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.INFO);
assertNull(r.getParameters());
assertSame(r.getThrown(), null);
this.sharedLogger.log(Level.CONFIG, "log(Level, String) msg");
assertTrue(CallVerificationStack.getInstance().empty());
this.sharedLogger.setLevel(Level.OFF);
this.sharedLogger.log(Level.OFF, "log(Level, String) msg");
assertTrue(CallVerificationStack.getInstance().empty());
}
use of java.util.logging.LogRecord in project j2objc by google.
the class LoggerTest method testEntering_StringString_Normal.
/*
* Test entering(String, String) with normal values.
*/
public void testEntering_StringString_Normal() {
this.sharedLogger.setLevel(Level.FINER);
this.sharedLogger.entering("sourceClass", "sourceMethod");
LogRecord r = (LogRecord) CallVerificationStack.getInstance().pop();
assertTrue(CallVerificationStack.getInstance().empty());
assertSame(r.getLoggerName(), this.sharedLogger.getName());
assertEquals(r.getMessage(), "ENTRY");
assertSame(r.getResourceBundleName(), this.sharedLogger.getResourceBundleName());
assertSame(r.getResourceBundle(), this.sharedLogger.getResourceBundle());
assertSame(r.getSourceClassName(), "sourceClass");
assertSame(r.getSourceMethodName(), "sourceMethod");
assertSame(r.getLevel(), Level.FINER);
assertSame(r.getParameters(), null);
assertSame(r.getThrown(), null);
this.sharedLogger.setLevel(Level.FINE);
this.sharedLogger.entering("sourceClass", "sourceMethod");
assertTrue(CallVerificationStack.getInstance().empty());
}
Aggregations