Search in sources :

Example 1 with MappedRecord

use of javax.resource.cci.MappedRecord in project spring-framework by spring-projects.

the class CciTemplateTests method testCreateMappedRecord.

@Test
public void testCreateMappedRecord() throws ResourceException {
    ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
    RecordFactory recordFactory = mock(RecordFactory.class);
    MappedRecord mappedRecord = mock(MappedRecord.class);
    given(connectionFactory.getRecordFactory()).willReturn(recordFactory);
    given(recordFactory.createMappedRecord("name")).willReturn(mappedRecord);
    CciTemplate ct = new CciTemplate(connectionFactory);
    ct.createMappedRecord("name");
    verify(recordFactory).createMappedRecord("name");
}
Also used : ConnectionFactory(javax.resource.cci.ConnectionFactory) RecordFactory(javax.resource.cci.RecordFactory) NotSupportedRecordFactory(org.springframework.jca.cci.connection.NotSupportedRecordFactory) CciTemplate(org.springframework.jca.cci.core.CciTemplate) MappedRecord(javax.resource.cci.MappedRecord) Test(org.junit.Test)

Aggregations

ConnectionFactory (javax.resource.cci.ConnectionFactory)1 MappedRecord (javax.resource.cci.MappedRecord)1 RecordFactory (javax.resource.cci.RecordFactory)1 Test (org.junit.Test)1 NotSupportedRecordFactory (org.springframework.jca.cci.connection.NotSupportedRecordFactory)1 CciTemplate (org.springframework.jca.cci.core.CciTemplate)1