CompositeTemplateLoader implements TemplateLoader { @Override public String resolve(final String location) { for (TemplateLoader delegate : delegates) { try { delegate.sourceAt(location); return delegate.resolve(location); } catch (IOException ex) { logger.trace("Unable to resolve: {}, trying next loader in the chain.", location); } } throw new IllegalStateException("Can't resolve: '" + location + "'"); } CompositeTemplateLoader(final TemplateLoader... loaders); @Override TemplateSource sourceAt(final String location); @Override String resolve(final String location); @Override String getPrefix(); @Override String getSuffix(); @Override void setPrefix(final String prefix); @Override void setSuffix(final String suffix); @Override void setCharset(final Charset charset); @Override Charset getCharset(); Iterable<TemplateLoader> getDelegates();  }
@Test public void resolveSourceAtCp() throws IOException { assertEquals("/template.hbs", loader.resolve("template")); }
@Test public void resolveSourceAtFs() throws IOException { assertTrue(new File("src/test/resources/inheritance", "home.hbs").getPath() .compareTo(new File(loader.resolve("home")).getPath()) == 0 ); }