}
String sqlState = e.getSQLState();
Throwable cause = e.getCause();
int errorCode = e.getErrorCode();
Throwable nestedException = e.getCause();
SQLException nextException = e.getNextException();
assertTrue("Expected MMSQLException.getSQLState() to return \"" //$NON-NLS-1$
+ esqlState + "\" but got \"" + sqlState + "\" instead.", //$NON-NLS-1$ //$NON-NLS-2$
sqlState.compareTo(esqlState) == 0);
assertTrue("Expected MMSQLException.getCause() to return [" //$NON-NLS-1$
+ (ecause != null ? ecause.getClass().getName() : "<null>") //$NON-NLS-1$
+ "] but got [" //$NON-NLS-1$
+ (cause != null ? cause.getClass().getName() : "<unknown>") //$NON-NLS-1$
+ "] instead.", cause == ecause); //$NON-NLS-1$
assertTrue(
"Expected MMSQLException.getErrorCode() to return [0] but got [" //$NON-NLS-1$
+ errorCode + "] instead.", errorCode == 0); //$NON-NLS-1$
assertTrue("Expected MMSQLException.getNestedException() to return [" //$NON-NLS-1$
+ (ecause != null ? ecause.getClass().getName() : "<null>") //$NON-NLS-1$
+ "] but got [" //$NON-NLS-1$
+ (nestedException != null ? nestedException.getClass()
.getName() : "<unknown>") + "] instead.", //$NON-NLS-1$ //$NON-NLS-2$
nestedException == ecause);
assertTrue(
"Expected MMSQLException.getNextException() to return <null> but got a SQLException with message \"" //$NON-NLS-1$
+ (nextException != null ? nextException.getMessage()
: "") + "\" instead.", nextException == null); //$NON-NLS-1$ //$NON-NLS-2$
return e;
}