ResourceSupport { public URL[] getLocalResources(final String resourceBaseName, final String[] suffixes, final Locale locale) { if(object != null) { return Resources.getLocalResources(clazz, resourceBaseName, suffixes, resolveLocale(locale)); } return Resources.getLocalResources(clazz, resourceBaseName, suffixes, locale); } ResourceSupport(Object object); Locale resolveLocale(final Locale locale); Class getResourceClass(); Object getResourceObject(); Localizable getLocalizable(); URL[] getLocalResources(final String resourceBaseName, final String[] suffixes, final Locale locale); URL[] getLocalResources(final String resourceBaseName, final String[] suffixes); URL[] getLocalResources(final String resourceName, final Locale locale); URL[] getLocalResources(final String resourceName); URL getLocalResource(final String resourceBaseName, final String[] suffixes, final Locale locale); URL getLocalResource(final String resourceBaseName, final String[] suffixes); URL getLocalResource(final String resourceName, final Locale locale); URL getLocalResource(final String resourceName); InputStream getLocalResourceAsStream(final String resourceBaseName, final String[] suffixes, final Locale locale); InputStream getLocalResourceAsStream(final String resourceBaseName, final String[] suffixes); InputStream getLocalResourceAsStream(final String resourceBaseName, final Locale locale); InputStream getLocalResourceAsStream(final String resourceName); URL[] getResources(final String resourceBaseName, final String[] suffixes, final Locale locale); URL[] getResources(final String resourceBaseName, final String[] suffixes); URL[] getResources(final String resourceName, final Locale locale); URL[] getResources(final String resourceName); URL getResource(final String resourceBaseName, final String[] suffixes, final Locale locale); URL getResource(final String resourceBaseName, final String[] suffixes); URL getResource(final String resourceName, final Locale locale); URL getResource(final String resourceName); InputStream getResourceAsStream(final String resourceBaseName, final String[] suffixes, final Locale locale); InputStream getResourceAsStream(final String resourceBaseName, final String[] suffixes); InputStream getResourceAsStream(final String resourceName, final Locale locale); InputStream getResourceAsStream(final String resourceName); Map<String, Object> getLocalResourceMap(final String bundleBaseName, final Locale locale); Map<String, Object> getLocalResourceMap(final String bundleBaseName); Map<String, Object> getResourceMap(final String bundleBaseName, final Locale locale); Map<String, Object> getResourceMap(final String bundleBaseName);  }
@Test public void getLocalResources() throws Exception { internalGetLocalResources("defaultFallback.txt", null, GERMANY_LOCALE, new String[]{}); internalGetLocalResources("defaultFallback", new String[]{".txt", ".html"}, GERMANY_LOCALE, new String[]{}); internalGetLocalResources("test.txt", null, GERMANY_LOCALE, new String[]{ "Foobar/test.txt", }); internalGetLocalResources("overloaded.txt", null, GERMANY_LOCALE, new String[]{ "Foobar/overloaded.txt", }); internalGetLocalResources("overloaded.txt", null, null, new String[]{ "Foobar/overloaded.txt", }); internalGetLocalResources("overloaded.txt", new String[]{}, null, new String[]{ "Foobar/overloaded.txt", }); internalGetLocalResources("overloaded.txt", new String[]{""}, null, new String[]{ "Foobar/overloaded.txt", }); internalGetLocalResources("overloaded", new String[]{".txt"}, null, new String[]{ "Foobar/overloaded.txt", }); internalGetLocalResources("link.txt", null, GERMANY_LOCALE, new String[]{ "Foobar/test.txt", }); internalGetLocalResources("cyclic1", null, GERMANY_LOCALE, new String[]{}); internalGetLocalResources("cyclicFallback1", null, GERMANY_LOCALE, new String[]{ "Foobar/cyclicFallback1", }); resourcesupport = new ResourceSupport(Foobar.Internal.class); internalGetLocalResources("test.txt", null, GERMANY_LOCALE, new String[]{ "Foobar/Internal/test.txt", }); resourcesupport = new ResourceSupport(Foobar.StaticInternal.class); internalGetLocalResources("test.txt", null, GERMANY_LOCALE, new String[]{ "Foobar/StaticInternal/de/test.txt", "Foobar/StaticInternal/test.txt", }); resourcesupport = new ResourceSupport(Foobar.StaticInternal.Foo.class); internalGetLocalResources("test.txt", null, GERMANY_LOCALE, new String[]{}); }