### Question:
PropertiesLoader extends AbstractResourceLoader implements PropertySource { @Override public void init() { if (this.ready) { return; } this.ready = true; this.resources.addAll(this.parse(this.locations)); for (SourceResource resource : this.resources) { try (Reader reader = this.getReader(resource)) { if (log.isDebugEnabled()) { log.debug("loading resource [{}]", resource.path()); } props.load(reader); } catch (IOException e) { if (log.isDebugEnabled()) { log.debug("resource [{}] read error", resource.path(), e); } if (!ignoreNotFound) { throw Exceptions.wrap(e); } } } } PropertiesLoader(String... locations);  PropertiesLoader(ClassLoader loader, String... locations); @Override int order(); @Override Properties props(); @Override void init(); @Override String name();  }### Answer:
@Test public void testDefault() { PropertiesLoader loader = new PropertiesLoader(defaultPath); loader.init(); assertEquals("k001", loader.getProperty("k1")); assertEquals("k002", loader.getProperty("k2")); }
@Test public void testClasspath() { PropertiesLoader loader = new PropertiesLoader(classpath); loader.init(); assertEquals("k001", loader.getProperty("k1")); assertEquals("k002", loader.getProperty("k2")); assertEquals("k003", loader.getProperty("k3")); assertEquals("k003", loader.getProperty("k4")); assertEquals("k003", loader.getProperty("k5")); assertEquals("k006", loader.getProperty("k6")); assertEquals("k006", loader.getProperty("k7")); }
@Test public void testFile() { makeFile(); PropertiesLoader loader = new PropertiesLoader(filePath); loader.init(); assertEquals("k001", loader.getProperty("k1")); assertEquals("k002", loader.getProperty("k2")); }
@Test(expected = CodedException.class) public void testNotFound() { PropertiesLoader loader = new PropertiesLoader("classpath:/xxx.properties"); loader.init(); }