Search in sources :

Example 6 with LogRotator

use of hudson.tasks.LogRotator in project hudson-2.x by hudson.

the class FreeStyleProjectTest method testSetLogRotatorParentNull.

@Test
public void testSetLogRotatorParentNull() {
    FreeStyleProject childProject1 = new FreeStyleProjectMock("child1");
    childProject1.setLogRotator(new LogRotator(10, 11, 12, 13));
    assertNotNull(childProject1.getLogRotator());
    assertEquals(childProject1.getLogRotator().getDaysToKeep(), 10);
}
Also used : LogRotator(hudson.tasks.LogRotator) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 7 with LogRotator

use of hudson.tasks.LogRotator in project hudson-2.x by hudson.

the class FreeStyleProjectTest method testGetLogRotatorFromChild.

@Test
public void testGetLogRotatorFromChild() {
    FreeStyleProject parentProject = new FreeStyleProjectMock("parent");
    parentProject.setLogRotator(new LogRotator(10, 10, 10, 10));
    FreeStyleProjectMock childProject1 = new FreeStyleProjectMock("child1");
    childProject1.setLogRotator(new LogRotator(20, 20, 20, 20));
    childProject1.setCascadingProject(parentProject);
    LogRotator result = childProject1.getLogRotator();
    assertNotNull(result);
    assertEquals(result.getDaysToKeep(), 20);
}
Also used : LogRotator(hudson.tasks.LogRotator) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 8 with LogRotator

use of hudson.tasks.LogRotator in project hudson-2.x by hudson.

the class ProjectPropertyTest method testLogRotatorProjectPropertyPrepareValue.

@Test
public void testLogRotatorProjectPropertyPrepareValue() {
    //Boolean property acts as BaseProperty
    BaseProjectProperty property = new LogRotatorProjectProperty(project);
    assertNull(property.prepareValue(null));
    LogRotator value = new LogRotator(1, 1, 1, 1);
    assertEquals(value, property.prepareValue(value));
}
Also used : LogRotator(hudson.tasks.LogRotator) Test(org.junit.Test)

Aggregations

LogRotator (hudson.tasks.LogRotator)8 Test (org.junit.Test)7 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)5 ExtensionPoint (hudson.ExtensionPoint)1 Hudson (hudson.model.Hudson)1 Node (hudson.model.Node)1 TransientProjectActionFactory (hudson.model.TransientProjectActionFactory)1 SaveableListener (hudson.model.listeners.SaveableListener)1 AuthorizationMatrixProperty (hudson.security.AuthorizationMatrixProperty)1 CopyOnWriteList (hudson.util.CopyOnWriteList)1 File (java.io.File)1 JSONObject (net.sf.json.JSONObject)1 BaseProjectProperty (org.hudsonci.model.project.property.BaseProjectProperty)1 Ignore (org.junit.Ignore)1