Search in sources :

Example 91 with SystemEnvironment

use of com.thoughtworks.go.util.SystemEnvironment in project gocd by gocd.

the class CommandRepositoryInitializerIntegrationTest method setUp.

@Before
public void setUp() {
    tempFiles = new TempFiles();
    initializer = new CommandRepositoryInitializer(new SystemEnvironment(), new ZipUtil(), null);
}
Also used : SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) ZipUtil(com.thoughtworks.go.util.ZipUtil) TempFiles(com.thoughtworks.go.util.TempFiles) Before(org.junit.Before)

Example 92 with SystemEnvironment

use of com.thoughtworks.go.util.SystemEnvironment in project gocd by gocd.

the class JobInstanceLogTest method setUp.

@Before
public void setUp() {
    context = new Mockery();
    context.setImposteriser(ClassImposteriser.INSTANCE);
    jobInstanceLog = new JobInstanceLog(null, new HashMap());
    defaultLogFile = new LogFile(new File("log20051209122103.xml"));
    rootFolder = new File("root");
    rootFolder.mkdirs();
    env = new SystemEnvironment();
}
Also used : SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) HashMap(java.util.HashMap) Mockery(org.jmock.Mockery) File(java.io.File) JobInstanceLog(com.thoughtworks.go.domain.JobInstanceLog) Before(org.junit.Before)

Example 93 with SystemEnvironment

use of com.thoughtworks.go.util.SystemEnvironment in project gocd by gocd.

the class DevelopmentServer method copyActivatorJarToClassPath.

private static void copyActivatorJarToClassPath() throws IOException {
    File activatorJar = new File("../plugin-infra/go-plugin-activator/target/libs/").listFiles((FileFilter) new WildcardFileFilter("go-plugin-activator-*.jar"))[0];
    new SystemEnvironment().set(SystemEnvironment.PLUGIN_ACTIVATOR_JAR_PATH, "go-plugin-activator.jar");
    if (activatorJar.exists()) {
        FileUtils.copyFile(activatorJar, new File(classpath(), "go-plugin-activator.jar"));
    } else {
        System.err.println("Could not find plugin activator jar, Plugin framework will not be loaded.");
    }
}
Also used : SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) FileFilter(java.io.FileFilter) WildcardFileFilter(org.apache.commons.io.filefilter.WildcardFileFilter) File(java.io.File) WildcardFileFilter(org.apache.commons.io.filefilter.WildcardFileFilter)

Example 94 with SystemEnvironment

use of com.thoughtworks.go.util.SystemEnvironment in project gocd by gocd.

the class BackupServiceTest method setUp.

@Before
public void setUp() throws Exception {
    systemEnvironment = mock(SystemEnvironment.class);
    tempFiles = new TempFiles();
    when(systemEnvironment.getConfigDir()).thenReturn(tempFiles.createUniqueFile("config_dir").getAbsolutePath());
    serverVersion = mock(ServerVersion.class);
    configRepo = mock(ConfigRepository.class);
    databaseStrategy = mock(Database.class);
    when(configRepo.doLocked(Matchers.<ThrowingFn<Object, Exception>>any())).thenCallRealMethod();
}
Also used : SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) ServerVersion(com.thoughtworks.go.server.util.ServerVersion) ConfigRepository(com.thoughtworks.go.service.ConfigRepository) Database(com.thoughtworks.go.database.Database) TempFiles(com.thoughtworks.go.util.TempFiles) Before(org.junit.Before)

Example 95 with SystemEnvironment

use of com.thoughtworks.go.util.SystemEnvironment in project gocd by gocd.

the class CommandRepositoryLocationValidatorTest method setUp.

@Before
public void setUp() throws Exception {
    SystemEnvironment systemEnvironment = mock(SystemEnvironment.class);
    validator = new CommandRepositoryLocationValidator(systemEnvironment);
    cruiseConfig = mock(BasicCruiseConfig.class);
    serverConfig = mock(ServerConfig.class);
    when(cruiseConfig.server()).thenReturn(serverConfig);
    when(systemEnvironment.get(COMMAND_REPOSITORY_DIRECTORY)).thenReturn("db/task_repository");
    repoRootLocation = new File("db/task_repository").getAbsolutePath();
}
Also used : SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) ServerConfig(com.thoughtworks.go.config.ServerConfig) BasicCruiseConfig(com.thoughtworks.go.config.BasicCruiseConfig) File(java.io.File) Before(org.junit.Before)

Aggregations

SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)174 Test (org.junit.Test)93 Before (org.junit.Before)38 File (java.io.File)37 AgentInstance (com.thoughtworks.go.domain.AgentInstance)27 MaterialRevisions (com.thoughtworks.go.domain.MaterialRevisions)15 HttpLocalizedOperationResult (com.thoughtworks.go.server.service.result.HttpLocalizedOperationResult)14 ArrayList (java.util.ArrayList)14 AgentRuntimeInfo (com.thoughtworks.go.server.service.AgentRuntimeInfo)11 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)10 BuildCause (com.thoughtworks.go.domain.buildcause.BuildCause)10 AgentStatusChangeListener (com.thoughtworks.go.listener.AgentStatusChangeListener)10 AgentIdentifier (com.thoughtworks.go.remote.AgentIdentifier)9 AgentConfig (com.thoughtworks.go.config.AgentConfig)8 MaterialRevision (com.thoughtworks.go.domain.MaterialRevision)8 PipelineConfigDependencyGraph (com.thoughtworks.go.server.domain.PipelineConfigDependencyGraph)8 SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)7 EnvironmentVariableContext (com.thoughtworks.go.util.command.EnvironmentVariableContext)7 Date (java.util.Date)7 CruiseConfig (com.thoughtworks.go.config.CruiseConfig)6