Package org.stringtree.mojasef.model

Examples of org.stringtree.mojasef.model.NonTerminalAlias


    public void addTerminalAlias(String pattern, String rewrite) {
      addAlias(new TerminalAlias(pattern, rewrite));
    }
   
    public void addNonterminalAlias(String pattern, String rewrite) {
      addAlias(new NonTerminalAlias(pattern, rewrite));
    }
View Full Code Here


    assertEquals("StringRet finder worked a='hello' b=''", request("/aa/hello"));
  }

  public void testTerminalAndNonTerminalReplace() throws IOException {
    server.addAlias(new TerminalAlias("/blue", "/index"));
    server.addAlias(new NonTerminalAlias("/([^\\/]*)/(.*)", "/$2"));
    server.addAlias(new NonTerminalAlias("/", "/ugh"));
    server.addAlias(new NonTerminalAlias("/index", "/ugh"));
    assertEquals("StringRet ugh worked", request("/"));
    assertEquals("StringRet ugh worked", request("/index"));
    assertEquals("StringRet ugh worked", request("/aa/index"));
    assertEquals("StringRet index worked", request("/blue"));
  }
View Full Code Here

TOP

Related Classes of org.stringtree.mojasef.model.NonTerminalAlias

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.