use of java.sql.SQLFeatureNotSupportedException in project jdk8u_jdk by JetBrains.
the class SQLFeatureNotSupportedExceptionTests method test8.
/**
* Create SQLFeatureNotSupportedException with null Throwable
*/
@Test
public void test8() {
SQLFeatureNotSupportedException ex = new SQLFeatureNotSupportedException((Throwable) null);
assertTrue(ex.getMessage() == null && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0);
}
use of java.sql.SQLFeatureNotSupportedException in project jdk8u_jdk by JetBrains.
the class SQLFeatureNotSupportedExceptionTests method test1.
/**
* Create SQLFeatureNotSupportedException with no-arg constructor
*/
@Test
public void test1() {
SQLFeatureNotSupportedException ex = new SQLFeatureNotSupportedException();
assertTrue(ex.getMessage() == null && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0);
}
use of java.sql.SQLFeatureNotSupportedException in project jdk8u_jdk by JetBrains.
the class SQLFeatureNotSupportedExceptionTests method test10.
/**
* Serialize a SQLFeatureNotSupportedException and make sure you can read it back properly
*/
@Test
public void test10() throws Exception {
SQLFeatureNotSupportedException e = new SQLFeatureNotSupportedException(reason, state, errorCode, t);
SQLFeatureNotSupportedException ex1 = createSerializedException(e);
assertTrue(reason.equals(ex1.getMessage()) && ex1.getSQLState().equals(state) && cause.equals(ex1.getCause().toString()) && ex1.getErrorCode() == errorCode);
}
use of java.sql.SQLFeatureNotSupportedException in project jdk8u_jdk by JetBrains.
the class SQLFeatureNotSupportedExceptionTests method test12.
/**
* Validate that the ordering of the returned Exceptions is correct
* using traditional while loop
*/
@Test
public void test12() {
SQLFeatureNotSupportedException ex = new SQLFeatureNotSupportedException("Exception 1", t1);
SQLFeatureNotSupportedException ex1 = new SQLFeatureNotSupportedException("Exception 2");
SQLFeatureNotSupportedException ex2 = new SQLFeatureNotSupportedException("Exception 3", t2);
ex.setNextException(ex1);
ex.setNextException(ex2);
int num = 0;
SQLException sqe = ex;
while (sqe != null) {
assertTrue(msgs[num++].equals(sqe.getMessage()));
Throwable c = sqe.getCause();
while (c != null) {
assertTrue(msgs[num++].equals(c.getMessage()));
c = c.getCause();
}
sqe = sqe.getNextException();
}
}
use of java.sql.SQLFeatureNotSupportedException in project jdk8u_jdk by JetBrains.
the class SQLFeatureNotSupportedExceptionTests method test2.
/**
* Create SQLFeatureNotSupportedException with message
*/
@Test
public void test2() {
SQLFeatureNotSupportedException ex = new SQLFeatureNotSupportedException(reason);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0);
}
Aggregations