Search in sources :

Example 1 with ArtifactsDirHolder

use of com.thoughtworks.go.server.service.ArtifactsDirHolder in project gocd by gocd.

the class ZipArtifactCacheTest method setUp.

@Before
public void setUp() throws Exception {
    folder = TestFileUtil.createTempFolder("ZipArtifactCacheTest-" + System.currentTimeMillis());
    File artifact = new File(folder, JOB_FOLDERS);
    artifact.mkdirs();
    TestFileUtil.createTestFolder(artifact, "dir");
    TestFileUtil.createTestFile(artifact, "dir/file1");
    artifactsDirHolder = context.mock(ArtifactsDirHolder.class);
    context.checking(new Expectations() {

        {
            allowing(artifactsDirHolder).getArtifactsDir();
            will(returnValue(folder));
        }
    });
    zipArtifactCache = new ZipArtifactCache(this.artifactsDirHolder, new ZipUtil());
    artifactFolder = new ArtifactFolder(JOB_IDENTIFIER, new File(artifact, "dir"), "dir");
}
Also used : Expectations(org.jmock.Expectations) ZipUtil(com.thoughtworks.go.util.ZipUtil) File(java.io.File) ArtifactsDirHolder(com.thoughtworks.go.server.service.ArtifactsDirHolder) ArtifactFolder(com.thoughtworks.go.server.web.ArtifactFolder) Before(org.junit.Before)

Aggregations

ArtifactsDirHolder (com.thoughtworks.go.server.service.ArtifactsDirHolder)1 ArtifactFolder (com.thoughtworks.go.server.web.ArtifactFolder)1 ZipUtil (com.thoughtworks.go.util.ZipUtil)1 File (java.io.File)1 Expectations (org.jmock.Expectations)1 Before (org.junit.Before)1