Package javax.resource.cci

Examples of javax.resource.cci.ConnectionFactory


    creatorControl.verify();
  }

  public void testTemplateExecuteInputGeneratorFalse() throws ResourceException {
    MockControl connectionFactoryControl = MockControl.createStrictControl(ConnectionFactory.class);
    ConnectionFactory connectionFactory = (ConnectionFactory) connectionFactoryControl.getMock();
    MockControl recordFactoryControl = MockControl.createStrictControl(RecordFactory.class);
    RecordFactory recordFactory = (RecordFactory) recordFactoryControl.getMock();
    MockControl connectionControl = MockControl.createStrictControl(Connection.class);
    Connection connection = (Connection) connectionControl.getMock();
    MockControl interactionControl = MockControl.createStrictControl(Interaction.class);
    Interaction interaction = (Interaction) interactionControl.getMock();
    MockControl generatorControl = MockControl.createStrictControl(RecordCreator.class);
    RecordCreator generator = (RecordCreator) generatorControl.getMock();

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

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

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

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

    connection.createInteraction();
    connectionControl.setReturnValue(interaction);
View Full Code Here


    generatorControl.verify();
  }

  public void testTemplateExecuteInputGeneratorExtractorTrueWithCreator() throws ResourceException, SQLException {
    MockControl connectionFactoryControl = MockControl.createStrictControl(ConnectionFactory.class);
    ConnectionFactory connectionFactory = (ConnectionFactory) connectionFactoryControl.getMock();
    MockControl recordFactoryControl = MockControl.createStrictControl(RecordFactory.class);
    RecordFactory recordFactory = (RecordFactory) recordFactoryControl.getMock();
    MockControl connectionControl = MockControl.createStrictControl(Connection.class);
    Connection connection = (Connection) connectionControl.getMock();
    MockControl interactionControl = MockControl.createStrictControl(Interaction.class);
    Interaction interaction = (Interaction) interactionControl.getMock();
    MockControl generatorControl = MockControl.createStrictControl(RecordCreator.class);
    RecordCreator generator = (RecordCreator) generatorControl.getMock();
    MockControl extractorControl = MockControl.createStrictControl(RecordExtractor.class);
    RecordExtractor extractor = (RecordExtractor) extractorControl.getMock();
    MockControl creatorControl = MockControl.createStrictControl(RecordCreator.class);
    RecordCreator creator = (RecordCreator) creatorControl.getMock();

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

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

    Object obj = new Object();

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

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

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

    creator.createRecord(recordFactory);
    creatorControl.setReturnValue(outputRecord);

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

    generator.createRecord(recordFactory);
    generatorControl.setReturnValue(inputRecord);
View Full Code Here

    creatorControl.verify();
  }

  public void testTemplateExecuteInputGeneratorExtractorFalse() throws ResourceException, SQLException {
    MockControl connectionFactoryControl = MockControl.createStrictControl(ConnectionFactory.class);
    ConnectionFactory connectionFactory = (ConnectionFactory) connectionFactoryControl.getMock();
    MockControl recordFactoryControl = MockControl.createStrictControl(RecordFactory.class);
    RecordFactory recordFactory = (RecordFactory) recordFactoryControl.getMock();
    MockControl connectionControl = MockControl.createStrictControl(Connection.class);
    Connection connection = (Connection) connectionControl.getMock();
    MockControl interactionControl = MockControl.createStrictControl(Interaction.class);
    Interaction interaction = (Interaction) interactionControl.getMock();
    MockControl generatorControl = MockControl.createStrictControl(RecordCreator.class);
    RecordCreator generator = (RecordCreator) generatorControl.getMock();
    MockControl extractorControl = MockControl.createStrictControl(RecordExtractor.class);
    RecordExtractor extractor = (RecordExtractor) extractorControl.getMock();

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

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

    Object obj = new Object();

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

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

    connection.createInteraction();
    connectionControl.setReturnValue(interaction);
View Full Code Here

    extractorControl.verify();
  }

  public void testTemplateExecuteInputOutputConnectionSpec() throws ResourceException {
    MockControl connectionFactoryControl = MockControl.createStrictControl(ConnectionFactory.class);
    ConnectionFactory connectionFactory = (ConnectionFactory) connectionFactoryControl.getMock();
    MockControl connectionControl = MockControl.createStrictControl(Connection.class);
    Connection connection = (Connection) connectionControl.getMock();
    MockControl interactionControl = MockControl.createStrictControl(Interaction.class);
    Interaction interaction = (Interaction) interactionControl.getMock();

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

    MockControl connectionSpecControl = MockControl.createStrictControl(ConnectionSpec.class);
    ConnectionSpec connectionSpec = (ConnectionSpec) connectionSpecControl.getMock();
    MockControl interactionSpecControl = MockControl.createStrictControl(InteractionSpec.class);
    InteractionSpec interactionSpec = (InteractionSpec) interactionSpecControl.getMock();

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

    connection.createInteraction();
    connectionControl.setReturnValue(interaction, 1);
View Full Code Here

    interactionControl.verify();
  }

  public void testTemplateExecuteInputOutputResultsSetFalse() throws ResourceException, SQLException {
    MockControl connectionFactoryControl = MockControl.createStrictControl(ConnectionFactory.class);
    ConnectionFactory connectionFactory = (ConnectionFactory) connectionFactoryControl.getMock();
    MockControl recordFactoryControl = MockControl.createStrictControl(RecordFactory.class);
    RecordFactory recordFactory = (RecordFactory) recordFactoryControl.getMock();
    MockControl connectionControl = MockControl.createStrictControl(Connection.class);
    Connection connection = (Connection) connectionControl.getMock();
    MockControl interactionControl = MockControl.createStrictControl(Interaction.class);
    Interaction interaction = (Interaction) interactionControl.getMock();
    MockControl recordControl = MockControl.createStrictControl(Record.class);
    Record record = (Record) recordControl.getMock();
    MockControl resultsetControl = MockControl.createStrictControl(ResultSet.class);
    ResultSet resultset = (ResultSet) resultsetControl.getMock();
    MockControl generatorControl = MockControl.createStrictControl(RecordCreator.class);
    RecordCreator generator = (RecordCreator) generatorControl.getMock();
    MockControl extractorControl = MockControl.createStrictControl(RecordExtractor.class);
    RecordExtractor extractor = (RecordExtractor) extractorControl.getMock();

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

    Object obj = new Object();

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

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

    connection.createInteraction();
    connectionControl.setReturnValue(interaction);
View Full Code Here

    resultsetControl.verify();
  }

  public void testTemplateExecuteConnectionCallback() throws ResourceException, SQLException {
    MockControl connectionFactoryControl = MockControl.createStrictControl(ConnectionFactory.class);
    ConnectionFactory connectionFactory = (ConnectionFactory) connectionFactoryControl.getMock();
    MockControl connectionControl = MockControl.createStrictControl(Connection.class);
    Connection connection = (Connection) connectionControl.getMock();
    MockControl connectionCallbackControl = MockControl.createStrictControl(ConnectionCallback.class);
    ConnectionCallback connectionCallback = (ConnectionCallback) connectionCallbackControl.getMock();

    Object obj = new Object();

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

    connectionCallback.doInConnection(connection, connectionFactory);
    connectionCallbackControl.setReturnValue(obj);
View Full Code Here

    connectionCallbackControl.verify();
  }

  public void testTemplateExecuteInteractionCallback() throws ResourceException, SQLException {
    MockControl connectionFactoryControl = MockControl.createStrictControl(ConnectionFactory.class);
    ConnectionFactory connectionFactory = (ConnectionFactory) connectionFactoryControl.getMock();
    MockControl connectionControl = MockControl.createStrictControl(Connection.class);
    Connection connection = (Connection) connectionControl.getMock();
    MockControl interactionControl = MockControl.createStrictControl(Interaction.class);
    Interaction interaction = (Interaction) interactionControl.getMock();
    MockControl interactionCallbackControl = MockControl.createStrictControl(InteractionCallback.class);
    InteractionCallback interactionCallback = (InteractionCallback) interactionCallbackControl.getMock();

    Object obj = new Object();

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

    connection.createInteraction();
    connectionControl.setReturnValue(interaction);
View Full Code Here

    interactionCallbackControl.verify();
  }

  public void testTemplateExecuteInputTrueTrueWithCreator() throws ResourceException {
    MockControl connectionFactoryControl = MockControl.createStrictControl(ConnectionFactory.class);
    ConnectionFactory connectionFactory = (ConnectionFactory) connectionFactoryControl.getMock();
    MockControl connectionControl = MockControl.createStrictControl(Connection.class);
    Connection connection = (Connection) connectionControl.getMock();
    MockControl interactionControl = MockControl.createStrictControl(Interaction.class);
    Interaction interaction = (Interaction) interactionControl.getMock();
    MockControl creatorControl = MockControl.createStrictControl(RecordCreator.class);
    RecordCreator creator = (RecordCreator) creatorControl.getMock();

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

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

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

    connection.createInteraction();
    connectionControl.setReturnValue(interaction);
View Full Code Here

    creatorControl.verify();
  }

  public void testTemplateExecuteInputTrueTrue() throws ResourceException {
    MockControl connectionFactoryControl = MockControl.createStrictControl(ConnectionFactory.class);
    ConnectionFactory connectionFactory = (ConnectionFactory) connectionFactoryControl.getMock();
    MockControl connectionControl = MockControl.createStrictControl(Connection.class);
    Connection connection = (Connection) connectionControl.getMock();
    MockControl interactionControl = MockControl.createStrictControl(Interaction.class);
    Interaction interaction = (Interaction) interactionControl.getMock();

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

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

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

    connection.createInteraction();
    connectionControl.setReturnValue(interaction);
View Full Code Here

    interactionControl.verify();
  }

  public void testTemplateExecuteInputFalseTrue() throws ResourceException {
    MockControl connectionFactoryControl = MockControl.createStrictControl(ConnectionFactory.class);
    ConnectionFactory connectionFactory = (ConnectionFactory) connectionFactoryControl.getMock();
    MockControl connectionControl = MockControl.createStrictControl(Connection.class);
    Connection connection = (Connection) connectionControl.getMock();
    MockControl interactionControl = MockControl.createStrictControl(Interaction.class);
    Interaction interaction = (Interaction) interactionControl.getMock();

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

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

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

    connection.createInteraction();
    connectionControl.setReturnValue(interaction);
View Full Code Here

TOP

Related Classes of javax.resource.cci.ConnectionFactory

Copyright © 2018 www.massapicom. 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.