Ejemplo n.º 1
0
  @Test
  public void testDelTail() {
    System.out.println("\n___ TEST DEL TAIL____\n");
    List<Object> l = new ArrayList<Object>();
    l.add("a");
    l.add("b");
    l.add("c");
    l.add("d");
    l.add("e");
    l.add("f");
    l.add("g");

    DifTree test = DifTreeImpl.create(l);
    System.out.println("Del everything from the Tail");
    System.out.println(test);
    test.delTail();
    System.out.println(test);
    test.delTail();
    System.out.println(test);
    test.delTail();
    System.out.println(test);
    test.delTail();
    System.out.println(test);
    test.delTail();
    System.out.println(test);
    test.delTail();
    System.out.println(test);
    test.delTail();
    System.out.println(test);
    assertTrue(true);
  }
Ejemplo n.º 2
0
 @Test
 public void testDelBoth() {
   System.out.println("___ VARIOUS ADD AND DEL TEST____\n");
   DifTree test = DifTreeImpl.create("a", "b", "c", "d", 4, 3, 2, 1);
   System.out.println("Bevore:");
   System.out.println(test);
   System.out.println("Items Added: (Head: x), (Tail: blub)");
   test.addHead("x");
   test.addTail("blub");
   System.out.println("Various deletes");
   System.out.println(test);
   test.delHead();
   System.out.println(test);
   test.delTail();
   System.out.println(test);
   test.delTail();
   System.out.println(test);
   test.delTail();
   System.out.println(test);
   test.delHead();
   System.out.println(test);
   test.delHead();
   System.out.println(test);
   assertTrue(true);
 }
Ejemplo n.º 3
0
  /** Test method for {@link stringList.implementations.DifTreeImpl#create(java.util.List)}. */
  @Test
  public void testCreate() {

    List<Object> l = new ArrayList<Object>();
    l.add("a");
    l.add("b");
    l.add("c");
    l.add("d");
    l.add("e");

    DifTree test = DifTreeImpl.create(l);
    System.out.println(test);
    assertTrue(true);
  }
Ejemplo n.º 4
0
 @Test
 public void testAdd() {
   System.out.println("\n___ TEST SimpleAdd____\n");
   List<Object> l = new ArrayList<Object>();
   l.add("a");
   l.add("b");
   l.add("c");
   DifTree test = DifTreeImpl.create(l);
   System.out.println("Before:");
   System.out.println(test);
   System.out.println("\n Items to be Added:\n Head: # and Tail: d\n");
   test.addHead("#");
   test.addTail("d");
   System.out.println("Result:");
   System.out.println(test);
   assertEquals("#", test.get(1));
   assertTrue(true);
 }
Ejemplo n.º 5
0
  /** Test method for {@link stringList.implementations.DifTreeImpl#get(int)}. */
  @Test
  public void testGet() {
    System.out.println("\n___ TEST Get____\n");
    List<Object> l = new ArrayList<Object>();
    l.add("a");
    l.add("b");
    l.add("c");
    l.add("d");
    l.add("e");

    DifTree test = DifTreeImpl.create(l);
    assertEquals("a", test.get(1));
    assertEquals("b", test.get(2));
    assertEquals("c", test.get(3));
    assertEquals("d", test.get(4));
    assertEquals("e", test.get(5));
    assertEquals(null, test.get(6));
    assertEquals(null, test.get(0));
    assertEquals(null, test.get(-1));
  }