Package org.pentaho.reporting.libraries.base.util

Examples of org.pentaho.reporting.libraries.base.util.MemoryByteArrayOutputStream.toByteArray()


    ct.setPrintDetailsHeader(false);

    final MemoryByteArrayOutputStream outputStream = new MemoryByteArrayOutputStream();
    HtmlReportUtil.createStreamHTML(report, outputStream);

    final String htmlText = new String(outputStream.toByteArray(), "UTF-8");
    DebugLog.log(htmlText);
    assertTrue(htmlText.contains("<td colspan=\"2\" valign=\"top\" class=\"style-1\">2003</td>"));
    assertTrue(htmlText.contains("<td colspan=\"2\" valign=\"top\" class=\"style-1\">2004</td>"));
    assertTrue(htmlText.contains("<td colspan=\"2\" valign=\"top\" class=\"style-1\">2005</td>"));
    assertTrue(htmlText.contains("<td valign=\"top\" class=\"style-3\">Product Line</td>"));
View Full Code Here


    ct.setPrintDetailsHeader(false);

    final MemoryByteArrayOutputStream outputStream = new MemoryByteArrayOutputStream();
    HtmlReportUtil.createStreamHTML(report, outputStream);

    final String htmlText = new String(outputStream.toByteArray(), "UTF-8");
    DebugLog.log(htmlText);
    assertTrue(htmlText.contains("<td colspan=\"2\" valign=\"top\" class=\"style-1\">2003</td>"));
    assertTrue(htmlText.contains("<td colspan=\"2\" valign=\"top\" class=\"style-1\">2004</td>"));
    assertTrue(htmlText.contains("<td colspan=\"2\" valign=\"top\" class=\"style-1\">2005</td>"));
    assertTrue(htmlText.contains("<td valign=\"top\" class=\"style-3\">Product Line</td>"));
View Full Code Here

    band.addElement(table);

    final MemoryByteArrayOutputStream outputStream = new MemoryByteArrayOutputStream();
    HtmlReportUtil.createStreamHTML(report, outputStream);

    final String htmlText = new String(outputStream.toByteArray(), "UTF-8");
    assertTrue(htmlText.contains("<td valign=\"top\" class=\"style-1\">header</td>"));
    assertTrue(htmlText.contains("<td valign=\"top\" class=\"style-1\">body</td>"));
  }

  private Band createBodyBox(final String text)
View Full Code Here

      final InputStream postResult = filePost.getResponseBodyAsStream();
      try
      {
        final MemoryByteArrayOutputStream bout = new MemoryByteArrayOutputStream();
        IOUtils.getInstance().copyStreams(postResult, bout);
        return bout.toByteArray();
      }
      finally
      {
        postResult.close();
      }
View Full Code Here

    BundleWriter.writeReportToZipStream(originalReport, bout);
    assertTrue(bout.getLength() > 0);

    final ResourceManager mgr = new ResourceManager();
    mgr.registerDefaults();
    final Resource reportRes = mgr.createDirectly(bout.toByteArray(), MasterReport.class);
    return (MasterReport) reportRes.getResource();
  }


}
View Full Code Here

    // clear all report properties, which may cause trouble ...
    final MemoryByteArrayOutputStream bo = new MemoryByteArrayOutputStream();
    final ObjectOutputStream oout = new ObjectOutputStream(bo);
    oout.writeObject(report);
    oout.close();
    return bo.toByteArray();
  }

  private MasterReport deserializeReportObject(final byte[] data) throws IOException, ClassNotFoundException
  {
    final ByteArrayInputStream bin = new ByteArrayInputStream(data);
View Full Code Here

    BundleWriter.writeReportToZipStream(originalReport, bout);
    assertTrue(bout.getLength() > 0);

    final ResourceManager mgr = new ResourceManager();
    mgr.registerDefaults();
    final Resource reportRes = mgr.createDirectly(bout.toByteArray(), MasterReport.class);
    return (MasterReport) reportRes.getResource();
  }

  public void testWrite() throws Exception
  {
View Full Code Here

    {
      try
      {
        final MemoryByteArrayOutputStream bout = new MemoryByteArrayOutputStream();
        IOUtils.getInstance().copyStreams(byteStream, bout);
        return bout.toByteArray();
      }
      finally
      {
        byteStream.close();
      }
View Full Code Here

    {
      final MemoryByteArrayOutputStream bout = new MemoryByteArrayOutputStream();
      final OutputStreamWriter owriter = new OutputStreamWriter(bout);
      IOUtils.getInstance().copyWriter(characterStream, owriter);
      owriter.close();
      return bout.toByteArray();
    }
    finally
    {
      characterStream.close();
    }
View Full Code Here

    BundleWriter.writeReportToZipStream(originalReport, bout);
    assertTrue(bout.getLength() > 0);

    final ResourceManager mgr = new ResourceManager();
    mgr.registerDefaults();
    final Resource reportRes = mgr.createDirectly(bout.toByteArray(), MasterReport.class);
    return (MasterReport) reportRes.getResource();
  }

  public void testWrite() throws Exception
  {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.