Search in sources :

Example 6 with TeamCityProperties

use of jetbrains.buildServer.serverSide.TeamCityProperties in project teamcity-git by JetBrains.

the class MapFullPathTest method setUp.

@BeforeMethod
public void setUp() throws IOException {
    new TeamCityProperties() {

        {
            setModel(new BasePropertiesModel() {
            });
        }
    };
    myTempFiles = new TempFiles();
    myContext = new Mockery() {

        {
            setImposteriser(ClassImposteriser.INSTANCE);
        }
    };
    myRemoteRepositoryDir = myTempFiles.createTempDir();
    copyRepository(dataFile("repo_for_fetch.1"), myRemoteRepositoryDir);
    myRemoteRepositoryDir2 = myTempFiles.createTempDir();
    copyRepository(dataFile("repo.git"), myRemoteRepositoryDir2);
    ServerPaths paths = new ServerPaths(myTempFiles.createTempDir().getAbsolutePath());
    GitSupportBuilder gitBuilder = gitSupport().withServerPaths(paths);
    myGit = gitBuilder.build();
    myMapFullPath = gitBuilder.getMapFullPath();
    myRoot = vcsRoot().withId(1).withFetchUrl(myRemoteRepositoryDir.getAbsolutePath()).build();
    myRootEntry = new VcsRootEntry(myRoot, CheckoutRules.DEFAULT);
    myRoot2 = vcsRoot().withId(2).withFetchUrl(myRemoteRepositoryDir2.getAbsolutePath()).build();
    myRootEntry2 = new VcsRootEntry(myRoot2, CheckoutRules.DEFAULT);
}
Also used : BasePropertiesModel(jetbrains.buildServer.serverSide.BasePropertiesModel) VcsRootEntry(jetbrains.buildServer.vcs.VcsRootEntry) Mockery(org.jmock.Mockery) ServerPaths(jetbrains.buildServer.serverSide.ServerPaths) TeamCityProperties(jetbrains.buildServer.serverSide.TeamCityProperties) TempFiles(jetbrains.buildServer.TempFiles)

Example 7 with TeamCityProperties

use of jetbrains.buildServer.serverSide.TeamCityProperties in project teamcity-git by JetBrains.

the class GitResetCacheHandlerTest method setUp.

@BeforeMethod
public void setUp() throws IOException {
    new TeamCityProperties() {

        {
            setModel(new BasePropertiesModel() {
            });
        }
    };
    myContext = new Mockery() {

        {
            setImposteriser(ClassImposteriser.INSTANCE);
        }
    };
    myTempFiles = new TempFiles();
    myCachesDir = myTempFiles.createTempDir();
    myRepositoryManager = myContext.mock(RepositoryManager.class);
    myCacheHandler = new GitResetCacheHandler(myRepositoryManager, new GcErrors());
}
Also used : GcErrors(jetbrains.buildServer.buildTriggers.vcs.git.GcErrors) BasePropertiesModel(jetbrains.buildServer.serverSide.BasePropertiesModel) RepositoryManager(jetbrains.buildServer.buildTriggers.vcs.git.RepositoryManager) GitResetCacheHandler(jetbrains.buildServer.buildTriggers.vcs.git.GitResetCacheHandler) Mockery(org.jmock.Mockery) TeamCityProperties(jetbrains.buildServer.serverSide.TeamCityProperties) TempFiles(jetbrains.buildServer.TempFiles) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 8 with TeamCityProperties

use of jetbrains.buildServer.serverSide.TeamCityProperties in project teamcity-git by JetBrains.

the class GitPatchTest method setUp.

@BeforeMethod
public void setUp() throws Exception {
    super.setUp();
    new TeamCityProperties() {

        {
            setModel(new BasePropertiesModel() {
            });
        }
    };
    Mockery context = new Mockery();
    ServerPaths serverPaths = new ServerPaths(myTempFiles.createTempDir().getAbsolutePath());
    myConfigBuilder = new PluginConfigBuilder(serverPaths);
    File repoGitDir = dataFile("repo.git");
    File tmpDir = myTempFiles.createTempDir();
    myMainRepositoryDir = new File(tmpDir, "repo.git");
    copyRepository(repoGitDir, myMainRepositoryDir);
    copyRepository(dataFile("submodule.git"), new File(tmpDir, "submodule"));
    copyRepository(dataFile("submodule.git"), new File(tmpDir, "submodule.git"));
    copyRepository(dataFile("sub-submodule.git"), new File(tmpDir, "sub-submodule.git"));
    myResetCacheManager = context.mock(ResetCacheRegister.class);
    context.checking(new Expectations() {

        {
            allowing(myResetCacheManager).registerHandler(with(any(ResetCacheHandler.class)));
        }
    });
    myPropertiesBeforeTest = GitTestUtil.copyCurrentProperties();
}
Also used : Expectations(org.jmock.Expectations) BasePropertiesModel(jetbrains.buildServer.serverSide.BasePropertiesModel) ResetCacheRegister(jetbrains.buildServer.util.cache.ResetCacheRegister) Mockery(org.jmock.Mockery) ServerPaths(jetbrains.buildServer.serverSide.ServerPaths) GitTestUtil.dataFile(jetbrains.buildServer.buildTriggers.vcs.git.tests.GitTestUtil.dataFile) File(java.io.File) ResetCacheHandler(jetbrains.buildServer.util.cache.ResetCacheHandler) TeamCityProperties(jetbrains.buildServer.serverSide.TeamCityProperties) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 9 with TeamCityProperties

use of jetbrains.buildServer.serverSide.TeamCityProperties in project teamcity-git by JetBrains.

the class SSLInvestigatorTest method setUp.

@BeforeMethod
public void setUp() throws Exception {
    myHomeDirectory = myTempFiles.createTempDir();
    myTempDirectory = myTempFiles.createTempDir();
    new TeamCityProperties() {

        {
            setModel(new BasePropertiesModel() {
            });
        }
    };
    myMockery = new Mockery() {

        {
            setImposteriser(ClassImposteriser.INSTANCE);
        }
    };
    myLoggingFactory = new LoggingGitMetaFactory();
}
Also used : BasePropertiesModel(jetbrains.buildServer.serverSide.BasePropertiesModel) Mockery(org.jmock.Mockery) TeamCityProperties(jetbrains.buildServer.serverSide.TeamCityProperties)

Example 10 with TeamCityProperties

use of jetbrains.buildServer.serverSide.TeamCityProperties in project teamcity-git by JetBrains.

the class RepositoryManagerTest method setUp.

@BeforeMethod
public void setUp() throws Exception {
    new TeamCityProperties() {

        {
            setModel(new BasePropertiesModel() {
            });
        }
    };
    myTempFiles = new TempFiles();
    ServerPaths paths = new ServerPaths(myTempFiles.createTempDir().getAbsolutePath());
    myPluginConfig = new PluginConfigBuilder(paths);
}
Also used : BasePropertiesModel(jetbrains.buildServer.serverSide.BasePropertiesModel) ServerPaths(jetbrains.buildServer.serverSide.ServerPaths) TeamCityProperties(jetbrains.buildServer.serverSide.TeamCityProperties) TempFiles(jetbrains.buildServer.TempFiles) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

BasePropertiesModel (jetbrains.buildServer.serverSide.BasePropertiesModel)10 TeamCityProperties (jetbrains.buildServer.serverSide.TeamCityProperties)10 BeforeMethod (org.testng.annotations.BeforeMethod)7 TempFiles (jetbrains.buildServer.TempFiles)6 Mockery (org.jmock.Mockery)6 File (java.io.File)5 ServerPaths (jetbrains.buildServer.serverSide.ServerPaths)5 Expectations (org.jmock.Expectations)3 GitTestUtil.dataFile (jetbrains.buildServer.buildTriggers.vcs.git.tests.GitTestUtil.dataFile)2 ResetCacheHandler (jetbrains.buildServer.util.cache.ResetCacheHandler)2 ResetCacheRegister (jetbrains.buildServer.util.cache.ResetCacheRegister)2 FileReader (java.io.FileReader)1 IOException (java.io.IOException)1 AgentRunningBuild (jetbrains.buildServer.agent.AgentRunningBuild)1 BuildAgentConfiguration (jetbrains.buildServer.agent.BuildAgentConfiguration)1 GcErrors (jetbrains.buildServer.buildTriggers.vcs.git.GcErrors)1 GitResetCacheHandler (jetbrains.buildServer.buildTriggers.vcs.git.GitResetCacheHandler)1 RepositoryManager (jetbrains.buildServer.buildTriggers.vcs.git.RepositoryManager)1 AgentMirrorConfig (jetbrains.buildServer.buildTriggers.vcs.git.agent.AgentMirrorConfig)1 RemoteRepositoryUrlInvestigatorImpl (jetbrains.buildServer.buildTriggers.vcs.git.agent.RemoteRepositoryUrlInvestigatorImpl)1