return true;
}
};
application.setDefaultLocale(Locale.ENGLISH);
ResourceMeta resource = resourceHandler.deriveResourceMeta(facesContext, loader, "en/mylib/1_0_2/myres.js/1_3.js");
Assert.assertNotNull(resource);
Assert.assertEquals("en", resource.getLocalePrefix());
Assert.assertEquals("mylib", resource.getLibraryName());
Assert.assertEquals("1_0_2", resource.getLibraryVersion());
Assert.assertEquals("myres.js", resource.getResourceName());
Assert.assertEquals("1_3", resource.getResourceVersion());
resource = resourceHandler.deriveResourceMeta(facesContext, loader, "en/mylib/1_0_2/myres.js");
Assert.assertNotNull(resource);
Assert.assertEquals("en", resource.getLocalePrefix());
Assert.assertEquals("mylib", resource.getLibraryName());
Assert.assertEquals("1_0_2", resource.getLibraryVersion());
Assert.assertEquals("myres.js", resource.getResourceName());
Assert.assertNull(resource.getResourceVersion());
resource = resourceHandler.deriveResourceMeta(facesContext, loader, "en/mylib/myres.js/1_3.js");
Assert.assertNotNull(resource);
Assert.assertEquals("en", resource.getLocalePrefix());
Assert.assertEquals("mylib", resource.getLibraryName());
Assert.assertNull(resource.getLibraryVersion());
Assert.assertEquals("myres.js", resource.getResourceName());
Assert.assertEquals("1_3", resource.getResourceVersion());
resource = resourceHandler.deriveResourceMeta(facesContext, loader, "en/mylib/myres.js");
Assert.assertNotNull(resource);
Assert.assertEquals("en", resource.getLocalePrefix());
Assert.assertEquals("mylib", resource.getLibraryName());
Assert.assertEquals("myres.js", resource.getResourceName());
Assert.assertNull(resource.getLibraryVersion());
Assert.assertNull(resource.getResourceVersion());
resource = resourceHandler.deriveResourceMeta(facesContext, loader, "en/myres.js");
Assert.assertNotNull(resource);
Assert.assertNull(resource.getLibraryName());
Assert.assertNull(resource.getLibraryVersion());
Assert.assertNull(resource.getResourceVersion());
Assert.assertEquals("en", resource.getLocalePrefix());
Assert.assertEquals("myres.js", resource.getResourceName());
resource = resourceHandler.deriveResourceMeta(facesContext, loader, "mylib/myres.js");
Assert.assertNotNull(resource);
Assert.assertNull(resource.getLocalePrefix());
Assert.assertNull(resource.getLibraryVersion());
Assert.assertNull(resource.getResourceVersion());
Assert.assertEquals("mylib", resource.getLibraryName());
Assert.assertEquals("myres.js", resource.getResourceName());
resource = resourceHandler.deriveResourceMeta(facesContext, loader, "myres.js");
Assert.assertNotNull(resource);
Assert.assertNull(resource.getLocalePrefix());
Assert.assertNull(resource.getLibraryName());
Assert.assertNull(resource.getLibraryVersion());
Assert.assertNull(resource.getResourceVersion());
Assert.assertEquals("myres.js", resource.getResourceName());
}