Package com.google.greaze.definition

Examples of com.google.greaze.definition.CallPathParser


    // Since we map GuiceServlet to * the entire path after context-path becomes Servlet-Path
    String servletPath = request.getServletPath();
    if (LogConfig.FINE) log.fine("Received ServletPath: " + servletPath);
    String incomingPath =  servletPath.substring(greazeDispatcherServletPath.length());
    for (CallPath servicePath : servicePaths) {
      CallPathParser callPathParser = servicePath.toParser();
      try {
        CallPath incomingCallPath = callPathParser.parse(incomingPath);
        if (incomingCallPath.matches(servicePath)) {
          if (LogConfig.FINE) {
            log.fine(String.format(
                "Matched: Incoming path: %s, servicePath: %s", incomingPath, servicePath));
          }
          return callPathParser.parse(incomingPath);
        }
      } catch (CallPathParser.ParseException e) {
      }
    }
    return CallPath.NULL_PATH;
View Full Code Here


    super.setUp();
    this.gson = new Gson();
    ServerConfig serverConfig = new ServerConfig(SERVER_URL);
    this.client = new WebServiceClient(serverConfig);

    CallPath callPath = new CallPathParser(null, false, "/resource").parse(CALL_PATH);
    callSpec = new WebServiceCallSpec.Builder(callPath).build();
    HeaderMapSpec headerSpec = new HeaderMapSpec.Builder().build();
    requestHeaders = new HeaderMap.Builder(headerSpec).build();
    RequestBodySpec requestBodySpec = new RequestBodySpec.Builder().build();
    requestBody = new RequestBody.Builder(requestBodySpec).build();
View Full Code Here

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    String resourcePrefix = "/rest";
    CallPath resourcePath = new CallPathParser(
        resourcePrefix, false, "/employee").parse(resourcePrefix + "/employee");
    ResourceUrlPaths urlPaths = new ResourceUrlPaths("http://localhost/fake/service/rest",
        "/fake", "/service", resourcePrefix);

    this.employees = new RepositoryInMemory<Employee>();
View Full Code Here

    this.gsonBuilder = new GsonBuilder().registerTypeAdapterFactory(new IdGsonTypeAdapterFactory());
    this.employees = new RepositoryInMemory<Employee>();
    this.queryHandler = new QueryHandlerEmployee(employees);

    CallPath queryPath =
        new CallPathParser("/rest", true, "/employee").parse("/rest/1.2/employee");
    this.urlPaths = new ResourceUrlPaths("http://localhost/fake/service/rest",
        "/fake", "/service", "/rest");
    ResourceQueryClientFake<Employee, QueryEmployeeByName> stub =
      new ResourceQueryClientFake<Employee, QueryEmployeeByName>(queryHandler, gsonBuilder,
          urlPaths, queryPath, null);
View Full Code Here

    employees.put(new Employee(null, "bar"));
  }

  public void testParamsRoundTripWithoutVersion() throws Exception {
    CallPath queryPath =
      new CallPathParser("/rest", false, "/employee").parse("/rest/employee");
    ResourceQueryClientFake<Employee, QueryEmployeeByName> stub =
      new ResourceQueryClientFake<Employee, QueryEmployeeByName>(
          queryHandler, gsonBuilder, urlPaths, queryPath, null);
    ResourceQueryClient<Employee, QueryEmployeeByName> queryClient =
        new ResourceQueryClient<Employee, QueryEmployeeByName>(
View Full Code Here

    }
  }

  public void testParamsRoundTripInlined() throws Exception {
    CallPath queryPath =
        new CallPathParser("/rest", true, "/employee").parse("/rest/1.2/employee");
    ResourceQueryClientFake<Employee, QueryEmployeeByName> stub =
      new ResourceQueryClientFake<Employee, QueryEmployeeByName>(
          queryHandler, gsonBuilder, urlPaths, queryPath, null);
    ResourceQueryClient<Employee, QueryEmployeeByName> queryClient =
        new ResourceQueryClient<Employee, QueryEmployeeByName>(
View Full Code Here

TOP

Related Classes of com.google.greaze.definition.CallPathParser

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.