Package no.priv.garshol.duke

Examples of no.priv.garshol.duke.RecordIterator


   
    source.addColumn(new Column("ID", null, null, null));
    source.addColumn(new Column("NAME", "GIVENNAME", null, givencleaner));
    source.addColumn(new Column("NAME", "FAMILYNAME", null, familycleaner));
       
    RecordIterator it = source.getRecords();
    assertTrue(it.hasNext());

    Record r = it.next();
    assertEquals("1", r.getValue("ID"));
    assertEquals("john", r.getValue("GIVENNAME"));
    assertEquals("smith", r.getValue("FAMILYNAME"));

    assertFalse(it.hasNext());
  }
View Full Code Here


    LowerCaseNormalizeCleaner cleaner = new LowerCaseNormalizeCleaner();
   
    source.addColumn(new Column("ID", null, null, null));
    source.addColumn(new Column("NAME", "GIVENNAME", null, cleaner));
       
    RecordIterator it = source.getRecords();
    assertTrue(it.hasNext());

    Record r = it.next();
    assertEquals("1", r.getValue("ID"));
    assertEquals(null, r.getValue("GIVENNAME"));

    assertFalse(it.hasNext());
  }
View Full Code Here

    source.addColumn(new Column("ID", null, null, null));
    Column col = new Column("NAME", null, null, null);
    col.setSplitOn(" ");
    source.addColumn(col);
       
    RecordIterator it = source.getRecords();
    assertTrue(it.hasNext());

    Record r = it.next();
    assertEquals("1", r.getValue("ID"));
    Collection<String> values = r.getValues("NAME");
    assertEquals(3, values.size());
    assertTrue(values.contains("foo"));
    assertTrue(values.contains("bar"));
    assertTrue(values.contains("baz"));

    assertFalse(it.hasNext());
  }
View Full Code Here

TOP

Related Classes of no.priv.garshol.duke.RecordIterator

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.