Package org.jwall.audit.script.utils

Examples of org.jwall.audit.script.utils.ListIteratorImpl


  }

  @Override
  public Iterator<ScriptEvent> iterator() {
    log.debug( "returning new iterator()" );
    return new ListIteratorImpl( this );
  }
View Full Code Here


  }

  @Override
  public ListIterator<ScriptEvent> listIterator() {
    log.debug( "returning new listIterator()" );
    return new ListIteratorImpl( this );
  }
View Full Code Here

  }

  @Override
  public ListIterator<ScriptEvent> listIterator(int arg0) {
    log.debug( "returning new listIterator( {} )", arg0 );
    return new ListIteratorImpl( this, arg0 );
  }
View Full Code Here

    }
  }

  @Test
  public void testHasNext() throws Exception {
    ListIterator<ScriptEvent> it = new ListIteratorImpl(eventList);
    boolean containsEvents = !database.getRealList().isEmpty();
    boolean hasNext = it.hasNext();
    Assert.assertEquals(containsEvents, hasNext);
  }
View Full Code Here

    Assert.assertEquals(containsEvents, hasNext);
  }

  @Test
  public void testHasPrevious() {
    ListIterator<ScriptEvent> it = new ListIteratorImpl(eventList);
    Assert.assertFalse(it.hasPrevious());
    it.next();
    Assert.assertTrue(it.hasPrevious());
  }
View Full Code Here

    Assert.assertTrue(it.hasPrevious());
  }

  @Test
  public void testNext() {
    ListIterator<ScriptEvent> it = new ListIteratorImpl(eventList);

    ScriptEvent evt = it.next();
    Assert.assertNotNull(evt);

    AuditEvent first = database.getRealList().get(0);
    Assert.assertEquals(first.get(ModSecurity.TX_ID),
        evt.get(ModSecurity.TX_ID));
View Full Code Here

        evt.get(ModSecurity.TX_ID));
  }

  @Test
  public void testNextIndex() {
    ListIterator<ScriptEvent> it = new ListIteratorImpl(eventList);

    ScriptEvent evt = it.next();
    Assert.assertNotNull(evt);

    AuditEvent first = database.getRealList().get(0);
    Assert.assertEquals(first.get(ModSecurity.TX_ID),
        evt.get(ModSecurity.TX_ID));

    Assert.assertEquals(1, it.nextIndex());
  }
View Full Code Here

    Assert.assertEquals(1, it.nextIndex());
  }

  @Test
  public void testPrevious() {
    ListIterator<ScriptEvent> it = new ListIteratorImpl(eventList);

    ScriptEvent evt = it.next();
    Assert.assertNotNull(evt);

    AuditEvent first = database.getRealList().get(0);

    it.next();
    it.previous();
    evt = it.previous();
    Assert.assertEquals(first.get(ModSecurity.TX_ID),
        evt.get(ModSecurity.TX_ID));
  }
View Full Code Here

        evt.get(ModSecurity.TX_ID));
  }

  @Test
  public void testPreviousIndex() {
    ListIterator<ScriptEvent> it = new ListIteratorImpl(eventList);

    ScriptEvent evt = it.next();
    Assert.assertNotNull(evt);

    AuditEvent first = database.getRealList().get(0);
    Assert.assertEquals(first.get(ModSecurity.TX_ID),
        evt.get(ModSecurity.TX_ID));

    Assert.assertEquals(0, it.previousIndex());
  }
View Full Code Here

TOP

Related Classes of org.jwall.audit.script.utils.ListIteratorImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.