### Question:
DdlInfoFileImpl implements DdlInfoFile { public int getCurrentVersionNo() { return getCurrentVersionNoInternal(); } DdlInfoFileImpl(File file); int getCurrentVersionNo(); int getNextVersionNo(); void applyNextVersionNo(String comment);  }### Answer:
@Test public void testGetVersionNo() { String path = getClass().getName().replace('.', '/') + "_version.txt"; File file = ResourceUtil.getResourceAsFile(path); DdlInfoFileImpl ddlInfoFile = new DdlInfoFileImpl(file); assertEquals(10, ddlInfoFile.getCurrentVersionNo()); assertEquals(10, ddlInfoFile.getCurrentVersionNo()); }
@Test public void testGetVersionNo_fileNotExistent() { DdlInfoFileImpl ddlInfoFile = new DdlInfoFileImpl(new File( "notExistent")); assertEquals(0, ddlInfoFile.getCurrentVersionNo()); }
@Test public void testGetVersionNo_illegalVersionNoFormat() { String fileName = getClass().getName().replace('.', '/') + "_illegalVersion.txt"; File file = ResourceUtil.getResourceAsFile(fileName); DdlInfoFileImpl ddlInfoFile = new DdlInfoFileImpl(file); try { ddlInfoFile.getCurrentVersionNo(); fail(); } catch (IllegalDdlInfoVersionRuntimeException expected) { } }