Permalink
Browse files

test helper methods: ProjectSetup.build(), ProblemTestUtil.assertProb…

…lemCount()
  • Loading branch information...
1 parent 194e5ad commit 7cb70b6fee9c5d316e4d5c0fb8e2834bf83ef086 @panchenko committed Dec 25, 2012
@@ -17,6 +17,7 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
@@ -421,4 +422,11 @@ public TestSearchResults search(String patternString, int searchFor,
return ProblemTestUtil.findProblems(resource);
}
+ /**
+ * Performs the incremental build in this project.
+ */
+ public void build() throws CoreException {
+ get().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
+ }
+
}
@@ -79,6 +79,13 @@ public static void assertNoProblems(IFile file) throws CoreException {
problems.length);
}
+ /**
+ * Asserts the expected number of problems in the specified array.
+ */
+ public static void assertProblemCount(int expectedCount, IMarker[] problems) {
+ assertEquals(toString(problems), expectedCount, problems.length);
+ }
+
/**
* Returns string representation of the specified problem marker.
*/

0 comments on commit 7cb70b6

Please sign in to comment.