Package org.springframework.extensions.webscripts

Examples of org.springframework.extensions.webscripts.Match


    webScriptUriRegistry.registerWebScript(webScript);
  }

  @Test
  public void testWebScriptRegistration() {
    final Match match = webScriptUriRegistry.findWebScript("GET", "/test");
    assertNotNull(match);
    assertNotSame(webScript, match.getWebScript());
    assertSame(webScript.getDescription(), match.getWebScript().getDescription());
    assertSame(webScript, ((WebScriptProxy) match.getWebScript()).getWrappedWebScript());
  }
View Full Code Here


  }

  @Test
  public void testWebScriptRegistrationIsPersistentWhenCleared() {
    webScriptUriRegistry.clear();
    final Match match = webScriptUriRegistry.findWebScript("GET", "/test");
    assertNotNull(match);
  }
View Full Code Here

  }

  @Test
  public void testWebScriptUnregistration() {
    webScriptUriRegistry.unregisterWebScript(webScript);
    final Match match = webScriptUriRegistry.findWebScript("GET", "/test");
    assertNotNull(match);
    final WebScriptProxy webScriptProxy = (WebScriptProxy) match.getWebScript();
    assertNotNull(webScriptProxy.getWrappedWebScript());
    assertNotSame(webScript, webScriptProxy.getWrappedWebScript());
    assertSame(webScript.getDescription(), webScriptProxy.getDescription());
  }
View Full Code Here

  @Test
  public void testWebScriptUnregistrationIsPermanentWhenCleared() {
    webScriptUriRegistry.unregisterWebScript(webScript);
    webScriptUriRegistry.clear();
    final Match match = webScriptUriRegistry.findWebScript("GET", "/test");
    assertNull(match);
  }
View Full Code Here

  /* Utility operations */

  protected void handleRequest(final HttpMethod httpMethod, final String uri, final MockWebScriptRequest request,
      final WebScriptResponse response) {
    try {
      final Match match = uriIndex.findWebScript(httpMethod.name(), uri);
      assertNotNull(String.format("Could not find annotation-based WebScript for method '%s' and URI '%s'.",
          httpMethod, uri), match);
      final WebScript webScript = match.getWebScript();
      webScript.execute(request.setServiceMatch(match), response);
    } catch (final IOException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.extensions.webscripts.Match

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.