PortletApplicationContext implements ApplicationContext { public Collection<ApplicationResource> getResources(String path) { ArrayList<ApplicationResource> resources = new ArrayList<ApplicationResource>(); resources.add(getResource(path)); return resources; } PortletApplicationContext(PortletContext context); Object getContext(); void initialize(PortletContext context); PortletContext getPortletContext(); Map<String, Object> getApplicationScope(); Map<String, String> getInitParams(); ApplicationResource getResource(String localePath); ApplicationResource getResource(ApplicationResource base, Locale locale); Collection<ApplicationResource> getResources(String path);  }
@Test public void testGetResources() throws IOException { URL url = new URL("file: expect(portletContext.getResource("/my/path")).andReturn(url); replay(portletContext); Collection<ApplicationResource> resources = context.getResources("/my/path"); assertEquals(1, resources.size()); assertEquals(resources.iterator().next().getLocalePath(), "/my/path"); verify(portletContext); }