@Test public void processJustRightCols() throws BadDataException { final String code = "1"; final String name = "TuringOS"; final String version = "0.1"; final String mfg_code = "AT"; final OSData osd = new OSData(code, name, version, mfg_code); final RecordProcessor proc = new OSRecordProcessor(); assertEquals(osd, proc.process( new String[] { osd.code, osd.name, osd.version, osd.mfg_code } )); }
public OSData process(String[] col) throws BadDataException { if (col.length < 4) { throw new BadDataException("too few columns"); } else if (col.length > 4) { throw new BadDataException("too many columns"); } return new OSData(col[0], col[1], col[2], col[3]); }
OSRecordProcessor implements RecordProcessor<OSData> { public OSData process(String[] col) throws BadDataException { if (col.length < 4) { throw new BadDataException("too few columns"); } else if (col.length > 4) { throw new BadDataException("too many columns"); } return new OSData(col[0], col[1], col[2], col[3]); } }
OSRecordProcessor implements RecordProcessor<OSData> { public OSData process(String[] col) throws BadDataException { if (col.length < 4) { throw new BadDataException("too few columns"); } else if (col.length > 4) { throw new BadDataException("too many columns"); } return new OSData(col[0], col[1], col[2], col[3]); }  }
OSRecordProcessor implements RecordProcessor<OSData> { public OSData process(String[] col) throws BadDataException { if (col.length < 4) { throw new BadDataException("too few columns"); } else if (col.length > 4) { throw new BadDataException("too many columns"); } return new OSData(col[0], col[1], col[2], col[3]); }  OSData process(String[] col); }
OSRecordProcessor implements RecordProcessor<OSData> { public OSData process(String[] col) throws BadDataException { if (col.length < 4) { throw new BadDataException("too few columns"); } else if (col.length > 4) { throw new BadDataException("too many columns"); } return new OSData(col[0], col[1], col[2], col[3]); }  OSData process(String[] col);  }