@Test
public void testNewAuthenticator() throws Exception {

    try {
        LogManagerProperties.newAuthenticator(null);
        fail("Null was allowed.");
    } catch (NullPointerException expect) {
    }
    try {
        LogManagerProperties.newAuthenticator("");
        fail("Empty class was allowed.");
    } catch (ClassNotFoundException expect) {
    }
    try {
        LogManagerProperties.newAuthenticator(Object.class.getName());
        fail("Wrong type was allowed.");
    } catch (ClassCastException expect) {
    }
    final Class<?> type = ErrorAuthenticator.class;
    final javax.mail.Authenticator a
            = LogManagerProperties.newAuthenticator(type.getName());
    assertEquals(type, a.getClass());
    setPending(new RuntimeException());
    try {
        LogManagerProperties.newAuthenticator(type.getName());
        fail("Exception was not thrown.");
    } catch (InvocationTargetException expect) {
        assertEquals(RuntimeException.class, expect.getCause().getClass());
    } finally {
        setPending(null);
    }
}