package at.kugel.tool.buildtray.action;
import org.junit.Test;
import at.kugel.tool.buildtray.config.IntegrationTestConfig;
import at.kugel.tool.buildtray.status.IntegrationStatusResult;
import at.kugel.tool.buildtray.status.Status;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
public class AnthillActionTest extends AbstractHtmlRegularExpressionActionsTestCase {
private IntegrationTestConfig createConfig() {
return createConfig("./config/AnthillOS-1.7.properties");
}
@Test
public void testFailedNewest() {
IntegrationTestConfig mockConf = createConfig();
mockConf.setServerlUrl4Test(getTestDataUrl("anthill-1.7_newest_failed.html"));
IntegrationStatusResult res = refreshWith(mockConf);
assertNull(res.error);
assertEquals("CVS_Fails_D", res.projectName);
assertEquals(Status.FAILED, res.status);
assertEquals("17.01.09 00:04", res.date);
}
@Test
public void testFailedOlder() {
IntegrationTestConfig mockConf = createConfig();
mockConf.setServerlUrl4Test(getTestDataUrl("anthill-1.7_older_failed.html"));
IntegrationStatusResult res = refreshWith(mockConf);
assertNull(res.error);
assertEquals("CVS_Fails_D", res.projectName);
assertEquals(Status.FAILED, res.status);
assertEquals("17.01.09 00:04", res.date);
}
@Test
public void testSuccess() {
IntegrationTestConfig mockConf = createConfig();
mockConf.setServerlUrl4Test(getTestDataUrl("anthil-1.7_success.html"));
IntegrationStatusResult res = refreshWith(mockConf);
assertNull(res.error);
assertEquals("PVCS_Test", res.projectName);
assertEquals(Status.OK, res.status);
assertEquals("17.01.09 01:04", res.date);
}
}