Search in sources :

Example 46 with SQLNonTransientException

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

the class SQLNonTransientExceptionTests method test9.

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

Example 47 with SQLNonTransientException

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

the class SQLNonTransientExceptionTests method test5.

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

Example 48 with SQLNonTransientException

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

the class SQLDataExceptionTests method test13.

/**
     * Create SQLDataException and validate it is an instance of
     * SQLNonTransientException
     */
@Test
public void test13() {
    Exception ex = new SQLDataException();
    assertTrue(ex instanceof SQLNonTransientException);
}
Also used : SQLNonTransientException(java.sql.SQLNonTransientException) SQLDataException(java.sql.SQLDataException) SQLException(java.sql.SQLException) SQLNonTransientException(java.sql.SQLNonTransientException) SQLDataException(java.sql.SQLDataException) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 49 with SQLNonTransientException

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

the class SQLFeatureNotSupportedExceptionTests method test13.

/**
     * Create SQLFeatureNotSupportedException and validate it is an instance of
     * SQLNonTransientException
     */
@Test
public void test13() {
    Exception ex = new SQLFeatureNotSupportedException();
    assertTrue(ex instanceof SQLNonTransientException);
}
Also used : SQLNonTransientException(java.sql.SQLNonTransientException) SQLFeatureNotSupportedException(java.sql.SQLFeatureNotSupportedException) SQLException(java.sql.SQLException) SQLNonTransientException(java.sql.SQLNonTransientException) SQLFeatureNotSupportedException(java.sql.SQLFeatureNotSupportedException) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Aggregations

SQLNonTransientException (java.sql.SQLNonTransientException)49 Test (org.testng.annotations.Test)19 BaseTest (util.BaseTest)19 TableConfig (io.mycat.config.model.TableConfig)12 RouteResultset (io.mycat.route.RouteResultset)8 SQLException (java.sql.SQLException)8 RouteResultsetNode (io.mycat.route.RouteResultsetNode)7 ColumnRoutePair (io.mycat.sqlengine.mpp.ColumnRoutePair)6 SlotFunction (io.mycat.route.function.SlotFunction)5 MySqlStatementParser (com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser)4 AbstractPartitionAlgorithm (io.mycat.route.function.AbstractPartitionAlgorithm)4 RouteCalculateUnit (io.mycat.route.parser.druid.RouteCalculateUnit)4 SQLExpr (com.alibaba.druid.sql.ast.SQLExpr)3 SQLStatement (com.alibaba.druid.sql.ast.SQLStatement)3 MySqlInsertStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlInsertStatement)3 SchemaConfig (io.mycat.config.model.SchemaConfig)3 SQLSyntaxErrorException (java.sql.SQLSyntaxErrorException)3 SchemaConfig (com.alibaba.cobar.config.model.SchemaConfig)2 SQLCharExpr (com.alibaba.druid.sql.ast.expr.SQLCharExpr)2 MySqlUpdateStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlUpdateStatement)2