comparison mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupportTest.java @ 791:249eb1d652a7

Merge branch Gaya-8.1.x
author Dmitry Neverov <dmitry.neverov@jetbrains.com>
date Thu, 01 May 2014 19:55:03 +0200
parents 06dcc79b304d 914a0b473c45
children f86c06f4ab8a
comparison
equal deleted inserted replaced
789:5cf7d1b3c476 791:249eb1d652a7
235 assertEquals(e.getMessage(), "Cannot find mercurial executable at path '" + nonExistingHgPath + "'"); 235 assertEquals(e.getMessage(), "Cannot find mercurial executable at path '" + nonExistingHgPath + "'");
236 } 236 }
237 } 237 }
238 238
239 239
240 @TestFor(issues = "TW-36251")
241 public void exception_should_contain_no_password_when_password_is_escaped() throws Exception {
242 String pwd = "pa{{word";//'{' requires escaping
243 String escapedPwd = "pa%7B%7Bword";
244 VcsRootImpl root = vcsRoot().withUrl("http://acme.com").withUserName("user").withPassword(pwd).build();
245 File nonExistingHg = myTempFiles.createTempFile();
246 delete(nonExistingHg);
247 String nonExistingHgPath = nonExistingHg.getAbsolutePath();
248 root.addProperty(Constants.HG_COMMAND_PATH_PROP, nonExistingHgPath);
249 try {
250 myVcs.getTestConnectionSupport().testConnection(root);
251 fail("Exception expected");
252 } catch (VcsException e) {
253 String msg = e.getCause().getMessage();
254 assertFalse(msg.contains(pwd));
255 assertFalse(msg.contains(escapedPwd));
256 }
257 }
258
259
240 public void test_tag() throws IOException, VcsException { 260 public void test_tag() throws IOException, VcsException {
241 VcsRootImpl vcsRoot = createVcsRoot(simpleRepo()); 261 VcsRootImpl vcsRoot = createVcsRoot(simpleRepo());
242 262
243 String actualTag = myVcs.label("new:tag", "1:1d446e82d356", vcsRoot, new CheckoutRules("")); 263 String actualTag = myVcs.label("new:tag", "1:1d446e82d356", vcsRoot, new CheckoutRules(""));
244 assertEquals(actualTag, "new_tag"); 264 assertEquals(actualTag, "new_tag");