Search in sources :

Example 71 with SQLNonTransientException

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

the class SQLNonTransientExceptionTests method test10.

/**
     * Serialize a SQLNonTransientException and make sure you can read it back properly
     */
@Test
public void test10() throws Exception {
    SQLNonTransientException e = new SQLNonTransientException(reason, state, errorCode, t);
    SQLNonTransientException ex1 = createSerializedException(e);
    assertTrue(reason.equals(ex1.getMessage()) && ex1.getSQLState().equals(state) && cause.equals(ex1.getCause().toString()) && ex1.getErrorCode() == errorCode);
}
Also used : SQLNonTransientException(java.sql.SQLNonTransientException) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 72 with SQLNonTransientException

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

the class SQLNonTransientExceptionTests method test4.

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

Example 73 with SQLNonTransientException

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

the class SQLNonTransientExceptionTests method test6.

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

Example 74 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 75 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)

Aggregations

SQLNonTransientException (java.sql.SQLNonTransientException)125 TableConfig (io.mycat.config.model.TableConfig)26 SQLException (java.sql.SQLException)23 Test (org.testng.annotations.Test)19 BaseTest (util.BaseTest)19 RouteResultset (io.mycat.route.RouteResultset)17 TableConfig (com.actiontech.dble.config.model.TableConfig)15 HashMap (java.util.HashMap)14 MySqlStatementParser (com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser)13 RouteResultsetNode (io.mycat.route.RouteResultsetNode)13 HashSet (java.util.HashSet)13 SQLExpr (com.alibaba.druid.sql.ast.SQLExpr)12 ColumnRoutePair (io.mycat.sqlengine.mpp.ColumnRoutePair)12 LinkedHashSet (java.util.LinkedHashSet)12 SchemaConfig (com.actiontech.dble.config.model.SchemaConfig)11 SQLStatement (com.alibaba.druid.sql.ast.SQLStatement)11 SchemaInfo (com.actiontech.dble.server.util.SchemaUtil.SchemaInfo)10 Map (java.util.Map)10 SlotFunction (io.mycat.route.function.SlotFunction)9 SQLExprTableSource (com.alibaba.druid.sql.ast.statement.SQLExprTableSource)8