* Test close() when having sufficient privilege, and a record has been
* written to the output stream.
*/
public void testClose_SufficientPrivilege_NormalClose() {
ByteArrayOutputStream aos = new MockOutputStream();
StreamHandler h = new StreamHandler(aos, new MockFormatter());
h.publish(new LogRecord(Level.SEVERE,
"testClose_SufficientPrivilege_NormalClose msg"));
h.close();
assertEquals("close", CallVerificationStack.getInstance()
.getCurrentSourceMethod());
assertNull(CallVerificationStack.getInstance().pop());
assertEquals("flush", CallVerificationStack.getInstance()
.getCurrentSourceMethod());
CallVerificationStack.getInstance().clear();
assertTrue(aos.toString().endsWith("MockFormatter_Tail"));
h.close();
}