Resources { public static URL[] getResources(final Class clazz, final String resourceBaseName, final String[] suffixes, final Locale locale) { return getResources(clazz, resourceBaseName, suffixes, locale, false); } private  Resources(); static URL[] getLocalResources(final Class clazz, final String resourceBaseName, final String[] suffixes, final Locale locale); static URL[] getLocalResources(final Class clazz, final String resourceBaseName, final String[] suffixes); static URL[] getLocalResources(final Class clazz, final String resourceName, final Locale locale); static URL[] getLocalResources(final Class clazz, final String resourceName); static URL getLocalResource(final Class clazz, final String resourceBaseName, final String[] suffixes, final Locale locale); static URL getLocalResource(final Class clazz, final String resourceBaseName, final String[] suffixes); static URL getLocalResource(final Class clazz, final String resourceName, final Locale locale); static URL getLocalResource(final Class clazz, final String resourceName); static InputStream getLocalResourceAsStream(final Class clazz, final String resourceBaseName, final String[] suffixes, final Locale locale); static InputStream getLocalResourceAsStream(final Class clazz, final String resourceBaseName, final String[] suffixes); static InputStream getLocalResourceAsStream(final Class clazz, final String resourceName, final Locale locale); static InputStream getLocalResourceAsStream(final Class clazz, final String resourceName); static URL[] getResources(final Class clazz, final String resourceBaseName, final String[] suffixes, final Locale locale); static URL[] getResources(final Class clazz, final String resourceBaseName, final String[] suffixes); static URL[] getResources(final Class clazz, final String resourceName, final Locale locale); static URL[] getResources(final Class clazz, final String resourceName); static URL getResource(final Class clazz, final String resourceBaseName, final String[] suffixes, final Locale locale); static URL getResource(final Class clazz, final String resourceBaseName, final String[] suffixes); static URL getResource(final Class clazz, final String resourceName, final Locale locale); static URL getResource(final Class clazz, final String resourceName); static InputStream getResourceAsStream(final Class clazz, final String resourceBaseName, final String[] suffixes, final Locale locale); static InputStream getResourceAsStream(final Class clazz, final String resourceBaseName, final String[] suffixes); static InputStream getResourceAsStream(final Class clazz, final String resourceName, final Locale locale); static InputStream getResourceAsStream(final Class clazz, final String resourceName); static String getShortClassName(final Class clazz); static String[] getLocaleSuffixArray(final Locale locale); static String[] getSingleLocaleSuffixArray(final Locale locale); static String getPathToClass(final Class clazz); static String getPathToPackage(final Class clazz); static final String LINK_SUFFIX; }
@Test public void getResources() throws Exception { Class c; c = Foobar.class; internalGetResources(c, "defaultFallback.txt", null, GERMANY_LOCALE, new String[]{}); internalGetResources(c, "defaultFallback", new String[]{".txt", ".html"}, GERMANY_LOCALE, new String[]{}); internalGetResources(c, "................../underflow.txt", null, GERMANY_LOCALE, new String[]{}); internalGetResources(c, "test.txt", null, GERMANY_LOCALE, new String[]{ "Foobar/test.txt", }); internalGetResources(c, "overloaded.txt", null, GERMANY_LOCALE, new String[]{ "Foobar/overloaded.txt", "BaseClass/overloaded.txt", }); internalGetResources(c, "overloaded.txt", null, null, new String[]{ "Foobar/overloaded.txt", "BaseClass/overloaded.txt", }); internalGetResources(c, "overloaded.txt", new String[]{}, null, new String[]{ "Foobar/overloaded.txt", "BaseClass/overloaded.txt", }); internalGetResources(c, "overloaded.txt", new String[]{""}, null, new String[]{ "Foobar/overloaded.txt", "BaseClass/overloaded.txt", }); internalGetResources(c, "overloaded", new String[]{".txt"}, null, new String[]{ "Foobar/overloaded.txt", "BaseClass/overloaded.txt", }); internalGetResources(c, "link.txt", null, GERMANY_LOCALE, new String[]{ "Foobar/test.txt", }); internalGetResources(c, "cyclic1", null, GERMANY_LOCALE, new String[]{}); internalGetResources(c, "cyclicFallback1", null, GERMANY_LOCALE, new String[]{ "Foobar/cyclicFallback1", }); c = Foobar.Internal.class; internalGetResources(c, "test.txt", null, GERMANY_LOCALE, new String[]{ "Foobar/Internal/test.txt", "Foobar/test.txt", }); c = Foobar.StaticInternal.class; internalGetResources(c, "test.txt", null, GERMANY_LOCALE, new String[]{ "Foobar/StaticInternal/de/test.txt", "Foobar/StaticInternal/test.txt", "Foobar/test.txt", }); c = Foobar.StaticInternal.Foo.class; internalGetResources(c, "test.txt", null, GERMANY_LOCALE, new String[]{ "Foobar/StaticInternal/de/test.txt", "Foobar/StaticInternal/test.txt", "Foobar/test.txt", }); }