Permalink
Browse files

tests: Update tests

  • Loading branch information...
arafsheikh committed Jun 16, 2016
1 parent fa70d22 commit 4c3befe4440d75e26c8e21c1b10ee9ff458a7822
@@ -2,8 +2,8 @@
import static org.junit.Assert.assertEquals;
import com.coala.core.handlers.Plugin;
import com.coala.core.handlers.RemoveMarkers;
import com.coala.core.utils.ExternalUtils;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IFile;
@@ -24,7 +24,6 @@
public class MarkerTest {
private IProject project;
private Plugin plugin;
private RemoveMarkers removeMarkers;
private IFile file;
@@ -49,15 +48,14 @@ public void setUp() throws Exception {
InputStream source = new ByteArrayInputStream(bytes);
file.create(source, IResource.NONE, null);
}
plugin = new Plugin();
removeMarkers = new RemoveMarkers();
}
@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");
ExternalUtils.createCoolMarker(file, 0, 0, "First marker");
ExternalUtils.createCoolMarker(file, 0, 0, "Second marker");
IMarker[] markers = file.findMarkers("com.coala.core.coolproblem", true,
IResource.DEPTH_INFINITE);
assertEquals(markers.length, 2);
@@ -2,8 +2,8 @@
import static org.junit.Assert.assertEquals;
import com.coala.core.handlers.Plugin;
import com.coala.core.handlers.RemoveMarkers;
import com.coala.core.utils.ExternalUtils;
import org.apache.commons.exec.ExecuteException;
import org.eclipse.core.resources.IFile;
@@ -25,7 +25,6 @@
public class RunCmdTest {
private IProject project;
private Plugin plugin;
private RemoveMarkers removeMarkers;
private IFile file;
@@ -50,14 +49,13 @@ public void setUp() throws Exception {
InputStream source = new ByteArrayInputStream(bytes);
file.create(source, IResource.NONE, null);
}
plugin = new Plugin();
removeMarkers = new RemoveMarkers();
}
@Test
public void test() throws InterruptedException, CoreException, ExecuteException, IOException {
removeMarkers.removeAllMarkers(file);
plugin.runcoalaOnFile(file, "CheckstyleBear");
ExternalUtils.runcoalaOnFile(file, "CheckstyleBear");
sleep(15);
IMarker[] markers = file.findMarkers("com.coala.core.coolproblem", true,
IResource.DEPTH_INFINITE);
@@ -19,4 +19,5 @@ Require-Bundle: org.eclipse.ui,
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Import-Package: javax.inject;version="1.0.0"
Export-Package: com.coala.core.handlers;x-friends:="com.coala.core.tests",
com.coala.core.utils,
org.apache.commons.exec

0 comments on commit 4c3befe

Please sign in to comment.