@Test
public void testLoadDb() throws Exception {

    System.out.println("TestZpeUpdPolLoader: testLoadDb: dir=" + TEST_POL_DIR);
    java.nio.file.Path dirPath  = java.nio.file.Paths.get(TEST_POL_DIR);
    try {
        java.nio.file.Files.createDirectory(dirPath);
    } catch (java.nio.file.FileAlreadyExistsException ignored) {
    }
    ZpeUpdPolLoader loader = new ZpeUpdPolLoader(TEST_POL_DIR);
    java.nio.file.Path badFile  = java.nio.file.Paths.get(TEST_POL_DIR, TEST_POL_FILE);
    java.nio.file.Files.deleteIfExists(badFile);
    java.io.File polFile = new java.io.File(TEST_POL_DIR, TEST_POL_FILE);
    //noinspection ResultOfMethodCallIgnored
    polFile.createNewFile();
    java.io.File [] files = { polFile };
    loader.loadDb(files);
    long lastModMilliSeconds = polFile.lastModified();
    java.util.Map<String, ZpeUpdPolLoader.ZpeFileStatus> fsmap = loader.getFileStatusMap();
    ZpeUpdPolLoader.ZpeFileStatus fstat = fsmap.get(polFile.getName());
    assertFalse(fstat.validPolFile);
    // move good policy file over the bad one
    java.nio.file.Path goodFile = java.nio.file.Paths.get(TEST_POL_GOOD_FILE);
    java.nio.file.Files.copy(goodFile, badFile, java.nio.file.StandardCopyOption.REPLACE_EXISTING);
    loader.loadDb(files);
    long lastModMilliSeconds2 = polFile.lastModified();
    fsmap = loader.getFileStatusMap();
    fstat = fsmap.get(polFile.getName());
    assertTrue(fstat.validPolFile);
    loader.close();
    System.out.println("TestZpeUpdPolLoader: testLoadDb: timestamp1=" + lastModMilliSeconds + " timestamp2=" + lastModMilliSeconds2);
}