private void checkChainedStyle(boolean debug, boolean noCache, String version) throws Exception { String host = "host.com"; String path = "/proxy/" + DefaultProxyUriManager.CHAINED_PARAMS_TOKEN + "/path"; List<Uri> resources = ImmutableList.of(RESOURCE_1); List<Uri> uris = makeAndGet(host, path, debug, noCache, resources, version); assertEquals(1, uris.size()); verifyChainedUri(RESOURCE_1, uris.get(0), debug, noCache, version, false, host, path); }
private void checkChainedStyleEndOfPath(boolean debug, boolean noCache, String version) throws Exception { String host = "host.com"; String path = "/proxy/" + DefaultProxyUriManager.CHAINED_PARAMS_TOKEN; List<Uri> resources = ImmutableList.of(RESOURCE_1); List<Uri> uris = makeAndGet(host, path, debug, noCache, resources, version); assertEquals(1, uris.size()); verifyChainedUri(RESOURCE_1, uris.get(0), debug, noCache, version, true, host, path); }
private void checkChainedStyle(boolean debug, boolean noCache, String version) throws Exception { String host = "host.com"; String path = "/proxy/" + DefaultProxyUriManager.CHAINED_PARAMS_TOKEN + "/path"; List<Uri> resources = ImmutableList.<Uri>of(RESOURCE_1); List<Uri> uris = makeAndGet(host, path, debug, noCache, resources, version); assertEquals(1, uris.size()); verifyChainedUri(RESOURCE_1, uris.get(0), debug, noCache, version, false, host, path); }
private void checkChainedStyleEndOfPath(boolean debug, boolean noCache, String version) throws Exception { String host = "host.com"; String path = "/proxy/" + DefaultProxyUriManager.CHAINED_PARAMS_TOKEN; List<Uri> resources = ImmutableList.of(RESOURCE_1); List<Uri> uris = makeAndGet(host, path, debug, noCache, resources, version); assertEquals(1, uris.size()); verifyChainedUri(RESOURCE_1, uris.get(0), debug, noCache, version, true, host, path); }
private void checkChainedStyleEndOfPath(boolean debug, boolean noCache, String version) throws Exception { String host = "host.com"; String path = "/proxy/" + DefaultProxyUriManager.CHAINED_PARAMS_TOKEN; List<Uri> resources = ImmutableList.<Uri>of(RESOURCE_1); List<Uri> uris = makeAndGet(host, path, debug, noCache, resources, version); assertEquals(1, uris.size()); verifyChainedUri(RESOURCE_1, uris.get(0), debug, noCache, version, true, host, path); }
private void checkChainedStyle(boolean debug, boolean noCache, String version) throws Exception { String host = "host.com"; String path = "/proxy/" + DefaultProxyUriManager.CHAINED_PARAMS_TOKEN + "/path"; List<Uri> resources = ImmutableList.of(RESOURCE_1); List<Uri> uris = makeAndGet(host, path, debug, noCache, resources, version); assertEquals(1, uris.size()); verifyChainedUri(RESOURCE_1, uris.get(0), debug, noCache, version, false, host, path); }
@Test public void batchedProxyChainedStyle() throws Exception { String host = "host.com"; String path = "/proxy/" + DefaultProxyUriManager.CHAINED_PARAMS_TOKEN + "/path"; List<Uri> resources = ImmutableList.of(RESOURCE_1, RESOURCE_2, RESOURCE_3); String[] versions = new String[] { "v1", "v2", "v3" }; List<Uri> uris = makeAndGet(host, path, true, true, resources, versions); assertEquals(3, uris.size()); for (int i = 0; i < 3; ++i) { verifyChainedUri(resources.get(i), uris.get(i), true, true, versions[i], false, host, path); } }
@Test public void batchedProxyChainedStyle() throws Exception { String host = "host.com"; String path = "/proxy/" + DefaultProxyUriManager.CHAINED_PARAMS_TOKEN + "/path"; List<Uri> resources = ImmutableList.of(RESOURCE_1, RESOURCE_2, RESOURCE_3); String[] versions = new String[] { "v1", "v2", "v3" }; List<Uri> uris = makeAndGet(host, path, true, true, resources, versions); assertEquals(3, uris.size()); for (int i = 0; i < 3; ++i) { verifyChainedUri(resources.get(i), uris.get(i), true, true, versions[i], false, host, path); } }
@Test public void batchedProxyChainedStyle() throws Exception { String host = "host.com"; String path = "/proxy/" + DefaultProxyUriManager.CHAINED_PARAMS_TOKEN + "/path"; List<Uri> resources = ImmutableList.<Uri>of(RESOURCE_1, RESOURCE_2, RESOURCE_3); String[] versions = new String[] { "v1", "v2", "v3" }; List<Uri> uris = makeAndGet(host, path, true, true, resources, versions); assertEquals(3, uris.size()); for (int i = 0; i < 3; ++i) { verifyChainedUri(resources.get(i), uris.get(i), true, true, versions[i], false, host, path); } }
@Test public void batchedProxyChainedStyleNoVerisons() throws Exception { String host = "host.com"; String path = "/proxy/" + DefaultProxyUriManager.CHAINED_PARAMS_TOKEN + "/path"; List<Uri> resources = ImmutableList.<Uri>of(RESOURCE_1, RESOURCE_2, RESOURCE_3); List<Uri> uris = makeAndGet(host, path, true, true, resources); assertEquals(3, uris.size()); for (int i = 0; i < 3; ++i) { verifyChainedUri(resources.get(i), uris.get(i), true, true, null, false, host, path); } }
@Test public void batchedProxyChainedStyleNoVerisons() throws Exception { String host = "host.com"; String path = "/proxy/" + DefaultProxyUriManager.CHAINED_PARAMS_TOKEN + "/path"; List<Uri> resources = ImmutableList.of(RESOURCE_1, RESOURCE_2, RESOURCE_3); List<Uri> uris = makeAndGet(host, path, true, true, resources); assertEquals(3, uris.size()); for (int i = 0; i < 3; ++i) { verifyChainedUri(resources.get(i), uris.get(i), true, true, null, false, host, path); } }
@Test public void batchedProxyChainedStyleNoVerisons() throws Exception { String host = "host.com"; String path = "/proxy/" + DefaultProxyUriManager.CHAINED_PARAMS_TOKEN + "/path"; List<Uri> resources = ImmutableList.of(RESOURCE_1, RESOURCE_2, RESOURCE_3); List<Uri> uris = makeAndGet(host, path, true, true, resources); assertEquals(3, uris.size()); for (int i = 0; i < 3; ++i) { verifyChainedUri(resources.get(i), uris.get(i), true, true, null, false, host, path); } }
@Test public void verifyAddedParamsChained() throws Exception { String host = "host.com"; String path = "/proxy/" + DefaultProxyUriManager.CHAINED_PARAMS_TOKEN + "/path"; ProxyUriManager.Versioner versioner = makeVersioner(null, "version"); DefaultProxyUriManager manager = makeManager(host, path, versioner); List<ProxyUri> proxyUris = Lists.newLinkedList(); ProxyUri pUri = new ProxyUri(null, false, true, CONTAINER, SPEC_URI.toString(), RESOURCE_1); pUri.setExtensionParams(ImmutableMap.<String, String>of("test", "1")); pUri.setResize(100, 10, 90, true); proxyUris.add(pUri); List<Uri> uris = manager.make(proxyUris, null); assertEquals(1, uris.size()); verifyChainedUri(RESOURCE_1, uris.get(0), false, true, null, false, host, path); // Verify added param: assertEquals("/proxy/container=container&gadget=http%3A%2F%2Fexample.com%2Fgadget.xml" + "&debug=0&nocache=1&v=version&test=1&resize_h=10&resize_w=100&resize_q=90&no_expand=1" + "/path/http://example.com/one.dat", uris.get(0).getPath()); }
@Test public void verifyAddedParamsChained() throws Exception { String host = "host.com"; String path = "/proxy/" + DefaultProxyUriManager.CHAINED_PARAMS_TOKEN + "/path"; ProxyUriManager.Versioner versioner = makeVersioner(null, "version"); DefaultProxyUriManager manager = makeManager(host, path, versioner); List<ProxyUri> proxyUris = Lists.newLinkedList(); ProxyUri pUri = new ProxyUri(null, false, true, CONTAINER, SPEC_URI.toString(), RESOURCE_1); pUri.setResize(100, 10, 90, true); proxyUris.add(pUri); List<Uri> uris = manager.make(proxyUris, null); assertEquals(1, uris.size()); verifyChainedUri(RESOURCE_1, uris.get(0), false, true, null, false, host, path); // Verify added param: assertEquals("/proxy/container=container&gadget=http%3A%2F%2Fexample.com%2Fgadget.xml" + "&debug=0&nocache=1&v=version&resize_h=10&resize_w=100&resize_q=90&no_expand=1" + "/path/http://example.com/one.dat", uris.get(0).getPath()); }
@Test public void verifyAddedParamsChained() throws Exception { String host = "host.com"; String path = "/proxy/" + DefaultProxyUriManager.CHAINED_PARAMS_TOKEN + "/path"; ProxyUriManager.Versioner versioner = makeVersioner(null, "version"); DefaultProxyUriManager manager = makeManager(host, path, versioner); List<ProxyUri> proxyUris = Lists.newLinkedList(); ProxyUri pUri = new ProxyUri(null, false, true, CONTAINER, SPEC_URI.toString(), RESOURCE_1); pUri.setExtensionParams(ImmutableMap.<String, String>of("test", "1")); pUri.setResize(100, 10, 90, true); proxyUris.add(pUri); List<Uri> uris = manager.make(proxyUris, null); assertEquals(1, uris.size()); verifyChainedUri(RESOURCE_1, uris.get(0), false, true, null, false, host, path); // Verify added param: assertEquals("/proxy/container=container&gadget=http%3A%2F%2Fexample.com%2Fgadget.xml" + "&debug=0&nocache=1&v=version&test=1&resize_h=10&resize_w=100&resize_q=90&no_expand=1" + "/path/http://example.com/one.dat", uris.get(0).getPath()); }