Mercurial > hg > mercurial
comparison mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/AgentSideCheckoutTest.java @ 443:d0f80762461a
Test refactoring: get rid of LocalRepositoryUtil
author | Dmitry Neverov <dmitry.neverov@gmail.com> |
---|---|
date | Tue, 19 Jun 2012 15:17:11 +0400 |
parents | 45f25ca68312 |
children | b47cfe5cbaba |
comparison
equal
deleted
inserted
replaced
441:2d3caaaa3e6b | 443:d0f80762461a |
---|---|
17 | 17 |
18 import jetbrains.buildServer.agent.AgentRunningBuild; | 18 import jetbrains.buildServer.agent.AgentRunningBuild; |
19 import jetbrains.buildServer.agent.BuildAgentConfiguration; | 19 import jetbrains.buildServer.agent.BuildAgentConfiguration; |
20 import jetbrains.buildServer.agent.BuildProgressLogger; | 20 import jetbrains.buildServer.agent.BuildProgressLogger; |
21 import jetbrains.buildServer.util.FileUtil; | 21 import jetbrains.buildServer.util.FileUtil; |
22 import jetbrains.buildServer.util.TestFor; | |
22 import jetbrains.buildServer.vcs.CheckoutRules; | 23 import jetbrains.buildServer.vcs.CheckoutRules; |
23 import jetbrains.buildServer.vcs.IncludeRule; | 24 import jetbrains.buildServer.vcs.IncludeRule; |
24 import jetbrains.buildServer.vcs.VcsException; | 25 import jetbrains.buildServer.vcs.VcsException; |
25 import jetbrains.buildServer.vcs.VcsRoot; | 26 import jetbrains.buildServer.vcs.VcsRoot; |
26 import jetbrains.buildServer.vcs.impl.VcsRootImpl; | 27 import jetbrains.buildServer.vcs.impl.VcsRootImpl; |
35 import java.util.HashMap; | 36 import java.util.HashMap; |
36 import java.util.List; | 37 import java.util.List; |
37 import java.util.Map; | 38 import java.util.Map; |
38 import java.util.concurrent.*; | 39 import java.util.concurrent.*; |
39 | 40 |
41 import static jetbrains.buildServer.buildTriggers.vcs.mercurial.Util.copyRepository; | |
42 | |
40 /** | 43 /** |
41 * @author Pavel.Sher | 44 * @author Pavel.Sher |
42 * Date: 30.07.2008 | 45 * Date: 30.07.2008 |
43 */ | 46 */ |
44 @Test | 47 @Test |
80 | 83 |
81 } | 84 } |
82 | 85 |
83 public void should_work_when_path_to_hg_is_property() throws Exception { | 86 public void should_work_when_path_to_hg_is_property() throws Exception { |
84 VcsRootImpl root = new VcsRootBuilder() | 87 VcsRootImpl root = new VcsRootBuilder() |
85 .withUrl(LocalRepositoryUtil.prepareRepository(simpleRepo()).getAbsolutePath()) | 88 .withUrl(copyRepository(myTempFiles, simpleRepo()).getAbsolutePath()) |
86 .withHgPath(HG_PATH_REFERENCE).build(); | 89 .withHgPath(HG_PATH_REFERENCE).build(); |
87 testUpdate(root, "4:b06a290a363b", "cleanPatch1/after", new IncludeRule(".", ".", null)); | 90 testUpdate(root, "4:b06a290a363b", "cleanPatch1/after", new IncludeRule(".", ".", null)); |
88 } | 91 } |
89 | 92 |
90 | 93 |
251 File hgrc = new File(workingDir, ".hg" + File.separator + "hgrc"); | 254 File hgrc = new File(workingDir, ".hg" + File.separator + "hgrc"); |
252 String hgrcContent = FileUtil.readText(hgrc); | 255 String hgrcContent = FileUtil.readText(hgrc); |
253 assertTrue(hgrcContent.contains("default = " + root.getProperty(Constants.REPOSITORY_PROP))); | 256 assertTrue(hgrcContent.contains("default = " + root.getProperty(Constants.REPOSITORY_PROP))); |
254 } | 257 } |
255 | 258 |
256 //TW-19703 | 259 @TestFor(issues = "TW-19703") |
257 public void should_work_when_repository_is_locked() throws Exception{ | 260 public void should_work_when_repository_is_locked() throws Exception{ |
258 VcsRootImpl root = new VcsRootBuilder() | 261 VcsRootImpl root = new VcsRootBuilder() |
259 .withUrl(LocalRepositoryUtil.prepareRepository(simpleRepo()).getAbsolutePath()) | 262 .withUrl(copyRepository(myTempFiles, simpleRepo()).getAbsolutePath()) |
260 .withHgPath(HG_PATH_REFERENCE).build(); | 263 .withHgPath(HG_PATH_REFERENCE).build(); |
261 File workingDir = doUpdate(root, "4:b06a290a363b"); | 264 File workingDir = doUpdate(root, "4:b06a290a363b"); |
262 | 265 |
263 lockRepository(workingDir); | 266 lockRepository(workingDir); |
264 doUpdate(root, "6:b9deb9a1c6f4", 10); | 267 doUpdate(root, "6:b9deb9a1c6f4", 10); |