Search in sources :

Example 1 with SQLTimeoutException

use of java.sql.SQLTimeoutException in project jdk8u_jdk by JetBrains.

the class SQLTimeoutExceptionTests method test3.

/**
     * Create SQLTimeoutException with message, and SQLState
     */
@Test
public void test3() {
    SQLTimeoutException ex = new SQLTimeoutException(reason, state);
    assertTrue(ex.getMessage().equals(reason) && ex.getSQLState().equals(state) && ex.getCause() == null && ex.getErrorCode() == 0);
}
Also used : SQLTimeoutException(java.sql.SQLTimeoutException) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 2 with SQLTimeoutException

use of java.sql.SQLTimeoutException in project jdk8u_jdk by JetBrains.

the class SQLTimeoutExceptionTests method test2.

/**
     * Create SQLTimeoutException with message
     */
@Test
public void test2() {
    SQLTimeoutException ex = new SQLTimeoutException(reason);
    assertTrue(ex.getMessage().equals(reason) && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0);
}
Also used : SQLTimeoutException(java.sql.SQLTimeoutException) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 3 with SQLTimeoutException

use of java.sql.SQLTimeoutException in project jdk8u_jdk by JetBrains.

the class SQLTimeoutExceptionTests method test.

/**
     * Create SQLTimeoutException and setting all objects to null
     */
@Test
public void test() {
    SQLTimeoutException e = new SQLTimeoutException(null, null, errorCode, null);
    assertTrue(e.getMessage() == null && e.getSQLState() == null && e.getCause() == null && e.getErrorCode() == errorCode);
}
Also used : SQLTimeoutException(java.sql.SQLTimeoutException) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 4 with SQLTimeoutException

use of java.sql.SQLTimeoutException in project jdk8u_jdk by JetBrains.

the class SQLTimeoutExceptionTests method test5.

/**
     * Create SQLTimeoutException with message, SQLState, errorCode, and Throwable
     */
@Test
public void test5() {
    SQLTimeoutException ex = new SQLTimeoutException(reason, state, errorCode, t);
    assertTrue(ex.getMessage().equals(reason) && ex.getSQLState().equals(state) && cause.equals(ex.getCause().toString()) && ex.getErrorCode() == errorCode);
}
Also used : SQLTimeoutException(java.sql.SQLTimeoutException) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 5 with SQLTimeoutException

use of java.sql.SQLTimeoutException in project jdk8u_jdk by JetBrains.

the class SQLTimeoutExceptionTests method test8.

/**
     * Create SQLTimeoutException with null Throwable
     */
@Test
public void test8() {
    SQLTimeoutException ex = new SQLTimeoutException((Throwable) null);
    assertTrue(ex.getMessage() == null && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0);
}
Also used : SQLTimeoutException(java.sql.SQLTimeoutException) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Aggregations

SQLTimeoutException (java.sql.SQLTimeoutException)53 SQLException (java.sql.SQLException)36 ResultSet (java.sql.ResultSet)20 Statement (java.sql.Statement)17 Test (org.testng.annotations.Test)15 Test (org.junit.Test)14 BaseTest (util.BaseTest)14 Connection (java.sql.Connection)12 PreparedStatement (java.sql.PreparedStatement)10 JdbcTest (org.apache.drill.categories.JdbcTest)8 SQLFeatureNotSupportedException (java.sql.SQLFeatureNotSupportedException)7 ArrayList (java.util.ArrayList)7 HadoopException (org.apache.ranger.plugin.client.HadoopException)6 ScreenCreator (org.apache.drill.exec.physical.impl.ScreenCreator)4 MessageEvent (org.cerberus.engine.entity.MessageEvent)4 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)3 Ignore (org.junit.Ignore)3 IOException (java.io.IOException)2 BatchUpdateException (java.sql.BatchUpdateException)2 CallableStatement (java.sql.CallableStatement)2