use of org.firebirdsql.gds.ng.wire.AbstractWireOperations in project jaybird by FirebirdSQL.
the class TestV10WireOperations method testProcessResponse_noException.
/**
* Test if processResponse does not throw an exception if the response does
* not contain an exception.
*/
@Test
public void testProcessResponse_noException() throws Exception {
AbstractWireOperations wire = createDummyWireOperations();
GenericResponse genericResponse = new GenericResponse(-1, -1, null, null);
wire.processResponse(genericResponse);
}
use of org.firebirdsql.gds.ng.wire.AbstractWireOperations in project jaybird by FirebirdSQL.
the class TestV10WireOperations method testProcessResponseWarnings_exception.
/**
* Test if no warning is registered with the callback if the response
* contains an exception that is not a warning.
*/
@Test
public void testProcessResponseWarnings_exception() throws Exception {
AbstractWireOperations wire = createDummyWireOperations();
SQLException exception = new FbExceptionBuilder().exception(ISCConstants.isc_numeric_out_of_range).toSQLException();
GenericResponse genericResponse = new GenericResponse(-1, -1, null, exception);
wire.processResponseWarnings(genericResponse, null);
List<SQLWarning> warnings = warningCallback.getWarnings();
assertEquals("Expected no warnings to be registered", 0, warnings.size());
}
use of org.firebirdsql.gds.ng.wire.AbstractWireOperations in project jaybird by FirebirdSQL.
the class TestV10WireOperations method testProcessResponseWarnings_warning.
/**
* Test if a warning is registered with the callback if the response
* contains an exception that is a warning.
*/
@Test
public void testProcessResponseWarnings_warning() throws Exception {
AbstractWireOperations wire = createDummyWireOperations();
SQLWarning warning = new FbExceptionBuilder().warning(ISCConstants.isc_numeric_out_of_range).toSQLException(SQLWarning.class);
GenericResponse genericResponse = new GenericResponse(-1, -1, null, warning);
wire.processResponseWarnings(genericResponse, null);
List<SQLWarning> warnings = warningCallback.getWarnings();
assertEquals("Unexpected warnings registered or no warnings registered", Collections.singletonList(warning), warnings);
}
use of org.firebirdsql.gds.ng.wire.AbstractWireOperations in project jaybird by FirebirdSQL.
the class TestV10WireOperations method testProcessResponseWarnings_noException.
/**
* Test if no warning is registered with the callback if the response does
* not contain an exception.
*/
@Test
public void testProcessResponseWarnings_noException() throws Exception {
AbstractWireOperations wire = createDummyWireOperations();
GenericResponse genericResponse = new GenericResponse(-1, -1, null, null);
wire.processResponseWarnings(genericResponse, null);
List<SQLWarning> warnings = warningCallback.getWarnings();
assertEquals("Expected no warnings to be registered", 0, warnings.size());
}
use of org.firebirdsql.gds.ng.wire.AbstractWireOperations in project jaybird by FirebirdSQL.
the class TestV10WireOperations method testProcessResponse_exception.
/**
* Test if processResponse throws the exception in the response if the
* exception is not a warning.
*/
@Test
public void testProcessResponse_exception() throws Exception {
AbstractWireOperations wire = createDummyWireOperations();
SQLException exception = new FbExceptionBuilder().exception(ISCConstants.isc_numeric_out_of_range).toSQLException();
expectedException.expect(sameInstance(exception));
GenericResponse genericResponse = new GenericResponse(-1, -1, null, exception);
wire.processResponse(genericResponse);
}
Aggregations