|
|
|
@ -1,14 +1,12 @@
|
|
|
|
package link.pagan.traqtor.api;
|
|
|
|
package link.pagan.traqtor.api;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import link.pagan.traqtor._api.Executor;
|
|
|
|
|
|
|
|
import link.pagan.traqtor._api.TraqtorApiTestUtils;
|
|
|
|
import link.pagan.traqtor._api.TraqtorApiTestUtils;
|
|
|
|
import link.pagan.traqtor._api.result.CommandExecResult;
|
|
|
|
import link.pagan.traqtor._api.result.CommandExecResult;
|
|
|
|
import static link.pagan.traqtor._api.result.CommandExecResultStatus.DONE;
|
|
|
|
import static link.pagan.traqtor._api.result.CommandExecResultStatus.DONE;
|
|
|
|
import static link.pagan.traqtor._api.result.CommandExecResultStatus.FAIL;
|
|
|
|
import static link.pagan.traqtor._api.result.CommandExecResultStatus.FAIL;
|
|
|
|
import org.junit.jupiter.api.AfterEach;
|
|
|
|
import org.junit.jupiter.api.AfterEach;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
|
|
import org.junit.jupiter.api.BeforeAll;
|
|
|
|
|
|
|
|
import org.junit.jupiter.api.BeforeEach;
|
|
|
|
import org.junit.jupiter.api.BeforeEach;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
|
|
|
|
|
|
|
@ -20,11 +18,6 @@ public class TraqtorTest {
|
|
|
|
|
|
|
|
|
|
|
|
CommandExecResult result;
|
|
|
|
CommandExecResult result;
|
|
|
|
|
|
|
|
|
|
|
|
@BeforeAll
|
|
|
|
|
|
|
|
public static void setup() {
|
|
|
|
|
|
|
|
Executor.enableParanoindLoggin();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@BeforeEach
|
|
|
|
@BeforeEach
|
|
|
|
public void cleanTestDir() throws IOException {
|
|
|
|
public void cleanTestDir() throws IOException {
|
|
|
|
TraqtorApiTestUtils.killTestRoot();
|
|
|
|
TraqtorApiTestUtils.killTestRoot();
|
|
|
|
@ -34,7 +27,6 @@ public class TraqtorTest {
|
|
|
|
@AfterEach
|
|
|
|
@AfterEach
|
|
|
|
public void killCore() {
|
|
|
|
public void killCore() {
|
|
|
|
Traqtor.reset();
|
|
|
|
Traqtor.reset();
|
|
|
|
System.out.println("TEST_WORKSPACE_ROOT = " + TraqtorApiTestUtils.TEST_WORKSPACE_ROOT);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
@ -52,6 +44,9 @@ public class TraqtorTest {
|
|
|
|
result = Traqtor.exec(new Traqtor.SaveWorkspace());
|
|
|
|
result = Traqtor.exec(new Traqtor.SaveWorkspace());
|
|
|
|
assertEquals(FAIL, result.getStatus());
|
|
|
|
assertEquals(FAIL, result.getStatus());
|
|
|
|
assertEquals(Traqtor.getWorkspace().isDirty(), true);
|
|
|
|
assertEquals(Traqtor.getWorkspace().isDirty(), true);
|
|
|
|
|
|
|
|
result = Traqtor.exec(new Traqtor.SaveAsWorkspace(TraqtorApiTestUtils.TEST_WORKSPACE_ROOT));
|
|
|
|
|
|
|
|
assertEquals(DONE, result.getStatus());
|
|
|
|
|
|
|
|
assertEquals(Traqtor.getWorkspace().isDirty(), false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
|