コード例 #1
0
ファイル: ImageTestUtils.java プロジェクト: akarmas/mrgeo
  public static void outputImageMatchesBaseline(
      final WebResponse response, final String baselineImage) throws IOException {
    final File baseline = new File(baselineImage);

    assertTrue(baseline.exists());

    log.debug("Response content length: " + response.getContentLength());

    Raster raster = GDALUtils.toRaster(GDALUtils.open(response.getInputStream()));
    Assert.assertNotNull("Test Image: not loaded, could not read stream", raster);

    TestUtils.compareRasters(baseline, raster);
  }
コード例 #2
0
ファイル: MyTest.java プロジェクト: bflavius/nb-soa
  public void testWSDL() throws Exception {
    WebConversation conversation = new WebConversation();
    String destination = testProps.getProperty("destination");
    if (destination != null && destination.length() > 0) {
      WebRequest request = new GetMethodWebRequest(destination + "?WSDL");

      WebResponse response = conversation.getResponse(request);

      int i = response.getContentLength();
      InputSource is = new InputSource(response.getInputStream());

      Document doc = builder.parse(is);

      doc.getDocumentElement();
      System.out.println("My test");
    }
  }