1
2
3
4
5
6
7
8
9
10
11 package org.eclipse.jgit.revwalk;
12
13 import static org.junit.Assert.assertEquals;
14 import static org.junit.Assert.assertFalse;
15 import static org.junit.Assert.assertNull;
16 import static org.junit.Assert.assertTrue;
17 import static org.junit.Assert.fail;
18
19 import org.junit.Test;
20
21 public class AlwaysEmptyRevQueueTest extends RevWalkTestCase {
22 private final AbstractRevQueue q = AbstractRevQueue.EMPTY_QUEUE;
23
24 @Test
25 public void testEmpty() throws Exception {
26 assertNull(q.next());
27 assertTrue(q.everbodyHasFlag(RevWalk.UNINTERESTING));
28 assertFalse(q.anybodyHasFlag(RevWalk.UNINTERESTING));
29 assertEquals(0, q.outputType());
30 }
31
32 @Test
33 public void testClear() throws Exception {
34 q.clear();
35 testEmpty();
36 }
37
38 @Test
39 public void testAddFails() throws Exception {
40 try {
41 q.add(commit());
42 fail("Did not throw UnsupportedOperationException");
43 } catch (UnsupportedOperationException e) {
44
45 }
46 }
47 }