PullConfiguration implements IWorkerPoolConfiguration { public static PullConfiguration loadFromFile(final String path) { final Log log = LogFactory.getLog(PullConfiguration.class); PullConfiguration pullCfg = null; log.debug("Loading pulling configuration from XML document in " + path); final File f = new File(path); if (f.exists() && f.canRead()) { final Serializer serializer = new Persister(); try { pullCfg = serializer.read(PullConfiguration.class, f); log.debug("Loaded configuration"); } catch (final Exception ex) { log.error("Error while reading configuration from " + path + "! Details: " + ex.getMessage()); } } else log.error("Unable to access configuration file" + path + "!"); return pullCfg; }  @Override String getName(); @Override List<IWorkerConfiguration> getWorkers(); static PullConfiguration loadFromFile(final String  path); static final String PULL_WORKER_POOL_NAME; }
@Test public void testLoad_ErrorConfig() { final String path = TestUtils.getPath(PullConfigurationTest.class.getSimpleName() + "/pullcfg3.xml").toString(); try { final PullConfiguration pullCfg = PullConfiguration.loadFromFile(path); assertNull(pullCfg); } catch (final Exception e) { e.printStackTrace(); fail(); } }