當前位置: 首頁>>代碼示例>>Java>>正文


Java RecordExtractor類代碼示例

本文整理匯總了Java中org.springframework.jca.cci.core.RecordExtractor的典型用法代碼示例。如果您正苦於以下問題:Java RecordExtractor類的具體用法?Java RecordExtractor怎麽用?Java RecordExtractor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RecordExtractor類屬於org.springframework.jca.cci.core包,在下文中一共展示了RecordExtractor類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testTemplateExecuteInputExtractorFalse

import org.springframework.jca.cci.core.RecordExtractor; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Test
public void testTemplateExecuteInputExtractorFalse()
		throws ResourceException, SQLException {
	ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
	Connection connection = mock(Connection.class);
	Interaction interaction = mock(Interaction.class);
	RecordExtractor<Object> extractor = mock(RecordExtractor.class);

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

	InteractionSpec interactionSpec = mock(InteractionSpec.class);

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

	CciTemplate ct = new CciTemplate(connectionFactory);
	ct.execute(interactionSpec, inputRecord, extractor);

	verify(extractor).extractData(outputRecord);
	verify(interaction).close();
	verify(connection).close();
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:27,代碼來源:CciTemplateTests.java

示例2: testTemplateExecuteInputExtractorTrueWithCreator

import org.springframework.jca.cci.core.RecordExtractor; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Test
public void testTemplateExecuteInputExtractorTrueWithCreator()
		throws ResourceException, SQLException {
	ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
	RecordFactory recordFactory = mock(RecordFactory.class);
	Connection connection = mock(Connection.class);
	Interaction interaction = mock(Interaction.class);
	RecordExtractor<Object> extractor = mock(RecordExtractor.class);
	RecordCreator creator = mock(RecordCreator.class);

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

	InteractionSpec interactionSpec = mock(InteractionSpec.class);

	given(connectionFactory.getConnection()).willReturn(connection);
	given(connection.createInteraction()).willReturn(interaction);
	given(connectionFactory.getRecordFactory()).willReturn(recordFactory);
	given(creator.createRecord(recordFactory)).willReturn(outputRecord);
	given(interaction.execute(interactionSpec, inputRecord, outputRecord)).willReturn(true);
	given(extractor.extractData(outputRecord)).willReturn(new Object());

	CciTemplate ct = new CciTemplate(connectionFactory);
	ct.setOutputRecordCreator(creator);
	ct.execute(interactionSpec, inputRecord, extractor);

	verify(extractor).extractData(outputRecord);
	verify(interaction).close();
	verify(connection).close();
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:32,代碼來源:CciTemplateTests.java

示例3: testTemplateExecuteInputGeneratorExtractorTrueWithCreator

import org.springframework.jca.cci.core.RecordExtractor; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Test
public void testTemplateExecuteInputGeneratorExtractorTrueWithCreator()
		throws ResourceException, SQLException {
	ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
	RecordFactory recordFactory = mock(RecordFactory.class);
	Connection connection = mock(Connection.class);
	Interaction interaction = mock(Interaction.class);
	RecordCreator generator = mock(RecordCreator.class);
	RecordExtractor<Object> extractor = mock(RecordExtractor.class);
	RecordCreator creator = mock(RecordCreator.class);

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

	Object obj = new Object();

	InteractionSpec interactionSpec = mock(InteractionSpec.class);

	given(connectionFactory.getRecordFactory()).willReturn(recordFactory);
	given(connectionFactory.getConnection()).willReturn(connection);
	given(connection.createInteraction()).willReturn(interaction);
	given(creator.createRecord(recordFactory)).willReturn(outputRecord);
	given(connectionFactory.getRecordFactory()).willReturn(recordFactory);
	given(generator.createRecord(recordFactory)).willReturn(inputRecord);
	given(interaction.execute(interactionSpec, inputRecord, outputRecord)).willReturn(true);
	given(extractor.extractData(outputRecord)).willReturn(obj);

	CciTemplate ct = new CciTemplate(connectionFactory);
	ct.setOutputRecordCreator(creator);
	assertEquals(obj, ct.execute(interactionSpec, generator, extractor));

	verify(interaction).close();
	verify(connection).close();
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:36,代碼來源:CciTemplateTests.java

示例4: testTemplateExecuteInputGeneratorExtractorFalse

import org.springframework.jca.cci.core.RecordExtractor; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Test
public void testTemplateExecuteInputGeneratorExtractorFalse()
		throws ResourceException, SQLException {
	ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
	RecordFactory recordFactory = mock(RecordFactory.class);
	Connection connection = mock(Connection.class);
	Interaction interaction = mock(Interaction.class);
	RecordCreator generator = mock(RecordCreator.class);
	RecordExtractor<Object> extractor = mock(RecordExtractor.class);

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

	InteractionSpec interactionSpec = mock(InteractionSpec.class);

	given(connectionFactory.getRecordFactory()).willReturn(recordFactory);
	given(connectionFactory.getConnection()).willReturn(connection);
	given(connection.createInteraction()).willReturn(interaction);
	given(generator.createRecord(recordFactory)).willReturn(inputRecord);
	given(interaction.execute(interactionSpec, inputRecord)).willReturn(outputRecord);
	given(extractor.extractData(outputRecord)).willReturn(new Object());

	CciTemplate ct = new CciTemplate(connectionFactory);
	ct.execute(interactionSpec, generator, extractor);

	verify(extractor).extractData(outputRecord);
	verify(interaction).close();
	verify(connection).close();
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:31,代碼來源:CciTemplateTests.java

示例5: testTemplateExecuteInputOutputResultsSetFalse

import org.springframework.jca.cci.core.RecordExtractor; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Test
public void testTemplateExecuteInputOutputResultsSetFalse()
		throws ResourceException, SQLException {
	ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
	RecordFactory recordFactory = mock(RecordFactory.class);
	Connection connection = mock(Connection.class);
	Interaction interaction = mock(Interaction.class);
	Record record = mock(Record.class);
	ResultSet resultset = mock(ResultSet.class);
	RecordCreator generator = mock(RecordCreator.class);
	RecordExtractor<Object> extractor = mock(RecordExtractor.class);

	InteractionSpec interactionSpec = mock(InteractionSpec.class);

	given(connectionFactory.getRecordFactory()).willReturn(recordFactory);
	given(connectionFactory.getConnection()).willReturn(connection);
	given(connection.createInteraction()).willReturn(interaction);
	given(generator.createRecord(recordFactory)).willReturn(record);
	given(interaction.execute(interactionSpec, record)).willReturn(resultset);
	given(extractor.extractData(resultset)).willReturn(new Object());

	CciTemplate ct = new CciTemplate(connectionFactory);
	ct.execute(interactionSpec, generator, extractor);

	verify(extractor).extractData(resultset);
	verify(resultset).close();
	verify(interaction).close();
	verify(connection).close();
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:31,代碼來源:CciTemplateTests.java


注:本文中的org.springframework.jca.cci.core.RecordExtractor類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。