AbstractFileLineWriter implements FileLineWriter<T> { protected boolean isCheckByte(OutputFileColumn outputFileColumn) { if (0 < outputFileColumn.bytes()) { return true; } return false; } AbstractFileLineWriter(String fileName, Class<T> clazz,
            Map<String, ColumnFormatter> columnFormatterMap); @Override void printHeaderLine(List<String> headerLine); @Override void printDataLine(T t); @Override void printTrailerLine(List<String> trailerLine); @Override void closeFile(); String getFileName(); void setColumnFormatterMap(
            Map<String, ColumnFormatter> columnFormatterMap); abstract char getDelimiter(); abstract char getEncloseChar();  }
@Test public void testIsCheckByte01() throws Exception { String fileName = "fileName"; Class<AbstractFileLineWriter_Stub13> clazz = AbstractFileLineWriter_Stub13.class; Map<String, ColumnFormatter> columnFormatterMap = new HashMap<String, ColumnFormatter>(); columnFormatterMap.put("int", new IntColumnFormatter()); columnFormatterMap.put("java.lang.String", new NullColumnFormatter()); AbstractFileLineWriter<AbstractFileLineWriter_Stub13> fileLineWriter = new AbstractFileLineWriterImpl01<AbstractFileLineWriter_Stub13>(fileName, clazz, columnFormatterMap); Field column2 = AbstractFileLineWriter_Stub13.class .getDeclaredFields()[1]; OutputFileColumn outputFileColumn = column2.getAnnotation( OutputFileColumn.class); boolean result = fileLineWriter.isCheckByte(outputFileColumn); assertFalse(result); }
@Test public void testIsCheckByte02() throws Exception { String fileName = "fileName"; Class<AbstractFileLineWriter_Stub37> clazz = AbstractFileLineWriter_Stub37.class; Map<String, ColumnFormatter> columnFormatterMap = new HashMap<String, ColumnFormatter>(); columnFormatterMap.put("int", new IntColumnFormatter()); columnFormatterMap.put("java.lang.String", new NullColumnFormatter()); AbstractFileLineWriter<AbstractFileLineWriter_Stub37> fileLineWriter = new AbstractFileLineWriterImpl01<AbstractFileLineWriter_Stub37>(fileName, clazz, columnFormatterMap); Field column2 = AbstractFileLineWriter_Stub37.class .getDeclaredFields()[1]; OutputFileColumn outputFileColumn = column2.getAnnotation( OutputFileColumn.class); boolean result = fileLineWriter.isCheckByte(outputFileColumn); assertTrue(result); }
@Test public void testIsCheckByte03() throws Exception { String fileName = "fileName"; Map<String, ColumnFormatter> columnFormatterMap = new HashMap<String, ColumnFormatter>(); columnFormatterMap.put("java.lang.String", new NullColumnFormatter()); AbstractFileLineWriter<FileLineObject_Empty> fileLineWriter = new AbstractFileLineWriterImpl01<FileLineObject_Empty>(fileName, FileLineObject_Empty.class, columnFormatterMap); boolean result = fileLineWriter.isCheckByte(1); assertTrue(result); }