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

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


    final MemoryByteArrayOutputStream bout = new MemoryByteArrayOutputStream();
    BundleWriter.writeReportToZipStream(report, bout);
    final ResourceManager mgr = new ResourceManager();
    mgr.registerDefaults();

    final Resource resource = mgr.createDirectly(bout.toByteArray(), MasterReport.class);
    final MasterReport r2 = (MasterReport) resource.getResource();
    return r2.getDataFactory();
  }

  protected void runTest(final String[][] queriesAndResults) throws Exception
View Full Code Here


    }
    finally
    {
      outputStream.close();
    }
    return (outputStream.toByteArray());
  }

  protected byte[] executeTableStream(final MasterReport report)
      throws IOException, ReportProcessingException
  {
View Full Code Here

    }
    finally
    {
      outputStream.close();
    }
    return (outputStream.toByteArray());
  }

  protected void initializeTestEnvironment() throws Exception
  {
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 testWriteBanded() throws Exception
  {
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 testWriteBandedNullCubeName() throws Exception
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, originalMeta);
    assertTrue(bout.getLength() > 0);

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


  @Test
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.