Examples of Interaction


Examples of javax.resource.cci.Interaction

    MockControl connectionFactoryControl = MockControl.createControl(ConnectionFactory.class);
    ConnectionFactory connectionFactory = (ConnectionFactory) connectionFactoryControl.getMock();
    MockControl connectionControl = MockControl.createControl(Connection.class);
    Connection connection = (Connection) connectionControl.getMock();
    MockControl interactionControl = MockControl.createControl(Interaction.class);
    Interaction interaction = (Interaction) interactionControl.getMock();

    MockControl inputRecordControl = MockControl.createControl(Record.class);
    Record inputRecord = (Record) inputRecordControl.getMock();
    MockControl outputRecordControl = MockControl.createControl(Record.class);
    Record outputRecord = (Record) outputRecordControl.getMock();

    MockControl interactionSpecControl = MockControl.createControl(InteractionSpec.class);
    InteractionSpec interactionSpec = (InteractionSpec) interactionSpecControl.getMock();

    SimpleRecordOperation operation = new SimpleRecordOperation(connectionFactory, interactionSpec);

    connectionFactory.getConnection();
    connectionFactoryControl.setReturnValue(connection, 1);

    connection.createInteraction();
    connectionControl.setReturnValue(interaction, 1);

    interaction.execute(interactionSpec, inputRecord, outputRecord);
    interactionControl.setReturnValue(true, 1);

    interaction.close();
    interactionControl.setVoidCallable(1);

    connection.close();
    connectionControl.setVoidCallable(1);
View Full Code Here

Examples of javax.resource.cci.Interaction

    MockControl connectionFactoryControl = MockControl.createControl(ConnectionFactory.class);
    final ConnectionFactory connectionFactory = (ConnectionFactory) connectionFactoryControl.getMock();
    MockControl connectionControl = MockControl.createControl(Connection.class);
    Connection connection = (Connection) connectionControl.getMock();
    MockControl interactionControl = MockControl.createControl(Interaction.class);
    Interaction interaction = (Interaction) interactionControl.getMock();

    MockControl inputOutputRecordControl = MockControl.createControl(Record.class);
    Record inputOutputRecord = (Record) inputOutputRecordControl.getMock();

    MockControl interactionSpecControl = MockControl.createControl(InteractionSpec.class);
    InteractionSpec interactionSpec = (InteractionSpec) interactionSpecControl.getMock();

    SimpleRecordOperation query = new SimpleRecordOperation(connectionFactory, interactionSpec);

    connectionFactory.getConnection();
    connectionFactoryControl.setReturnValue(connection);

    connection.createInteraction();
    connectionControl.setReturnValue(interaction);

    interaction.execute(interactionSpec, inputOutputRecord, inputOutputRecord);
    interactionControl.setReturnValue(true, 1);

    interaction.close();
    interactionControl.setVoidCallable(1);

    connection.close();
    connectionControl.setVoidCallable(1);
View Full Code Here

Examples of javax.resource.cci.Interaction

    MockControl recordFactoryControl = MockControl.createStrictControl(RecordFactory.class);
    RecordFactory recordFactory = (RecordFactory) recordFactoryControl.getMock();
    MockControl connectionControl = MockControl.createControl(Connection.class);
    Connection connection = (Connection) connectionControl.getMock();
    MockControl interactionControl = MockControl.createControl(Interaction.class);
    Interaction interaction = (Interaction) interactionControl.getMock();

    MockControl inputRecordControl = MockControl.createControl(Record.class);
    Record inputRecord = (Record) inputRecordControl.getMock();
    MockControl outputRecordControl = MockControl.createControl(Record.class);
    Record outputRecord = (Record) outputRecordControl.getMock();

    MockControl interactionSpecControl = MockControl.createControl(InteractionSpec.class);
    InteractionSpec interactionSpec = (InteractionSpec) interactionSpecControl.getMock();

    MockControl callDetectorControl = MockControl.createControl(QueryCallDetector.class);
    QueryCallDetector callDetector = (QueryCallDetector) callDetectorControl.getMock();

    MappingRecordOperationImpl query = new MappingRecordOperationImpl(connectionFactory, interactionSpec);
    query.setCallDetector(callDetector);

    Object inObj = new Object();
    Object outObj = new Object();

    connectionFactory.getRecordFactory();
    connectionFactoryControl.setReturnValue(recordFactory, 1);

    callDetector.callCreateInputRecord(recordFactory, inObj);
    callDetectorControl.setReturnValue(inputRecord, 1);

    connectionFactory.getConnection();
    connectionFactoryControl.setReturnValue(connection, 1);

    connection.createInteraction();
    connectionControl.setReturnValue(interaction, 1);

    interaction.execute(interactionSpec, inputRecord);
    interactionControl.setReturnValue(outputRecord, 1);

    callDetector.callExtractOutputData(outputRecord);
    callDetectorControl.setReturnValue(outObj, 1);

    interaction.close();
    interactionControl.setVoidCallable(1);

    connection.close();
    connectionControl.setVoidCallable(1);
View Full Code Here

Examples of javax.resource.cci.Interaction

    MockControl recordFactoryControl = MockControl.createStrictControl(RecordFactory.class);
    RecordFactory recordFactory = (RecordFactory) recordFactoryControl.getMock();
    MockControl connectionControl = MockControl.createControl(Connection.class);
    Connection connection = (Connection) connectionControl.getMock();
    MockControl interactionControl = MockControl.createControl(Interaction.class);
    Interaction interaction = (Interaction) interactionControl.getMock();

    MockControl inputRecordControl = MockControl.createControl(Record.class);
    Record inputRecord = (Record) inputRecordControl.getMock();
    MockControl outputRecordControl = MockControl.createControl(Record.class);
    Record outputRecord = (Record) outputRecordControl.getMock();
    MockControl outputCreatorControl = MockControl.createControl(RecordCreator.class);
    RecordCreator outputCreator = (RecordCreator) outputCreatorControl.getMock();

    MockControl interactionSpecControl = MockControl.createControl(InteractionSpec.class);
    InteractionSpec interactionSpec = (InteractionSpec) interactionSpecControl.getMock();

    MockControl callDetectorControl = MockControl.createControl(QueryCallDetector.class);
    QueryCallDetector callDetector = (QueryCallDetector) callDetectorControl.getMock();

    MappingRecordOperationImpl query = new MappingRecordOperationImpl(connectionFactory, interactionSpec);
    query.setOutputRecordCreator(outputCreator);
    query.setCallDetector(callDetector);

    Object inObj = new Object();
    Object outObj = new Object();

    connectionFactory.getRecordFactory();
    connectionFactoryControl.setReturnValue(recordFactory, 1);

    callDetector.callCreateInputRecord(recordFactory, inObj);
    callDetectorControl.setReturnValue(inputRecord, 1);

    connectionFactory.getConnection();
    connectionFactoryControl.setReturnValue(connection, 1);

    connection.createInteraction();
    connectionControl.setReturnValue(interaction, 1);

    connectionFactory.getRecordFactory();
    connectionFactoryControl.setReturnValue(recordFactory, 1);

    outputCreator.createRecord(recordFactory);
    outputCreatorControl.setReturnValue(outputRecord, 1);

    interaction.execute(interactionSpec, inputRecord, outputRecord);
    interactionControl.setReturnValue(true, 1);

    callDetector.callExtractOutputData(outputRecord);
    callDetectorControl.setReturnValue(outObj, 1);

    interaction.close();
    interactionControl.setVoidCallable(1);

    connection.close();
    connectionControl.setVoidCallable(1);
View Full Code Here

Examples of javax.resource.cci.Interaction

    }

    @Override
    public Message process(Exchange exchange) throws HandlerException {
        Connection connection = null;
        Interaction interaction = null;
        try {
            if (_connectionSpec != null) {
                connection = _connectionFactory.getConnection(_connectionSpec);
            } else {
                connection = _connectionFactory.getConnection();
            }
            interaction = connection.createInteraction();
            return _recordHandler.handle(exchange, connection, interaction);
        } catch (Exception e) {
            throw JCAMessages.MESSAGES.failedToProcessCCIOutboundInteraction(e);
        } finally {
            try {
                if (interaction != null) {
                    interaction.close();
                }
                if (connection != null) {
                    connection.close();
                }
            } catch (ResourceException e) {
View Full Code Here

Examples of javax.resource.cci.Interaction

  @Test
  public void testTemplateExecuteInputOutput() throws ResourceException {
    ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
    Connection connection = mock(Connection.class);
    Interaction interaction = mock(Interaction.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, outputRecord)).willReturn(true);


    CciTemplate ct = new CciTemplate(connectionFactory);
    ct.execute(interactionSpec, inputRecord, outputRecord);
View Full Code Here

Examples of jinngine.rendering.Interaction

    // put gravity on box
    scene.addForce( new GravityForce(box));   
   
    // handle drawing
    Rendering rendering = new jinngine.rendering.jogl.JoglRendering(this, new Interaction(scene));
    rendering.drawMe(boxgeometry);

    rendering.start();
  }
View Full Code Here

Examples of jinngine.rendering.Interaction

    scene.addForce( new GravityForce(cap3));   
    scene.addForce( new GravityForce(cap4));   

   
    // handle drawing
    Rendering rendering = new jinngine.rendering.jogl.JoglRendering(this, new Interaction(scene));
    rendering.drawMe(boxgeometry);
    rendering.drawMe(capgeo);
    rendering.drawMe(capgeo2);
    rendering.drawMe(capgeo3);
    rendering.drawMe(capgeo4);
View Full Code Here

Examples of jinngine.rendering.Interaction

    scene.addForce( new GravityForce(rightthigh));   
    scene.addForce( new GravityForce(righttaiba));   

   
    // handle drawing
    Rendering rendering = new jinngine.rendering.jogl.JoglRendering(this, new Interaction(scene));
    rendering.drawMe(headgeometry);
    rendering.drawMe(torso1geometry);
    rendering.drawMe(torso2geometry);
    rendering.drawMe(torso3geometry);
    rendering.drawMe(upleftarmgeometry);
View Full Code Here

Examples of jinngine.rendering.Interaction

        System.out.println("No longer in contact with " + interactingBody );
      }
    }));
   
    // handle drawing
    Rendering rendering = new jinngine.rendering.jogl.JoglRendering(this, new Interaction(scene));
    rendering.drawMe(boxgeometry);
    rendering.start();
  }
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.