Skip to content

Commit 97ad121

Browse files
committed
ReviewCodeCmdNonJavaTest: explicitly request full build and wait
in order to avoid an automatic (parallel) review run that is still active when trying to delete the project at the end.
1 parent c34b61a commit 97ad121

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

net.sourceforge.pmd.eclipse.plugin.test/src/main/java/net/sourceforge/pmd/eclipse/runtime/cmd/ReviewCodeCmdNonJavaTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
import org.eclipse.core.resources.IFolder;
1212
import org.eclipse.core.resources.IProject;
1313
import org.eclipse.core.resources.IResource;
14+
import org.eclipse.core.resources.IncrementalProjectBuilder;
1415
import org.eclipse.jdt.core.JavaCore;
1516
import org.junit.Assert;
1617
import org.junit.Test;
1718

1819
import net.sourceforge.pmd.eclipse.EclipseUtils;
20+
import net.sourceforge.pmd.eclipse.WaitingMonitor;
1921
import net.sourceforge.pmd.eclipse.plugin.PMDPlugin;
2022
import net.sourceforge.pmd.eclipse.runtime.builder.PMDNature;
2123
import net.sourceforge.pmd.eclipse.runtime.properties.IProjectProperties;
@@ -57,6 +59,12 @@ public void checkCodeForNonJavaProject() throws Exception {
5759
IProjectProperties properties = PMDPlugin.getDefault().getPropertiesManager().loadProjectProperties(testProject);
5860
properties.setPmdEnabled(true);
5961

62+
// explicitly request full build to prevent automatic (parallel) building later on
63+
WaitingMonitor waitingMonitor = new WaitingMonitor();
64+
testProject.build(IncrementalProjectBuilder.FULL_BUILD, waitingMonitor);
65+
waitingMonitor.await();
66+
EclipseUtils.waitForJobs();
67+
6068
ReviewCodeCmd cmd = new ReviewCodeCmd();
6169
cmd.addResource(testProject);
6270
cmd.performExecute();

0 commit comments

Comments
 (0)