some more test clean ups have been done
[fedora-idea.git] / LocalVcs / test / com / intellij / localvcs / TestCase.java
blob27fc7a63918e7a9cb327f6a3536d460f1971d5a4
1 package com.intellij.localvcs;
3 import java.util.ArrayList;
4 import java.util.Arrays;
5 import java.util.Collection;
6 import java.util.List;
8 import org.junit.Assert;
9 import org.junit.Before;
11 public class TestCase extends Assert {
12 protected LocalVcs vcs;
13 protected Snapshot s;
15 @Before
16 public void setUp() {
17 vcs = new LocalVcs();
18 s = new Snapshot();
21 protected Path p(String name) {
22 return new Path(name);
25 protected ChangeSet cs(Change... changes) {
26 return new ChangeSet(Arrays.asList(changes));
29 @SuppressWarnings("unchecked")
30 protected void assertElements(Object[] expected, Collection actual) {
31 assertEquals(expected.length, actual.size());
32 assertTrue(actual.containsAll(Arrays.asList(expected)));
35 protected void assertEntiesContents(String[] expectedContents,
36 Collection<Entry> actualEntries) {
37 List<String> actualContents = new ArrayList<String>();
38 for (Entry rev : actualEntries) {
39 actualContents.add(rev.getContent());
41 assertEquals(expectedContents, actualContents.toArray(new Object[0]));