Examples of MatchNode


Examples of org.apache.cocoon.sitemap.node.MatchNode

        assertEquals(3, matches.size());
    }

    @Test
    public void wildcardMatchingPathAttributeWithSlash() throws Exception {
        MatchNode matchNode = new MatchNode();
        PrivateAccessor.setField(matchNode, "wildcard", "abc/*/*");
        MatcherContext matcherContext = matchNode.lookupMatcherContext();
        Map<String, String> matches = matcherContext.match("abc/def/ghi");
        assertTrue(matches.containsValue("abc/def/ghi"));
        assertTrue(matches.containsValue("def"));
        assertTrue(matches.containsValue("ghi"));
        assertEquals(3, matches.size());
View Full Code Here

Examples of org.apache.cocoon.sitemap.node.MatchNode

        assertEquals(3, matches.size());
    }

    @Test
    public void noMatchingAttribute() {
        MatchNode matchNode = new MatchNode();
        MatcherContext matcherContext = matchNode.lookupMatcherContext();
        assertNull("If there is no match attribute, no matcher can be found.", matcherContext);
    }
View Full Code Here

Examples of org.apache.cocoon.sitemap.node.MatchNode

        assertNull("If there is no match attribute, no matcher can be found.", matcherContext);
    }

    @Test
    public void moreThanOneMatchingAttribute() throws Exception {
        MatchNode matchNode = new MatchNode();
        PrivateAccessor.setField(matchNode, "pattern", "123");
        PrivateAccessor.setField(matchNode, "equals", "123");
        try {
            matchNode.lookupMatcherContext();
            fail();
        } catch (Exception e) {
            // expected
        }
    }
View Full Code Here

Examples of org.apache.flink.compiler.dag.MatchNode

  private static final MapNode getMapNode() {
    return new MapNode(new MapOperatorBase<String, String, MapFunction<String,String>>(new IdentityMapper<String>(), new UnaryOperatorInformation<String, String>(BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.STRING_TYPE_INFO), "map op"));
  }
 
  private static final MatchNode getJoinNode() {
    return new MatchNode(new JoinOperatorBase<String, String, String, FlatJoinFunction<String, String, String>>(new DummyFlatJoinFunction<String>(), new BinaryOperatorInformation<String, String, String>(BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.STRING_TYPE_INFO), new int[] {1}, new int[] {2}, "join op"));
  }
View Full Code Here

Examples of org.apache.flink.compiler.dag.MatchNode

      }
      else if (c instanceof GroupReduceOperatorBase) {
        n = new GroupReduceNode((GroupReduceOperatorBase<?, ?, ?>) c);
      }
      else if (c instanceof JoinOperatorBase) {
        n = new MatchNode((JoinOperatorBase<?, ?, ?, ?>) c);
      }
      else if (c instanceof CoGroupOperatorBase) {
        n = new CoGroupNode((CoGroupOperatorBase<?, ?, ?, ?>) c);
      }
      else if (c instanceof CrossOperatorBase) {
View Full Code Here

Examples of org.apache.flink.compiler.dag.MatchNode

          for (PactConnection conn : solutionSetNode.getOutgoingConnections()) {
            OptimizerNode successor = conn.getTarget();
         
            if (successor.getClass() == MatchNode.class) {
              // find out which input to the match the solution set is
              MatchNode mn = (MatchNode) successor;
              if (mn.getFirstPredecessorNode() == solutionSetNode) {
                mn.makeJoinWithSolutionSet(0);
              } else if (mn.getSecondPredecessorNode() == solutionSetNode) {
                mn.makeJoinWithSolutionSet(1);
              } else {
                throw new CompilerException();
              }
            }
            else if (successor.getClass() == CoGroupNode.class) {
View Full Code Here

Examples of org.jruby.ast.MatchNode

        context.getVariableCompiler().retrieveLocalVariable(localVarNode.getIndex(), localVarNode.getDepth());
    }

    public void compileMatch(Node node, BodyCompiler context) {
        MatchNode matchNode = (MatchNode) node;

        compile(matchNode.getRegexpNode(), context);

        context.match();
    }
View Full Code Here

Examples of org.jruby.ast.MatchNode

                    dotNode.isExclusive(), slot);
        }
        case REGEXPNODE:
            warningUnlessEOption(ID.REGEXP_LITERAL_IN_CONDITION, node, "regex literal in condition");
           
            return new MatchNode(node.getPosition(), node);
        }

        return node;
    }
View Full Code Here

Examples of org.jruby.ast.MatchNode

        if (expr) context.getVariableCompiler().retrieveLocalVariable(localVarNode.getIndex(), localVarNode.getDepth());
    }

    public void compileMatch(Node node, BodyCompiler context, boolean expr) {
        MatchNode matchNode = (MatchNode) node;

        compile(matchNode.getRegexpNode(), context,true);

        context.match();
        // TODO: don't require pop
        if (!expr) context.consumeCurrentValue();
    }
View Full Code Here

Examples of org.jruby.ast.MatchNode

                    dotNode.isExclusive(), slot);
        }
        case REGEXPNODE:
            warningUnlessEOption(ID.REGEXP_LITERAL_IN_CONDITION, node, "regex literal in condition");
           
            return new MatchNode(node.getPosition(), node);
        }

        return node;
    }
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.