use of javax.naming.CompositeName in project wildfly by wildfly.
the class InMemoryNamingStoreTestCase method testRebindInvalidContext.
@Test
public void testRebindInvalidContext() throws Exception {
try {
nameStore.rebind(new CompositeName("subcontext/test"), new Object(), Object.class);
fail("Should have thrown and NameNotFoundException");
} catch (NameNotFoundException expected) {
}
}
use of javax.naming.CompositeName in project wildfly by wildfly.
the class InMemoryNamingStoreTestCase method testLookupEmptyName.
@Test
public void testLookupEmptyName() throws Exception {
Object result = nameStore.lookup(new CompositeName());
assertTrue(result instanceof NamingContext);
result = nameStore.lookup(new CompositeName(""));
assertTrue(result instanceof NamingContext);
}
use of javax.naming.CompositeName in project wildfly by wildfly.
the class InMemoryNamingStoreTestCase method testBindUnbindLookup.
@Test
public void testBindUnbindLookup() throws Exception {
final Name name = new CompositeName("test");
final Object object = new Object();
nameStore.bind(name, object, Object.class);
final Object result = nameStore.lookup(name);
assertEquals(object, result);
nameStore.unbind(name);
try {
nameStore.lookup(name);
fail("Should have thrown and NameNotFoundException");
} catch (NameNotFoundException expected) {
}
}
use of javax.naming.CompositeName in project wildfly by wildfly.
the class InMemoryNamingStoreTestCase method testListNameNotFound.
@Test
public void testListNameNotFound() throws Exception {
try {
nameStore.list(new CompositeName("test"));
fail("Should have thrown and NameNotFoundException");
} catch (NameNotFoundException expected) {
}
}
use of javax.naming.CompositeName in project wildfly by wildfly.
the class InMemoryNamingStoreTestCase method testBindAndLookupResolveResult.
@Test
public void testBindAndLookupResolveResult() throws Exception {
final Name name = new CompositeName("test");
final Reference reference = new Reference(Context.class.getName());
nameStore.bind(name, reference, Context.class);
final Object result = nameStore.lookup(new CompositeName("test/value"));
assertTrue(result instanceof ResolveResult);
}
Aggregations