use of java.sql.SQLNonTransientException in project hazelcast by hazelcast.
the class WriteJdbcPTest method testFailJob_withNonTransientException.
@Test(expected = CompletionException.class)
public void testFailJob_withNonTransientException() {
Pipeline p = Pipeline.create();
p.readFrom(TestSources.items(IntStream.range(0, PERSON_COUNT).boxed().toArray(Integer[]::new))).map(item -> entry(item, item.toString())).writeTo(Sinks.jdbc("INSERT INTO " + tableName + " VALUES(?, ?)", () -> createDataSource(false), (stmt, item) -> {
throw new SQLNonTransientException();
}));
instance().getJet().newJob(p).join();
}
use of java.sql.SQLNonTransientException in project jdk8u_jdk by JetBrains.
the class SQLNonTransientConnectionExceptionTests method test13.
/**
* Create SQLNonTransientConnectionException and validate it is an instance of
* SQLNonTransientException
*/
@Test
public void test13() {
Exception ex = new SQLNonTransientConnectionException();
assertTrue(ex instanceof SQLNonTransientException);
}
use of java.sql.SQLNonTransientException in project jdk8u_jdk by JetBrains.
the class SQLNonTransientExceptionTests method test7.
/**
* Create SQLNonTransientException with message, and Throwable
*/
@Test
public void test7() {
SQLNonTransientException ex = new SQLNonTransientException(reason, t);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState() == null && cause.equals(ex.getCause().toString()) && ex.getErrorCode() == 0);
}
use of java.sql.SQLNonTransientException in project jdk8u_jdk by JetBrains.
the class SQLNonTransientExceptionTests method test1.
/**
* Create SQLNonTransientException with no-arg constructor
*/
@Test
public void test1() {
SQLNonTransientException ex = new SQLNonTransientException();
assertTrue(ex.getMessage() == null && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0);
}
use of java.sql.SQLNonTransientException in project jdk8u_jdk by JetBrains.
the class SQLSyntaxErrorExceptionTests method test13.
/**
* Create SQLSyntaxErrorException and validate it is an instance of
* SQLNonTransientException
*/
@Test
public void test13() {
Exception ex = new SQLSyntaxErrorException();
assertTrue(ex instanceof SQLNonTransientException);
}
Aggregations