ResourceSupport { public Localizable getLocalizable() { return localizable; } 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 getLocalizable() throws Exception { resourcesupport = new ResourceSupport(Foobar.class); internalGetLocalizable(null, false); Object o = new Foobar(); resourcesupport = new ResourceSupport(o); internalGetLocalizable(o, false); o = ((Foobar) o).new Internal(); resourcesupport = new ResourceSupport(o); internalGetLocalizable(o, true); Locale l; Localizable loc; o = new Foobar(); resourcesupport = new ResourceSupport(o); loc = resourcesupport.getLocalizable(); loc.setLocale(HESSIAN_LOCALE); l = loc.getLocale(); assertEquals(HESSIAN_LOCALE, l); o = ((Foobar) o).new Internal(); resourcesupport = new ResourceSupport(o); loc = resourcesupport.getLocalizable(); loc.setLocale(null); l = loc.getLocale(); assertEquals(HESSIAN_LOCALE, l); o = new Foobar.StaticInternal(); resourcesupport = new ResourceSupport(o); loc = resourcesupport.getLocalizable(); loc.setLocale(HESSIAN_LOCALE); l = loc.getLocale(); assertEquals(HESSIAN_LOCALE, l); o = new Foobar.StaticInternal.Foo(); resourcesupport = new ResourceSupport(o); loc = resourcesupport.getLocalizable(); loc.setLocale(HESSIAN_LOCALE); l = loc.getLocale(); assertEquals(null, l); }