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 CruiseActionTest extends AbstractHtmlRegularExpressionActionsTestCase {
private IntegrationTestConfig createConfig() {
return createConfig("./config/CruiseControl-2.3.properties");
}
@Test
public void testFailedNewest() {
IntegrationTestConfig mockConf = createConfig();
mockConf.setServerlUrl4Test(getTestDataUrl("cruisecontrol-2.3_failed.html"));
IntegrationStatusResult res = refreshWith(mockConf);
assertNull(res.error);
assertEquals("KrimiCEE", res.projectName);
assertEquals(Status.FAILED, res.status);
assertEquals("20/01/2009 13:44:52", res.date);
}
@Test
public void testSuccess() {
IntegrationTestConfig mockConf = createConfig();
mockConf.setServerlUrl4Test(getTestDataUrl("cruisecontrol-2.3_success.html"));
IntegrationStatusResult res = refreshWith(mockConf);
assertNull(res.error);
assertEquals("KrimiCEE_PROD_5_2_SLSP", res.projectName);
assertEquals(Status.OK, res.status);
assertEquals("16/01/2009 22:29:06", res.date);
}
}