@Override public final CancellationException requestCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), requestCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String timedOut = "EJBCLIENT000403: Timed out";
@Override public final CancellationException opCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), opCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } @Override
@Override public final CancellationException operationCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), operationCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String operationFailed = "JBTHR00005: Operation failed";
@Override public final CancellationException taskWasCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), taskWasCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String methodNotImplemented = "WFLYEJB0206: Not implemented yet";
@GwtIncompatible public void testImmediateCancelledFutureStack() throws Exception { ListenableFuture<String> future = CallerClass1.makeImmediateCancelledFuture(); assertTrue(future.isCancelled()); try { CallerClass2.get(future); fail(); } catch (CancellationException expected) { // There should be two CancellationException chained together. The outer one should have the // stack trace of where the get() call was made, and the inner should have the stack trace of // where the immediateCancelledFuture() call was made. List<StackTraceElement> stackTrace = ImmutableList.copyOf(expected.getStackTrace()); assertFalse(Iterables.any(stackTrace, hasClassName(CallerClass1.class))); assertTrue(Iterables.any(stackTrace, hasClassName(CallerClass2.class))); // See AbstractFutureCancellationCauseTest for how to set causes. assertThat(expected.getCause()).isNull(); } }
@Override public final CancellationException serviceInstallCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), serviceInstallCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String servicesMissing = "is missing [%s]";
@Override public final CancellationException opCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), opCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } @Override
@Override public final CancellationException operationCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), operationCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String operationFailed = "JBTHR00005: Operation failed";
@Override public final CancellationException requestCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), requestCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String timedOut = "EJBCLIENT000403: Timed out";
@Override public final CancellationException operationCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), operationCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String operationFailed = "JBTHR00005: Operation failed";
@Override public final CancellationException serviceInstallCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), serviceInstallCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String servicesMissing = "is missing [%s]";
@Override public final CancellationException requestCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), requestCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String timedOut = "EJBCLIENT000403: Timed out";
StringBuffer sb = new StringBuffer(); for(StackTraceElement ste : ce.getStackTrace()) { sb.append("\n"); sb.append(ste.toString());
@GwtIncompatible public void testImmediateCancelledFutureStack() throws Exception { ListenableFuture<String> future = CallerClass1.makeImmediateCancelledFuture(); assertTrue(future.isCancelled()); try { CallerClass2.get(future); fail(); } catch (CancellationException expected) { // There should be two CancellationException chained together. The outer one should have the // stack trace of where the get() call was made, and the inner should have the stack trace of // where the immediateCancelledFuture() call was made. List<StackTraceElement> stackTrace = ImmutableList.copyOf(expected.getStackTrace()); assertFalse(Iterables.any(stackTrace, hasClassName(CallerClass1.class))); assertTrue(Iterables.any(stackTrace, hasClassName(CallerClass2.class))); // See AbstractFutureCancellationCauseTest for how to set causes. assertThat(expected.getCause()).isNull(); } }