Ejemplo n.º 1
0
 // Break the line at commas, return a map of the resulting strings
 // broken at equals sign.  (<i>Ie</i>, name value pairs.)
 Map getRow(String line) {
   Map map = new HashMap();
   for (Iterator iter = StringUtil.breakAt(line, ',').iterator(); iter.hasNext(); ) {
     String item = (String) iter.next();
     List pair = StringUtil.breakAt(item, '=');
     map.put(pair.get(0), pair.get(1));
   }
   return map;
 }
Ejemplo n.º 2
0
 protected void assertEqualTables(Object[][] a1, List lines) {
   assertEquals("numrows", a1.length, lines.size() - NUM_HEADER_LINES);
   for (int irow = 0; irow <= a1.length - 1; irow++) {
     Object expRow[] = a1[irow];
     List row = StringUtil.breakAt((String) lines.get(irow + NUM_HEADER_LINES), ',');
     assertEquals("numcols", expRow.length, row.size());
     assertEquals(("row " + irow), SetUtil.fromArray(expRow), new HashSet(row));
   }
 }