Permalink
Browse files

MarkerTest: Improve test

  • Loading branch information...
arafsheikh committed May 29, 2016
1 parent e5cf094 commit 12f53607858448f1817e3243d25b16bbe960704a
Showing with 8 additions and 11 deletions.
  1. +8 −11 com.coala.core.tests/src/com/coala/core/tests/MarkerTest.java
@@ -48,26 +48,23 @@ public void setUp() throws Exception {
plugin = new Plugin();
removeMarkers = new RemoveMarkers();
}
@Test
public void test() throws IOException, CoreException, ExecutionException {
removeMarkers.removeAllMarkers(file);
String json = Plugin.getcoalaJSON(file, "CheckstyleBear");
plugin.processJSON(json, file);
IMarker[] markers = file.findMarkers("com.coala.core.coolproblem", true, IResource.DEPTH_INFINITE);
assertEquals(markers.length, 3);
}
@After
public void tearDown() throws CoreException {
project.close(null);
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
for (IProject project : projects) {
project.delete(true, true, null);
}
ResourcesPlugin.getWorkspace().save(true, null);
}
@Test
public void test() throws IOException, CoreException, ExecutionException {
removeMarkers.removeAllMarkers(file);
plugin.createCoolMarker(file, 0, 0, "First marker");
plugin.createCoolMarker(file, 0, 0, "Second marker");
IMarker[] markers = file.findMarkers("com.coala.core.coolproblem", true, IResource.DEPTH_INFINITE);
assertEquals(markers.length, 2);
}
}

0 comments on commit 12f5360

Please sign in to comment.