Examples of ElementMatcher


Examples of org.mule.munit.mel.assertions.ElementMatcher

        context.declareFunction("messageInboundProperty", new MessageMatchingAssertionMelFunction(new ElementMatcherFactory()
        {
            @Override
            public ElementMatcher build(String elementName, MuleMessage muleMessage)
            {
                return new ElementMatcher(muleMessage.getInboundProperty(elementName));
            }
        }));

        context.declareFunction("messageOutboundProperty", new MessageMatchingAssertionMelFunction(new ElementMatcherFactory()
        {
            @Override
            public ElementMatcher build(String elementName, MuleMessage muleMessage)
            {
                return new ElementMatcher(muleMessage.getOutboundProperty(elementName));
            }
        }));


        context.declareFunction("messageInvocationProperty", new MessageMatchingAssertionMelFunction(new ElementMatcherFactory()
        {
            @Override
            public ElementMatcher build(String elementName, MuleMessage muleMessage)
            {
                return new ElementMatcher(muleMessage.getInvocationProperty(elementName));
            }
        }));

        context.declareFunction("messageInboundAttachment", new MessageMatchingAssertionMelFunction(new ElementMatcherFactory()
        {
            @Override
            public ElementMatcher build(String elementName, MuleMessage muleMessage)
            {
                return new ElementMatcher(muleMessage.getInboundAttachment(elementName));
            }
        }));

        context.declareFunction("messageOutboundAttachment", new MessageMatchingAssertionMelFunction(new ElementMatcherFactory()
        {
            @Override
            public ElementMatcher build(String elementName, MuleMessage muleMessage)
            {
                return new ElementMatcher(muleMessage.getOutboundAttachment(elementName));
            }
        }));

        context.declareFunction("valueOf", new ElementMatchingAssertionMelFunction());
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.dom.ElementMatcher

  private static String findTitle(final String field, final Band titleHeader)
  {
    final MatcherContext context = new MatcherContext();
    context.setMatchSubReportChilds(false);

    NodeMatcher m = new AndMatcher(new ElementMatcher(LabelType.INSTANCE),
        new AttributeMatcher(AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.LABEL_FOR, field));
    ReportElement match = ReportStructureMatcher.match(context, titleHeader, m);
    if (match == null)
    {
      if (titleHeader.getElementCount() > 0)
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.testsupport.selector.ElementMatcher

    band.addElement(table);

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, band, false, false);
    //ModelPrinter.INSTANCE.print(logicalPageBox);

    final NodeMatcher matcher = new ChildMatcher(new ElementMatcher("TableCellRenderBox"));
    final RenderNode[] all = MatchFactory.matchAll(logicalPageBox, matcher);


    // assert that the direct childs of a table-cell-render-box have the same width as the table-cell render box
   
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.testsupport.selector.ElementMatcher

    // Test whether the final page has out-of-bounds boxes. The FillPhysicalPages step should have removed them
    List<LogicalPageBox> pages = DebugReportRunner.layoutPages(report, 0, 1, 2);
    for (final LogicalPageBox logicalPageBox: pages)
    {
      final RenderNode[] all = MatchFactory.matchAll(logicalPageBox, new ElementMatcher(TableRowRenderBox.class));
      for (int i = 0; i < all.length; i += 1)
      {
        final RenderNode node = all[i];
        // temporary workaround:
        final RenderBox parent = node.getParent();
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.testsupport.selector.ElementMatcher

    // Test whether the final page has out-of-bounds boxes. The FillPhysicalPages step should have removed them
    List<LogicalPageBox> pages = DebugReportRunner.layoutPages(report, 0, 1, 2);
    for (final LogicalPageBox logicalPageBox: pages)
    {
      final RenderNode[] all = MatchFactory.matchAll(logicalPageBox, new ElementMatcher(TableRowRenderBox.class));
      for (int i = 0; i < all.length; i += 1)
      {
        final RenderNode node = all[i];
        // temporary workaround:
        final RenderBox parent = node.getParent();
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.testsupport.selector.ElementMatcher

      final PhysicalPageDrawable pageDrawable = (PhysicalPageDrawable) rp.getPageDrawable(page);
      final LogicalPageBox logicalPageBox = pageDrawable.getPageDrawable().getLogicalPageBox();

      //ModelPrinter.print(logicalPageBox);
      //if (true) return;
      final RenderNode[] all = MatchFactory.matchAll(logicalPageBox, new ElementMatcher(TableRowRenderBox.class));
      for (int i = 0; i < all.length; i += 1)
      {
        final RenderNode node = all[i];
        // temporary workaround:
        final RenderBox parent = node.getParent();
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.testsupport.selector.ElementMatcher

      final LogicalPageBox logicalPageBox = pageDrawable.getPageDrawable().getLogicalPageBox();


//      new FileModelPrinter("Prd-3930-page-" + page + "-", DebugReportRunner.createTestOutputFile()).print(logicalPageBox);

      final RenderNode[] all = MatchFactory.matchAll(logicalPageBox, new ElementMatcher(TableRowRenderBox.class));
      for (int i = 0; i < all.length; i += 1)
      {
        final RenderNode node = all[i];
        // temporary workaround:
        final RenderBox parent = node.getParent();
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.testsupport.selector.ElementMatcher

      final PhysicalPageDrawable pageDrawable = (PhysicalPageDrawable) rp.getPageDrawable(page);
      final LogicalPageBox logicalPageBox = pageDrawable.getPageDrawable().getLogicalPageBox();

      //ModelPrinter.print(logicalPageBox);
      //if (true) return;
      final RenderNode[] all = MatchFactory.matchAll(logicalPageBox, new ElementMatcher(TableRowRenderBox.class));
      for (int i = 0; i < all.length; i += 1)
      {
        final RenderNode node = all[i];
        // temporary workaround:
        final RenderBox parent = node.getParent();
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.testsupport.selector.ElementMatcher

    band.addElement(table);

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, band, false, false);
    //ModelPrinter.print(logicalPageBox);

    final NodeMatcher matcher = new ChildMatcher(new ElementMatcher("TableCellRenderBox"));
    final RenderNode[] all = MatchFactory.matchAll(logicalPageBox, matcher);

    assertEquals(1, all.length);
    for (final RenderNode renderNode : all)
    {
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.testsupport.selector.ElementMatcher

    band.addElement(table);

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, band, false, false);
    //ModelPrinter.print(logicalPageBox);

    final NodeMatcher matcher = new ChildMatcher(new ElementMatcher("TableCellRenderBox"));
    final RenderNode[] all = MatchFactory.matchAll(logicalPageBox, matcher);

    assertEquals(1, all.length);
    for (final RenderNode renderNode : all)
    {
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.