File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
scijava-progress/src/test/java/org/scijava/progress Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,27 @@ public void testUpdateWithoutDefinition() {
7070 Assertions .assertTrue (listener .isComplete ());
7171 }
7272
73+ /**
74+ * Tests "empty" {@link Task}s.
75+ */
76+ @ Test
77+ public void testEmptyProgress () {
78+ Supplier <Long > progressible = () -> {
79+ Progress .defineTotal (0 );
80+ return 0L ;
81+ };
82+ // Add the ProgressListener
83+ var listener = new TestSuiteProgressListener (0 );
84+ Progress .addListener (progressible , listener );
85+ // Register the Task
86+ Progress .register (progressible );
87+ // Run the Task
88+ progressible .get ();
89+ // Complete the Task
90+ Progress .complete ();
91+ Assertions .assertTrue (listener .isComplete ());
92+ }
93+
7394 /**
7495 * Tests progress listening on a simple task with only one processing stage
7596 * and no dependencies.
You can’t perform that action at this time.
0 commit comments