mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
svn: Replace deprecated "junit.framework.Assert" usages
This commit is contained in:
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.idea.svn;
|
||||
|
||||
import com.intellij.openapi.diff.impl.patch.*;
|
||||
@@ -25,7 +11,6 @@ import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileVisitor;
|
||||
import com.intellij.util.TimeoutUtil;
|
||||
import junit.framework.Assert;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.idea.svn.info.Info;
|
||||
import org.jetbrains.idea.svn.status.StatusType;
|
||||
@@ -36,6 +21,8 @@ import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class ConflictCreator {
|
||||
private final Project myProject;
|
||||
private final VirtualFile myTheirsDir;
|
||||
@@ -76,7 +63,7 @@ public class ConflictCreator {
|
||||
PatchApplier<BinaryFilePatch> applier = new PatchApplier<>(myProject, myTheirsDir, filePatchList, (LocalChangeList)null, null);
|
||||
applier.setIgnoreContentRootsCheck();
|
||||
applier.execute();
|
||||
Assert.assertEquals(0, applier.getRemainingPatches().size());
|
||||
assertEquals(0, applier.getRemainingPatches().size());
|
||||
}
|
||||
|
||||
TimeoutUtil.sleep(10);
|
||||
|
||||
@@ -1,26 +1,13 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.idea.svn;
|
||||
|
||||
import com.intellij.openapi.util.Version;
|
||||
import com.intellij.openapi.vcs.VcsException;
|
||||
import junit.framework.Assert;
|
||||
import org.jetbrains.idea.svn.api.CmdVersionClient;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* @author Konstantin Kolosovsky.
|
||||
*/
|
||||
@@ -28,12 +15,12 @@ public class ParseVersionTest {
|
||||
|
||||
@Test
|
||||
public void testSvnOutput() throws Exception {
|
||||
Assert.assertEquals(new Version(1, 8, 0), CmdVersionClient.parseVersion("1.8.0"));
|
||||
assertEquals(new Version(1, 8, 0), CmdVersionClient.parseVersion("1.8.0"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSlikSvnOutput() throws Exception {
|
||||
Assert.assertEquals(new Version(1, 7, 8), CmdVersionClient.parseVersion("1.7.8-SlikSvn-1.7.8-WIN32"));
|
||||
assertEquals(new Version(1, 7, 8), CmdVersionClient.parseVersion("1.7.8-SlikSvn-1.7.8-WIN32"));
|
||||
}
|
||||
|
||||
@Test(expected = VcsException.class)
|
||||
@@ -43,11 +30,11 @@ public class ParseVersionTest {
|
||||
|
||||
@Test
|
||||
public void testMultilineFirstLineCorrect() throws Exception {
|
||||
Assert.assertEquals(new Version(10, 2, 15), CmdVersionClient.parseVersion("10.2.15fdsjkf\n8.10.3"));
|
||||
assertEquals(new Version(10, 2, 15), CmdVersionClient.parseVersion("10.2.15fdsjkf\n8.10.3"));
|
||||
}
|
||||
|
||||
@Test(expected = VcsException.class)
|
||||
public void testMultilineSecondLineCorrect() throws Exception {
|
||||
Assert.assertEquals(new Version(8, 10, 3), CmdVersionClient.parseVersion("10.2.fdsjkf\n8.10.3"));
|
||||
assertEquals(new Version(8, 10, 3), CmdVersionClient.parseVersion("10.2.fdsjkf\n8.10.3"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
|
||||
import com.intellij.openapi.vcs.history.VcsRevisionDescription;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -21,6 +20,8 @@ import java.io.File;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class SvnAnnotationIsClosedTest extends SvnTestCase {
|
||||
private volatile boolean myIsClosed;
|
||||
private volatile boolean myIsClosed1;
|
||||
@@ -59,21 +60,21 @@ public class SvnAnnotationIsClosedTest extends SvnTestCase {
|
||||
listener.registerAnnotation(tree.myS1File, annotation);
|
||||
|
||||
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4++\n");
|
||||
Assert.assertFalse(myIsClosed); // not closed on typing
|
||||
assertFalse(myIsClosed); // not closed on typing
|
||||
|
||||
myDirtyScopeManager.markEverythingDirty();
|
||||
myChangeListManager.ensureUpToDate(false);
|
||||
final Change change = myChangeListManager.getChange(tree.myS1File);
|
||||
Assert.assertNotNull(change);
|
||||
assertNotNull(change);
|
||||
|
||||
final List<VcsException> exceptions = myVcs.getCheckinEnvironment().commit(Collections.singletonList(change), "commit");
|
||||
Assert.assertTrue(exceptions == null || exceptions.isEmpty());
|
||||
assertTrue(exceptions == null || exceptions.isEmpty());
|
||||
myDirtyScopeManager.fileDirty(tree.myS1File);
|
||||
|
||||
myChangeListManager.ensureUpToDate(false);
|
||||
myChangeListManager.ensureUpToDate(false); // wait for after-events like annotations recalculation
|
||||
sleep(100); // zipper updater
|
||||
Assert.assertTrue(myIsClosed);
|
||||
assertTrue(myIsClosed);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -98,7 +99,7 @@ public class SvnAnnotationIsClosedTest extends SvnTestCase {
|
||||
myChangeListManager.ensureUpToDate(false);
|
||||
|
||||
imitUpdate(myProject);
|
||||
Assert.assertTrue(myIsClosed);
|
||||
assertTrue(myIsClosed);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -122,10 +123,10 @@ public class SvnAnnotationIsClosedTest extends SvnTestCase {
|
||||
|
||||
myDirtyScopeManager.markEverythingDirty();
|
||||
myChangeListManager.ensureUpToDate(false);
|
||||
Assert.assertFalse(myIsClosed);
|
||||
assertFalse(myIsClosed);
|
||||
|
||||
imitUpdate(myProject);
|
||||
Assert.assertTrue(myIsClosed);
|
||||
assertTrue(myIsClosed);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -149,7 +150,7 @@ public class SvnAnnotationIsClosedTest extends SvnTestCase {
|
||||
|
||||
myDirtyScopeManager.markEverythingDirty();
|
||||
myChangeListManager.ensureUpToDate(false);
|
||||
Assert.assertFalse(myIsClosed);
|
||||
assertFalse(myIsClosed);
|
||||
|
||||
update();
|
||||
myWorkingCopyDir.refresh(false, true);
|
||||
@@ -158,7 +159,7 @@ public class SvnAnnotationIsClosedTest extends SvnTestCase {
|
||||
myChangeListManager.ensureUpToDate(false);
|
||||
myChangeListManager.ensureUpToDate(false); // wait for after-events like annotations recalculation
|
||||
sleep(100); // zipper updater
|
||||
Assert.assertTrue(myIsClosed);
|
||||
assertTrue(myIsClosed);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -179,14 +180,14 @@ public class SvnAnnotationIsClosedTest extends SvnTestCase {
|
||||
listener.registerAnnotation(tree.myS1File, annotation);
|
||||
|
||||
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4++\n");
|
||||
Assert.assertFalse(myIsClosed); // not closed on typing
|
||||
assertFalse(myIsClosed); // not closed on typing
|
||||
VcsTestUtil.renameFileInCommand(myProject, tree.myS1File, "5364536");
|
||||
Assert.assertFalse(myIsClosed); // not closed on typing
|
||||
assertFalse(myIsClosed); // not closed on typing
|
||||
|
||||
myDirtyScopeManager.markEverythingDirty();
|
||||
myChangeListManager.ensureUpToDate(false);
|
||||
final Change change = myChangeListManager.getChange(tree.myS1File);
|
||||
Assert.assertNotNull(change);
|
||||
assertNotNull(change);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -207,12 +208,12 @@ public class SvnAnnotationIsClosedTest extends SvnTestCase {
|
||||
});
|
||||
listener.registerAnnotation(tree.myS1File, annotation);
|
||||
|
||||
Assert.assertFalse(myIsClosed); // not closed on typing
|
||||
assertFalse(myIsClosed); // not closed on typing
|
||||
|
||||
myDirtyScopeManager.markEverythingDirty();
|
||||
myChangeListManager.ensureUpToDate(false);
|
||||
final Change change = myChangeListManager.getChange(tree.myS1File);
|
||||
Assert.assertNotNull(change);
|
||||
assertNotNull(change);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -235,7 +236,7 @@ public class SvnAnnotationIsClosedTest extends SvnTestCase {
|
||||
|
||||
myDirtyScopeManager.markEverythingDirty();
|
||||
myChangeListManager.ensureUpToDate(false);
|
||||
Assert.assertFalse(myIsClosed);
|
||||
assertFalse(myIsClosed);
|
||||
|
||||
checkin();
|
||||
myWorkingCopyDir.refresh(false, true);
|
||||
@@ -244,7 +245,7 @@ public class SvnAnnotationIsClosedTest extends SvnTestCase {
|
||||
myChangeListManager.ensureUpToDate(false);
|
||||
myChangeListManager.ensureUpToDate(false); // wait for after-events like annotations recalculation
|
||||
sleep(100); // zipper updater
|
||||
Assert.assertTrue(myIsClosed);
|
||||
assertTrue(myIsClosed);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -258,8 +259,8 @@ public class SvnAnnotationIsClosedTest extends SvnTestCase {
|
||||
final VirtualFile vf1 = lfs.refreshAndFindFileByIoFile(sourceFile);
|
||||
final VirtualFile vf2 = lfs.refreshAndFindFileByIoFile(externalFile);
|
||||
|
||||
Assert.assertNotNull(vf1);
|
||||
Assert.assertNotNull(vf2);
|
||||
assertNotNull(vf1);
|
||||
assertNotNull(vf2);
|
||||
|
||||
VcsTestUtil.editFileInCommand(myProject, vf1, "test externals 123" + System.currentTimeMillis());
|
||||
VcsTestUtil.editFileInCommand(myProject, vf2, "test externals 123" + System.currentTimeMillis());
|
||||
@@ -269,8 +270,8 @@ public class SvnAnnotationIsClosedTest extends SvnTestCase {
|
||||
|
||||
final Change change1 = myChangeListManager.getChange(vf1);
|
||||
final Change change2 = myChangeListManager.getChange(vf2);
|
||||
Assert.assertNotNull(change1);
|
||||
Assert.assertNotNull(change2);
|
||||
assertNotNull(change1);
|
||||
assertNotNull(change2);
|
||||
|
||||
final File sourceDir = new File(myWorkingCopyDir.getPath(), "source");
|
||||
final File externalDir = new File(myWorkingCopyDir.getPath(), "source/external");
|
||||
@@ -318,13 +319,13 @@ public class SvnAnnotationIsClosedTest extends SvnTestCase {
|
||||
assertRevision(vf1, diffProvider, 3);
|
||||
assertRevision(vf2, diffProvider, 5);
|
||||
|
||||
Assert.assertTrue(myIsClosed1);
|
||||
Assert.assertFalse(myIsClosed); // in source is not closed..
|
||||
assertTrue(myIsClosed1);
|
||||
assertFalse(myIsClosed); // in source is not closed..
|
||||
}
|
||||
|
||||
private void assertRevision(VirtualFile vf1, SvnDiffProvider diffProvider, final long number) {
|
||||
final VcsRevisionDescription vf1Rev = diffProvider.getCurrentRevisionDescription(vf1);
|
||||
Assert.assertEquals(number, ((SvnRevisionNumber) vf1Rev.getRevisionNumber()).getLongRevisionNumber());
|
||||
assertEquals(number, ((SvnRevisionNumber)vf1Rev.getRevisionNumber()).getLongRevisionNumber());
|
||||
}
|
||||
|
||||
// test is not closed by ext/int update to not-last-committed-rev (rev that changes another file) +
|
||||
|
||||
@@ -4,7 +4,6 @@ package org.jetbrains.idea.svn;
|
||||
import com.intellij.openapi.vcs.VcsException;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.util.TimeoutUtil;
|
||||
import junit.framework.Assert;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.idea.svn.api.Target;
|
||||
import org.jetbrains.idea.svn.auth.AuthenticationService;
|
||||
@@ -13,6 +12,8 @@ import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
// TODO: Rather strange test - probably it should be removed
|
||||
public class SvnCommandLineStabilityTest extends SvnTestCase {
|
||||
|
||||
@@ -27,7 +28,7 @@ public class SvnCommandLineStabilityTest extends SvnTestCase {
|
||||
private void call() throws VcsException {
|
||||
String result = runInfo().getOutput();
|
||||
System.out.println(result);
|
||||
Assert.assertNotNull(result);
|
||||
assertNotNull(result);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.vcsUtil.VcsUtil;
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -22,6 +21,8 @@ import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class SvnCommitTest extends SvnTestCase {
|
||||
private SvnVcs myVcs;
|
||||
private VcsDirtyScopeManager myDirtyScopeManager;
|
||||
@@ -129,12 +130,12 @@ public class SvnCommitTest extends SvnTestCase {
|
||||
final File file1 = new File(myWorkingCopyDir.getPath(), "source/s1.txt");
|
||||
final File fileInner = new File(myWorkingCopyDir.getPath(), "source/inner1/inner2/inner/t11.txt");
|
||||
|
||||
Assert.assertTrue(file1.exists());
|
||||
Assert.assertTrue(fileInner.exists());
|
||||
assertTrue(file1.exists());
|
||||
assertTrue(fileInner.exists());
|
||||
final VirtualFile vf1 = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(file1);
|
||||
final VirtualFile vf2 = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(fileInner);
|
||||
Assert.assertNotNull(vf1);
|
||||
Assert.assertNotNull(vf2);
|
||||
assertNotNull(vf1);
|
||||
assertNotNull(vf2);
|
||||
|
||||
editFileInCommand(vf1, "2317468732ghdwwe7y348rf");
|
||||
editFileInCommand(vf2, "2317468732ghdwwe7y348rf csdjcjksw");
|
||||
@@ -144,7 +145,7 @@ public class SvnCommitTest extends SvnTestCase {
|
||||
|
||||
final HashSet<String> strings = checkinFiles(vf1, vf2);
|
||||
System.out.println("" + StringUtil.join(strings, "\n"));
|
||||
Assert.assertEquals(1, strings.size());
|
||||
assertEquals(1, strings.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -155,12 +156,12 @@ public class SvnCommitTest extends SvnTestCase {
|
||||
final File file1 = new File(myWorkingCopyDir.getPath(), "source/s1.txt");
|
||||
final File fileInner = new File(myWorkingCopyDir.getPath(), "source/inner1/inner2/inner/t11.txt");
|
||||
|
||||
Assert.assertTrue(file1.exists());
|
||||
Assert.assertTrue(fileInner.exists());
|
||||
assertTrue(file1.exists());
|
||||
assertTrue(fileInner.exists());
|
||||
final VirtualFile vf1 = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(file1);
|
||||
final VirtualFile vf2 = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(fileInner);
|
||||
Assert.assertNotNull(vf1);
|
||||
Assert.assertNotNull(vf2);
|
||||
assertNotNull(vf1);
|
||||
assertNotNull(vf2);
|
||||
|
||||
editFileInCommand(vf1, "2317468732ghdwwe7y348rf");
|
||||
editFileInCommand(vf2, "2317468732ghdwwe7y348rf csdjcjksw");
|
||||
@@ -179,12 +180,12 @@ public class SvnCommitTest extends SvnTestCase {
|
||||
final File file1 = new File(myWorkingCopyDir.getPath(), "source/s1.txt");
|
||||
final File fileInner = new File(myWorkingCopyDir.getPath(), "source/external/t11.txt");
|
||||
|
||||
Assert.assertTrue(file1.exists());
|
||||
Assert.assertTrue(fileInner.exists());
|
||||
assertTrue(file1.exists());
|
||||
assertTrue(fileInner.exists());
|
||||
final VirtualFile vf1 = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(file1);
|
||||
final VirtualFile vf2 = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(fileInner);
|
||||
Assert.assertNotNull(vf1);
|
||||
Assert.assertNotNull(vf2);
|
||||
assertNotNull(vf1);
|
||||
assertNotNull(vf2);
|
||||
|
||||
editFileInCommand(vf1, "2317468732ghdwwe7y348rf");
|
||||
editFileInCommand(vf2, "2317468732ghdwwe7y348rf csdjcjksw");
|
||||
@@ -199,17 +200,17 @@ public class SvnCommitTest extends SvnTestCase {
|
||||
final List<Change> changes = new ArrayList<>();
|
||||
for (FilePath file : files) {
|
||||
final Change change = myChangeListManager.getChange(file);
|
||||
Assert.assertNotNull(change);
|
||||
assertNotNull(change);
|
||||
changes.add(change);
|
||||
}
|
||||
final List<VcsException> exceptions = myVcs.getCheckinEnvironment().commit(changes, "test comment list");
|
||||
Assert.assertTrue(exceptions == null || exceptions.isEmpty());
|
||||
assertTrue(exceptions == null || exceptions.isEmpty());
|
||||
myDirtyScopeManager.markEverythingDirty();
|
||||
myChangeListManager.ensureUpToDate(false);
|
||||
|
||||
for (FilePath file : files) {
|
||||
final Change changeA = myChangeListManager.getChange(file);
|
||||
Assert.assertNull(changeA);
|
||||
assertNull(changeA);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,7 +218,7 @@ public class SvnCommitTest extends SvnTestCase {
|
||||
final List<Change> changes = new ArrayList<>();
|
||||
for (VirtualFile file : files) {
|
||||
final Change change = myChangeListManager.getChange(file);
|
||||
Assert.assertNotNull(change);
|
||||
assertNotNull(change);
|
||||
changes.add(change);
|
||||
}
|
||||
final HashSet<String> feedback = new HashSet<>();
|
||||
@@ -225,26 +226,26 @@ public class SvnCommitTest extends SvnTestCase {
|
||||
if (exceptions !=null && ! exceptions.isEmpty()) {
|
||||
exceptions.get(0).printStackTrace();
|
||||
}
|
||||
Assert.assertTrue(exceptions == null || exceptions.isEmpty());
|
||||
assertTrue(exceptions == null || exceptions.isEmpty());
|
||||
myDirtyScopeManager.markEverythingDirty();
|
||||
myChangeListManager.ensureUpToDate(false);
|
||||
|
||||
for (VirtualFile file : files) {
|
||||
final Change changeA = myChangeListManager.getChange(file);
|
||||
Assert.assertNull(changeA);
|
||||
assertNull(changeA);
|
||||
}
|
||||
return feedback;
|
||||
}
|
||||
|
||||
protected void checkinFile(VirtualFile file, FileStatus status) {
|
||||
final Change change = myChangeListManager.getChange(file);
|
||||
Assert.assertNotNull(change);
|
||||
Assert.assertEquals(status, change.getFileStatus());
|
||||
assertNotNull(change);
|
||||
assertEquals(status, change.getFileStatus());
|
||||
final List<VcsException> exceptions = myVcs.getCheckinEnvironment().commit(Collections.singletonList(change), "test comment");
|
||||
Assert.assertTrue(exceptions == null || exceptions.isEmpty());
|
||||
assertTrue(exceptions == null || exceptions.isEmpty());
|
||||
myDirtyScopeManager.markEverythingDirty();
|
||||
myChangeListManager.ensureUpToDate(false);
|
||||
final Change changeA = myChangeListManager.getChange(file);
|
||||
Assert.assertNull(changeA);
|
||||
assertNull(changeA);
|
||||
}
|
||||
}
|
||||
|
||||
+15
-13
@@ -10,11 +10,13 @@ import com.intellij.openapi.vcs.changes.LocalChangeList;
|
||||
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.testFramework.vcs.DuringChangeListManagerUpdateTestScheme;
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
public class SvnConcurrentChangeListManagerTest extends SvnTestCase {
|
||||
private DuringChangeListManagerUpdateTestScheme myScheme;
|
||||
private String myDefaulListName;
|
||||
@@ -64,11 +66,11 @@ public class SvnConcurrentChangeListManagerTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
final Runnable check = () -> {
|
||||
Assert.assertEquals(FileStatus.SWITCHED, changeListManager.getStatus(tree.myS1File));
|
||||
Assert.assertEquals(FileStatus.NOT_CHANGED, changeListManager.getStatus(tree.myS2File));
|
||||
Assert.assertEquals(FileStatus.NOT_CHANGED, changeListManager.getStatus(tree.mySourceDir));
|
||||
Assert.assertEquals(FileStatus.SWITCHED, changeListManager.getStatus(tree.myTargetDir));
|
||||
Assert.assertEquals(FileStatus.SWITCHED, changeListManager.getStatus(tree.myTargetFiles.get(1)));
|
||||
assertEquals(FileStatus.SWITCHED, changeListManager.getStatus(tree.myS1File));
|
||||
assertEquals(FileStatus.NOT_CHANGED, changeListManager.getStatus(tree.myS2File));
|
||||
assertEquals(FileStatus.NOT_CHANGED, changeListManager.getStatus(tree.mySourceDir));
|
||||
assertEquals(FileStatus.SWITCHED, changeListManager.getStatus(tree.myTargetDir));
|
||||
assertEquals(FileStatus.SWITCHED, changeListManager.getStatus(tree.myTargetFiles.get(1)));
|
||||
};
|
||||
// do before refresh check
|
||||
check.run();
|
||||
@@ -82,11 +84,11 @@ public class SvnConcurrentChangeListManagerTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
final Runnable check2 = () -> {
|
||||
Assert.assertEquals(FileStatus.MODIFIED, changeListManager.getStatus(tree.myS1File));
|
||||
Assert.assertEquals(FileStatus.NOT_CHANGED, changeListManager.getStatus(tree.myS2File));
|
||||
Assert.assertEquals(FileStatus.NOT_CHANGED, changeListManager.getStatus(tree.mySourceDir));
|
||||
Assert.assertEquals(FileStatus.SWITCHED, changeListManager.getStatus(tree.myTargetDir));
|
||||
Assert.assertEquals(FileStatus.SWITCHED, changeListManager.getStatus(tree.myTargetFiles.get(1)));
|
||||
assertEquals(FileStatus.MODIFIED, changeListManager.getStatus(tree.myS1File));
|
||||
assertEquals(FileStatus.NOT_CHANGED, changeListManager.getStatus(tree.myS2File));
|
||||
assertEquals(FileStatus.NOT_CHANGED, changeListManager.getStatus(tree.mySourceDir));
|
||||
assertEquals(FileStatus.SWITCHED, changeListManager.getStatus(tree.myTargetDir));
|
||||
assertEquals(FileStatus.SWITCHED, changeListManager.getStatus(tree.myTargetFiles.get(1)));
|
||||
};
|
||||
myScheme.doTest(check2);
|
||||
|
||||
@@ -327,9 +329,9 @@ public class SvnConcurrentChangeListManagerTest extends SvnTestCase {
|
||||
|
||||
private void checkFilesAreInList(final VirtualFile[] files, final String listName, final ChangeListManager manager) {
|
||||
System.out.println("Checking files for list: " + listName);
|
||||
Assert.assertNotNull(manager.findChangeList(listName));
|
||||
assertNotNull(manager.findChangeList(listName));
|
||||
final Collection<Change> changes = manager.findChangeList(listName).getChanges();
|
||||
Assert.assertEquals(changes.size(), files.length);
|
||||
assertEquals(changes.size(), files.length);
|
||||
|
||||
for (Change change : changes) {
|
||||
final VirtualFile vf = change.getAfterRevision().getFile().getVirtualFile();
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import junit.framework.Assert;
|
||||
import org.jetbrains.idea.svn.api.Url;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -21,6 +20,7 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static org.jetbrains.idea.svn.SvnUtil.parseUrl;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class SvnExternalTest extends SvnTestCase {
|
||||
private ChangeListManagerImpl clManager;
|
||||
@@ -56,7 +56,7 @@ public class SvnExternalTest extends SvnTestCase {
|
||||
private void externalCopyIsDetectedImpl() {
|
||||
final SvnFileUrlMapping workingCopies = myVcs.getSvnFileUrlMapping();
|
||||
final List<RootUrlInfo> infos = workingCopies.getAllWcInfos();
|
||||
Assert.assertEquals(2, infos.size());
|
||||
assertEquals(2, infos.size());
|
||||
Set<Url> expectedUrls = new HashSet<>();
|
||||
if (myAnotherRepoUrl != null) {
|
||||
expectedUrls.add(parseUrl(myAnotherRepoUrl + "/root/target", false));
|
||||
@@ -68,7 +68,7 @@ public class SvnExternalTest extends SvnTestCase {
|
||||
for (RootUrlInfo info : infos) {
|
||||
expectedUrls.remove(info.getUrl());
|
||||
}
|
||||
Assert.assertTrue(expectedUrls.isEmpty());
|
||||
assertTrue(expectedUrls.isEmpty());
|
||||
}
|
||||
|
||||
protected void prepareInnerCopy() throws Exception {
|
||||
@@ -81,7 +81,7 @@ public class SvnExternalTest extends SvnTestCase {
|
||||
|
||||
final SvnFileUrlMapping workingCopies = myVcs.getSvnFileUrlMapping();
|
||||
final List<RootUrlInfo> infos = workingCopies.getAllWcInfos();
|
||||
Assert.assertEquals(2, infos.size());
|
||||
assertEquals(2, infos.size());
|
||||
Set<Url> expectedUrls = new HashSet<>();
|
||||
expectedUrls.add(myExternalURL);
|
||||
expectedUrls.add(myMainUrl);
|
||||
@@ -91,8 +91,8 @@ public class SvnExternalTest extends SvnTestCase {
|
||||
expectedUrls.remove(info.getUrl());
|
||||
sawInner |= NestedCopyType.inner.equals(info.getType());
|
||||
}
|
||||
Assert.assertTrue(expectedUrls.isEmpty());
|
||||
Assert.assertTrue(sawInner);
|
||||
assertTrue(expectedUrls.isEmpty());
|
||||
assertTrue(sawInner);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -115,8 +115,8 @@ public class SvnExternalTest extends SvnTestCase {
|
||||
final VirtualFile vf1 = lfs.refreshAndFindFileByIoFile(sourceFile);
|
||||
final VirtualFile vf2 = lfs.refreshAndFindFileByIoFile(externalFile);
|
||||
|
||||
Assert.assertNotNull(vf1);
|
||||
Assert.assertNotNull(vf2);
|
||||
assertNotNull(vf1);
|
||||
assertNotNull(vf2);
|
||||
|
||||
VcsTestUtil.editFileInCommand(myProject, vf1, "test externals 123" + System.currentTimeMillis());
|
||||
VcsTestUtil.editFileInCommand(myProject, vf2, "test externals 123" + System.currentTimeMillis());
|
||||
@@ -127,14 +127,14 @@ public class SvnExternalTest extends SvnTestCase {
|
||||
final Change change1 = clManager.getChange(vf1);
|
||||
final Change change2 = clManager.getChange(vf2);
|
||||
|
||||
Assert.assertNotNull(change1);
|
||||
Assert.assertNotNull(change2);
|
||||
assertNotNull(change1);
|
||||
assertNotNull(change2);
|
||||
|
||||
Assert.assertNotNull(change1.getBeforeRevision());
|
||||
Assert.assertNotNull(change2.getBeforeRevision());
|
||||
assertNotNull(change1.getBeforeRevision());
|
||||
assertNotNull(change2.getBeforeRevision());
|
||||
|
||||
Assert.assertNotNull(change1.getAfterRevision());
|
||||
Assert.assertNotNull(change2.getAfterRevision());
|
||||
assertNotNull(change1.getAfterRevision());
|
||||
assertNotNull(change2.getAfterRevision());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -156,7 +156,7 @@ public class SvnExternalTest extends SvnTestCase {
|
||||
|
||||
final File externalFile = new File(sourceDir, "external/t11.txt");
|
||||
final VirtualFile externalVf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(externalFile);
|
||||
Assert.assertNotNull(externalVf);
|
||||
assertNotNull(externalVf);
|
||||
}
|
||||
|
||||
private void setNewDirectoryMappings(final File sourceDir) {
|
||||
@@ -180,15 +180,15 @@ public class SvnExternalTest extends SvnTestCase {
|
||||
final File sourceDir = new File(myWorkingCopyDir.getPath(), "source");
|
||||
final File externalFile = new File(sourceDir, "external/t11.txt");
|
||||
final VirtualFile externalVf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(externalFile);
|
||||
Assert.assertNotNull(externalVf);
|
||||
assertNotNull(externalVf);
|
||||
editFileInCommand(externalVf, "some new content");
|
||||
|
||||
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
|
||||
clManager.ensureUpToDate(false);
|
||||
|
||||
final Change change = clManager.getChange(externalVf);
|
||||
Assert.assertNotNull(change);
|
||||
Assert.assertEquals(FileStatus.MODIFIED, change.getFileStatus());
|
||||
assertNotNull(change);
|
||||
assertEquals(FileStatus.MODIFIED, change.getFileStatus());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -14,12 +14,14 @@ import com.intellij.openapi.vcs.history.VcsFileRevision;
|
||||
import com.intellij.openapi.vcs.history.VcsHistoryProvider;
|
||||
import com.intellij.util.concurrency.Semaphore;
|
||||
import com.intellij.vcsUtil.VcsUtil;
|
||||
import junit.framework.Assert;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class SvnHistoryTest extends SvnTestCase {
|
||||
|
||||
@Test
|
||||
@@ -37,7 +39,7 @@ public class SvnHistoryTest extends SvnTestCase {
|
||||
|
||||
FilePath rootPath = VcsContextFactory.SERVICE.getInstance().createFilePathOnNonLocal(myRepoUrl, true);
|
||||
int count = reportHistory(provider, rootPath, true);
|
||||
Assert.assertTrue(count > 0);
|
||||
assertTrue(count > 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -55,7 +57,7 @@ public class SvnHistoryTest extends SvnTestCase {
|
||||
|
||||
FilePath rootPath = VcsContextFactory.SERVICE.getInstance().createFilePathOnNonLocal(myRepoUrl + "/root/source/s1.txt", true);
|
||||
int count = reportHistory(provider, rootPath);
|
||||
Assert.assertEquals(11, count);
|
||||
assertEquals(11, count);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -72,7 +74,7 @@ public class SvnHistoryTest extends SvnTestCase {
|
||||
}
|
||||
|
||||
int count = reportHistory(provider, VcsUtil.getFilePath(tree.myS1File));
|
||||
Assert.assertEquals(11, count);
|
||||
assertEquals(11, count);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -93,7 +95,7 @@ public class SvnHistoryTest extends SvnTestCase {
|
||||
ChangeListManager.getInstance(myProject).ensureUpToDate(false);
|
||||
|
||||
int count = reportHistory(provider, VcsUtil.getFilePath(tree.myS1File));
|
||||
Assert.assertEquals(11, count);
|
||||
assertEquals(11, count);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -115,13 +117,13 @@ public class SvnHistoryTest extends SvnTestCase {
|
||||
ChangeListManager.getInstance(myProject).ensureUpToDate(false);
|
||||
|
||||
int count = reportHistory(provider, VcsUtil.getFilePath(tree.myS1File));
|
||||
Assert.assertEquals(11, count);
|
||||
assertEquals(11, count);
|
||||
|
||||
count = reportHistory(provider, VcsUtil.getFilePath(tree.myTargetDir));
|
||||
Assert.assertEquals(1, count);
|
||||
assertEquals(1, count);
|
||||
|
||||
count = reportHistory(provider, VcsUtil.getFilePath(tree.myTargetFiles.get(0)));
|
||||
Assert.assertEquals(1, count);
|
||||
assertEquals(1, count);
|
||||
}
|
||||
|
||||
private static int reportHistory(@NotNull VcsHistoryProvider provider, @NotNull FilePath path) throws VcsException {
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.intellij.openapi.vcs.update.UpdatedFiles;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.vcsUtil.VcsUtil;
|
||||
import junit.framework.Assert;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.idea.svn.api.Depth;
|
||||
import org.jetbrains.idea.svn.api.Revision;
|
||||
@@ -28,6 +27,8 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.idea.svn.SvnUtil.parseUrl;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class SvnNativeClientAuthTest extends SvnTestCase {
|
||||
private SvnVcs myVcs;
|
||||
@@ -475,18 +476,18 @@ public class SvnNativeClientAuthTest extends SvnTestCase {
|
||||
}
|
||||
|
||||
private File testCommitImpl(File wc1) throws IOException {
|
||||
Assert.assertTrue(wc1.isDirectory());
|
||||
assertTrue(wc1.isDirectory());
|
||||
final File file = FileUtil.createTempFile(wc1, "file", ".txt");
|
||||
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(file);
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final ArrayList<VirtualFile> files = new ArrayList<>();
|
||||
files.add(vf);
|
||||
final List<VcsException> exceptions = myVcs.getCheckinEnvironment().scheduleUnversionedFilesForAddition(files);
|
||||
Assert.assertTrue(exceptions.isEmpty());
|
||||
assertTrue(exceptions.isEmpty());
|
||||
|
||||
final Change change = new Change(null, new CurrentContentRevision(VcsUtil.getFilePath(vf)));
|
||||
final List<VcsException> commit = myVcs.getCheckinEnvironment().commit(Collections.singletonList(change), "commit");
|
||||
Assert.assertTrue(commit.isEmpty());
|
||||
assertTrue(commit.isEmpty());
|
||||
++ myExpectedCreds;
|
||||
++ myExpectedCert;
|
||||
return file;
|
||||
@@ -495,7 +496,7 @@ public class SvnNativeClientAuthTest extends SvnTestCase {
|
||||
private File testCheckoutImpl(@NotNull Url url) throws IOException {
|
||||
final File root = FileUtil.createTempDirectory("checkoutRoot", "");
|
||||
root.deleteOnExit();
|
||||
Assert.assertTrue(root.exists());
|
||||
assertTrue(root.exists());
|
||||
SvnCheckoutProvider
|
||||
.checkout(myProject, root, url, Revision.HEAD, Depth.INFINITY, false, new CheckoutProvider.Listener() {
|
||||
@Override
|
||||
@@ -512,7 +513,7 @@ public class SvnNativeClientAuthTest extends SvnTestCase {
|
||||
++ cnt[0];
|
||||
return ! (cnt[0] > 1);
|
||||
});
|
||||
Assert.assertTrue(cnt[0] > 1);
|
||||
assertTrue(cnt[0] > 1);
|
||||
myIsSecure = "https".equals(url.getProtocol());
|
||||
if (myIsSecure) {
|
||||
++ myExpectedCreds;
|
||||
@@ -524,15 +525,15 @@ public class SvnNativeClientAuthTest extends SvnTestCase {
|
||||
}
|
||||
|
||||
private void updateExpectAuthCanceled(File wc1, String expectedText) {
|
||||
Assert.assertTrue(wc1.isDirectory());
|
||||
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));
|
||||
assertTrue(session.getExceptions() != null && !session.getExceptions().isEmpty());
|
||||
assertTrue(!session.isCanceled());
|
||||
assertTrue(session.getExceptions().get(0).getMessage().contains(expectedText));
|
||||
|
||||
if (myIsSecure) {
|
||||
++ myExpectedCreds;
|
||||
@@ -541,14 +542,14 @@ public class SvnNativeClientAuthTest extends SvnTestCase {
|
||||
}
|
||||
|
||||
private void updateSimple(File wc1) {
|
||||
Assert.assertTrue(wc1.isDirectory());
|
||||
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());
|
||||
assertTrue(session.getExceptions() == null || session.getExceptions().isEmpty());
|
||||
assertTrue(!session.isCanceled());
|
||||
if (myIsSecure) {
|
||||
++ myExpectedCreds;
|
||||
++ myExpectedCert;
|
||||
|
||||
+18
-18
@@ -10,7 +10,6 @@ import com.intellij.testFramework.PlatformTestUtil;
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import com.intellij.testFramework.vcs.AbstractJunitVcsTestCase;
|
||||
import com.intellij.util.containers.MultiMap;
|
||||
import junit.framework.Assert;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.idea.svn.api.Depth;
|
||||
import org.jetbrains.idea.svn.api.NodeKind;
|
||||
@@ -38,6 +37,7 @@ import static com.intellij.util.io.PathKt.inputStream;
|
||||
import static com.intellij.util.io.PathKt.readText;
|
||||
import static org.jetbrains.idea.svn.SvnTestCase.getPluginHome;
|
||||
import static org.jetbrains.idea.svn.SvnUtil.createUrl;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
@TestDataPath("$CONTENT_ROOT/../testData/parse/")
|
||||
public class SvnParseCommandLineParseTest extends AbstractJunitVcsTestCase {
|
||||
@@ -57,7 +57,7 @@ public class SvnParseCommandLineParseTest extends AbstractJunitVcsTestCase {
|
||||
SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
|
||||
parser.parse(inputStream(getTestData()), handler);
|
||||
|
||||
Assert.assertNotNull(info[0]);
|
||||
assertNotNull(info[0]);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -84,12 +84,12 @@ public class SvnParseCommandLineParseTest extends AbstractJunitVcsTestCase {
|
||||
}
|
||||
if (isWindows) {
|
||||
final int idx = o.getPath().indexOf(":");
|
||||
Assert.assertTrue(idx > 0);
|
||||
assertTrue(idx > 0);
|
||||
final int secondIdx = o.getPath().indexOf(":", idx + 1);
|
||||
Assert.assertTrue(o.getPath(), secondIdx == -1);
|
||||
assertTrue(o.getPath(), secondIdx == -1);
|
||||
} else {
|
||||
if (o.getPath().contains(LINUX_ROOT)) {
|
||||
Assert.assertFalse(o.getPath().contains(basePath));
|
||||
assertFalse(o.getPath().contains(basePath));
|
||||
}
|
||||
}
|
||||
try {
|
||||
@@ -128,11 +128,11 @@ public class SvnParseCommandLineParseTest extends AbstractJunitVcsTestCase {
|
||||
if (new File(
|
||||
"C:\\TestProjects\\sortedProjects\\Subversion\\local2\\sep12main\\main\\slave\\src\\com\\slave\\MacMessagesParser.java")
|
||||
.equals(status1.getFile())) {
|
||||
Assert.assertEquals("http://external/src/com/slave/MacMessagesParser.java", status1.getURL().toString());
|
||||
assertEquals("http://external/src/com/slave/MacMessagesParser.java", status1.getURL().toString());
|
||||
}
|
||||
if (new File("C:\\TestProjects\\sortedProjects\\Subversion\\local2\\sep12main\\main\\slave\\src\\com\\slave\\SomeOtherClass.java")
|
||||
.equals(status1.getFile())) {
|
||||
Assert.assertEquals("http://external/src/com/slave/SomeOtherClass.java", status1.getURL().toString());
|
||||
assertEquals("http://external/src/com/slave/SomeOtherClass.java", status1.getURL().toString());
|
||||
}
|
||||
}, baseFile, createStubInfo(basePath, "http://mainurl/"), () -> handler.get().getPending());
|
||||
handler.set(new SvnStatusHandler(callback, baseFile, o -> {
|
||||
@@ -177,12 +177,12 @@ public class SvnParseCommandLineParseTest extends AbstractJunitVcsTestCase {
|
||||
}
|
||||
if (isWindows) {
|
||||
final int idx = o.getPath().indexOf(":");
|
||||
Assert.assertTrue(idx > 0);
|
||||
assertTrue(idx > 0);
|
||||
final int secondIdx = o.getPath().indexOf(":", idx + 1);
|
||||
Assert.assertTrue(o.getPath(), secondIdx == -1);
|
||||
assertTrue(o.getPath(), secondIdx == -1);
|
||||
} else {
|
||||
if (o.getPath().contains(LINUX_ROOT)) {
|
||||
Assert.assertFalse(o.getPath().contains(basePath));
|
||||
assertFalse(o.getPath().contains(basePath));
|
||||
}
|
||||
}
|
||||
try {
|
||||
@@ -204,7 +204,7 @@ public class SvnParseCommandLineParseTest extends AbstractJunitVcsTestCase {
|
||||
}
|
||||
int cntMatched = 0;
|
||||
for (PortableStatus status : statuses) {
|
||||
Assert.assertTrue(status.isSwitched());
|
||||
assertTrue(status.isSwitched());
|
||||
final String path = FileUtil.toSystemDependentName(status.getPath());
|
||||
for (String s1 : expected) {
|
||||
if (s1.equals(path)) {
|
||||
@@ -213,7 +213,7 @@ public class SvnParseCommandLineParseTest extends AbstractJunitVcsTestCase {
|
||||
}
|
||||
}
|
||||
}
|
||||
Assert.assertEquals(2, cntMatched);
|
||||
assertEquals(2, cntMatched);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -246,12 +246,12 @@ public class SvnParseCommandLineParseTest extends AbstractJunitVcsTestCase {
|
||||
}
|
||||
if (isWindows) {
|
||||
final int idx = o.getPath().indexOf(":");
|
||||
Assert.assertTrue(idx > 0);
|
||||
assertTrue(idx > 0);
|
||||
final int secondIdx = o.getPath().indexOf(":", idx + 1);
|
||||
Assert.assertTrue(o.getPath(), secondIdx == -1);
|
||||
assertTrue(o.getPath(), secondIdx == -1);
|
||||
} else {
|
||||
if (o.getPath().contains(LINUX_ROOT)) {
|
||||
Assert.assertFalse(o.getPath().contains(basePath));
|
||||
assertFalse(o.getPath().contains(basePath));
|
||||
}
|
||||
}
|
||||
try {
|
||||
@@ -267,9 +267,9 @@ public class SvnParseCommandLineParseTest extends AbstractJunitVcsTestCase {
|
||||
SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
|
||||
parser.parse(new ByteArrayInputStream(osChecked.getBytes(CharsetToolkit.UTF8_CHARSET)), handler);
|
||||
|
||||
Assert.assertEquals(1, statuses.size());
|
||||
assertEquals(1, statuses.size());
|
||||
final PortableStatus next = statuses.iterator().next();
|
||||
Assert.assertEquals("a.txt", next.getPath());
|
||||
Assert.assertEquals("target", next.getChangelistName());
|
||||
assertEquals("a.txt", next.getPath());
|
||||
assertEquals("target", next.getChangelistName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.intellij.openapi.vcs.update.UpdatedFiles;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.vcsUtil.VcsUtil;
|
||||
import junit.framework.Assert;
|
||||
import org.jetbrains.idea.svn.api.Depth;
|
||||
import org.jetbrains.idea.svn.api.Revision;
|
||||
import org.jetbrains.idea.svn.api.Target;
|
||||
@@ -41,6 +40,7 @@ import java.util.List;
|
||||
|
||||
import static com.intellij.util.containers.ContainerUtil.newArrayList;
|
||||
import static org.jetbrains.idea.svn.SvnUtil.parseUrl;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class SvnProtocolsTest extends SvnTestCase {
|
||||
// todo correct URL
|
||||
@@ -96,7 +96,7 @@ public class SvnProtocolsTest extends SvnTestCase {
|
||||
List<DirectoryEntry> list = newArrayList();
|
||||
myVcs.getFactoryFromSettings().createBrowseClient().list(Target.on(url), null, null, list::add);
|
||||
|
||||
Assert.assertTrue(!list.isEmpty());
|
||||
assertTrue(!list.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -133,7 +133,7 @@ public class SvnProtocolsTest extends SvnTestCase {
|
||||
//ok
|
||||
}
|
||||
final List<VcsFileRevision> list = partner.getSession().getRevisionList();
|
||||
Assert.assertTrue(! list.isEmpty());
|
||||
assertTrue(!list.isEmpty());
|
||||
}
|
||||
|
||||
// todo this test writes to repository - so it's disabled for now - while admins are preparing a server
|
||||
@@ -151,40 +151,40 @@ public class SvnProtocolsTest extends SvnTestCase {
|
||||
}*/
|
||||
|
||||
private void testUpdateImpl(File wc1, final File created) {
|
||||
Assert.assertTrue(wc1.isDirectory());
|
||||
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());
|
||||
assertTrue(session.getExceptions() == null || session.getExceptions().isEmpty());
|
||||
assertTrue(!session.isCanceled());
|
||||
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);
|
||||
assertEquals(created.getName(), name);
|
||||
}
|
||||
|
||||
private File testCommitImpl(File wc1) throws IOException {
|
||||
Assert.assertTrue(wc1.isDirectory());
|
||||
assertTrue(wc1.isDirectory());
|
||||
final File file = FileUtil.createTempFile(wc1, "file", ".txt");
|
||||
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(file);
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final ArrayList<VirtualFile> files = new ArrayList<>();
|
||||
files.add(vf);
|
||||
final List<VcsException> exceptions = myVcs.getCheckinEnvironment().scheduleUnversionedFilesForAddition(files);
|
||||
Assert.assertTrue(exceptions.isEmpty());
|
||||
assertTrue(exceptions.isEmpty());
|
||||
|
||||
final Change change = new Change(null, new CurrentContentRevision(VcsUtil.getFilePath(vf)));
|
||||
final List<VcsException> commit = myVcs.getCheckinEnvironment().commit(Collections.singletonList(change), "commit");
|
||||
Assert.assertTrue(commit.isEmpty());
|
||||
assertTrue(commit.isEmpty());
|
||||
return file;
|
||||
}
|
||||
|
||||
private File testCheckoutImpl(Url url) throws IOException {
|
||||
final File root = FileUtil.createTempDirectory("checkoutRoot", "");
|
||||
root.deleteOnExit();
|
||||
Assert.assertTrue(root.exists());
|
||||
assertTrue(root.exists());
|
||||
SvnCheckoutProvider
|
||||
.checkout(myProject, root, url, Revision.HEAD, Depth.INFINITY, false, new CheckoutProvider.Listener() {
|
||||
@Override
|
||||
@@ -201,7 +201,7 @@ public class SvnProtocolsTest extends SvnTestCase {
|
||||
++ cnt[0];
|
||||
return ! (cnt[0] > 1);
|
||||
});
|
||||
Assert.assertTrue(cnt[0] > 1);
|
||||
assertTrue(cnt[0] > 1);
|
||||
return root;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.SmartList;
|
||||
import junit.framework.Assert;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.idea.svn.api.Target;
|
||||
import org.jetbrains.idea.svn.api.Url;
|
||||
@@ -39,6 +38,7 @@ import static org.jetbrains.idea.svn.SvnPropertyKeys.MERGE_INFO;
|
||||
import static org.jetbrains.idea.svn.SvnUtil.createUrl;
|
||||
import static org.jetbrains.idea.svn.SvnUtil.parseUrl;
|
||||
import static org.jetbrains.idea.svn.api.Revision.WORKING;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class SvnQuickMergeTest extends SvnTestCase {
|
||||
private SvnVcs myVcs;
|
||||
@@ -60,9 +60,9 @@ public class SvnQuickMergeTest extends SvnTestCase {
|
||||
myBranchRoot = new File(myTempDirFixture.getTempDirPath(), "b1");
|
||||
|
||||
runInAndVerifyIgnoreOutput("co", myBranchUrl, myBranchRoot.getPath());
|
||||
Assert.assertTrue(myBranchRoot.exists());
|
||||
assertTrue(myBranchRoot.exists());
|
||||
myBranchVf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(myBranchRoot);
|
||||
Assert.assertNotNull(myBranchVf);
|
||||
assertNotNull(myBranchVf);
|
||||
|
||||
myBranchTree = new SubTree(myBranchVf);
|
||||
myTree = new SubTree(myWorkingCopyDir);
|
||||
@@ -92,12 +92,12 @@ public class SvnQuickMergeTest extends SvnTestCase {
|
||||
|
||||
// should have changed svn:mergeinfo on wc root and s1 file
|
||||
final Change fileChange = myChangeListManager.getChange(myTree.myS1File);
|
||||
Assert.assertNotNull(fileChange);
|
||||
Assert.assertEquals(FileStatus.MODIFIED, fileChange.getFileStatus());
|
||||
assertNotNull(fileChange);
|
||||
assertEquals(FileStatus.MODIFIED, fileChange.getFileStatus());
|
||||
|
||||
final Change dirChange = myChangeListManager.getChange(myWorkingCopyDir);
|
||||
Assert.assertNotNull(dirChange);
|
||||
Assert.assertEquals(FileStatus.MODIFIED, dirChange.getFileStatus());
|
||||
assertNotNull(dirChange);
|
||||
assertEquals(FileStatus.MODIFIED, dirChange.getFileStatus());
|
||||
}
|
||||
|
||||
// if we create branches like this:
|
||||
@@ -117,7 +117,7 @@ public class SvnQuickMergeTest extends SvnTestCase {
|
||||
@Test
|
||||
public void testSelectRevisionsWithQuickSelectCheckForLocalChanges() throws Exception {
|
||||
Info info = myVcs.getInfo(virtualToIoFile(myBranchTree.myS1File), WORKING);
|
||||
Assert.assertNotNull(info);
|
||||
assertNotNull(info);
|
||||
|
||||
final long numberBefore = info.getRevision().getNumber();
|
||||
final int totalChanges = 3;
|
||||
@@ -150,17 +150,17 @@ public class SvnQuickMergeTest extends SvnTestCase {
|
||||
|
||||
// should have changed svn:mergeinfo on wc root and s1 file
|
||||
final Change fileChange = myChangeListManager.getChange(myTree.myS1File);
|
||||
Assert.assertNotNull(fileChange);
|
||||
Assert.assertEquals(FileStatus.MODIFIED, fileChange.getFileStatus());
|
||||
assertNotNull(fileChange);
|
||||
assertEquals(FileStatus.MODIFIED, fileChange.getFileStatus());
|
||||
|
||||
final Change dirChange = myChangeListManager.getChange(myWorkingCopyDir);
|
||||
Assert.assertNotNull(dirChange);
|
||||
Assert.assertEquals(FileStatus.MODIFIED, dirChange.getFileStatus());
|
||||
assertNotNull(dirChange);
|
||||
assertEquals(FileStatus.MODIFIED, dirChange.getFileStatus());
|
||||
|
||||
File file = virtualToIoFile(myWorkingCopyDir);
|
||||
PropertyValue value = myVcs.getFactory(file).createPropertyClient().getProperty(Target.on(file), MERGE_INFO, false, WORKING);
|
||||
System.out.println(value.toString());
|
||||
Assert.assertEquals("/branches/b1:" + (numberBefore + 1), value.toString());
|
||||
assertEquals("/branches/b1:" + (numberBefore + 1), value.toString());
|
||||
}
|
||||
|
||||
// this test is mainly to check revisions selection. at the moment we are not sure whether we support
|
||||
@@ -168,7 +168,7 @@ public class SvnQuickMergeTest extends SvnTestCase {
|
||||
@Test
|
||||
public void testSelectRevisionsWithQuickSelect() throws Exception {
|
||||
Info info = myVcs.getInfo(virtualToIoFile(myBranchTree.myS1File), WORKING);
|
||||
Assert.assertNotNull(info);
|
||||
assertNotNull(info);
|
||||
|
||||
final long numberBefore = info.getRevision().getNumber();
|
||||
final int totalChanges = 3;
|
||||
@@ -183,7 +183,7 @@ public class SvnQuickMergeTest extends SvnTestCase {
|
||||
|
||||
// before copy
|
||||
Info info2 = myVcs.getInfo(virtualToIoFile(myBranchTree.myS1File), WORKING);
|
||||
Assert.assertNotNull(info2);
|
||||
assertNotNull(info2);
|
||||
final long numberBeforeCopy = info2.getRevision().getNumber();
|
||||
|
||||
runInAndVerifyIgnoreOutput("copy", "-q", "-m", "copy1", myBranchUrl, myRepoUrl + "/branches/b2");
|
||||
@@ -216,23 +216,23 @@ public class SvnQuickMergeTest extends SvnTestCase {
|
||||
|
||||
// should have changed svn:mergeinfo on wc root and s1 file
|
||||
final Change fileChange = myChangeListManager.getChange(myTree.myS2File);
|
||||
Assert.assertNotNull(fileChange);
|
||||
Assert.assertEquals(FileStatus.MODIFIED, fileChange.getFileStatus());
|
||||
assertNotNull(fileChange);
|
||||
assertEquals(FileStatus.MODIFIED, fileChange.getFileStatus());
|
||||
|
||||
final Change dirChange = myChangeListManager.getChange(myWorkingCopyDir);
|
||||
Assert.assertNotNull(dirChange);
|
||||
Assert.assertEquals(FileStatus.MODIFIED, dirChange.getFileStatus());
|
||||
assertNotNull(dirChange);
|
||||
assertEquals(FileStatus.MODIFIED, dirChange.getFileStatus());
|
||||
|
||||
File file = virtualToIoFile(myWorkingCopyDir);
|
||||
PropertyValue value = myVcs.getFactory(file).createPropertyClient().getProperty(Target.on(file), MERGE_INFO, false, WORKING);
|
||||
System.out.println(value.toString());
|
||||
Assert.assertEquals("/branches/b2:" + (numberBeforeCopy + 2), value.toString());
|
||||
assertEquals("/branches/b2:" + (numberBeforeCopy + 2), value.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSelectRevisions() throws Exception {
|
||||
Info info = myVcs.getInfo(virtualToIoFile(myBranchTree.myS1File), WORKING);
|
||||
Assert.assertNotNull(info);
|
||||
assertNotNull(info);
|
||||
|
||||
final long numberBefore = info.getRevision().getNumber();
|
||||
final int totalChanges = 10;
|
||||
@@ -256,17 +256,17 @@ public class SvnQuickMergeTest extends SvnTestCase {
|
||||
|
||||
// should have changed svn:mergeinfo on wc root and s1 file
|
||||
final Change fileChange = myChangeListManager.getChange(myTree.myS1File);
|
||||
Assert.assertNotNull(fileChange);
|
||||
Assert.assertEquals(FileStatus.MODIFIED, fileChange.getFileStatus());
|
||||
assertNotNull(fileChange);
|
||||
assertEquals(FileStatus.MODIFIED, fileChange.getFileStatus());
|
||||
|
||||
final Change dirChange = myChangeListManager.getChange(myWorkingCopyDir);
|
||||
Assert.assertNotNull(dirChange);
|
||||
Assert.assertEquals(FileStatus.MODIFIED, dirChange.getFileStatus());
|
||||
assertNotNull(dirChange);
|
||||
assertEquals(FileStatus.MODIFIED, dirChange.getFileStatus());
|
||||
|
||||
File file = virtualToIoFile(myWorkingCopyDir);
|
||||
PropertyValue value = myVcs.getFactory(file).createPropertyClient().getProperty(Target.on(file), MERGE_INFO, false, WORKING);
|
||||
System.out.println(value.toString());
|
||||
Assert.assertEquals("/branches/b1:" + (numberBefore + 1) + "-" + (numberBefore + 2), value.toString());
|
||||
assertEquals("/branches/b1:" + (numberBefore + 1) + "-" + (numberBefore + 2), value.toString());
|
||||
}
|
||||
|
||||
private WCInfo getWcInfo() {
|
||||
@@ -279,7 +279,7 @@ public class SvnQuickMergeTest extends SvnTestCase {
|
||||
break;
|
||||
}
|
||||
}
|
||||
Assert.assertNotNull(found);
|
||||
assertNotNull(found);
|
||||
return found;
|
||||
}
|
||||
|
||||
@@ -304,12 +304,12 @@ public class SvnQuickMergeTest extends SvnTestCase {
|
||||
|
||||
// should have changed svn:mergeinfo on wc root and s1 file
|
||||
final Change fileChange = myChangeListManager.getChange(myTree.myS1File);
|
||||
Assert.assertNotNull(fileChange);
|
||||
Assert.assertEquals(FileStatus.MODIFIED, fileChange.getFileStatus());
|
||||
assertNotNull(fileChange);
|
||||
assertEquals(FileStatus.MODIFIED, fileChange.getFileStatus());
|
||||
|
||||
final Change dirChange = myChangeListManager.getChange(myWorkingCopyDir);
|
||||
Assert.assertNotNull(dirChange);
|
||||
Assert.assertEquals(FileStatus.MODIFIED, dirChange.getFileStatus());
|
||||
assertNotNull(dirChange);
|
||||
assertEquals(FileStatus.MODIFIED, dirChange.getFileStatus());
|
||||
}
|
||||
|
||||
private void waitQuickMerge(@NotNull String sourceUrl, @NotNull QuickMergeTestInteraction interaction) throws Exception {
|
||||
|
||||
+37
-27
@@ -14,7 +14,6 @@ import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.vcsUtil.VcsUtil;
|
||||
import junit.framework.Assert;
|
||||
import org.jetbrains.idea.svn.info.Info;
|
||||
import org.jetbrains.idea.svn.status.Status;
|
||||
import org.jetbrains.idea.svn.status.StatusType;
|
||||
@@ -31,6 +30,7 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import static com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Irina.Chernushina
|
||||
@@ -117,8 +117,8 @@ public class SvnResolveTreeAcceptVariantsTest extends SvnTestCase {
|
||||
final File conflictIoFile = new File(myWorkingCopyDir.getPath(), conflictFile);
|
||||
final FilePath filePath = VcsUtil.getFilePath(conflictIoFile);
|
||||
final Change change = myChangeListManager.getChange(filePath);
|
||||
Assert.assertNotNull(change);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertNotNull(change);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
final SvnRevisionNumber committedRevision =
|
||||
change.getBeforeRevision() != null ? (SvnRevisionNumber)change.getBeforeRevision().getRevisionNumber() : null;
|
||||
//SvnRevisionNumber committedRevision = new SvnRevisionNumber(Revision.of(cnt * 2 + 1));
|
||||
@@ -140,16 +140,16 @@ public class SvnResolveTreeAcceptVariantsTest extends SvnTestCase {
|
||||
for (TreeConflictData.FileData leftFile : leftFiles) {
|
||||
if (! leftFile.myIsDir && ! StringUtil.isEmpty(leftFile.myContents)) {
|
||||
final File ioFile = new File(myWorkingCopyDir.getPath(), leftFile.myRelativePath);
|
||||
Assert.assertTrue(ioFile.exists());
|
||||
assertTrue(ioFile.exists());
|
||||
final String text = FileUtil.loadFile(ioFile);
|
||||
Assert.assertEquals(leftFile.myContents, text);
|
||||
assertEquals(leftFile.myContents, text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void checkStatusesAfterMineFullResolve(TreeConflictData.Data data, File conflictIoFile) {
|
||||
Status conflStatus = SvnUtil.getStatus(myVcs, conflictIoFile);
|
||||
Assert.assertTrue(createTestFailedComment(data, conflictIoFile.getPath()) + " tree conflict resolved",
|
||||
assertTrue(createTestFailedComment(data, conflictIoFile.getPath()) + " tree conflict resolved",
|
||||
conflStatus.getTreeConflict() == null);
|
||||
Collection<TreeConflictData.FileData> leftFiles = data.getLeftFiles();
|
||||
for (TreeConflictData.FileData file : leftFiles) {
|
||||
@@ -158,36 +158,46 @@ public class SvnResolveTreeAcceptVariantsTest extends SvnTestCase {
|
||||
boolean theirsExists = new File(myTheirs.getPath(), file.myRelativePath).exists();
|
||||
|
||||
if (StatusType.STATUS_UNVERSIONED.equals(file.myNodeStatus)) {
|
||||
Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (file exists)", exFile.exists());
|
||||
assertTrue(createTestFailedComment(data, exFile.getPath()) + " (file exists)", exFile.exists());
|
||||
if (theirsExists) {
|
||||
// should be deleted
|
||||
Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (unversioned)", status == null || StatusType.STATUS_DELETED.equals(status.getNodeStatus()));
|
||||
assertTrue(createTestFailedComment(data, exFile.getPath()) + " (unversioned)",
|
||||
status == null || StatusType.STATUS_DELETED.equals(status.getNodeStatus()));
|
||||
} else {
|
||||
// unversioned
|
||||
Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (unversioned)", status == null || StatusType.STATUS_UNVERSIONED.equals(status.getNodeStatus()));
|
||||
assertTrue(createTestFailedComment(data, exFile.getPath()) + " (unversioned)",
|
||||
status == null || StatusType.STATUS_UNVERSIONED.equals(status.getNodeStatus()));
|
||||
}
|
||||
} else if (StatusType.STATUS_DELETED.equals(file.myNodeStatus)) {
|
||||
Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (deleted status)", status != null && file.myNodeStatus.equals(status.getNodeStatus()));
|
||||
assertTrue(createTestFailedComment(data, exFile.getPath()) + " (deleted status)",
|
||||
status != null && file.myNodeStatus.equals(status.getNodeStatus()));
|
||||
} else if (StatusType.STATUS_ADDED.equals(file.myNodeStatus)) {
|
||||
Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (file exists)", exFile.exists());
|
||||
assertTrue(createTestFailedComment(data, exFile.getPath()) + " (file exists)", exFile.exists());
|
||||
if (theirsExists) {
|
||||
Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (added status)", status != null && StatusType.STATUS_REPLACED.equals(status.getNodeStatus()));
|
||||
assertTrue(createTestFailedComment(data, exFile.getPath()) + " (added status)",
|
||||
status != null && StatusType.STATUS_REPLACED.equals(status.getNodeStatus()));
|
||||
} else {
|
||||
Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (added status)", status != null && StatusType.STATUS_ADDED.equals(status.getNodeStatus()));
|
||||
assertTrue(createTestFailedComment(data, exFile.getPath()) + " (added status)",
|
||||
status != null && StatusType.STATUS_ADDED.equals(status.getNodeStatus()));
|
||||
}
|
||||
} else {
|
||||
if (StatusType.STATUS_ADDED.equals(status.getNodeStatus())) {
|
||||
// in theirs -> deleted
|
||||
Assert.assertFalse(createTestFailedComment(data, file.myRelativePath) + " check deleted in theirs", theirsExists);
|
||||
assertFalse(createTestFailedComment(data, file.myRelativePath) + " check deleted in theirs", theirsExists);
|
||||
} else {
|
||||
if (theirsExists) {
|
||||
Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (normal node status)", status != null && StatusType.STATUS_REPLACED.equals(status.getNodeStatus()));
|
||||
assertTrue(createTestFailedComment(data, exFile.getPath()) + " (normal node status)",
|
||||
status != null && StatusType.STATUS_REPLACED.equals(status.getNodeStatus()));
|
||||
} else {
|
||||
Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (normal node status)", status != null &&
|
||||
(StatusType.STATUS_NORMAL.equals(status.getNodeStatus()) || StatusType.STATUS_MODIFIED.equals(status.getNodeStatus())));
|
||||
assertTrue(createTestFailedComment(data, exFile.getPath()) + " (normal node status)", status != null &&
|
||||
(StatusType.STATUS_NORMAL
|
||||
.equals(status.getNodeStatus()) ||
|
||||
StatusType.STATUS_MODIFIED
|
||||
.equals(status.getNodeStatus())));
|
||||
}
|
||||
}
|
||||
Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (modified text status)", status != null && file.myContentsStatus.equals(status.getContentsStatus()));
|
||||
assertTrue(createTestFailedComment(data, exFile.getPath()) + " (modified text status)",
|
||||
status != null && file.myContentsStatus.equals(status.getContentsStatus()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -227,8 +237,8 @@ public class SvnResolveTreeAcceptVariantsTest extends SvnTestCase {
|
||||
final File conflictIoFile = new File(myWorkingCopyDir.getPath(), conflictFile);
|
||||
final FilePath filePath = VcsUtil.getFilePath(conflictIoFile);
|
||||
final Change change = myChangeListManager.getChange(filePath);
|
||||
Assert.assertNotNull(change);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertNotNull(change);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
final SvnRevisionNumber committedRevision =
|
||||
change.getBeforeRevision() != null ? (SvnRevisionNumber)change.getBeforeRevision().getRevisionNumber() : null;
|
||||
FilePath beforePath = null;
|
||||
@@ -251,24 +261,24 @@ public class SvnResolveTreeAcceptVariantsTest extends SvnTestCase {
|
||||
if (excluded != null && Arrays.asList(excluded).contains(relative)) {
|
||||
return true;
|
||||
}
|
||||
Assert.assertTrue("Check failed for test: " + getTestName(data) + " and file: " + relative + " in: " + myWorkingCopyDir.getPath(),
|
||||
exists);
|
||||
assertTrue("Check failed for test: " + getTestName(data) + " and file: " + relative + " in: " + myWorkingCopyDir.getPath(),
|
||||
exists);
|
||||
}
|
||||
final File theirsFile = virtualToIoFile(file);
|
||||
Info theirsInfo = myVcs.getInfo(theirsFile);
|
||||
Info thisInfo = myVcs.getInfo(workingFile);
|
||||
if (theirsInfo != null) {
|
||||
Assert.assertEquals("Check failed for test: " + getTestName(data) + " and file: " + relative + " in: " + myWorkingCopyDir.getPath() +
|
||||
", theirs: " + theirsInfo.getRevision().getNumber() + ", mine: " + thisInfo.getRevision().getNumber(),
|
||||
theirsInfo.getRevision().getNumber(), thisInfo.getRevision().getNumber());
|
||||
assertEquals("Check failed for test: " + getTestName(data) + " and file: " + relative + " in: " + myWorkingCopyDir.getPath() +
|
||||
", theirs: " + theirsInfo.getRevision().getNumber() + ", mine: " + thisInfo.getRevision().getNumber(),
|
||||
theirsInfo.getRevision().getNumber(), thisInfo.getRevision().getNumber());
|
||||
if (! theirsFile.isDirectory()){
|
||||
try {
|
||||
final String workText = FileUtil.loadFile(workingFile);
|
||||
final String theirsText = FileUtil.loadFile(theirsFile);
|
||||
Assert.assertEquals(theirsText, workText);
|
||||
assertEquals(theirsText, workText);
|
||||
}
|
||||
catch (IOException e) {
|
||||
Assert.assertTrue(e.getMessage(), false);
|
||||
assertTrue(e.getMessage(), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
-14
@@ -11,13 +11,14 @@ import com.intellij.openapi.vcs.changes.VcsDirtyScopeVfsListener;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.TimeoutUtil;
|
||||
import com.intellij.vcsUtil.VcsUtil;
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class SvnTestDirtyScopeStateTest extends SvnTestCase {
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
@@ -48,29 +49,29 @@ public class SvnTestDirtyScopeStateTest extends SvnTestCase {
|
||||
vcsDirtyScopeManager.fileDirty(fileB);
|
||||
|
||||
final Collection<FilePath> dirty1 = vcsDirtyScopeManager.whatFilesDirty(list);
|
||||
Assert.assertTrue(dirty1.contains(VcsUtil.getFilePath(file)));
|
||||
Assert.assertTrue(dirty1.contains(VcsUtil.getFilePath(fileB)));
|
||||
assertTrue(dirty1.contains(VcsUtil.getFilePath(file)));
|
||||
assertTrue(dirty1.contains(VcsUtil.getFilePath(fileB)));
|
||||
|
||||
Assert.assertTrue(! dirty1.contains(VcsUtil.getFilePath(fileC)));
|
||||
Assert.assertTrue(! dirty1.contains(VcsUtil.getFilePath(fileD)));
|
||||
assertTrue(!dirty1.contains(VcsUtil.getFilePath(fileC)));
|
||||
assertTrue(!dirty1.contains(VcsUtil.getFilePath(fileD)));
|
||||
|
||||
vcsDirtyScopeManager.retrieveScopes();
|
||||
|
||||
final Collection<FilePath> dirty2 = vcsDirtyScopeManager.whatFilesDirty(list);
|
||||
Assert.assertTrue(dirty2.contains(VcsUtil.getFilePath(file)));
|
||||
Assert.assertTrue(dirty2.contains(VcsUtil.getFilePath(fileB)));
|
||||
assertTrue(dirty2.contains(VcsUtil.getFilePath(file)));
|
||||
assertTrue(dirty2.contains(VcsUtil.getFilePath(fileB)));
|
||||
|
||||
Assert.assertTrue(! dirty2.contains(VcsUtil.getFilePath(fileC)));
|
||||
Assert.assertTrue(! dirty2.contains(VcsUtil.getFilePath(fileD)));
|
||||
assertTrue(!dirty2.contains(VcsUtil.getFilePath(fileC)));
|
||||
assertTrue(!dirty2.contains(VcsUtil.getFilePath(fileD)));
|
||||
|
||||
vcsDirtyScopeManager.changesProcessed();
|
||||
|
||||
final Collection<FilePath> dirty3 = vcsDirtyScopeManager.whatFilesDirty(list);
|
||||
Assert.assertTrue(! dirty3.contains(VcsUtil.getFilePath(file)));
|
||||
Assert.assertTrue(! dirty3.contains(VcsUtil.getFilePath(fileB)));
|
||||
assertTrue(!dirty3.contains(VcsUtil.getFilePath(file)));
|
||||
assertTrue(!dirty3.contains(VcsUtil.getFilePath(fileB)));
|
||||
|
||||
Assert.assertTrue(! dirty3.contains(VcsUtil.getFilePath(fileC)));
|
||||
Assert.assertTrue(! dirty3.contains(VcsUtil.getFilePath(fileD)));
|
||||
assertTrue(!dirty3.contains(VcsUtil.getFilePath(fileC)));
|
||||
assertTrue(!dirty3.contains(VcsUtil.getFilePath(fileD)));
|
||||
}
|
||||
|
||||
private void waitABit() {
|
||||
@@ -115,6 +116,6 @@ public class SvnTestDirtyScopeStateTest extends SvnTestCase {
|
||||
final Collection<FilePath> dirty1 = vcsDirtyScopeManager.whatFilesDirty(list);
|
||||
if (dirty1.contains(fp) && dirty1.contains(fpB)) return;
|
||||
}
|
||||
Assert.assertTrue(false);
|
||||
assertTrue(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.vcsUtil.VcsUtil;
|
||||
import junit.framework.Assert;
|
||||
import org.jetbrains.idea.svn.conflict.ConflictAction;
|
||||
import org.jetbrains.idea.svn.conflict.ConflictOperation;
|
||||
import org.jetbrains.idea.svn.conflict.ConflictVersion;
|
||||
@@ -18,6 +17,8 @@ import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Irina.Chernushina
|
||||
* @since 2.05.2012
|
||||
@@ -51,23 +52,23 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final Change change = changeListManager.getChange(vf);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
Assert.assertNull(beforeDescription.getSourceLeftVersion());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
assertNull(beforeDescription.getSourceLeftVersion());
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isFile());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isFile());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -79,25 +80,25 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final Change change = changeListManager.getChange(vf);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.DELETE, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.DELETE, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNotNull(leftVersion);
|
||||
Assert.assertTrue(leftVersion.isFile());
|
||||
assertNotNull(leftVersion);
|
||||
assertTrue(leftVersion.isFile());
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isNone());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isNone());
|
||||
}
|
||||
|
||||
private String createConflict(final TreeConflictData.Data data) throws Exception {
|
||||
@@ -118,25 +119,25 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final Change change = changeListManager.getChange(vf);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.EDIT, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.EDIT, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNotNull(leftVersion);
|
||||
Assert.assertTrue(leftVersion.isFile());
|
||||
assertNotNull(leftVersion);
|
||||
assertTrue(leftVersion.isFile());
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isFile());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isFile());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -148,25 +149,25 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final Change change = changeListManager.getChange(vf);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.DELETE, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.DELETE, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNotNull(leftVersion);
|
||||
Assert.assertTrue(leftVersion.isFile());
|
||||
assertNotNull(leftVersion);
|
||||
assertTrue(leftVersion.isFile());
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isNone());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isNone());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -178,24 +179,24 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final Change change = changeListManager.getChange(vf);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNull(leftVersion);
|
||||
assertNull(leftVersion);
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isFile());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isFile());
|
||||
|
||||
}
|
||||
|
||||
@@ -210,25 +211,25 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final Change change = changeListManager.getChange(vf);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.EDIT, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.EDIT, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNotNull(leftVersion);
|
||||
Assert.assertTrue(leftVersion.isFile());
|
||||
assertNotNull(leftVersion);
|
||||
assertTrue(leftVersion.isFile());
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isFile());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isFile());
|
||||
|
||||
}
|
||||
|
||||
@@ -243,25 +244,25 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final Change change = changeListManager.getChange(vf);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNull(leftVersion);
|
||||
assertNull(leftVersion);
|
||||
//Assert.assertEquals(NodeKind.FILE, leftVersion.getKind());
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isFile());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isFile());
|
||||
|
||||
}
|
||||
|
||||
@@ -275,24 +276,24 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final Change change = changeListManager.getChange(vf);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNull(leftVersion);
|
||||
assertNull(leftVersion);
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isDirectory());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isDirectory());
|
||||
}
|
||||
|
||||
// not a conflict in Subversion 1.7.7. "mine" file becomes added
|
||||
@@ -335,23 +336,23 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
final Change change = changeListManager.getChange(VcsUtil.getFilePath(new File(myWorkingCopyDir.getPath(), conflictFile), true));
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.EDIT, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.EDIT, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNotNull(leftVersion);
|
||||
Assert.assertTrue(leftVersion.isDirectory());
|
||||
assertNotNull(leftVersion);
|
||||
assertTrue(leftVersion.isDirectory());
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isDirectory());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isDirectory());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -363,25 +364,25 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final Change change = changeListManager.getChange(vf);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.DELETE, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.DELETE, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNotNull(leftVersion);
|
||||
Assert.assertTrue(leftVersion.isDirectory());
|
||||
assertNotNull(leftVersion);
|
||||
assertTrue(leftVersion.isDirectory());
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isNone());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isNone());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -393,24 +394,24 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final Change change = changeListManager.getChange(vf);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNull(leftVersion);
|
||||
assertNull(leftVersion);
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isDirectory());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isDirectory());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -422,23 +423,23 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
final Change change = changeListManager.getChange(VcsUtil.getFilePath(new File(myWorkingCopyDir.getPath(), conflictFile), true));
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.EDIT, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.EDIT, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNotNull(leftVersion);
|
||||
Assert.assertTrue(leftVersion.isDirectory());
|
||||
assertNotNull(leftVersion);
|
||||
assertTrue(leftVersion.isDirectory());
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isDirectory());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isDirectory());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -450,23 +451,23 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
final Change change = changeListManager.getChange(VcsUtil.getFilePath(new File(myWorkingCopyDir.getPath(), conflictFile), true));
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNull(leftVersion);
|
||||
assertNull(leftVersion);
|
||||
//Assert.assertEquals(NodeKind.DIR, leftVersion.getKind());
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isDirectory());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isDirectory());
|
||||
}
|
||||
//---------------------------------
|
||||
@Test
|
||||
@@ -481,24 +482,24 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final Change change = changeListManager.getChange(vf);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNull(leftVersion);
|
||||
assertNull(leftVersion);
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isDirectory());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isDirectory());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -513,24 +514,24 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final Change change = changeListManager.getChange(vf);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNull(leftVersion);
|
||||
assertNull(leftVersion);
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isDirectory());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isDirectory());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -545,24 +546,24 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final Change change = changeListManager.getChange(vf);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNull(leftVersion);
|
||||
assertNull(leftVersion);
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isDirectory());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isDirectory());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -577,24 +578,24 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final Change change = changeListManager.getChange(vf);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNull(leftVersion);
|
||||
assertNull(leftVersion);
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isDirectory());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isDirectory());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -609,24 +610,24 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final Change change = changeListManager.getChange(vf);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNull(leftVersion);
|
||||
assertNull(leftVersion);
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isDirectory());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isDirectory());
|
||||
}
|
||||
//******************************************
|
||||
// dir -> file (mine, theirs)
|
||||
@@ -642,24 +643,24 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final Change change = changeListManager.getChange(vf);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNull(leftVersion);
|
||||
assertNull(leftVersion);
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isFile());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isFile());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -674,24 +675,24 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final Change change = changeListManager.getChange(vf);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNull(leftVersion);
|
||||
assertNull(leftVersion);
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isFile());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isFile());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -706,24 +707,24 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final Change change = changeListManager.getChange(vf);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNull(leftVersion);
|
||||
assertNull(leftVersion);
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isFile());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isFile());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -738,24 +739,24 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final Change change = changeListManager.getChange(vf);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNull(leftVersion);
|
||||
assertNull(leftVersion);
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isFile());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isFile());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -770,24 +771,24 @@ public class SvnTreeConflictDataTest extends SvnTestCase {
|
||||
changeListManager.ensureUpToDate(false);
|
||||
|
||||
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
|
||||
Assert.assertNotNull(vf);
|
||||
assertNotNull(vf);
|
||||
final Change change = changeListManager.getChange(vf);
|
||||
Assert.assertTrue(change instanceof ConflictedSvnChange);
|
||||
assertTrue(change instanceof ConflictedSvnChange);
|
||||
TreeConflictDescription beforeDescription = ((ConflictedSvnChange)change).getBeforeDescription();
|
||||
Assert.assertNotNull(beforeDescription);
|
||||
assertNotNull(beforeDescription);
|
||||
|
||||
final TreeConflictDescription afterDescription = ((ConflictedSvnChange)change).getAfterDescription();
|
||||
Assert.assertNull(afterDescription);
|
||||
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
assertNull(afterDescription);
|
||||
assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
|
||||
assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
|
||||
|
||||
Assert.assertTrue(beforeDescription.isTreeConflict());
|
||||
assertTrue(beforeDescription.isTreeConflict());
|
||||
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
|
||||
Assert.assertNull(leftVersion);
|
||||
assertNull(leftVersion);
|
||||
|
||||
final ConflictVersion version = beforeDescription.getSourceRightVersion();
|
||||
Assert.assertNotNull(version);
|
||||
Assert.assertTrue(version.isFile());
|
||||
assertNotNull(version);
|
||||
assertTrue(version.isFile());
|
||||
}
|
||||
|
||||
private void createSubTree() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user