Search in sources :

Example 21 with CciTemplate

use of org.springframework.jca.cci.core.CciTemplate 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)21 Test (org.junit.Test)21 CciTemplate (org.springframework.jca.cci.core.CciTemplate)21 Connection (javax.resource.cci.Connection)19 Interaction (javax.resource.cci.Interaction)18 InteractionSpec (javax.resource.cci.InteractionSpec)17 Record (javax.resource.cci.Record)17 IndexedRecord (javax.resource.cci.IndexedRecord)16 MappedRecord (javax.resource.cci.MappedRecord)16 RecordFactory (javax.resource.cci.RecordFactory)10 NotSupportedRecordFactory (org.springframework.jca.cci.connection.NotSupportedRecordFactory)10 RecordCreator (org.springframework.jca.cci.core.RecordCreator)9 LocalTransaction (javax.resource.cci.LocalTransaction)2 CciLocalTransactionManager (org.springframework.jca.cci.connection.CciLocalTransactionManager)2 TransactionStatus (org.springframework.transaction.TransactionStatus)2 TransactionTemplate (org.springframework.transaction.support.TransactionTemplate)2 NotSupportedException (javax.resource.NotSupportedException)1 ResourceException (javax.resource.ResourceException)1 ConnectionSpec (javax.resource.cci.ConnectionSpec)1 ResultSet (javax.resource.cci.ResultSet)1