Package javax.resource.cci

Examples of javax.resource.cci.Interaction.execute()


    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));
View Full Code Here


    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);
View Full Code Here

    InteractionSpec interactionSpec = mock(InteractionSpec.class);

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

    ConnectionSpecConnectionFactoryAdapter adapter = new ConnectionSpecConnectionFactoryAdapter();
    adapter.setTargetConnectionFactory(connectionFactory);
    adapter.setConnectionSpec(connectionSpec);
    CciTemplate ct = new CciTemplate(adapter);
View Full Code Here

    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);
View Full Code Here

    InteractionSpec interactionSpec = mock(InteractionSpec.class);

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

    CciTemplate ct = new CciTemplate(connectionFactory);
    ct.setOutputRecordCreator(creator);
    ct.execute(interactionSpec, inputOutputRecord, inputOutputRecord);
View Full Code Here

    Record inputOutputRecord = mock(Record.class);
    InteractionSpec interactionSpec = mock(InteractionSpec.class);

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

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

    verify(interaction).execute(interactionSpec, inputOutputRecord, inputOutputRecord);
View Full Code Here

    Record inputOutputRecord = mock(Record.class);
    InteractionSpec interactionSpec = mock(InteractionSpec.class);

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

    CciTemplate ct = new CciTemplate(connectionFactory);
    Record tmpOutputRecord = ct.execute(interactionSpec,
        inputOutputRecord);
    assertNull(tmpOutputRecord);
View Full Code Here

    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();
View Full Code Here

    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();
View Full Code Here

    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();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.