本文整理汇总了Java中java.sql.SQLTransientConnectionException类的典型用法代码示例。如果您正苦于以下问题:Java SQLTransientConnectionException类的具体用法?Java SQLTransientConnectionException怎么用?Java SQLTransientConnectionException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SQLTransientConnectionException类属于java.sql包,在下文中一共展示了SQLTransientConnectionException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test11
import java.sql.SQLTransientConnectionException; //导入依赖的package包/类
/**
* Validate that the ordering of the returned Exceptions is correct
* using for-each loop
*/
@Test
public void test11() {
SQLTransientConnectionException ex =
new SQLTransientConnectionException("Exception 1", t1);
SQLTransientConnectionException ex1 =
new SQLTransientConnectionException("Exception 2");
SQLTransientConnectionException ex2 =
new SQLTransientConnectionException("Exception 3", t2);
ex.setNextException(ex1);
ex.setNextException(ex2);
int num = 0;
for (Throwable e : ex) {
assertTrue(msgs[num++].equals(e.getMessage()));
}
}
示例2: test12
import java.sql.SQLTransientConnectionException; //导入依赖的package包/类
/**
* Validate that the ordering of the returned Exceptions is correct
* using traditional while loop
*/
@Test
public void test12() {
SQLTransientConnectionException ex =
new SQLTransientConnectionException("Exception 1", t1);
SQLTransientConnectionException ex1 =
new SQLTransientConnectionException("Exception 2");
SQLTransientConnectionException ex2 =
new SQLTransientConnectionException("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();
}
}
示例3: test_Constructor_LStringLString
import java.sql.SQLTransientConnectionException; //导入依赖的package包/类
/**
* @test java.sql.SQLTransientConnectionException(String, String)
*/
public void test_Constructor_LStringLString() {
SQLTransientConnectionException sQLTransientConnectionException = new SQLTransientConnectionException(
"MYTESTSTRING1", "MYTESTSTRING2");
assertNotNull(sQLTransientConnectionException);
assertEquals(
"The SQLState of SQLTransientConnectionException set and get should be equivalent",
"MYTESTSTRING2", sQLTransientConnectionException.getSQLState());
assertEquals(
"The reason of SQLTransientConnectionException set and get should be equivalent",
"MYTESTSTRING1", sQLTransientConnectionException.getMessage());
assertEquals(
"The error code of SQLTransientConnectionException should be 0",
sQLTransientConnectionException.getErrorCode(), 0);
}
示例4: test_Constructor_LThrowable
import java.sql.SQLTransientConnectionException; //导入依赖的package包/类
/**
* @test java.sql.SQLTransientConnectionException(Throwable)
*/
public void test_Constructor_LThrowable() {
Throwable cause = new Exception("MYTHROWABLE");
SQLTransientConnectionException sQLTransientConnectionException = new SQLTransientConnectionException(
cause);
assertNotNull(sQLTransientConnectionException);
assertEquals(
"The reason of SQLTransientConnectionException should be equals to cause.toString()",
"java.lang.Exception: MYTHROWABLE",
sQLTransientConnectionException.getMessage());
assertNull(
"The SQLState of SQLTransientConnectionException should be null",
sQLTransientConnectionException.getSQLState());
assertEquals(
"The error code of SQLTransientConnectionException should be 0",
sQLTransientConnectionException.getErrorCode(), 0);
assertEquals(
"The cause of SQLTransientConnectionException set and get should be equivalent",
cause, sQLTransientConnectionException.getCause());
}
示例5: test_Constructor_LThrowable_1
import java.sql.SQLTransientConnectionException; //导入依赖的package包/类
/**
* @test java.sql.SQLTransientConnectionException(Throwable)
*/
public void test_Constructor_LThrowable_1() {
SQLTransientConnectionException sQLTransientConnectionException = new SQLTransientConnectionException(
(Throwable) null);
assertNotNull(sQLTransientConnectionException);
assertNull(
"The SQLState of SQLTransientConnectionException should be null",
sQLTransientConnectionException.getSQLState());
assertNull(
"The reason of SQLTransientConnectionException should be null",
sQLTransientConnectionException.getMessage());
assertEquals(
"The error code of SQLTransientConnectionException should be 0",
sQLTransientConnectionException.getErrorCode(), 0);
assertNull(
"The cause of SQLTransientConnectionException should be null",
sQLTransientConnectionException.getCause());
}
示例6: test_Constructor_LStringLThrowable
import java.sql.SQLTransientConnectionException; //导入依赖的package包/类
/**
* @test java.sql.SQLTransientConnectionException(String, Throwable)
*/
public void test_Constructor_LStringLThrowable() {
Throwable cause = new Exception("MYTHROWABLE");
SQLTransientConnectionException sQLTransientConnectionException = new SQLTransientConnectionException(
"MYTESTSTRING", cause);
assertNotNull(sQLTransientConnectionException);
assertEquals(
"The reason of SQLTransientConnectionException set and get should be equivalent",
"MYTESTSTRING", sQLTransientConnectionException.getMessage());
assertNull(
"The SQLState of SQLTransientConnectionException should be null",
sQLTransientConnectionException.getSQLState());
assertEquals(
"The error code of SQLTransientConnectionException should be 0",
sQLTransientConnectionException.getErrorCode(), 0);
assertEquals(
"The cause of SQLTransientConnectionException set and get should be equivalent",
cause, sQLTransientConnectionException.getCause());
}
示例7: test_Constructor_LStringLThrowable_1
import java.sql.SQLTransientConnectionException; //导入依赖的package包/类
/**
* @test java.sql.SQLTransientConnectionException(String, Throwable)
*/
public void test_Constructor_LStringLThrowable_1() {
SQLTransientConnectionException sQLTransientConnectionException = new SQLTransientConnectionException(
"MYTESTSTRING", (Throwable) null);
assertNotNull(sQLTransientConnectionException);
assertEquals(
"The reason of SQLTransientConnectionException set and get should be equivalent",
"MYTESTSTRING", sQLTransientConnectionException.getMessage());
assertNull(
"The SQLState of SQLTransientConnectionException should be null",
sQLTransientConnectionException.getSQLState());
assertEquals(
"The error code of SQLTransientConnectionException should be 0",
sQLTransientConnectionException.getErrorCode(), 0);
assertNull(
"The cause of SQLTransientConnectionException should be null",
sQLTransientConnectionException.getCause());
}
示例8: test_Constructor_LStringLThrowable_2
import java.sql.SQLTransientConnectionException; //导入依赖的package包/类
/**
* @test java.sql.SQLTransientConnectionException(String, Throwable)
*/
public void test_Constructor_LStringLThrowable_2() {
Throwable cause = new Exception("MYTHROWABLE");
SQLTransientConnectionException sQLTransientConnectionException = new SQLTransientConnectionException(
null, cause);
assertNotNull(sQLTransientConnectionException);
assertNull(
"The reason of SQLTransientConnectionException should be null",
sQLTransientConnectionException.getMessage());
assertNull(
"The SQLState of SQLTransientConnectionException should be null",
sQLTransientConnectionException.getSQLState());
assertEquals(
"The error code of SQLTransientConnectionException should be 0",
sQLTransientConnectionException.getErrorCode(), 0);
}
示例9: test_Constructor_LStringLThrowable_3
import java.sql.SQLTransientConnectionException; //导入依赖的package包/类
/**
* @test java.sql.SQLTransientConnectionException(String, Throwable)
*/
public void test_Constructor_LStringLThrowable_3() {
SQLTransientConnectionException sQLTransientConnectionException = new SQLTransientConnectionException(
(String) null, (Throwable) null);
assertNotNull(sQLTransientConnectionException);
assertNull(
"The SQLState of SQLTransientConnectionException should be null",
sQLTransientConnectionException.getSQLState());
assertNull(
"The reason of SQLTransientConnectionException should be null",
sQLTransientConnectionException.getMessage());
assertEquals(
"The error code of SQLTransientConnectionException should be 0",
sQLTransientConnectionException.getErrorCode(), 0);
assertNull(
"The cause of SQLTransientConnectionException should be null",
sQLTransientConnectionException.getCause());
}
示例10: test_Constructor_LStringLStringLThrowable
import java.sql.SQLTransientConnectionException; //导入依赖的package包/类
/**
* @test java.sql.SQLTransientConnectionException(String, String, Throwable)
*/
public void test_Constructor_LStringLStringLThrowable() {
Throwable cause = new Exception("MYTHROWABLE");
SQLTransientConnectionException sQLTransientConnectionException = new SQLTransientConnectionException(
"MYTESTSTRING1", "MYTESTSTRING2", cause);
assertNotNull(sQLTransientConnectionException);
assertEquals(
"The SQLState of SQLTransientConnectionException set and get should be equivalent",
"MYTESTSTRING2", sQLTransientConnectionException.getSQLState());
assertEquals(
"The reason of SQLTransientConnectionException set and get should be equivalent",
"MYTESTSTRING1", sQLTransientConnectionException.getMessage());
assertEquals(
"The error code of SQLTransientConnectionException should be 0",
sQLTransientConnectionException.getErrorCode(), 0);
assertEquals(
"The cause of SQLTransientConnectionException set and get should be equivalent",
cause, sQLTransientConnectionException.getCause());
}
示例11: test_Constructor_LStringLStringLThrowable_1
import java.sql.SQLTransientConnectionException; //导入依赖的package包/类
/**
* @test java.sql.SQLTransientConnectionException(String, String, Throwable)
*/
public void test_Constructor_LStringLStringLThrowable_1() {
SQLTransientConnectionException sQLTransientConnectionException = new SQLTransientConnectionException(
"MYTESTSTRING1", "MYTESTSTRING2", null);
assertNotNull(sQLTransientConnectionException);
assertEquals(
"The SQLState of SQLTransientConnectionException set and get should be equivalent",
"MYTESTSTRING2", sQLTransientConnectionException.getSQLState());
assertEquals(
"The reason of SQLTransientConnectionException set and get should be equivalent",
"MYTESTSTRING1", sQLTransientConnectionException.getMessage());
assertEquals(
"The error code of SQLTransientConnectionException should be 0",
sQLTransientConnectionException.getErrorCode(), 0);
assertNull(
"The cause of SQLTransientConnectionException should be null",
sQLTransientConnectionException.getCause());
}
示例12: test_Constructor_LStringLStringLThrowable_2
import java.sql.SQLTransientConnectionException; //导入依赖的package包/类
/**
* @test java.sql.SQLTransientConnectionException(String, String, Throwable)
*/
public void test_Constructor_LStringLStringLThrowable_2() {
Throwable cause = new Exception("MYTHROWABLE");
SQLTransientConnectionException sQLTransientConnectionException = new SQLTransientConnectionException(
"MYTESTSTRING", null, cause);
assertNotNull(sQLTransientConnectionException);
assertNull(
"The SQLState of SQLTransientConnectionException should be null",
sQLTransientConnectionException.getSQLState());
assertEquals(
"The reason of SQLTransientConnectionException set and get should be equivalent",
"MYTESTSTRING", sQLTransientConnectionException.getMessage());
assertEquals(
"The error code of SQLTransientConnectionException should be 0",
sQLTransientConnectionException.getErrorCode(), 0);
assertEquals(
"The cause of SQLTransientConnectionException set and get should be equivalent",
cause, sQLTransientConnectionException.getCause());
}
示例13: test_Constructor_LStringLStringLThrowable_3
import java.sql.SQLTransientConnectionException; //导入依赖的package包/类
/**
* @test java.sql.SQLTransientConnectionException(String, String, Throwable)
*/
public void test_Constructor_LStringLStringLThrowable_3() {
SQLTransientConnectionException sQLTransientConnectionException = new SQLTransientConnectionException(
"MYTESTSTRING", null, null);
assertNotNull(sQLTransientConnectionException);
assertNull(
"The SQLState of SQLTransientConnectionException should be null",
sQLTransientConnectionException.getSQLState());
assertEquals(
"The reason of SQLTransientConnectionException set and get should be equivalent",
"MYTESTSTRING", sQLTransientConnectionException.getMessage());
assertEquals(
"The error code of SQLTransientConnectionException should be 0",
sQLTransientConnectionException.getErrorCode(), 0);
assertNull(
"The cause of SQLTransientConnectionException should be null",
sQLTransientConnectionException.getCause());
}
示例14: test_Constructor_LStringLStringLThrowable_4
import java.sql.SQLTransientConnectionException; //导入依赖的package包/类
/**
* @test java.sql.SQLTransientConnectionException(String, String, Throwable)
*/
public void test_Constructor_LStringLStringLThrowable_4() {
Throwable cause = new Exception("MYTHROWABLE");
SQLTransientConnectionException sQLTransientConnectionException = new SQLTransientConnectionException(
null, "MYTESTSTRING", cause);
assertNotNull(sQLTransientConnectionException);
assertEquals(
"The SQLState of SQLTransientConnectionException set and get should be equivalent",
"MYTESTSTRING", sQLTransientConnectionException.getSQLState());
assertNull(
"The reason of SQLTransientConnectionException should be null",
sQLTransientConnectionException.getMessage());
assertEquals(
"The error code of SQLTransientConnectionException should be 0",
sQLTransientConnectionException.getErrorCode(), 0);
assertEquals(
"The cause of SQLTransientConnectionException set and get should be equivalent",
cause, sQLTransientConnectionException.getCause());
}
示例15: test_Constructor_LStringLStringLThrowable_5
import java.sql.SQLTransientConnectionException; //导入依赖的package包/类
/**
* @test java.sql.SQLTransientConnectionException(String, String, Throwable)
*/
public void test_Constructor_LStringLStringLThrowable_5() {
SQLTransientConnectionException sQLTransientConnectionException = new SQLTransientConnectionException(
null, "MYTESTSTRING", null);
assertNotNull(sQLTransientConnectionException);
assertEquals(
"The SQLState of SQLTransientConnectionException set and get should be equivalent",
"MYTESTSTRING", sQLTransientConnectionException.getSQLState());
assertNull(
"The reason of SQLTransientConnectionException should be null",
sQLTransientConnectionException.getMessage());
assertEquals(
"The error code of SQLTransientConnectionException should be 0",
sQLTransientConnectionException.getErrorCode(), 0);
assertNull(
"The cause of SQLTransientConnectionException should be null",
sQLTransientConnectionException.getCause());
}