pull/539/head
Nitin 9 years ago
parent fbb31cc2bb
commit 6769539f10

@ -46,9 +46,10 @@ public class TestJNDI
ref.add(new BogusRef("dataSource.loginTimeout", "10"));
Context nameCtx = new BogusContext();
HikariDataSource ds = (HikariDataSource) jndi.getObjectInstance(ref, null, nameCtx, null);
Assert.assertNotNull(ds);
Assert.assertEquals("foo", ds.getUsername());
try (HikariDataSource ds = (HikariDataSource) jndi.getObjectInstance(ref, null, nameCtx, null)) {
Assert.assertNotNull(ds);
Assert.assertEquals("foo", ds.getUsername());
}
}
@Test
@ -67,9 +68,10 @@ public class TestJNDI
ref.add(new BogusRef("dataSource.loginTimeout", "10"));
Context nameCtx = new BogusContext2();
HikariDataSource ds = (HikariDataSource) jndi.getObjectInstance(ref, null, nameCtx, null);
Assert.assertNotNull(ds);
Assert.assertEquals("foo", ds.getUsername());
try (HikariDataSource ds = (HikariDataSource) jndi.getObjectInstance(ref, null, nameCtx, null)) {
Assert.assertNotNull(ds);
Assert.assertEquals("foo", ds.getUsername());
}
}
@Test

Loading…
Cancel
Save