VariableFileQueryDAO extends AbstractFileQueryDAO { @Override public <T> FileLineIterator<T> execute(String fileName, Class<T> clazz) { VariableFileLineIterator<T> fileLineIterator = new VariableFileLineIterator<T>( fileName, clazz, getColumnParserMap()); return fileLineIterator; }  @Override FileLineIterator<T> execute(String fileName, Class<T> clazz);  }
@Test public void testExcecute01() throws Exception { VariableFileQueryDAO fileQueryDAO = new VariableFileQueryDAO(); URL url = this.getClass().getResource("File_Empty.txt"); String fileName = url.getPath(); Class<VariableFileQueryDAO_Stub01> clazz = VariableFileQueryDAO_Stub01.class; Map<String, ColumnParser> columnParserMap = new HashMap<String, ColumnParser>(); columnParserMap.put("java.lang.String", new NullColumnParser()); ReflectionTestUtils.setField(fileQueryDAO, "columnParserMap", columnParserMap); FileLineIterator<VariableFileQueryDAO_Stub01> fileLineIterator = fileQueryDAO .execute(fileName, VariableFileQueryDAO_Stub01.class); assertEquals(VariableFileLineIterator.class, fileLineIterator .getClass()); assertEquals(fileName, ReflectionTestUtils.getField(fileLineIterator, "fileName")); assertSame(clazz, ReflectionTestUtils.getField(fileLineIterator, "clazz")); assertSame(columnParserMap, ReflectionTestUtils.getField( fileLineIterator, "columnParserMap")); }