public void testErrorHandlingBad() throws Exception {
    final URL url = getClass().getResource("Prd-3985.prpt");
    final ResourceManager mgr = new ResourceManager();
    final MasterReport report =
        (MasterReport) mgr.createDirectly(url, MasterReport.class).getResource();
    report
        .getReportConfiguration()
        .setConfigProperty(
            "org.pentaho.reporting.engine.classic.core.FailOnAttributeExpressionErrors", "true");

    final FormulaExpression function = new FormulaExpression();
    function.setName("Test");
    function.setFormula("=MULTIVALUEQUERY(\"Bad\")");

    report
        .getReportHeader()
        .setAttributeExpression(AttributeNames.Core.NAMESPACE, AttributeNames.Core.NAME, function);

    try {
      DebugReportRunner.createPDF(report);
      Assert.fail();
    } catch (Exception e) {
      // ignored
    }
  }
Exemplo n.º 2
0
 public void testSeq1Crash2() throws Exception {
   if (DebugReportRunner.isSkipLongRunTest()) {
     return;
   }
   final MasterReport masterReport =
       DebugReportRunner.parseGoldenSampleReport("Prd-2087-small.prpt");
   DebugReportRunner.createPDF(masterReport);
 }
  public void testSeq1Crash2() throws Exception {
    final MasterReport masterReport =
        DebugReportRunner.parseGoldenSampleReport("Prd-2087-small.prpt");
    // masterReport.setCompatibilityLevel(ClassicEngineBoot.computeVersionId(3, 8, 0));
    DebugReportRunner.createPDF(masterReport);

    //    DebugReportRunner.showDialog(masterReport);

  }