- @Before
- @After
- public void setUp() {
- StubInitialContextFactory.unregister();
- }
-
-
- @Test(expected = NamingException.class)
- public void testLookupNotRegistered() throws Exception {
- InitialContext ctx = new InitialContext();
- ctx.bind("a/b", "hallo");
- }
-
- @Test
- public void testLookup() throws Exception {
- StubInitialContextFactory.register();
-
- InitialContext ctx = new InitialContext();
- ctx.bind("a/b", "hallo");
-
- ctx = new InitialContext();
- Object obj = ctx.lookup("a/b");
-
- assertEquals("hallo", obj);
- }
-
+ @Before
+ @After
+ public void setUp() {
+ StubInitialContextFactory.unregister();
+ }
+
+ @Test(expected = NamingException.class)
+ public void testLookupNotRegistered() throws Exception {
+ InitialContext ctx = new InitialContext();
+ ctx.bind("a/b", "hallo");
+ }
+
+ @Test
+ public void testLookup() throws Exception {
+ StubInitialContextFactory.register();
+
+ InitialContext ctx = new InitialContext();
+ ctx.bind("a/b", "hallo");
+
+ ctx = new InitialContext();
+ Object obj = ctx.lookup("a/b");
+
+ assertEquals("hallo", obj);
+ }
+