}
public void testGetResourcePath() throws Exception
{
String xpath;
ClasspathResourceLoader cp = new ClasspathResourceLoader(ClasspathResourceLoaderTest.class);
xpath = cp.getResourcePath("res.txt");
assertEquals( "net/sf/jportlet/util/test/res.txt", xpath);
/* Markup */
xpath = cp.getResourcePath("res.html", Portlet.Markup.HTML.toString());
assertEquals( "net/sf/jportlet/util/test/html/res.html", xpath);
xpath = cp.getResourcePath("res.txt", Portlet.Markup.HTML.toString());
assertEquals( "net/sf/jportlet/util/test/res.txt", xpath);
/* Language */
xpath = cp.getResourcePath("res.html", Portlet.Markup.HTML.toString(), Locale.ENGLISH);
assertEquals( "net/sf/jportlet/util/test/html/res_en.html", xpath);
xpath = cp.getResourcePath("res.txt", Portlet.Markup.HTML.toString(), Locale.ENGLISH);
assertEquals( "net/sf/jportlet/util/test/res.txt", xpath);
/* Locale */
xpath = cp.getResourcePath("res.html", Portlet.Markup.HTML.toString(), Locale.US );
assertEquals( "net/sf/jportlet/util/test/html/res_en_US.html", xpath);
xpath = cp.getResourcePath("res.txt", Portlet.Markup.HTML.toString(), Locale.US);
assertEquals( "net/sf/jportlet/util/test/res.txt", xpath);
}