@Test public void testThreeConcat() throws Exception { String results = addComment(SCRT1, URL1.toString()) + addComment(SCRT2,URL2.toString()) + addComment(SCRT3, URL3.toString()); runConcat(sequentialExecutor, results, null, URL1, URL2, URL3); }
@Test public void testThreeConcat() throws Exception { String results = addComment(SCRT1, URL1.toString()) + addComment(SCRT2,URL2.toString()) + addComment(SCRT3, URL3.toString()); runConcat(sequentialExecutor, results, null, URL1, URL2, URL3); }
@Test public void testThreeConcatThreaded() throws Exception { String results = addComment(SCRT1, URL1.toString()) + addComment(SCRT2,URL2.toString()) + addComment(SCRT3, URL3.toString()); runConcat(threadedExecutor, results, null, URL1, URL2, URL3); }
@Test public void testThreeConcat() throws Exception { String results = addComment(SCRT1, URL1.toString()) + addComment(SCRT2,URL2.toString()) + addComment(SCRT3, URL3.toString()); runConcat(sequentialExecutor, results, null, URL1, URL2, URL3); }
@Test public void testThreeConcatThreaded() throws Exception { String results = addComment(SCRT1, URL1.toString()) + addComment(SCRT2,URL2.toString()) + addComment(SCRT3, URL3.toString()); runConcat(threadedExecutor, results, null, URL1, URL2, URL3); }
@Test public void testThreeConcatThreaded() throws Exception { String results = addComment(SCRT1, URL1.toString()) + addComment(SCRT2,URL2.toString()) + addComment(SCRT3, URL3.toString()); runConcat(threadedExecutor, results, null, URL1, URL2, URL3); }
@Test public void testSimpleConcat() throws Exception { String results = addComment(SCRT1, URL1.toString()) + addComment(SCRT2,URL2.toString()); runConcat(sequentialExecutor, results, null, URL1, URL2); }
@Test public void testSimpleConcatThreaded() throws Exception { String results = addComment(SCRT1, URL1.toString()) + addComment(SCRT2,URL2.toString()); runConcat(threadedExecutor, results, null, URL1, URL2); }
@Test public void testSimpleConcat() throws Exception { String results = addComment(SCRT1, URL1.toString()) + addComment(SCRT2,URL2.toString()); runConcat(sequentialExecutor, results, null, URL1, URL2); }
@Test public void testSimpleConcatThreaded() throws Exception { String results = addComment(SCRT1, URL1.toString()) + addComment(SCRT2,URL2.toString()); runConcat(threadedExecutor, results, null, URL1, URL2); }
@Test public void testSimpleConcat() throws Exception { String results = addComment(SCRT1, URL1.toString()) + addComment(SCRT2,URL2.toString()); runConcat(sequentialExecutor, results, null, URL1, URL2); }
@Test public void testSimpleConcatThreaded() throws Exception { String results = addComment(SCRT1, URL1.toString()) + addComment(SCRT2,URL2.toString()); runConcat(threadedExecutor, results, null, URL1, URL2); }
@Test public void testConcat404() throws Exception { String url = "http://nobodyhome.com/"; HttpRequest req = new HttpRequest(Uri.parse(url)); HttpResponse resp = new HttpResponseBuilder().setHttpStatusCode(404).create(); expect(pipeline.execute(req)).andReturn(resp).anyTimes(); expectRequestWithUris(Lists.newArrayList(URL1, Uri.parse(url))); servlet.doGet(request, recorder); verify(); String results = addComment(SCRT1, URL1.toString()) + addErrComment(url,404); assertEquals(results, recorder.getResponseAsString()); assertEquals(200, recorder.getHttpStatusCode()); }
@Test public void testConcat404() throws Exception { String url = "http://nobodyhome.com/"; HttpRequest req = new HttpRequest(Uri.parse(url)); HttpResponse resp = new HttpResponseBuilder().setHttpStatusCode(404).create(); expect(pipeline.execute(req)).andReturn(resp).anyTimes(); expectRequestWithUris(Lists.newArrayList(URL1, Uri.parse(url))); servlet.doGet(request, recorder); verify(); String results = addComment(SCRT1, URL1.toString()) + addErrComment(url,404); assertEquals(results, recorder.getResponseAsString()); assertEquals(200, recorder.getHttpStatusCode()); }
@Test public void testConcat404() throws Exception { String url = "http://nobodyhome.com/"; HttpRequest req = new HttpRequest(Uri.parse(url)); HttpResponse resp = new HttpResponseBuilder().setHttpStatusCode(404).create(); expect(pipeline.execute(req)).andReturn(resp).anyTimes(); expectRequestWithUris(Lists.newArrayList(URL1, Uri.parse(url))); servlet.doGet(request, recorder); verify(); String results = addComment(SCRT1, URL1.toString()) + addErrComment(url,404); assertEquals(results, recorder.getResponseAsString()); assertEquals(200, recorder.getHttpStatusCode()); }
@Test public void testConcatBadException() throws Exception { final Uri URL4 = Uri.parse("http://example.org/4.js"); HttpRequest req = new HttpRequest(URL4); expect(pipeline.execute(req)).andThrow( new GadgetException(GadgetException.Code.HTML_PARSE_ERROR)).anyTimes(); expectRequestWithUris(Lists.newArrayList(URL1, URL4)); // Run the servlet servlet.doGet(request, recorder); verify(); String results = addComment(SCRT1, URL1.toString()) + "HTML_PARSE_ERROR concat(http://example.org/4.js) null"; assertEquals(results, recorder.getResponseAsString()); assertEquals(400, recorder.getHttpStatusCode()); }
@Test public void testConcatBadException() throws Exception { final Uri URL4 = Uri.parse("http://example.org/4.js"); HttpRequest req = new HttpRequest(URL4); expect(pipeline.execute(req)).andThrow( new GadgetException(GadgetException.Code.HTML_PARSE_ERROR)).anyTimes(); expectRequestWithUris(Lists.newArrayList(URL1, URL4)); // Run the servlet servlet.doGet(request, recorder); verify(); String results = addComment(SCRT1, URL1.toString()) + addConcatErrComment(GadgetException.Code.HTML_PARSE_ERROR, URL4.toString()); assertEquals(results, recorder.getResponseAsString()); assertEquals(400, recorder.getHttpStatusCode()); }
@Test public void testConcatBadException() throws Exception { final Uri URL4 = Uri.parse("http://example.org/4.js"); HttpRequest req = new HttpRequest(URL4); expect(pipeline.execute(req)).andThrow( new GadgetException(GadgetException.Code.HTML_PARSE_ERROR)).anyTimes(); expectRequestWithUris(Lists.newArrayList(URL1, URL4)); // Run the servlet servlet.doGet(request, recorder); verify(); String results = addComment(SCRT1, URL1.toString()) + addConcatErrComment(GadgetException.Code.HTML_PARSE_ERROR, URL4.toString()); assertEquals(results, recorder.getResponseAsString()); assertEquals(400, recorder.getHttpStatusCode()); }