use of fish.payara.ejb.http.protocol.ErrorResponse in project Payara by payara.
the class EjbOverHttpResourceTest method invoke_ErrorNoSuchMethodWrongArgumentType.
@Test
public void invoke_ErrorNoSuchMethodWrongArgumentType() {
ErrorResponse response = invokeExpectError(mediaType, EJB_NAME, "add", new String[] { float.class.getName(), int.class.getName() }, pack(1, 2));
assertEquals("java.lang.NoSuchMethodException", response.exceptionType);
assertEquals("No method matching add([float, int]) found in business interface", response.message);
assertNull(response.cause);
}
use of fish.payara.ejb.http.protocol.ErrorResponse in project Payara by payara.
the class EjbOverHttpResourceTest method lookup_ErrorMalformedGlobalJndiName.
@Test
public void lookup_ErrorMalformedGlobalJndiName() {
ErrorResponse response = lookupExpectError(mediaType, "java:global/" + RemoteCalculator.class.getName());
assertEquals("javax.naming.NamingException", response.exceptionType);
assertEquals("Global name must contain application name but got: java:global/fish.payara.ejb.endpoint.EjbOverHttpResourceTest$RemoteCalculator", response.message);
assertNull(response.cause);
}
use of fish.payara.ejb.http.protocol.ErrorResponse in project Payara by payara.
the class EjbOverHttpResourceTest method lookup_ErrorFullNameWithoutPackage.
@Test
public void lookup_ErrorFullNameWithoutPackage() {
ErrorResponse response = lookupExpectError(mediaType, "java:global/myapp/CalculatorBean!RemoteCalculator");
assertEquals("javax.naming.NamingException", response.exceptionType);
assertNotNull(response.cause);
assertEquals("java.lang.ClassNotFoundException", response.cause.exceptionType);
assertEquals("RemoteCalculator", response.cause.message);
}
use of fish.payara.ejb.http.protocol.ErrorResponse in project Payara by payara.
the class EjbOverHttpResourceTest method invoke_ErrorNoSuchApplication.
@Test
public void invoke_ErrorNoSuchApplication() {
ErrorResponse response = invokeExpectError(mediaType, EJB_NAME.replace("/myapp/", "/unknownapp/"), "sub", new String[] { int.class.getName(), int.class.getName() }, pack(1, 2));
assertEquals("javax.naming.NamingException", response.exceptionType);
assertEquals("Unknown application: unknownapp", response.message);
assertNull(response.cause);
}
use of fish.payara.ejb.http.protocol.ErrorResponse in project Payara by payara.
the class EjbOverHttpResourceTest method invoke_CyclicResult.
@Test
public void invoke_CyclicResult() {
if (isJavaObjectSerialisation()) {
InvokeMethodResponse response = invokeExpectSuccess(mediaType, EJB_NAME, "cyclic", new String[0], pack(new Object[0]));
@SuppressWarnings("unchecked") List<Object> result = (List<Object>) response.result;
assertEquals(1, result.size());
assertSame(result, result.get(0));
} else {
ErrorResponse response = invokeExpectError(mediaType, EJB_NAME, "cyclic", new String[0], pack(new Object[0]));
assertEquals("java.lang.StackOverflowError", response.exceptionType);
}
}
Aggregations