@Test
public void importData() {

    // should be ok
    assertNotNull(importer.importData(new FileDataSource(fileSystem.getPath("/"), "test0"), null));
    // should fail because file that does not exist
    try {
        importer.importData(new FileDataSource(fileSystem.getPath("/"), "test4"), null);
        fail();
    } catch (RuntimeException ignored) {
    }
    // extension plugin will be not found but default option just warn
    assertNotNull(importer.importData(new FileDataSource(fileSystem.getPath("/"), "test5"), null));
    // extension plugin will be not found but option is set to throw an exception
    // (deprecated parameter name)
    Properties params = new Properties();
    params.put("throwExceptionIfExtensionNotFound", "true");
    try {
        importer.importData(new FileDataSource(fileSystem.getPath("/"), "test5"), params);
        fail();
    } catch (RuntimeException ignored) {
    }
    // extension plugin will be not found but option is set to throw an exception
    // (parameter name following same naming convention of XmlExporter)
    Properties params2 = new Properties();
    params2.put("iidm.import.xml.throw-exception-if-extension-not-found", "true");
    try {
        importer.importData(new FileDataSource(fileSystem.getPath("/"), "test5"), params2);
        fail();
    } catch (RuntimeException ignored) {
    }
    // read file with id mapping
    Network network = importer.importData(new FileDataSource(fileSystem.getPath("/"), "test6"), params);
    assertNotNull(network.getSubstation("X1")); // and not P1 !!!!!
    Network network2 = importer.importData(new FileDataSource(fileSystem.getPath("/"), "test7"), null);
    assertNotNull(network2.getSubstation("P1"));
}