Search in sources :

Example 1 with TempFiles

use of jetbrains.buildServer.TempFiles in project teamcity-torrent-plugin by JetBrains.

the class BuildAgentConfigurationFixture method setUp.

public BuildAgentConfiguration setUp() throws IOException {
    myTmpFiles = new TempFiles();
    final File systemDir = myTmpFiles.createTempDir();
    final File torrentsDir = myTmpFiles.createTempDir();
    Mockery m = new Mockery();
    final BuildAgentConfiguration agentConfiguration = m.mock(BuildAgentConfiguration.class);
    m.checking(new Expectations() {

        {
            allowing(agentConfiguration).getServerUrl();
            will(returnValue("http://localhost:8111/bs"));
            allowing(agentConfiguration).getSystemDirectory();
            will(returnValue(systemDir));
            allowing(agentConfiguration).getCacheDirectory(with(Constants.TORRENTS_DIRNAME));
            will(returnValue(torrentsDir));
        }
    });
    return agentConfiguration;
}
Also used : Expectations(org.jmock.Expectations) File(java.io.File) Mockery(org.jmock.Mockery) BuildAgentConfiguration(jetbrains.buildServer.agent.BuildAgentConfiguration) TempFiles(jetbrains.buildServer.TempFiles)

Example 2 with TempFiles

use of jetbrains.buildServer.TempFiles in project teamcity-torrent-plugin by JetBrains.

the class ServerTorrentsSeederTest method setUp.

@BeforeMethod
@Override
protected void setUp() throws Exception {
    super.setUp();
    myTempFiles = new TempFiles();
}
Also used : TempFiles(jetbrains.buildServer.TempFiles) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

TempFiles (jetbrains.buildServer.TempFiles)2 File (java.io.File)1 BuildAgentConfiguration (jetbrains.buildServer.agent.BuildAgentConfiguration)1 Expectations (org.jmock.Expectations)1 Mockery (org.jmock.Mockery)1 BeforeMethod (org.testng.annotations.BeforeMethod)1