@Test public void loadUriInline() throws Exception { Uri uri = Uri.parse("http://apache.org/resource.js"); Map<String, String> attribs = Maps.newHashMap(); attribs.put("inline", "true"); mockFetcher(uri, URL_JS); FeatureResource resource = loader.load(uri, attribs); assertEquals(URL_JS, resource.getContent()); assertEquals(URL_JS, resource.getDebugContent()); assertTrue(resource.isProxyCacheable()); assertFalse(resource.isExternal()); }
@Test public void loadUriInline() throws Exception { Uri uri = Uri.parse("http://apache.org/resource.js"); Map<String, String> attribs = Maps.newHashMap(); attribs.put("inline", "true"); mockFetcher(uri, URL_JS); FeatureResource resource = loader.load(uri, attribs); assertEquals(URL_JS, resource.getContent()); assertEquals(URL_JS, resource.getDebugContent()); assertTrue(resource.isProxyCacheable()); assertFalse(resource.isExternal()); }
@Test public void loadUriInline() throws Exception { Uri uri = Uri.parse("http://apache.org/resource.js"); Map<String, String> attribs = Maps.newHashMap(); attribs.put("inline", "true"); HttpFetcher fetcher = mockFetcher(uri, URL_JS); loader.setHttpFetcher(fetcher); FeatureResource resource = loader.load(uri, attribs); assertEquals(URL_JS, resource.getContent()); assertEquals(URL_JS, resource.getDebugContent()); assertTrue(resource.isProxyCacheable()); assertFalse(resource.isExternal()); }
@Test public void loadUriExtern() throws Exception { String theUrl = "http://apache.org/resource.js"; Uri uri = Uri.parse(theUrl); Map<String, String> attribs = Maps.newHashMap(); mockFetcher(uri, URL_JS); FeatureResource resource = loader.load(uri, attribs); assertEquals(theUrl, resource.getContent()); assertEquals(theUrl, resource.getDebugContent()); assertTrue(resource.isProxyCacheable()); assertTrue(resource.isExternal()); }
@Test public void loadUriExtern() throws Exception { String theUrl = "http://apache.org/resource.js"; Uri uri = Uri.parse(theUrl); Map<String, String> attribs = Maps.newHashMap(); mockFetcher(uri, URL_JS); FeatureResource resource = loader.load(uri, attribs); assertEquals(theUrl, resource.getContent()); assertEquals(theUrl, resource.getDebugContent()); assertTrue(resource.isProxyCacheable()); assertTrue(resource.isExternal()); }
@Test public void loadUriExtern() throws Exception { String theUrl = "http://apache.org/resource.js"; Uri uri = Uri.parse(theUrl); Map<String, String> attribs = Maps.newHashMap(); HttpFetcher fetcher = mockFetcher(uri, URL_JS); loader.setHttpFetcher(fetcher); // should have no effect on its own FeatureResource resource = loader.load(uri, attribs); assertEquals(theUrl, resource.getContent()); assertEquals(theUrl, resource.getDebugContent()); assertTrue(resource.isProxyCacheable()); assertTrue(resource.isExternal()); }