annotate mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/BaseMercurialTestCase.java @ 34:0052d368c90c

initial working version of agent side checkout + some tests
author Pavel.Sher
date Thu, 31 Jul 2008 00:36:47 +0400
parents
children 1490e2981799
rev   line source
34
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
1 package jetbrains.buildServer.buildTriggers.vcs.mercurial;
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
2
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
3 import jetbrains.buildServer.MockSupport;
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
4 import jetbrains.buildServer.TempFiles;
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
5 import jetbrains.buildServer.vcs.impl.VcsRootImpl;
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
6 import jetbrains.buildServer.vcs.patches.PatchTestCase;
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
7 import org.testng.annotations.AfterMethod;
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
8 import org.testng.annotations.BeforeMethod;
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
9
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
10 import java.io.File;
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
11 import java.io.IOException;
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
12
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
13 /**
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
14 * @author Pavel.Sher
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
15 * Date: 31.07.2008
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
16 */
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
17 public abstract class BaseMercurialTestCase extends PatchTestCase {
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
18 protected TempFiles myTempFiles;
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
19 protected MockSupport myMockSupport;
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
20
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
21 @Override
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
22 @BeforeMethod
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
23 protected void setUp() throws Exception {
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
24 super.setUp();
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
25
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
26 myMockSupport = new MockSupport();
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
27 myMockSupport.setUpMocks();
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
28 myTempFiles = new TempFiles();
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
29 }
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
30
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
31 @AfterMethod
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
32 protected void tearDown() throws Exception {
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
33 myMockSupport.tearDownMocks();
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
34 myTempFiles.cleanup();
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
35 }
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
36
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
37 protected VcsRootImpl createVcsRoot() throws IOException {
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
38 VcsRootImpl vcsRoot = new VcsRootImpl(1, Constants.VCS_NAME);
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
39 vcsRoot.addProperty(Constants.HG_COMMAND_PATH_PROP, new File("mercurial-tests/testData/bin/hg.exe").getAbsolutePath());
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
40 File repository = LocalRepositoryUtil.prepareRepository(new File("mercurial-tests/testData/rep1").getAbsolutePath());
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
41 vcsRoot.addProperty(Constants.REPOSITORY_PROP, repository.getAbsolutePath());
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
42 return vcsRoot;
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
43 }
0052d368c90c initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff changeset
44 }