Search in sources :

Example 11 with ConfigCache

use of com.thoughtworks.go.config.ConfigCache in project gocd by gocd.

the class AbstractConfigXmlWriterTest method setup.

@BeforeEach
public void setup() {
    output = new ByteArrayOutputStream();
    ConfigCache configCache = new ConfigCache();
    xmlWriter = new MagicalGoConfigXmlWriter(configCache, ConfigElementImplementationRegistryMother.withNoPlugins());
    xmlLoader = new MagicalGoConfigXmlLoader(configCache, ConfigElementImplementationRegistryMother.withNoPlugins());
}
Also used : ConfigCache(com.thoughtworks.go.config.ConfigCache) MagicalGoConfigXmlLoader(com.thoughtworks.go.config.MagicalGoConfigXmlLoader) ByteArrayOutputStream(java.io.ByteArrayOutputStream) MagicalGoConfigXmlWriter(com.thoughtworks.go.config.MagicalGoConfigXmlWriter) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 12 with ConfigCache

use of com.thoughtworks.go.config.ConfigCache in project gocd by gocd.

the class RakeTaskTest method shouldNotKillAllChildrenWhenEmptyOnCancel.

@Test
public void shouldNotKillAllChildrenWhenEmptyOnCancel() throws Exception {
    RakeTask rakeTask = new MagicalGoConfigXmlLoader(new ConfigCache(), ConfigElementImplementationRegistryMother.withNoPlugins()).fromXmlPartial("<rake>" + "  <oncancel />" + "</rake>", RakeTask.class);
    assertThat(rakeTask.cancelTask(), is(instanceOf(NullTask.class)));
}
Also used : ConfigCache(com.thoughtworks.go.config.ConfigCache) RakeTask(com.thoughtworks.go.config.RakeTask) MagicalGoConfigXmlLoader(com.thoughtworks.go.config.MagicalGoConfigXmlLoader) Test(org.junit.jupiter.api.Test)

Example 13 with ConfigCache

use of com.thoughtworks.go.config.ConfigCache in project gocd by gocd.

the class RakeTaskTest method shouldDefaultToUsingAKillAllChildrenCancelTask.

@Test
public void shouldDefaultToUsingAKillAllChildrenCancelTask() throws Exception {
    RakeTask rakeTask = new MagicalGoConfigXmlLoader(new ConfigCache(), ConfigElementImplementationRegistryMother.withNoPlugins()).fromXmlPartial("<rake/>", RakeTask.class);
    assertThat(rakeTask.cancelTask(), is(instanceOf(KillAllChildProcessTask.class)));
}
Also used : ConfigCache(com.thoughtworks.go.config.ConfigCache) RakeTask(com.thoughtworks.go.config.RakeTask) MagicalGoConfigXmlLoader(com.thoughtworks.go.config.MagicalGoConfigXmlLoader) Test(org.junit.jupiter.api.Test)

Aggregations

ConfigCache (com.thoughtworks.go.config.ConfigCache)13 MagicalGoConfigXmlLoader (com.thoughtworks.go.config.MagicalGoConfigXmlLoader)10 Test (org.junit.jupiter.api.Test)9 MagicalGoConfigXmlWriter (com.thoughtworks.go.config.MagicalGoConfigXmlWriter)4 ByteArrayOutputStream (java.io.ByteArrayOutputStream)4 CruiseConfig (com.thoughtworks.go.config.CruiseConfig)3 RakeTask (com.thoughtworks.go.config.RakeTask)2 ConfigElementImplementationRegistry (com.thoughtworks.go.config.registry.ConfigElementImplementationRegistry)2 ByteArrayInputStream (java.io.ByteArrayInputStream)2 Matchers.containsString (org.hamcrest.Matchers.containsString)2 Before (org.junit.Before)2 Argument (com.thoughtworks.go.config.Argument)1 ExecTask (com.thoughtworks.go.config.ExecTask)1 JobConfig (com.thoughtworks.go.config.JobConfig)1 MailHost (com.thoughtworks.go.config.MailHost)1 BuildCause (com.thoughtworks.go.domain.buildcause.BuildCause)1 Builder (com.thoughtworks.go.domain.builder.Builder)1 Arguments (com.thoughtworks.go.domain.config.Arguments)1 GoCache (com.thoughtworks.go.server.cache.GoCache)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1