@Test public void record() { storageManager = spy(storageManager); DefaultData defaultData = mock(DefaultData.class); when(storageManager.canWriteMore()).thenReturn(true); when(storageRecorder.isRecordingOn()).thenReturn(true); storageManager.record(defaultData); verify(storageRecorder, times(1)).record(defaultData); when(storageRecorder.isRecordingOn()).thenReturn(false); }
public void record(DefaultData dataToRecord) { if (storageRecorder.isRecordingOn() && canWriteMore()) { storageRecorder.record(dataToRecord); } else if (storageRecorder.isRecordingOn() && !canWriteMore()) { try { stopRecording(); } catch (Exception e) { log.warn("Exception occurred trying to automatically stop the recording due to the hard disk space limitation warning.", e); } } }
CmrStorageManager extends StorageManager implements ApplicationListener<ContextClosedEvent> { public void record(DefaultData dataToRecord) { if (storageRecorder.isRecordingOn() && canWriteMore()) { storageRecorder.record(dataToRecord); } else if (storageRecorder.isRecordingOn() && !canWriteMore()) { try { stopRecording(); } catch (Exception e) { log.warn("Exception occurred trying to automatically stop the recording due to the hard disk space limitation warning.", e); } } } }
CmrStorageManager extends StorageManager implements ApplicationListener<ContextClosedEvent> { public void record(DefaultData dataToRecord) { if (storageRecorder.isRecordingOn() && canWriteMore()) { storageRecorder.record(dataToRecord); } else if (storageRecorder.isRecordingOn() && !canWriteMore()) { try { stopRecording(); } catch (Exception e) { log.warn("Exception occurred trying to automatically stop the recording due to the hard disk space limitation warning.", e); } } }  }
CmrStorageManager extends StorageManager implements ApplicationListener<ContextClosedEvent> { public void record(DefaultData dataToRecord) { if (storageRecorder.isRecordingOn() && canWriteMore()) { storageRecorder.record(dataToRecord); } else if (storageRecorder.isRecordingOn() && !canWriteMore()) { try { stopRecording(); } catch (Exception e) { log.warn("Exception occurred trying to automatically stop the recording due to the hard disk space limitation warning.", e); } } }  void createStorage(StorageData storageData); StorageWriter openStorage(StorageData storageData); void closeStorage(StorageData storageData); void deleteStorage(StorageData storageData); StorageData getRecordingStorage(); RecordingProperties getRecordingProperties(); RecordingState getRecordingState(); WritingStatus getRecordingStatus(); void startOrScheduleRecording(StorageData storageData, RecordingProperties recordingProperties); void stopRecording(); void record(DefaultData dataToRecord); void writeToStorage(StorageData storageData, Collection<? extends DefaultData> dataToWrite, Collection<AbstractDataProcessor> dataProcessors, boolean synchronously); void copyBufferToStorage(StorageData storageData, List<Long> platformIdents, Collection<AbstractDataProcessor> dataProcessors, boolean autoFinalize); void copyDataToStorage(StorageData storageData, Collection<Long> elementIds, long platformIdent, Set<Long> traceIds, Collection<AbstractDataProcessor> dataProcessors, boolean autoFinalize); StorageData getStorageData(String id); List<StorageData> getExistingStorages(); List<StorageData> getOpenedStorages(); List<StorageData> getReadableStorages(); boolean isStorageOpen(StorageData storageData); boolean isStorageExisting(StorageData storageData); boolean isStorageClosed(StorageData storageData); long getStorageQueuedWriteTaskCount(StorageData storageData); @Override Path getStoragePath(IStorageData storageData); Map<String, Long> getFilesHttpLocation(StorageData storageData, final String extension); void addLabelToStorage(StorageData storageData, AbstractStorageLabel<?> storageLabel, boolean doOverwrite); boolean removeLabelFromStorage(StorageData storageData, AbstractStorageLabel<?> storageLabel); void updateStorageData(StorageData storageData); Map<StorageData, String> getWritersStatus(); void unpackUploadedStorage(final IStorageData packedStorageData); void createStorageFromUploadedDir(final IStorageData localStorageData); String getCachedStorageDataFileLocation(StorageData storageData, int hash); @PostConstruct void postConstruct(); @Override void onApplicationEvent(ContextClosedEvent event); @Override String toString(); }
CmrStorageManager extends StorageManager implements ApplicationListener<ContextClosedEvent> { public void record(DefaultData dataToRecord) { if (storageRecorder.isRecordingOn() && canWriteMore()) { storageRecorder.record(dataToRecord); } else if (storageRecorder.isRecordingOn() && !canWriteMore()) { try { stopRecording(); } catch (Exception e) { log.warn("Exception occurred trying to automatically stop the recording due to the hard disk space limitation warning.", e); } } }  void createStorage(StorageData storageData); StorageWriter openStorage(StorageData storageData); void closeStorage(StorageData storageData); void deleteStorage(StorageData storageData); StorageData getRecordingStorage(); RecordingProperties getRecordingProperties(); RecordingState getRecordingState(); WritingStatus getRecordingStatus(); void startOrScheduleRecording(StorageData storageData, RecordingProperties recordingProperties); void stopRecording(); void record(DefaultData dataToRecord); void writeToStorage(StorageData storageData, Collection<? extends DefaultData> dataToWrite, Collection<AbstractDataProcessor> dataProcessors, boolean synchronously); void copyBufferToStorage(StorageData storageData, List<Long> platformIdents, Collection<AbstractDataProcessor> dataProcessors, boolean autoFinalize); void copyDataToStorage(StorageData storageData, Collection<Long> elementIds, long platformIdent, Set<Long> traceIds, Collection<AbstractDataProcessor> dataProcessors, boolean autoFinalize); StorageData getStorageData(String id); List<StorageData> getExistingStorages(); List<StorageData> getOpenedStorages(); List<StorageData> getReadableStorages(); boolean isStorageOpen(StorageData storageData); boolean isStorageExisting(StorageData storageData); boolean isStorageClosed(StorageData storageData); long getStorageQueuedWriteTaskCount(StorageData storageData); @Override Path getStoragePath(IStorageData storageData); Map<String, Long> getFilesHttpLocation(StorageData storageData, final String extension); void addLabelToStorage(StorageData storageData, AbstractStorageLabel<?> storageLabel, boolean doOverwrite); boolean removeLabelFromStorage(StorageData storageData, AbstractStorageLabel<?> storageLabel); void updateStorageData(StorageData storageData); Map<StorageData, String> getWritersStatus(); void unpackUploadedStorage(final IStorageData packedStorageData); void createStorageFromUploadedDir(final IStorageData localStorageData); String getCachedStorageDataFileLocation(StorageData storageData, int hash); @PostConstruct void postConstruct(); @Override void onApplicationEvent(ContextClosedEvent event); @Override String toString();  }