Class TapeLibrarySimulator


  • public class TapeLibrarySimulator
    extends java.lang.Object
    Helper class for emulating a Tape Library behaviour for integration testing purposes. Handles an in-memory tape library (1 changer, x drives, y slots and z tapes), and provides TapeLoadUnloadService, TapeReadWriteService and TapeDriveCommandService instances that simulates operations on tape library. Concurrent operations on the same changer, drive, slot or tape is prohibited (e.g. trying to load a tape A into a slot that is currently being unloaded...) Any unexpected error (i.e. reading past last file of a tape, loading from an empty slot...) is reported through getFailures() for post test checks
    • Constructor Detail

      • TapeLibrarySimulator

        public TapeLibrarySimulator​(java.nio.file.Path inputDirectory,
                                    java.nio.file.Path tempOutputStorageDirectory,
                                    int nbDrives,
                                    int nbSlots,
                                    int nbTapes,
                                    int maxTapeCapacityInBytes,
                                    java.lang.String cartridgeType,
                                    int sleepDelayMillis)
    • Method Detail

      • getFailures

        public java.util.List<java.lang.Exception> getFailures()