Examples of CciTemplate


Examples of org.springframework.jca.cci.core.CciTemplate

    connectionFactoryControl.replay();
    connectionControl.replay();
    interactionControl.replay();

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

    connectionFactoryControl.verify();
    connectionControl.verify();
    interactionControl.verify();
View Full Code Here

Examples of org.springframework.jca.cci.core.CciTemplate

    TransactionTemplate tt = new TransactionTemplate(tm);

    tt.execute(new TransactionCallbackWithoutResult() {
      protected void doInTransactionWithoutResult(TransactionStatus status) {
        assertTrue("Has thread connection", TransactionSynchronizationManager.hasResource(connectionFactory));
        CciTemplate ct = new CciTemplate(connectionFactory);
        ct.execute(interactionSpec, record, record);
      }
    });

    connectionFactoryControl.verify();
    connectionControl.verify();
View Full Code Here

Examples of org.springframework.jca.cci.core.CciTemplate

    try {
      Object result = tt.execute(new TransactionCallback() {
        public Object doInTransaction(TransactionStatus status) {
          assertTrue("Has thread connection", TransactionSynchronizationManager.hasResource(connectionFactory));
          CciTemplate ct = new CciTemplate(connectionFactory);
          ct.execute(interactionSpec, record, record);
          throw new DataRetrievalFailureException("error");
        }
      });
    }
    catch (Exception ex) {
View Full Code Here

Examples of org.springframework.jca.cci.core.CciTemplate

    RecordFactory recordFactory = mock(RecordFactory.class);
    IndexedRecord indexedRecord = mock(IndexedRecord.class);
    given(connectionFactory.getRecordFactory()).willReturn(recordFactory);
    given(recordFactory.createIndexedRecord("name")).willReturn(indexedRecord);

    CciTemplate ct = new CciTemplate(connectionFactory);
    ct.createIndexedRecord("name");

    verify(recordFactory).createIndexedRecord("name");
  }
View Full Code Here

Examples of org.springframework.jca.cci.core.CciTemplate

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

Examples of org.springframework.jca.cci.core.CciTemplate

    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);

    verify(interaction).execute(interactionSpec, inputRecord, outputRecord);
    verify(interaction).close();
    verify(connection).close();
  }
View Full Code Here

Examples of org.springframework.jca.cci.core.CciTemplate

    given(connectionFactory.getConnection()).willReturn(connection);
    given(connectionFactory.getRecordFactory()).willThrow(new NotSupportedException("not supported"));
    given(connection.createInteraction()).willReturn(interaction);
    given(interaction.execute(interactionSpec, inputRecord, outputRecord)).willReturn(true);

    CciTemplate ct = new CciTemplate(connectionFactory);
    ct.setOutputRecordCreator(new RecordCreator() {
      @Override
      public Record createRecord(RecordFactory recordFactory) {
        assertTrue(recordFactory instanceof NotSupportedRecordFactory);
        return outputRecord;
      }
    });
    ct.execute(interactionSpec, inputRecord);

    verify(interaction).execute(interactionSpec, inputRecord, outputRecord);
    verify(interaction).close();
    verify(connection).close();
  }
View Full Code Here

Examples of org.springframework.jca.cci.core.CciTemplate

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

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

    verify(interaction).execute(interactionSpec, inputRecord, outputRecord);
    verify(interaction).close();
    verify(connection).close();
  }
View Full Code Here

Examples of org.springframework.jca.cci.core.CciTemplate

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

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

    verify(interaction).execute(interactionSpec, inputRecord);
    verify(interaction).close();
    verify(connection).close();
  }
View Full Code Here

Examples of org.springframework.jca.cci.core.CciTemplate

    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();
  }
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.