Search in sources :

Example 1 with IndexedRecord

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

the class CciTemplateTests method testCreateIndexedRecord.

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

Aggregations

ConnectionFactory (javax.resource.cci.ConnectionFactory)1 IndexedRecord (javax.resource.cci.IndexedRecord)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