Mercurial > hg > mercurial
annotate 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 |
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; |
57 | 7 import org.jetbrains.annotations.NotNull; |
34
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
8 import org.testng.annotations.AfterMethod; |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
9 import org.testng.annotations.BeforeMethod; |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
10 |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
11 import java.io.File; |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
12 import java.io.IOException; |
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 /** |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
15 * @author Pavel.Sher |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
16 * Date: 31.07.2008 |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
17 */ |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
18 public abstract class BaseMercurialTestCase extends PatchTestCase { |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
19 protected TempFiles myTempFiles; |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
20 protected MockSupport myMockSupport; |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
21 |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
22 @Override |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
23 @BeforeMethod |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
24 protected void setUp() throws Exception { |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
25 super.setUp(); |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
26 |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
27 myMockSupport = new MockSupport(); |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
28 myMockSupport.setUpMocks(); |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
29 myTempFiles = new TempFiles(); |
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 |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
32 @AfterMethod |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
33 protected void tearDown() throws Exception { |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
34 myMockSupport.tearDownMocks(); |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
35 myTempFiles.cleanup(); |
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 |
90 | 38 protected VcsRootImpl createVcsRoot(@NotNull String repPath) throws IOException { |
34
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
39 VcsRootImpl vcsRoot = new VcsRootImpl(1, Constants.VCS_NAME); |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
40 vcsRoot.addProperty(Constants.HG_COMMAND_PATH_PROP, new File("mercurial-tests/testData/bin/hg.exe").getAbsolutePath()); |
44 | 41 File repository = LocalRepositoryUtil.prepareRepository(repPath); |
34
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
42 vcsRoot.addProperty(Constants.REPOSITORY_PROP, repository.getAbsolutePath()); |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
43 return vcsRoot; |
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
44 } |
44 | 45 |
90 | 46 protected VcsRootImpl createVcsRoot(@NotNull String repPath, @NotNull String branchName) throws IOException { |
47 VcsRootImpl vcsRoot = createVcsRoot(repPath); | |
57 | 48 vcsRoot.addProperty(Constants.BRANCH_NAME_PROP, branchName); |
49 return vcsRoot; | |
50 } | |
51 | |
90 | 52 protected void cleanRepositoryAfterTest(@NotNull String repPath) { |
53 LocalRepositoryUtil.forgetRepository(repPath); | |
44 | 54 } |
55 | |
90 | 56 protected String simpleRepo() { |
57 return new File("mercurial-tests/testData/rep1").getAbsolutePath(); | |
44 | 58 } |
34
0052d368c90c
initial working version of agent side checkout + some tests
Pavel.Sher
parents:
diff
changeset
|
59 } |