org.springframework.jca.cci.object.SimpleRecordOperation Java Examples

The following examples show how to use org.springframework.jca.cci.object.SimpleRecordOperation. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EisOperationTests.java    From spring-analysis-note with MIT License 6 votes vote down vote up
@Test
public void testSimpleRecordOperation() throws ResourceException {
	ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
	Connection connection = mock(Connection.class);
	Interaction interaction = mock(Interaction.class);

	Record inputRecord = mock(Record.class);
	Record outputRecord = mock(Record.class);

	InteractionSpec interactionSpec = mock(InteractionSpec.class);

	SimpleRecordOperation query = new SimpleRecordOperation(connectionFactory, interactionSpec);

	given(connectionFactory.getConnection()).willReturn(connection);
	given(connection.createInteraction()).willReturn(interaction);
	given(interaction.execute(interactionSpec, inputRecord)).willReturn(outputRecord);

	query.execute(inputRecord);

	verify(interaction).execute(interactionSpec, inputRecord);
	verify(interaction).close();
	verify(connection).close();
}
 
Example #2
Source File: EisOperationTests.java    From spring-analysis-note with MIT License 6 votes vote down vote up
@Test
public void testSimpleRecordOperationWithExplicitOutputRecord() throws ResourceException {
	ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
	Connection connection = mock(Connection.class);
	Interaction interaction = mock(Interaction.class);

	Record inputRecord = mock(Record.class);
	Record outputRecord = mock(Record.class);

	InteractionSpec interactionSpec = mock(InteractionSpec.class);

	SimpleRecordOperation operation = new SimpleRecordOperation(connectionFactory, interactionSpec);

	given(connectionFactory.getConnection()).willReturn(connection);
	given(connection.createInteraction()).willReturn(interaction);
	given(interaction.execute(interactionSpec, inputRecord, outputRecord)).willReturn(true);

	operation.execute(inputRecord, outputRecord);

	verify(interaction).execute(interactionSpec, inputRecord, outputRecord);
	verify(interaction).close();
	verify(connection).close();
}
 
Example #3
Source File: EisOperationTests.java    From spring-analysis-note with MIT License 6 votes vote down vote up
@Test
public void testSimpleRecordOperationWithInputOutputRecord() throws ResourceException {
	ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
	Connection connection = mock(Connection.class);
	Interaction interaction = mock(Interaction.class);

	Record inputOutputRecord = mock(Record.class);

	InteractionSpec interactionSpec = mock(InteractionSpec.class);

	SimpleRecordOperation query = new SimpleRecordOperation(connectionFactory, interactionSpec);

	given(connectionFactory.getConnection()).willReturn(connection);
	given(connection.createInteraction()).willReturn(interaction);
	given(interaction.execute(interactionSpec, inputOutputRecord, inputOutputRecord)).willReturn(true);

	query.execute(inputOutputRecord, inputOutputRecord);

	verify(interaction).execute(interactionSpec, inputOutputRecord, inputOutputRecord);
	verify(interaction).close();
	verify(connection).close();
}
 
Example #4
Source File: EisOperationTests.java    From java-technology-stack with MIT License 6 votes vote down vote up
@Test
public void testSimpleRecordOperation() throws ResourceException {
	ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
	Connection connection = mock(Connection.class);
	Interaction interaction = mock(Interaction.class);

	Record inputRecord = mock(Record.class);
	Record outputRecord = mock(Record.class);

	InteractionSpec interactionSpec = mock(InteractionSpec.class);

	SimpleRecordOperation query = new SimpleRecordOperation(connectionFactory, interactionSpec);

	given(connectionFactory.getConnection()).willReturn(connection);
	given(connection.createInteraction()).willReturn(interaction);
	given(interaction.execute(interactionSpec, inputRecord)).willReturn(outputRecord);

	query.execute(inputRecord);

	verify(interaction).execute(interactionSpec, inputRecord);
	verify(interaction).close();
	verify(connection).close();
}
 
Example #5
Source File: EisOperationTests.java    From java-technology-stack with MIT License 6 votes vote down vote up
@Test
public void testSimpleRecordOperationWithExplicitOutputRecord() throws ResourceException {
	ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
	Connection connection = mock(Connection.class);
	Interaction interaction = mock(Interaction.class);

	Record inputRecord = mock(Record.class);
	Record outputRecord = mock(Record.class);

	InteractionSpec interactionSpec = mock(InteractionSpec.class);

	SimpleRecordOperation operation = new SimpleRecordOperation(connectionFactory, interactionSpec);

	given(connectionFactory.getConnection()).willReturn(connection);
	given(connection.createInteraction()).willReturn(interaction);
	given(interaction.execute(interactionSpec, inputRecord, outputRecord)).willReturn(true);

	operation.execute(inputRecord, outputRecord);

	verify(interaction).execute(interactionSpec, inputRecord, outputRecord);
	verify(interaction).close();
	verify(connection).close();
}
 
Example #6
Source File: EisOperationTests.java    From java-technology-stack with MIT License 6 votes vote down vote up
@Test
public void testSimpleRecordOperationWithInputOutputRecord() throws ResourceException {
	ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
	Connection connection = mock(Connection.class);
	Interaction interaction = mock(Interaction.class);

	Record inputOutputRecord = mock(Record.class);

	InteractionSpec interactionSpec = mock(InteractionSpec.class);

	SimpleRecordOperation query = new SimpleRecordOperation(connectionFactory, interactionSpec);

	given(connectionFactory.getConnection()).willReturn(connection);
	given(connection.createInteraction()).willReturn(interaction);
	given(interaction.execute(interactionSpec, inputOutputRecord, inputOutputRecord)).willReturn(true);

	query.execute(inputOutputRecord, inputOutputRecord);

	verify(interaction).execute(interactionSpec, inputOutputRecord, inputOutputRecord);
	verify(interaction).close();
	verify(connection).close();
}
 
Example #7
Source File: EisOperationTests.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
@Test
public void testSimpleRecordOperation() throws ResourceException {
	ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
	Connection connection = mock(Connection.class);
	Interaction interaction = mock(Interaction.class);

	Record inputRecord = mock(Record.class);
	Record outputRecord = mock(Record.class);

	InteractionSpec interactionSpec = mock(InteractionSpec.class);

	SimpleRecordOperation query = new SimpleRecordOperation(connectionFactory, interactionSpec);

	given(connectionFactory.getConnection()).willReturn(connection);
	given(connection.createInteraction()).willReturn(interaction);
	given(interaction.execute(interactionSpec, inputRecord)).willReturn(outputRecord);

	query.execute(inputRecord);

	verify(interaction).execute(interactionSpec, inputRecord);
	verify(interaction).close();
	verify(connection).close();
}
 
Example #8
Source File: EisOperationTests.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
@Test
public void testSimpleRecordOperationWithExplicitOutputRecord() throws ResourceException {
	ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
	Connection connection = mock(Connection.class);
	Interaction interaction = mock(Interaction.class);

	Record inputRecord = mock(Record.class);
	Record outputRecord = mock(Record.class);

	InteractionSpec interactionSpec = mock(InteractionSpec.class);

	SimpleRecordOperation operation = new SimpleRecordOperation(connectionFactory, interactionSpec);

	given(connectionFactory.getConnection()).willReturn(connection);
	given(connection.createInteraction()).willReturn(interaction);
	given(interaction.execute(interactionSpec, inputRecord, outputRecord)).willReturn(true);

	operation.execute(inputRecord, outputRecord);

	verify(interaction).execute(interactionSpec, inputRecord, outputRecord);
	verify(interaction).close();
	verify(connection).close();
}
 
Example #9
Source File: EisOperationTests.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
@Test
public void testSimpleRecordOperationWithInputOutputRecord() throws ResourceException {
	ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
	Connection connection = mock(Connection.class);
	Interaction interaction = mock(Interaction.class);

	Record inputOutputRecord = mock(Record.class);

	InteractionSpec interactionSpec = mock(InteractionSpec.class);

	SimpleRecordOperation query = new SimpleRecordOperation(connectionFactory, interactionSpec);

	given(connectionFactory.getConnection()).willReturn(connection);
	given(connection.createInteraction()).willReturn(interaction);
	given(interaction.execute(interactionSpec, inputOutputRecord, inputOutputRecord)).willReturn(true);

	query.execute(inputOutputRecord, inputOutputRecord);

	verify(interaction).execute(interactionSpec, inputOutputRecord, inputOutputRecord);
	verify(interaction).close();
	verify(connection).close();
}