PoTransaction { public final void processOpening(PoTransaction.SessionSetting.AccessLevel accessLevel) { currentAccessLevel = accessLevel; List<AbstractPoCommandBuilder<? extends AbstractPoResponseParser>> poAtomicCommands = new ArrayList<AbstractPoCommandBuilder<? extends AbstractPoResponseParser>>(); AtomicInteger neededSessionBufferSpace = new AtomicInteger(); AtomicBoolean overflow = new AtomicBoolean(); for (AbstractPoCommandBuilder<? extends AbstractPoResponseParser> commandBuilder : poCommandManager.getPoCommandBuilders()) { if (checkModifyingCommand(commandBuilder, overflow, neededSessionBufferSpace)) { if (overflow.get()) { processAtomicOpening(currentAccessLevel, poAtomicCommands); processAtomicClosing( null, SessionSetting.RatificationMode.CLOSE_RATIFIED, ChannelControl.KEEP_OPEN); resetModificationsBufferCounter(); poAtomicCommands.clear(); poAtomicCommands.add(commandBuilder); isSessionBufferOverflowed(neededSessionBufferSpace.get()); } else { poAtomicCommands.add(commandBuilder); } } else { poAtomicCommands.add(commandBuilder); } } processAtomicOpening(currentAccessLevel, poAtomicCommands); poCommandManager.notifyCommandsProcessed(); } PoTransaction(SeResource<CalypsoPo> poResource, PoSecuritySettings poSecuritySettings);  PoTransaction(SeResource<CalypsoPo> poResource); final void processOpening(PoTransaction.SessionSetting.AccessLevel accessLevel); final void processPoCommands(); final void processClosing(); final void processCancel(); final void processVerifyPin(byte[] pin); final void processVerifyPin(String pin); final void prepareReleasePoChannel(); final void prepareSelectFile(byte[] lid); final void prepareSelectFile(SelectFileControl control); final void prepareReadRecordFile(byte sfi, int recordNumber); final void prepareReadRecordFile(
      byte sfi, int firstRecordNumber, int numberOfRecords, int recordSize); final void prepareReadCounterFile(byte sfi, int countersNumber); final void prepareAppendRecord(byte sfi, byte[] recordData); final void prepareUpdateRecord(byte sfi, int recordNumber, byte[] recordData); final void prepareWriteRecord(byte sfi, int recordNumber, byte[] recordData); final void prepareIncreaseCounter(byte sfi, int counterNumber, int incValue); final void prepareDecreaseCounter(byte sfi, int counterNumber, int decValue); final void prepareCheckPinStatus(); final void prepareSvGet(SvSettings.Operation svOperation, SvSettings.Action svAction); final void prepareSvReload(int amount, byte[] date, byte[] time, byte[] free); final void prepareSvReload(int amount); final void prepareSvDebit(int amount, byte[] date, byte[] time); final void prepareSvDebit(int amount); final void prepareSvReadAllLogs(); final void prepareInvalidate(); final void prepareRehabilitate();  }
@Test(expected = CalypsoPoTransactionIllegalStateException.class) public void testProcessOpening_noSamResource() { CalypsoPo calypsoPoRev31 = createCalypsoPo(FCI_REV31); poTransaction = new PoTransaction(new SeResource<CalypsoPo>(poReader, calypsoPoRev31)); poTransaction.processOpening(AccessLevel.SESSION_LVL_DEBIT); }