Mercurial > hg > mercurial
view mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/BaseMercurialTestCase.java @ 90:5d9c34cb543a Darjeeling-5.0.x
improving merge commits reporting
author | Pavel.Sher |
---|---|
date | Wed, 09 Dec 2009 01:28:10 +0300 |
parents | 99e757f2527b |
children | 6c1cff1f61cc |
line wrap: on
line source
package jetbrains.buildServer.buildTriggers.vcs.mercurial; import jetbrains.buildServer.MockSupport; import jetbrains.buildServer.TempFiles; import jetbrains.buildServer.vcs.impl.VcsRootImpl; import jetbrains.buildServer.vcs.patches.PatchTestCase; import org.jetbrains.annotations.NotNull; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import java.io.File; import java.io.IOException; /** * @author Pavel.Sher * Date: 31.07.2008 */ public abstract class BaseMercurialTestCase extends PatchTestCase { protected TempFiles myTempFiles; protected MockSupport myMockSupport; @Override @BeforeMethod protected void setUp() throws Exception { super.setUp(); myMockSupport = new MockSupport(); myMockSupport.setUpMocks(); myTempFiles = new TempFiles(); } @AfterMethod protected void tearDown() throws Exception { myMockSupport.tearDownMocks(); myTempFiles.cleanup(); } protected VcsRootImpl createVcsRoot(@NotNull String repPath) throws IOException { VcsRootImpl vcsRoot = new VcsRootImpl(1, Constants.VCS_NAME); vcsRoot.addProperty(Constants.HG_COMMAND_PATH_PROP, new File("mercurial-tests/testData/bin/hg.exe").getAbsolutePath()); File repository = LocalRepositoryUtil.prepareRepository(repPath); vcsRoot.addProperty(Constants.REPOSITORY_PROP, repository.getAbsolutePath()); return vcsRoot; } protected VcsRootImpl createVcsRoot(@NotNull String repPath, @NotNull String branchName) throws IOException { VcsRootImpl vcsRoot = createVcsRoot(repPath); vcsRoot.addProperty(Constants.BRANCH_NAME_PROP, branchName); return vcsRoot; } protected void cleanRepositoryAfterTest(@NotNull String repPath) { LocalRepositoryUtil.forgetRepository(repPath); } protected String simpleRepo() { return new File("mercurial-tests/testData/rep1").getAbsolutePath(); } }