@Test
public void testUnbind04() throws Exception {

    // 前処理
    DefaultJndiSupport support = new DefaultJndiSupport();
    String name = "java:comp/env/abc";
    // JndiTemplate取得
    DefaultJndiSupport_JndiTemplateStub02 template = new DefaultJndiSupport_JndiTemplateStub02();
    template.setCallRebind(false);
    template.setJndiNameToUse(null);
    support.setJndiTemplate(template);
    // super.resourceRef = false;
    support.setResourceRef(false);
    try {
        // テスト実施
        support.unbind(name);
        fail();
    } catch (JndiException e) {
        boolean b = template.isCallUnbind();
        assertTrue(b);
        assertEquals("java:comp/env/abc", template.getJndiNameToUse());
        // 判定
        assertThat(logger.getLoggingEvents(), is(asList(error(
                "Illegal JNDI context name."))));
        assertEquals(NamingException.class.getName(), e.getCause()
                .getClass().getName());
    }
}