|
35 | 35 | import static java.util.logging.Level.INFO;
|
36 | 36 | import java.util.logging.Logger;
|
37 | 37 | import javax.swing.SwingUtilities;
|
| 38 | +import org.netbeans.api.progress.ProgressHandle; |
| 39 | +import org.netbeans.api.progress.ProgressHandleFactory; |
38 | 40 | import org.netbeans.api.project.Project;
|
39 | 41 | import org.openide.util.Exceptions;
|
40 | 42 |
|
@@ -72,21 +74,27 @@ public void performAction(final ResultCollector resultCollector, Project... proj
|
72 | 74 | for (final Project project : projects) {
|
73 | 75 | final TmcProjectInfo projectInfo = projectMediator.wrapProject(project);
|
74 | 76 | eventBus.post(new InvokedEvent(projectInfo));
|
| 77 | + final ProgressHandle runningTestsLocally = ProgressHandleFactory.createSystemHandle( |
| 78 | + "Running tests."); |
| 79 | + runningTestsLocally.start(); |
75 | 80 | try {
|
76 | 81 | ListenableFuture<RunResult> result = TmcCoreSingleton.getInstance().test(projectInfo.getProjectDirAbsPath(), NBTmcSettings.getDefault());
|
77 | 82 | Futures.addCallback(result, new FutureCallback<RunResult>() {
|
78 | 83 | @Override
|
79 | 84 | public void onSuccess(final RunResult result) {
|
| 85 | + runningTestsLocally.finish(); |
80 | 86 | explainResults(result, projectInfo, resultCollector);
|
81 | 87 | }
|
82 | 88 |
|
83 | 89 | @Override
|
84 | 90 | public void onFailure(final Throwable ex) {
|
| 91 | + runningTestsLocally.finish(); |
85 | 92 | explainFailure(ex);
|
86 | 93 | }
|
87 | 94 |
|
88 | 95 | });
|
89 | 96 | } catch (TmcCoreException ex) {
|
| 97 | + runningTestsLocally.finish(); |
90 | 98 | Exceptions.printStackTrace(ex);
|
91 | 99 | }
|
92 | 100 | }
|
@@ -120,7 +128,7 @@ public void run() {
|
120 | 128 | public void run() {
|
121 | 129 | exerciseSubmitter.performAction(projectInfo.getProject());
|
122 | 130 | }
|
123 |
| - }, resultCollector); |
| 131 | + }, resultCollector); |
124 | 132 | }
|
125 | 133 | });
|
126 | 134 | }
|
|
0 commit comments