public void testRowBoxesEstablishOwnBlockContext() throws Exception {
    // this report defines that the group as well as all bands within that group are row-layout.
    // therefore the two itembands end on the same row.

    // The itemband did not define a width, not even a 100% width, and thus ends with a width of
    // auto/zero.
    // therefore the itemband shrinks to the minimal size that still encloses all elements.
    // the elements that have percentage width are resolved against the block context.
    // A band without a width defined (the itemband!), does not establish an own block-context, so
    // it
    // takes the block context of the parent, or as fallback: page.

    final File file = GoldTestBase.locateGoldenSampleReport("Prd-3479.prpt");
    final ResourceManager mgr = new ResourceManager();
    mgr.registerDefaults();
    final Resource directly = mgr.createDirectly(file, MasterReport.class);
    final MasterReport report = (MasterReport) directly.getResource();
    report.setCompatibilityLevel(null);

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutPage(report, 0);
    final RenderNode[] itembands =
        MatchFactory.findElementsByElementType(logicalPageBox, ItemBandType.INSTANCE);

    assertEquals(2, itembands.length);
    assertEquals(48208843, itembands[0].getWidth());
    assertEquals(48208843, itembands[1].getWidth());
    assertEquals(48208843, itembands[1].getX());
  }
  public void testGoldRun() throws Exception {
    final File file = GoldTestBase.locateGoldenSampleReport("Prd-3239.prpt");
    final ResourceManager mgr = new ResourceManager();
    mgr.registerDefaults();
    final Resource directly = mgr.createDirectly(file, MasterReport.class);
    final MasterReport report = (MasterReport) directly.getResource();
    report.setCompatibilityLevel(ClassicEngineBoot.computeVersionId(3, 8, 0));

    DebugReportRunner.createXmlFlow(report);
  }
  public void testWizardDefinitionIsAvailable() throws Exception {
    final File url = GoldTestBase.locateGoldenSampleReport("prd-2887.prpt");
    assertNotNull(url);
    final ResourceManager resourceManager = new ResourceManager();
    resourceManager.registerDefaults();
    final Resource directly = resourceManager.createDirectly(url, MasterReport.class);
    final MasterReport org = (MasterReport) directly.getResource();

    assertNotNull(WizardProcessorUtil.loadWizardSpecification(org, resourceManager));
    final MasterReport report = postProcess(org);
    assertNotNull(WizardProcessorUtil.loadWizardSpecification(report, report.getResourceManager()));
    DetailsHeader detailsHeader = report.getDetailsHeader();
    detailsHeader.getElement(0).setName("MagicChange");

    LogicalPageBox logicalPageBox = DebugReportRunner.layoutPage(report, 1);
    ModelPrinter.INSTANCE.print(logicalPageBox);
  }
  public void testResourceLabelAfterSerialization() throws Exception {
    final File url = GoldTestBase.locateGoldenSampleReport("Prd-3514.prpt");
    assertNotNull(url);
    final ResourceManager resourceManager = new ResourceManager();
    resourceManager.registerDefaults();
    final Resource directly = resourceManager.createDirectly(url, MasterReport.class);
    final MasterReport org = (MasterReport) directly.getResource();

    final MasterReport report = postProcess(org);

    RelationalGroup relationalGroup = report.getRelationalGroup(0);
    GroupHeader header = relationalGroup.getHeader();
    Band band = (Band) header.getElement(0);
    Element element = band.getElement(1);
    assertTrue(element.getElementType() instanceof ResourceMessageType);
    element.setName("DateTitleField");
    //    LogicalPageBox logicalPageBox = DebugReportRunner.layoutPage(report, 1);
    LogicalPageBox logicalPageBox =
        DebugReportRunner.layoutSingleBand(report, header, false, false);
    RenderNode dateTitleField = MatchFactory.findElementByName(logicalPageBox, "DateTitleField");
    assertNotNull(dateTitleField);
    //    ModelPrinter.INSTANCE.print(logicalPageBox);
  }