use of javax.naming.CompositeName in project wildfly by wildfly.
the class InMemoryNamingStoreTestCase method testAutoRemove.
@Test
public void testAutoRemove() throws Exception {
nameStore.bind(new CompositeName("test/item"), new Object());
assertNotNull(nameStore.lookup(new CompositeName("test/item")));
assertNotNull(nameStore.lookup(new CompositeName("test")));
nameStore.unbind(new CompositeName("test/item"));
try {
nameStore.lookup(new CompositeName("test"));
fail("Should have throw name not found exception");
} catch (NameNotFoundException expected) {
}
}
use of javax.naming.CompositeName in project wildfly by wildfly.
the class InMemoryNamingStoreTestCase method testLookupNameNotFound.
@Test
public void testLookupNameNotFound() throws Exception {
try {
nameStore.lookup(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 testUnbindNotFound.
@Test
public void testUnbindNotFound() throws Exception {
try {
nameStore.unbind(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 testBindEmptyName.
@Test
public void testBindEmptyName() throws Exception {
try {
nameStore.bind(new CompositeName(), new Object(), Object.class);
fail("Should have thrown and InvalidNameException");
} catch (InvalidNameException expected) {
}
try {
nameStore.bind(new CompositeName(""), new Object(), Object.class);
fail("Should have thrown and InvalidNameException");
} catch (InvalidNameException expected) {
}
}
use of javax.naming.CompositeName in project wildfly by wildfly.
the class NamingContextTestCase method testLookupEmptyName.
@Test
public void testLookupEmptyName() throws Exception {
Object result = namingContext.lookup(new CompositeName());
assertTrue(result instanceof NamingContext);
result = namingContext.lookup(new CompositeName(""));
assertTrue(result instanceof NamingContext);
//the same with security permissions
result = testActionPermission(JndiPermission.ACTION_LOOKUP, namingContext, null);
assertTrue(result instanceof NamingContext);
result = testActionPermission(JndiPermission.ACTION_LOOKUP, namingContext, "");
assertTrue(result instanceof NamingContext);
}
Aggregations