@Test public void testGetSetterCommandsDq8() { final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder(); builder.appendDayOfMonth(2).appendLiteral('-').appendMonthOfYearShortText().appendLiteral('-').appendYear(4, 4) .appendLiteral(' ').appendHourOfDay(2).appendLiteral(':').appendMinuteOfHour(2).appendLiteral(':') .appendSecondOfMinute(2).appendLiteral('.').appendMillisOfSecond(3); final DateTimeFormatter formatter = builder.toFormatter(); final Date currentDate = Calendar.getInstance().getTime(); final String fieldName = "dq8_field"; final String recordName = "record_name"; final Field field = mockField(fieldName, DataType.DQ8); final Structure struct = mockStructure(field); final Record record = mockRecord(recordName, struct); when(record.getDQ8(fieldName)).thenReturn(currentDate); final Collection<String> commands = RecordSetter.getSetterCommands(record); assertThat(commands).containsOnly("set record_name->dq8_field = cnvtdatetime('" + formatter.print(currentDate.getTime()).toUpperCase() + "') go"); }
public static List<String> getSetterCommands(final Record record) { final List<String> commands = new ArrayList<String>(); final BreadCrumb rootCrumb = new BreadCrumb(record.getName()); for (final Field field : record.getStructure().getFields()) getSetterCommands(rootCrumb, field, record, commands); return commands; }
RecordSetter { public static List<String> getSetterCommands(final Record record) { final List<String> commands = new ArrayList<String>(); final BreadCrumb rootCrumb = new BreadCrumb(record.getName()); for (final Field field : record.getStructure().getFields()) getSetterCommands(rootCrumb, field, record, commands); return commands; } }
RecordSetter { public static List<String> getSetterCommands(final Record record) { final List<String> commands = new ArrayList<String>(); final BreadCrumb rootCrumb = new BreadCrumb(record.getName()); for (final Field field : record.getStructure().getFields()) getSetterCommands(rootCrumb, field, record, commands); return commands; }  }
RecordSetter { public static List<String> getSetterCommands(final Record record) { final List<String> commands = new ArrayList<String>(); final BreadCrumb rootCrumb = new BreadCrumb(record.getName()); for (final Field field : record.getStructure().getFields()) getSetterCommands(rootCrumb, field, record, commands); return commands; }  static List<String> getSetterCommands(final Record record); }
RecordSetter { public static List<String> getSetterCommands(final Record record) { final List<String> commands = new ArrayList<String>(); final BreadCrumb rootCrumb = new BreadCrumb(record.getName()); for (final Field field : record.getStructure().getFields()) getSetterCommands(rootCrumb, field, record, commands); return commands; }  static List<String> getSetterCommands(final Record record);  }