use of com.intellij.openapi.vcs.update.UpdateSession in project intellij-community by JetBrains.
the class SvnNativeClientAuthTest method updateExpectAuthCanceled.
private void updateExpectAuthCanceled(File wc1, String expectedText) {
Assert.assertTrue(wc1.isDirectory());
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(wc1);
final UpdatedFiles files = UpdatedFiles.create();
final UpdateSession session = myVcs.getUpdateEnvironment().updateDirectories(new FilePath[] { VcsUtil.getFilePath(vf) }, files, new EmptyProgressIndicator(), new Ref<>());
Assert.assertTrue(session.getExceptions() != null && !session.getExceptions().isEmpty());
Assert.assertTrue(!session.isCanceled());
Assert.assertTrue(session.getExceptions().get(0).getMessage().contains(expectedText));
if (myIsSecure) {
++myExpectedCreds;
++myExpectedCert;
}
}
use of com.intellij.openapi.vcs.update.UpdateSession in project intellij-community by JetBrains.
the class SvnNativeClientAuthTest method updateSimple.
private void updateSimple(File wc1) {
Assert.assertTrue(wc1.isDirectory());
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(wc1);
final UpdatedFiles files = UpdatedFiles.create();
final UpdateSession session = myVcs.getUpdateEnvironment().updateDirectories(new FilePath[] { VcsUtil.getFilePath(vf) }, files, new EmptyProgressIndicator(), new Ref<>());
Assert.assertTrue(session.getExceptions() == null || session.getExceptions().isEmpty());
Assert.assertTrue(!session.isCanceled());
if (myIsSecure) {
++myExpectedCreds;
++myExpectedCert;
}
}
use of com.intellij.openapi.vcs.update.UpdateSession in project intellij-community by JetBrains.
the class SvnProtocolsTest method testUpdateImpl.
// todo this test writes to repository - so it's disabled for now - while admins are preparing a server
/*
@Test
public void testUpdateAndCommit() throws Exception {
for (String url : ourTestURL) {
final File wc1 = testCheckoutImpl(url);
final File wc2 = testCheckoutImpl(url);
final File file = testCommitImpl(wc1);
System.out.println("Committed file: " + file.getPath());
testUpdateImpl(wc2, file);
}
}*/
private void testUpdateImpl(File wc1, final File created) {
Assert.assertTrue(wc1.isDirectory());
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(wc1);
final UpdatedFiles files = UpdatedFiles.create();
final UpdateSession session = myVcs.getUpdateEnvironment().updateDirectories(new FilePath[] { VcsUtil.getFilePath(vf) }, files, new EmptyProgressIndicator(), new Ref<>());
Assert.assertTrue(session.getExceptions() == null || session.getExceptions().isEmpty());
Assert.assertTrue(!session.isCanceled());
Assert.assertTrue(!files.getGroupById(FileGroup.CREATED_ID).getFiles().isEmpty());
final String path = files.getGroupById(FileGroup.CREATED_ID).getFiles().iterator().next();
final String name = path.substring(path.lastIndexOf(File.separator) + 1);
Assert.assertEquals(created.getName(), name);
}
Aggregations