Java 类java.sql.SQLNonTransientConnectionException 实例源码

项目:jdk8u-jdk    文件:SQLNonTransientConnectionExceptionTests.java   
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using for-each loop
 */
@Test
public void test11() {
    SQLNonTransientConnectionException ex =
            new SQLNonTransientConnectionException("Exception 1", t1);
    SQLNonTransientConnectionException ex1 =
            new SQLNonTransientConnectionException("Exception 2");
    SQLNonTransientConnectionException ex2 =
            new SQLNonTransientConnectionException("Exception 3", t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    for (Throwable e : ex) {
        assertTrue(msgs[num++].equals(e.getMessage()));
    }
}
项目:jdk8u-jdk    文件:SQLNonTransientConnectionExceptionTests.java   
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using traditional while loop
 */
@Test
public void test12() {
    SQLNonTransientConnectionException ex =
            new SQLNonTransientConnectionException("Exception 1", t1);
    SQLNonTransientConnectionException ex1 =
            new SQLNonTransientConnectionException("Exception 2");
    SQLNonTransientConnectionException ex2 =
            new SQLNonTransientConnectionException("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();
    }
}
项目:Automekanik    文件:ShtoKonsumator.java   
private void shto(){
    try {
        if (!txtEmri.getText().isEmpty() && !txtVendbanimi.getText().isEmpty() && !txtMakina.getText().isEmpty()
                && !txtMbiemri.getText().isEmpty()) {
            String em = txtEmri.getText().substring(0, 1).toUpperCase() + txtEmri.getText().substring(1, txtEmri.getText().length()).toLowerCase();
            String mb = txtMbiemri.getText().substring(0, 1).toUpperCase() + txtMbiemri.getText().substring(1, txtMbiemri.getText().length()).toLowerCase();
            String sql = "insert into Konsumatori (emri, mbiemri, makina, komuna, pershkrimi) values ('" + em + "', " +
                    "'" + mb + "', '" + txtMakina.getText() + "', '" + txtVendbanimi.getText() + "', " +
                    "'" + txtDesc.getText() + "')";
            Connection conn = DriverManager.getConnection(CON_STR, "test", "test");
            Statement stmt = conn.createStatement();
            stmt.execute(sql);
            conn.close();
            new Mesazhi("Sukses", "Sukses", "Konsumatori " + txtEmri.getText().toUpperCase() + " " +
                    txtMbiemri.getText().toUpperCase() + " u shtua me sukese");
        }else new Mesazhi("Info", "", "Fushat duhet te plotesohen per te vazhduar.");
    }catch (SQLNonTransientConnectionException fu){}
    catch (Exception ex){
        ex.printStackTrace();
    }
}
项目:Automekanik    文件:ShtoPunetor.java   
private void shtoPunetoreMethod(){
    try {
        if (!emri.getText().isEmpty() && !mbiemri.getText().isEmpty() && !komuna.getText().isEmpty() && !pjesa.getText().isEmpty() &&
                !paga.getText().isEmpty() && !data.getEditor().getText().isEmpty() && !pw.getText().isEmpty()) {
            String em = emri.getText().substring(0, 1).toUpperCase() + emri.getText().substring(1, emri.getText().length()).toLowerCase();
            String mb = mbiemri.getText().substring(0, 1).toUpperCase() + mbiemri.getText().substring(1, mbiemri.getText().length()).toLowerCase();
            String sql = "insert into Punetoret (emri, mbiemri, komuna, pozita, paga, regjistrimi) values ('" +
                    em + "', '" + mb + "', '" + komuna.getText() + "', '" + pjesa.getText() + "', " +
                    Float.parseFloat(paga.getText()) + ", DATE '" + data.getValue() + "')";
            String adminSql = "insert into Admin (emri, fjalekalimi, lloji) values " +
                    "('" + emri.getText().toLowerCase() + mbiemri.getText().toLowerCase() + "', '" + pw.getText() + "', 0)";
            Connection conn = DriverManager.getConnection(CON_STR, "test", "test");
            Statement stmt = conn.createStatement();
            Statement AdminStmt = conn.createStatement();
            stmt.execute(sql);
            AdminStmt.execute(adminSql);
            conn.close();
            new Mesazhi("Sukses", em + " " + mb, "Punetori u shtua me sukses me daten " + data.getEditor().getText());
            stage.close();
        }else new Mesazhi("Info", "", "Fushat duhet te plotesohen para se te vazhdoni");
    }catch (SQLNonTransientConnectionException fu){}
    catch (NumberFormatException nfw){new Mesazhi("Info", "Gabim", "Fusha qmimi duhet te permbaj vetem numra.");}
    catch (Exception ex){ex.printStackTrace();}
}
项目:Automekanik    文件:ShtoPunetor.java   
private void rregullo(int id){
    try {
        if (!user.getText().isEmpty() && !pw.getText().isEmpty()) {
            String sql = "update Admin set emri = '" + user.getText() + "', fjalekalimi = '" + pw.getText() +
                    "' where id = " + id;
            System.out.println("ID: " + id);
            Connection conn = DriverManager.getConnection(CON_STR, "test", "test");
            Statement stmt = conn.createStatement();
            stmt.execute(sql);
            conn.close();
            new Mesazhi("Sukses", "", "Te dhenat u ruajten me sukses. Ju lutem restartoni programin.");
            stage.close();
        }
        else new Mesazhi("Gabim", "", "Fushat duhet te plotesohen para se te vazhdoni");
    }catch (SQLNonTransientConnectionException fu){}
    catch (NullPointerException npe){new Mesazhi("Info", "Gabim", "Fusha qmimi duhet te permbaj vetem numra.");}
    catch (Exception ex){ex.printStackTrace();}
}
项目:openjdk-jdk10    文件:SQLNonTransientConnectionExceptionTests.java   
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using for-each loop
 */
@Test
public void test11() {
    SQLNonTransientConnectionException ex =
            new SQLNonTransientConnectionException("Exception 1", t1);
    SQLNonTransientConnectionException ex1 =
            new SQLNonTransientConnectionException("Exception 2");
    SQLNonTransientConnectionException ex2 =
            new SQLNonTransientConnectionException("Exception 3", t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    for (Throwable e : ex) {
        assertTrue(msgs[num++].equals(e.getMessage()));
    }
}
项目:openjdk-jdk10    文件:SQLNonTransientConnectionExceptionTests.java   
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using traditional while loop
 */
@Test
public void test12() {
    SQLNonTransientConnectionException ex =
            new SQLNonTransientConnectionException("Exception 1", t1);
    SQLNonTransientConnectionException ex1 =
            new SQLNonTransientConnectionException("Exception 2");
    SQLNonTransientConnectionException ex2 =
            new SQLNonTransientConnectionException("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();
    }
}
项目:openjdk9    文件:SQLNonTransientConnectionExceptionTests.java   
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using for-each loop
 */
@Test
public void test11() {
    SQLNonTransientConnectionException ex =
            new SQLNonTransientConnectionException("Exception 1", t1);
    SQLNonTransientConnectionException ex1 =
            new SQLNonTransientConnectionException("Exception 2");
    SQLNonTransientConnectionException ex2 =
            new SQLNonTransientConnectionException("Exception 3", t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    for (Throwable e : ex) {
        assertTrue(msgs[num++].equals(e.getMessage()));
    }
}
项目:openjdk9    文件:SQLNonTransientConnectionExceptionTests.java   
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using traditional while loop
 */
@Test
public void test12() {
    SQLNonTransientConnectionException ex =
            new SQLNonTransientConnectionException("Exception 1", t1);
    SQLNonTransientConnectionException ex1 =
            new SQLNonTransientConnectionException("Exception 2");
    SQLNonTransientConnectionException ex2 =
            new SQLNonTransientConnectionException("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();
    }
}
项目:gemfirexd-oss    文件:TransactionTest.java   
public void Debug_tests_43222() throws SQLException {
  final Connection conn = getConnection();
  final Statement stmt = conn.createStatement();
  conn.setTransactionIsolation(getIsolationLevel());
  stmt.execute("create table warehouse (    w_id        integer   not null,"
      + "    w_ytd       decimal(12,2),"
      + "    w_tax       decimal(4,4),"
      + "    w_name      varchar(10)) replicate"+getSuffix());

  stmt.execute("alter table warehouse add constraint pk_warehouse "
      + "primary key (w_id)");

  stmt.execute("insert into warehouse values(1, 0.0, 0.0, 'name1'), "
      + "(2, 0.2, 0.0, 'name2')");
  conn.commit();

  int i = stmt.executeUpdate("UPDATE warehouse SET w_ytd = w_ytd + 4998.73 "
      + "WHERE w_id = 1");
  System.out.println(i);
  SQLNonTransientConnectionException ex = new SQLNonTransientConnectionException();
  System.out.println("ex.getSQLState returned: " + ex.getSQLState());
}
项目:jdk8u_jdk    文件:SQLNonTransientConnectionExceptionTests.java   
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using for-each loop
 */
@Test
public void test11() {
    SQLNonTransientConnectionException ex =
            new SQLNonTransientConnectionException("Exception 1", t1);
    SQLNonTransientConnectionException ex1 =
            new SQLNonTransientConnectionException("Exception 2");
    SQLNonTransientConnectionException ex2 =
            new SQLNonTransientConnectionException("Exception 3", t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    for (Throwable e : ex) {
        assertTrue(msgs[num++].equals(e.getMessage()));
    }
}
项目:jdk8u_jdk    文件:SQLNonTransientConnectionExceptionTests.java   
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using traditional while loop
 */
@Test
public void test12() {
    SQLNonTransientConnectionException ex =
            new SQLNonTransientConnectionException("Exception 1", t1);
    SQLNonTransientConnectionException ex1 =
            new SQLNonTransientConnectionException("Exception 2");
    SQLNonTransientConnectionException ex2 =
            new SQLNonTransientConnectionException("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();
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:SQLNonTransientConnectionExceptionTests.java   
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using for-each loop
 */
@Test
public void test11() {
    SQLNonTransientConnectionException ex =
            new SQLNonTransientConnectionException("Exception 1", t1);
    SQLNonTransientConnectionException ex1 =
            new SQLNonTransientConnectionException("Exception 2");
    SQLNonTransientConnectionException ex2 =
            new SQLNonTransientConnectionException("Exception 3", t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    for (Throwable e : ex) {
        assertTrue(msgs[num++].equals(e.getMessage()));
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:SQLNonTransientConnectionExceptionTests.java   
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using traditional while loop
 */
@Test
public void test12() {
    SQLNonTransientConnectionException ex =
            new SQLNonTransientConnectionException("Exception 1", t1);
    SQLNonTransientConnectionException ex1 =
            new SQLNonTransientConnectionException("Exception 2");
    SQLNonTransientConnectionException ex2 =
            new SQLNonTransientConnectionException("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();
    }
}
项目:ade    文件:ExtDataStoreUtils.java   
public static void handleConnectFailure(SQLNonTransientConnectionException e, String databaseUrl) { 

        logger.trace("handleConnectFailure( SQLNonTransientConnectionException )");

        boolean suppress = false;
        try {
            suppress = isDbNotFoundException(e);
        } catch (AdeInternalException i) {
            logger.error("Unable to determine sqlstate", i);
        }

        if (suppress) {
            logger.info("Suppress connection failure (nonexistent db), url: " + databaseUrl);
        } else {
            handleConnectFailure(e);
        }

    }
项目:gemfirexd-oss    文件:TransactionTest.java   
public void Debug_tests_43222() throws SQLException {
  final Connection conn = getConnection();
  final Statement stmt = conn.createStatement();
  conn.setTransactionIsolation(getIsolationLevel());
  stmt.execute("create table warehouse (    w_id        integer   not null,"
      + "    w_ytd       decimal(12,2),"
      + "    w_tax       decimal(4,4),"
      + "    w_name      varchar(10)) replicate"+getSuffix());

  stmt.execute("alter table warehouse add constraint pk_warehouse "
      + "primary key (w_id)");

  stmt.execute("insert into warehouse values(1, 0.0, 0.0, 'name1'), "
      + "(2, 0.2, 0.0, 'name2')");
  conn.commit();

  int i = stmt.executeUpdate("UPDATE warehouse SET w_ytd = w_ytd + 4998.73 "
      + "WHERE w_id = 1");
  System.out.println(i);
  SQLNonTransientConnectionException ex = new SQLNonTransientConnectionException();
  System.out.println("ex.getSQLState returned: " + ex.getSQLState());
}
项目:cassandra-jdbc-wrapper    文件:CassandraDataSource.java   
public CassandraConnection getConnection(String user, String password) throws SQLException
{
    Properties props = new Properties();

    this.user = user;
    this.password = password;

    if (this.serverName!=null) props.setProperty(TAG_SERVER_NAME, this.serverName);
    else throw new SQLNonTransientConnectionException(HOST_REQUIRED);
    props.setProperty(TAG_PORT_NUMBER, ""+this.portNumber);
    if (this.databaseName!=null) props.setProperty(TAG_DATABASE_NAME, this.databaseName);
    if (user!=null) props.setProperty(TAG_USER, user);
    if (password!=null) props.setProperty(TAG_PASSWORD, password);
    if (this.version != null) props.setProperty(TAG_CQL_VERSION, version);
    if (this.consistency != null) props.setProperty(TAG_CONSISTENCY_LEVEL, consistency);

    String url = PROTOCOL+createSubName(props);
    return (CassandraConnection) DriverManager.getConnection(url, props);
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(String, String)
 */
public void test_Constructor_LStringLString() {
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            "MYTESTSTRING1", "MYTESTSTRING2");
    assertNotNull(sQLNonTransientConnectionException);
    assertEquals(
            "The SQLState of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING2", sQLNonTransientConnectionException
                    .getSQLState());
    assertEquals(
            "The reason of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING1", sQLNonTransientConnectionException
                    .getMessage());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be 0",
            sQLNonTransientConnectionException.getErrorCode(), 0);

}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(String, String)
 */
public void test_Constructor_LStringLString_2() {
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            null, "MYTESTSTRING");
    assertNotNull(sQLNonTransientConnectionException);
    assertEquals(
            "The SQLState of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING", sQLNonTransientConnectionException
                    .getSQLState());
    assertNull(
            "The reason of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getMessage());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be 0",
            sQLNonTransientConnectionException.getErrorCode(), 0);
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(String, String, int)
 */
public void test_Constructor_LStringLStringI() {
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            "MYTESTSTRING1", "MYTESTSTRING2", 1);
    assertNotNull(sQLNonTransientConnectionException);
    assertEquals(
            "The SQLState of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING2", sQLNonTransientConnectionException
                    .getSQLState());
    assertEquals(
            "The reason of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING1", sQLNonTransientConnectionException
                    .getMessage());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be 1",
            sQLNonTransientConnectionException.getErrorCode(), 1);
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(String, String, int)
 */
public void test_Constructor_LStringLStringI_1() {
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            "MYTESTSTRING1", "MYTESTSTRING2", 0);
    assertNotNull(sQLNonTransientConnectionException);
    assertEquals(
            "The SQLState of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING2", sQLNonTransientConnectionException
                    .getSQLState());
    assertEquals(
            "The reason of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING1", sQLNonTransientConnectionException
                    .getMessage());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be 0",
            sQLNonTransientConnectionException.getErrorCode(), 0);
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(String, String, int)
 */
public void test_Constructor_LStringLStringI_2() {
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            "MYTESTSTRING1", "MYTESTSTRING2", -1);
    assertNotNull(sQLNonTransientConnectionException);
    assertEquals(
            "The SQLState of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING2", sQLNonTransientConnectionException
                    .getSQLState());
    assertEquals(
            "The reason of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING1", sQLNonTransientConnectionException
                    .getMessage());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be -1",
            sQLNonTransientConnectionException.getErrorCode(), -1);
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(String, String, int)
 */
public void test_Constructor_LStringLStringI_6() {
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            null, "MYTESTSTRING", 1);
    assertNotNull(sQLNonTransientConnectionException);
    assertEquals(
            "The SQLState of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING", sQLNonTransientConnectionException
                    .getSQLState());
    assertNull(
            "The reason of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getMessage());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be 1",
            sQLNonTransientConnectionException.getErrorCode(), 1);
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(String, String, int)
 */
public void test_Constructor_LStringLStringI_7() {
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            null, "MYTESTSTRING", 0);
    assertNotNull(sQLNonTransientConnectionException);
    assertEquals(
            "The SQLState of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING", sQLNonTransientConnectionException
                    .getSQLState());
    assertNull(
            "The reason of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getMessage());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be 0",
            sQLNonTransientConnectionException.getErrorCode(), 0);
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(String, String, int)
 */
public void test_Constructor_LStringLStringI_8() {
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            null, "MYTESTSTRING", -1);
    assertNotNull(sQLNonTransientConnectionException);
    assertEquals(
            "The SQLState of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING", sQLNonTransientConnectionException
                    .getSQLState());
    assertNull(
            "The reason of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getMessage());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be -1",
            sQLNonTransientConnectionException.getErrorCode(), -1);
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(Throwable)
 */
public void test_Constructor_LThrowable() {
    Throwable cause = new Exception("MYTHROWABLE");
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            cause);
    assertNotNull(sQLNonTransientConnectionException);
    assertEquals(
            "The reason of SQLNonTransientConnectionException should be equals to cause.toString()",
            "java.lang.Exception: MYTHROWABLE",
            sQLNonTransientConnectionException.getMessage());
    assertNull(
            "The SQLState of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getSQLState());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be 0",
            sQLNonTransientConnectionException.getErrorCode(), 0);
    assertEquals(
            "The cause of SQLNonTransientConnectionException set and get should be equivalent",
            cause, sQLNonTransientConnectionException.getCause());
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(Throwable)
 */
public void test_Constructor_LThrowable_1() {
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            (Throwable) null);
    assertNotNull(sQLNonTransientConnectionException);
    assertNull(
            "The SQLState of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getSQLState());
    assertNull(
            "The reason of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getMessage());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be 0",
            sQLNonTransientConnectionException.getErrorCode(), 0);
    assertNull(
            "The cause of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getCause());
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(String, Throwable)
 */
public void test_Constructor_LStringLThrowable() {
    Throwable cause = new Exception("MYTHROWABLE");
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            "MYTESTSTRING", cause);
    assertNotNull(sQLNonTransientConnectionException);
    assertEquals(
            "The reason of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING", sQLNonTransientConnectionException.getMessage());
    assertNull(
            "The SQLState of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getSQLState());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be 0",
            sQLNonTransientConnectionException.getErrorCode(), 0);
    assertEquals(
            "The cause of SQLNonTransientConnectionException set and get should be equivalent",
            cause, sQLNonTransientConnectionException.getCause());
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(String, Throwable)
 */
public void test_Constructor_LStringLThrowable_1() {
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            "MYTESTSTRING", (Throwable) null);
    assertNotNull(sQLNonTransientConnectionException);
    assertEquals(
            "The reason of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING", sQLNonTransientConnectionException.getMessage());
    assertNull(
            "The SQLState of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getSQLState());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be 0",
            sQLNonTransientConnectionException.getErrorCode(), 0);
    assertNull(
            "The cause of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getCause());
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(String, Throwable)
 */
public void test_Constructor_LStringLThrowable_2() {
    Throwable cause = new Exception("MYTHROWABLE");
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            null, cause);
    assertNotNull(sQLNonTransientConnectionException);
    assertNull(
            "The reason of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getMessage());
    assertNull(
            "The SQLState of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getSQLState());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be 0",
            sQLNonTransientConnectionException.getErrorCode(), 0);
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(String, Throwable)
 */
public void test_Constructor_LStringLThrowable_3() {
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            (String) null, (Throwable) null);
    assertNotNull(sQLNonTransientConnectionException);
    assertNull(
            "The SQLState of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getSQLState());
    assertNull(
            "The reason of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getMessage());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be 0",
            sQLNonTransientConnectionException.getErrorCode(), 0);
    assertNull(
            "The cause of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getCause());
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(String, String,
 *       Throwable)
 */
public void test_Constructor_LStringLStringLThrowable() {
    Throwable cause = new Exception("MYTHROWABLE");
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            "MYTESTSTRING1", "MYTESTSTRING2", cause);
    assertNotNull(sQLNonTransientConnectionException);
    assertEquals(
            "The SQLState of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING2", sQLNonTransientConnectionException
                    .getSQLState());
    assertEquals(
            "The reason of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING1", sQLNonTransientConnectionException
                    .getMessage());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be 0",
            sQLNonTransientConnectionException.getErrorCode(), 0);
    assertEquals(
            "The cause of SQLNonTransientConnectionException set and get should be equivalent",
            cause, sQLNonTransientConnectionException.getCause());
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(String, String,
 *       Throwable)
 */
public void test_Constructor_LStringLStringLThrowable_1() {
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            "MYTESTSTRING1", "MYTESTSTRING2", null);
    assertNotNull(sQLNonTransientConnectionException);
    assertEquals(
            "The SQLState of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING2", sQLNonTransientConnectionException
                    .getSQLState());
    assertEquals(
            "The reason of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING1", sQLNonTransientConnectionException
                    .getMessage());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be 0",
            sQLNonTransientConnectionException.getErrorCode(), 0);
    assertNull(
            "The cause of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getCause());
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(String, String,
 *       Throwable)
 */
public void test_Constructor_LStringLStringLThrowable_2() {
    Throwable cause = new Exception("MYTHROWABLE");
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            "MYTESTSTRING", null, cause);
    assertNotNull(sQLNonTransientConnectionException);
    assertNull(
            "The SQLState of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getSQLState());
    assertEquals(
            "The reason of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING", sQLNonTransientConnectionException.getMessage());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be 0",
            sQLNonTransientConnectionException.getErrorCode(), 0);
    assertEquals(
            "The cause of SQLNonTransientConnectionException set and get should be equivalent",
            cause, sQLNonTransientConnectionException.getCause());
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(String, String,
 *       Throwable)
 */
public void test_Constructor_LStringLStringLThrowable_3() {
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            "MYTESTSTRING", null, null);
    assertNotNull(sQLNonTransientConnectionException);
    assertNull(
            "The SQLState of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getSQLState());
    assertEquals(
            "The reason of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING", sQLNonTransientConnectionException.getMessage());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be 0",
            sQLNonTransientConnectionException.getErrorCode(), 0);
    assertNull(
            "The cause of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getCause());
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(String, String,
 *       Throwable)
 */
public void test_Constructor_LStringLStringLThrowable_4() {
    Throwable cause = new Exception("MYTHROWABLE");
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            null, "MYTESTSTRING", cause);
    assertNotNull(sQLNonTransientConnectionException);
    assertEquals(
            "The SQLState of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING", sQLNonTransientConnectionException
                    .getSQLState());
    assertNull(
            "The reason of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getMessage());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be 0",
            sQLNonTransientConnectionException.getErrorCode(), 0);
    assertEquals(
            "The cause of SQLNonTransientConnectionException set and get should be equivalent",
            cause, sQLNonTransientConnectionException.getCause());
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(String, String,
 *       Throwable)
 */
public void test_Constructor_LStringLStringLThrowable_5() {
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            null, "MYTESTSTRING", null);
    assertNotNull(sQLNonTransientConnectionException);
    assertEquals(
            "The SQLState of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING", sQLNonTransientConnectionException
                    .getSQLState());
    assertNull(
            "The reason of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getMessage());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be 0",
            sQLNonTransientConnectionException.getErrorCode(), 0);
    assertNull(
            "The cause of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getCause());
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(String, String,
 *       Throwable)
 */
public void test_Constructor_LStringLStringLThrowable_6() {
    Throwable cause = new Exception("MYTHROWABLE");
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            null, null, cause);
    assertNotNull(sQLNonTransientConnectionException);
    assertNull(
            "The SQLState of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getSQLState());
    assertNull(
            "The reason of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getMessage());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be 0",
            sQLNonTransientConnectionException.getErrorCode(), 0);
    assertEquals(
            "The cause of SQLNonTransientConnectionException set and get should be equivalent",
            cause, sQLNonTransientConnectionException.getCause());
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(String, String,
 *       Throwable)
 */
public void test_Constructor_LStringLStringLThrowable_7() {
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            null, null, null);
    assertNotNull(sQLNonTransientConnectionException);
    assertNull(
            "The SQLState of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getSQLState());
    assertNull(
            "The reason of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getMessage());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be 0",
            sQLNonTransientConnectionException.getErrorCode(), 0);
    assertNull(
            "The cause of SQLNonTransientConnectionException should be null",
            sQLNonTransientConnectionException.getCause());
}
项目:cn1    文件:SQLNonTransientConnectionExceptionTest.java   
/**
 * @test java.sql.SQLNonTransientConnectionException(String, String, int,
 *       Throwable)
 */
public void test_Constructor_LStringLStringILThrowable() {
    Throwable cause = new Exception("MYTHROWABLE");
    SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
            "MYTESTSTRING1", "MYTESTSTRING2", 1, cause);
    assertNotNull(sQLNonTransientConnectionException);
    assertEquals(
            "The SQLState of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING2", sQLNonTransientConnectionException
                    .getSQLState());
    assertEquals(
            "The reason of SQLNonTransientConnectionException set and get should be equivalent",
            "MYTESTSTRING1", sQLNonTransientConnectionException
                    .getMessage());
    assertEquals(
            "The error code of SQLNonTransientConnectionException should be 1",
            sQLNonTransientConnectionException.getErrorCode(), 1);
    assertEquals(
            "The cause of SQLNonTransientConnectionException set and get should be equivalent",
            cause, sQLNonTransientConnectionException.getCause());
}