public void testRemoveAll() throws OperationException { AnnotationTree<Object> tree = new AnnotationTree<Object>(new Object(), new Object(), null); insert(tree, 0, 1); setAnnotation(tree, 0, 1, "a", "0"); setAnnotation(tree, 0, 1, "a", null); delete(tree, 0, 1); }
public void testEraseMergeDuringSetAnnotation() throws OperationException { { AnnotationTree<Object> tree = new AnnotationTree<Object>(new Object(), new Object(), null); insert(tree, 0, 3); setAnnotation(tree, 0, 1, "a", "1"); setAnnotation(tree, 1, 2, "a", "2"); setAnnotation(tree, 2, 3, "a", "3"); setAnnotation(tree, 0, 2, "a", "5"); } { AnnotationTree<Object> tree = new AnnotationTree<Object>(new Object(), new Object(), null); insert(tree, 0, 3); setAnnotation(tree, 0, 1, "a", "1"); setAnnotation(tree, 1, 2, "a", "2"); setAnnotation(tree, 2, 3, "a", "3"); setAnnotation(tree, 1, 3, "a", "5"); } }
public void testCleanupKnownKeys() { AnnotationTree<Object> t = getNewSet(null); t.finish(); assertEquals(1, t.knownKeys().countEntries()); t.finish(); assertEquals(0, t.knownKeys().countEntries()); t.finish(); assertEquals(0, t.knownKeys().countEntries()); t.finish(); assertEquals(1, t.knownKeys().countEntries()); t.finish(); assertEquals(2, t.knownKeys().countEntries()); t.finish(); assertEquals(1, t.knownKeys().countEntries()); assertEquals(0, t.knownKeys().countEntries());
@SuppressWarnings("unchecked") public void testListenerBasics2() throws OperationException { final AnnotationSetListener<Object> listener = mock(AnnotationSetListener.class); RawAnnotationSet<Object> m = getNewSet(listener);
public void testConstructorChecksArguments() { try { new AnnotationTree<String>(null, "a", null); fail(); } catch (NullPointerException e) { // ok } try { new AnnotationTree<String>("a", null, null); fail(); } catch (NullPointerException e) { // ok } try { new AnnotationTree<String>("a", "a", null); fail(); } catch (IllegalArgumentException e) { // ok } try { new AnnotationTree<String>("b", "b", null); fail(); } catch (IllegalArgumentException e) { // ok } // Should not throw. new AnnotationTree<String>("a", "b", null); }
public void testEraseMergeDuringSetAnnotation() throws OperationException { { AnnotationTree<Object> tree = new AnnotationTree<Object>(new Object(), new Object(), null); insert(tree, 0, 3); setAnnotation(tree, 0, 1, "a", "1"); setAnnotation(tree, 1, 2, "a", "2"); setAnnotation(tree, 2, 3, "a", "3"); setAnnotation(tree, 0, 2, "a", "5"); } { AnnotationTree<Object> tree = new AnnotationTree<Object>(new Object(), new Object(), null); insert(tree, 0, 3); setAnnotation(tree, 0, 1, "a", "1"); setAnnotation(tree, 1, 2, "a", "2"); setAnnotation(tree, 2, 3, "a", "3"); setAnnotation(tree, 1, 3, "a", "5"); } }
RawAnnotationSet<Object> m = getNewSet(listener); m1[0] = m; m.finish(); assertEquals(4, callCounter[0]);
@SuppressWarnings("unchecked") public void testListenerBasics2() throws OperationException { final AnnotationSetListener<Object> listener = mock(AnnotationSetListener.class); RawAnnotationSet<Object> m = getNewSet(listener);
public void testConstructorChecksArguments() { try { new AnnotationTree<String>(null, "a", null); fail(); } catch (NullPointerException e) { // ok } try { new AnnotationTree<String>("a", null, null); fail(); } catch (NullPointerException e) { // ok } try { new AnnotationTree<String>("a", "a", null); fail(); } catch (IllegalArgumentException e) { // ok } try { new AnnotationTree<String>("b", "b", null); fail(); } catch (IllegalArgumentException e) { // ok } // Should not throw. new AnnotationTree<String>("a", "b", null); }
public void testRemoveAll() throws OperationException { AnnotationTree<Object> tree = new AnnotationTree<Object>(new Object(), new Object(), null); insert(tree, 0, 1); setAnnotation(tree, 0, 1, "a", "0"); setAnnotation(tree, 0, 1, "a", null); delete(tree, 0, 1); }
public void testOffBalance() throws OperationException { AnnotationTree<Object> tree = new AnnotationTree<Object>(new Object(), new Object(), null); final int size = 15; insert(tree, 0, size); for (int i = 0; i < size - 1; i++) { setAnnotation(tree, i, i + 1, "a", "" + i); tree.checkSomeInvariants(); } }
public void testCleanupKnownKeys() { AnnotationTree<Object> t = getNewSet(null); t.finish(); assertEquals(1, t.knownKeys().countEntries()); t.finish(); assertEquals(0, t.knownKeys().countEntries()); t.finish(); assertEquals(0, t.knownKeys().countEntries()); t.finish(); assertEquals(1, t.knownKeys().countEntries()); t.finish(); assertEquals(2, t.knownKeys().countEntries()); t.finish(); assertEquals(1, t.knownKeys().countEntries()); assertEquals(0, t.knownKeys().countEntries());
@SuppressWarnings("unchecked") public void testListenerBasics() throws OperationException { final AnnotationSetListener<Object> listener = mock(AnnotationSetListener.class); RawAnnotationSet<Object> m = getNewSet(listener);
public void testOffBalance() throws OperationException { AnnotationTree<Object> tree = new AnnotationTree<Object>(new Object(), new Object(), null); final int size = 15; insert(tree, 0, size); for (int i = 0; i < size - 1; i++) { setAnnotation(tree, i, i + 1, "a", "" + i); tree.checkSomeInvariants(); } }
RawAnnotationSet<Object> m = getNewSet(listener); m1[0] = m; m.finish(); assertEquals(4, callCounter[0]);
@SuppressWarnings("unchecked") public void testListenerBasics() throws OperationException { final AnnotationSetListener<Object> listener = mock(AnnotationSetListener.class); RawAnnotationSet<Object> m = getNewSet(listener);