/** * Processes the mock response exception and throws the appropriate service exception or a * MockResponseException if the response exception is not a recognized type. * * @param ex The Mock response exception to process */ private void processExceptionBasic(Exception ex) throws SOLAFault, UnhandledFault { if (SOLAFault.class.isAssignableFrom(ex.getClass())) { throw (SOLAFault) ex; } else if (UnhandledFault.class.isAssignableFrom(ex.getClass())) { throw (UnhandledFault) ex; } else if (RuntimeException.class.isAssignableFrom(ex.getClass())) { throw (RuntimeException) ex; } else { // The type of the exception does not match any recognized exception type used by this // web service. Throw a MockResponseException to fail the test. throw new MockResponseException( "Unable to convert the mocked response exception to " + "recognized exception type: " + ex.getClass().getName()); } }
/** * Processes the mock response exception and throws the appropriate service exception or a * MockResponseException if the response exception is not a recognized type. Extends {@linkplain * #processExceptionBasic(java.lang.Exception) processExceptionBasic} to include the * SOLAAccessFault; * * @param ex The Mock response exception to process */ private void processExceptionAccess(Exception ex) throws SOLAFault, SOLAAccessFault, UnhandledFault, MockResponseException { if (SOLAAccessFault.class.isAssignableFrom(ex.getClass())) { throw (SOLAAccessFault) ex; } else { processExceptionBasic(ex); } }
/** * Response Key = SearchClient.CHECK_CONNECTION * * @return default = true */ @Override public boolean checkConnection() { try { return getManager().getResponse(SearchClient.CHECK_CONNECTION, Boolean.class, true); } catch (Exception ex) { if (RuntimeException.class.isAssignableFrom(ex.getClass())) { throw (RuntimeException) ex; } else { return false; } } }