Clean grapes before tests

This commit is contained in:
Phillip Webb 2013-07-10 11:20:57 -07:00
parent d9fc3fc9de
commit 2d2ce0d3c3
2 changed files with 13 additions and 2 deletions

View File

@ -30,6 +30,7 @@ import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.cli.command.CleanCommand;
import org.springframework.cli.command.RunCommand;
import static org.junit.Assert.assertEquals;
@ -42,9 +43,15 @@ import static org.junit.Assert.assertTrue;
*/
public class SampleIntegrationTests {
@BeforeClass
public static void cleanGrapes() throws Exception {
new CleanCommand().run("--all");
}
private RunCommand command;
private PrintStream savedOutput;
private ByteArrayOutputStream output;
@Before

View File

@ -19,9 +19,8 @@ package org.springframework.cli.command;
import groovy.lang.GroovyObjectSupport;
import groovy.lang.Script;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.cli.command.OptionHandler;
import org.springframework.cli.command.ScriptCommand;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotSame;
@ -36,6 +35,11 @@ public class ScriptCommandTests {
public static boolean executed = false;
@BeforeClass
public static void cleanGrapes() throws Exception {
new CleanCommand().run("--all");
}
@Test(expected = IllegalStateException.class)
public void testMissing() throws Exception {
ScriptCommand command = new ScriptCommand("missing");