use of javax.naming.NameNotFoundException in project wildfly by wildfly.
the class MetadataCompleteCustomDescriptorTestCase method testAnnotated.
@Test
public void testAnnotated() throws NamingException {
final InitialContext ctx = new InitialContext();
try {
final AnnotatedGreeterBean bean = (AnnotatedGreeterBean) ctx.lookup("java:global/ejb-descriptor-test/AnnotatedGreeter!org.jboss.as.test.integration.ejb.descriptor.AnnotatedGreeterBean");
fail("The annotated bean should not be available");
} catch (NameNotFoundException e) {
// good
}
}
use of javax.naming.NameNotFoundException in project wildfly by wildfly.
the class SimpleSLSB method isUnInjectedStringEnvEntryPresentInEnc.
public boolean isUnInjectedStringEnvEntryPresentInEnc() {
Context ctx = null;
try {
ctx = new InitialContext();
ctx.lookup("java:comp/env/missingEnvEntryValStringResource");
return true;
} catch (NameNotFoundException nnfe) {
return false;
} catch (NamingException ne) {
throw new RuntimeException(ne);
}
}
use of javax.naming.NameNotFoundException in project wildfly by wildfly.
the class SimpleSLSB method isUnInjectedIntEnvEntryPresentInEnc.
public boolean isUnInjectedIntEnvEntryPresentInEnc() {
Context ctx = null;
try {
ctx = new InitialContext();
ctx.lookup("java:comp/env/missingEnvEntryValIntResource");
return true;
} catch (NameNotFoundException nnfe) {
return false;
} catch (NamingException ne) {
throw new RuntimeException(ne);
}
}
use of javax.naming.NameNotFoundException in project wildfly by wildfly.
the class OptionalEnvEntryBean method checkLookup.
public void checkLookup() {
try {
InitialContext ctx = new InitialContext();
ctx.lookup("java:comp/env/entry");
throw new RuntimeException("Should have thrown a NameNotFoundException");
} catch (NameNotFoundException e) {
// okay
} catch (NamingException e) {
throw new RuntimeException(e);
}
}
use of javax.naming.NameNotFoundException in project wildfly by wildfly.
the class AbstractCustomDescriptorTests method test1.
@Test
public void test1() throws NamingException {
final InitialContext ctx = new InitialContext();
try {
final DescriptorGreeterBean bean = (DescriptorGreeterBean) ctx.lookup("java:global/ejb-descriptor-test/DescriptorGreeter!org.jboss.as.test.integration.ejb.descriptor.DescriptorGreeterBean");
final String name = "test1";
final String result = bean.greet(name);
assertEquals("Hi test1", result);
} catch (NameNotFoundException e) {
fail(e.getMessage());
}
}
Aggregations