Package juzu.impl.router.regex

Examples of juzu.impl.router.regex.RENode


  private void assertCapturing(String test, String expected) throws SyntaxException, IOException {
    assertTransform(test, expected, true);
  }

  private void assertTransform(String test, String expected, boolean capturing) throws SyntaxException, IOException {
    RENode node = new REParser(test).parse();
    REVisitor<RuntimeException> transformer = capturing ? new CaptureGroupTransformation() : new NonCaptureGroupTransformation();
    node.accept(transformer);
    StringBuilder sb = new StringBuilder();
    RERenderer renderer = new RERenderer(sb);
    node.accept(renderer);
    assertEquals(expected, sb.toString());
  }
View Full Code Here


/** @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a> */
public class FooRendererTestCase extends AbstractTestCase {

  private static void assertSatisfied(String expression, String... expected) throws Exception {
    RENode root = new REParser(expression).parse();
    List<ValueResolverFactory.Alternative> alternatives = new ValueResolverFactory().foo(root);
    assertEquals(expected.length, alternatives.size());
    for (int i = 0;i < expected.length;i++) {
      assertEquals(expected[i], alternatives.get(i).getResolvingExpression().toString());
    }
View Full Code Here

/** @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a> */
public class FooVisitorTestCase extends AbstractTestCase {

  private static void assertSatisfied(String expression, String... expected) throws Exception {
    RENode root = new REParser(expression).parse();
    root.accept(new CaptureGroupTransformation());
    List<ValueResolverFactory.Alternative> alternatives = new ValueResolverFactory().foo(root);
    assertEquals(expected.length, alternatives.size());
    for (int i = 0;i < expected.length;i++) {
      assertEquals(expected[i], alternatives.get(i).getResolvingExpression().toString());
    }
View Full Code Here

TOP

Related Classes of juzu.impl.router.regex.RENode

Copyright © 2018 www.massapicom. 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.