Search in sources :

Example 1 with TempFiles

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

the class PerforceFixture method setUp.

@Before
public void setUp() throws Exception {
    p4Fixture = new P4Fixture();
    p4Fixture.setRepo(createTestRepo());
    clientFolder = TestFileUtil.createTempFolder("p4Client");
    if (clientFolder == null) {
        throw new RuntimeException();
    }
    outputconsumer = ProcessOutputStreamConsumer.inMemoryConsumer();
    p4 = p4Fixture.createClient();
    tmpFiles = new TempFiles();
    tempDir = tmpFiles.mkdir("tempDir");
}
Also used : TempFiles(com.thoughtworks.go.util.TempFiles) Before(org.junit.Before)

Example 2 with TempFiles

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

the class CommandRepositoryInitializerTest method setUp.

@Before
public void setUp() {
    serverHealthService = mock(ServerHealthService.class);
    systemEnvironment = mock(SystemEnvironment.class);
    zipUtil = mock(ZipUtil.class);
    zipInputStream = mock(ZipInputStream.class);
    when(systemEnvironment.get(SystemEnvironment.VERSION_FILE_IN_DEFAULT_COMMAND_REPOSITORY)).thenReturn("version.txt");
    CommandRepositoryInitializer initializer = new CommandRepositoryInitializer(systemEnvironment, zipUtil, serverHealthService);
    spy = spy(initializer);
    tempFiles = new TempFiles();
}
Also used : SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) ZipInputStream(java.util.zip.ZipInputStream) ZipUtil(com.thoughtworks.go.util.ZipUtil) ServerHealthService(com.thoughtworks.go.serverhealth.ServerHealthService) TempFiles(com.thoughtworks.go.util.TempFiles) Before(org.junit.Before)

Example 3 with TempFiles

use of com.thoughtworks.go.util.TempFiles 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 4 with TempFiles

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

the class MaterialCheckerTest method setUp.

@Before
public void setUp() throws Exception {
    materialRepository = Mockito.mock(MaterialRepository.class);
    tempFiles = new TempFiles();
    mockMaterial = Mockito.mock(ScmMaterial.class);
    materialChecker = new MaterialChecker(materialRepository);
    workingFolder = tempFiles.createUniqueFolder("materialChecker");
}
Also used : ScmMaterial(com.thoughtworks.go.config.materials.ScmMaterial) MaterialRepository(com.thoughtworks.go.server.persistence.MaterialRepository) TempFiles(com.thoughtworks.go.util.TempFiles) Before(org.junit.Before)

Example 5 with TempFiles

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

the class X509CertificateGeneratorTest method setup.

@Before
public void setup() {
    tempFiles = new TempFiles();
    keystore = new File(tempFiles.createUniqueFolder("X509CertificateGeneratorTest"), "keystore");
}
Also used : File(java.io.File) TempFiles(com.thoughtworks.go.util.TempFiles) Before(org.junit.Before)

Aggregations

TempFiles (com.thoughtworks.go.util.TempFiles)7 Before (org.junit.Before)7 SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)3 ZipUtil (com.thoughtworks.go.util.ZipUtil)2 ScmMaterial (com.thoughtworks.go.config.materials.ScmMaterial)1 Database (com.thoughtworks.go.database.Database)1 MaterialRepository (com.thoughtworks.go.server.persistence.MaterialRepository)1 ServerVersion (com.thoughtworks.go.server.util.ServerVersion)1 ServerHealthService (com.thoughtworks.go.serverhealth.ServerHealthService)1 ConfigRepository (com.thoughtworks.go.service.ConfigRepository)1 File (java.io.File)1 ZipInputStream (java.util.zip.ZipInputStream)1