Package org.apache.wookie.tests.helpers

Examples of org.apache.wookie.tests.helpers.MockHttpServletRequest


  }

  @Test
  public void createWidget() {

    MockHttpServletRequest request;
    request = new MockHttpServletRequest();
    request.setScheme("HTTP");
    request.setServerName("localhost");
    request.setServerPort(8080);
    request.setParameter("url", TEST_GADGET_URL_VALID);
   
    try {
      W3CWidget widget = GadgetUtils.createWidget(request);
      assertNotNull(widget);
    } catch (Exception e) {
View Full Code Here


    }
  }

  @Test(expected = Exception.class)
  public void createWidgetFromInvalidUrl() throws Exception {
    MockHttpServletRequest request;
    request = new MockHttpServletRequest();
    request.setScheme("HTTP");
    request.setServerName("localhost");
    request.setServerPort(8080);
    request.setParameter("url", TEST_GADGET_URL_INVALID);
    @SuppressWarnings("unused")
    W3CWidget widget = GadgetUtils.createWidget(request);
    // Uh-oh! No exception was thrown so we
    // better make this test fail!
    fail("should've thrown an exception!");
View Full Code Here

    fail("should've thrown an exception!");
  }

  @Test(expected = Exception.class)
  public void createWidgetFromInvalidServiceUrlPort() throws Exception {
    MockHttpServletRequest request;
    request = new MockHttpServletRequest();
    request.setScheme("HTTP");
    request.setServerName("localhost");
    request.setServerPort(8888);
    request.setParameter("url", TEST_GADGET_URL_VALID);
    @SuppressWarnings("unused")
    W3CWidget widget = GadgetUtils.createWidget(request);
    // Uh-oh! No exception was thrown so we
    // better make this test fail!
    fail("should've thrown an exception!");
View Full Code Here

TOP

Related Classes of org.apache.wookie.tests.helpers.MockHttpServletRequest

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.