Esempio n. 1
0
            public override void Progress(ImportStage stage, int percent)
            {
                if (percent > 100)
                {
                    fail("Expected percentage to be 0..100% but was " + percent);
                }

                AtomicInteger stageProgress = ProgressConflict.computeIfAbsent(stage, s => new AtomicInteger());
                int           previous      = stageProgress.getAndSet(percent);

                if (previous > percent)
                {
                    fail("Progress should go forwards only, but went from " + previous + " to " + percent);
                }
            }