Package org.simpleframework.http

Examples of org.simpleframework.http.Form


     
      while(!selector.isReady()) {
         body.collect(selector);
      }  
      Request request = new RequestEntity(body, null);
      Form form = request.getForm();
      List<Part> list = form.getParts();     
     
      assertEquals(form.get("a"), "b");
      assertEquals(form.get("c"), "d");
      assertEquals(form.get("e"), "f");
      assertEquals(form.get("g"), "h");
      assertEquals(form.getAll("a").size(), 2);
      assertEquals(form.getAll("a").get(0), "b");
      assertEquals(form.getAll("a").get(1), "1");       
      assertEquals(request.getTarget(), "/index.html?a=b&c=d&e=f&g=h&a=1");
      assertEquals(request.getMethod(), "POST");
      assertEquals(request.getMajor(), 1);
      assertEquals(request.getMinor(), 0);
      assertEquals(request.getContentType().getPrimary(), "multipart");
View Full Code Here


      list.add(new MockPart("b", "part_B", false));
      list.add(new MockPart("c", "part_C", false));
      list.add(new MockPart("f", "part_F", true));
      list.add(new MockPart("g", "part_G", false));
     
      Form form = builder.getInstance();
     
      assertEquals(form.getAll("a").size(), 3);
      assertEquals(form.getAll("b").size(), 2);
      assertEquals(form.getAll("c").size(), 3);
      assertEquals(form.getAll("e").size(), 1);
      assertEquals(form.getPart("a").getContent(), "part_A");
      assertEquals(form.getPart("b").getContent(), "part_B");
      assertEquals(form.getPart("c").getContent(), "part_C");
      assertEquals(form.getPart("f").getContent(), "part_F");
      assertEquals(form.getPart("g").getContent(), "part_G");
      assertEquals(form.get("a"), "query_A");
      assertEquals(form.get("b"), "query_B");
      assertEquals(form.get("c"), "query_C");
      assertEquals(form.get("d"), "query_D");
      assertEquals(form.get("e"), "post_E");
      assertEquals(form.get("f"), null);
      assertEquals(form.get("g"), "part_G");     
   }
View Full Code Here

         assertTrue(false);
      }
   }
  
   public void process(Request request, Response response) throws Exception {
      Form form = request.getForm();
      List<Part> list = form.getParts();
      String method = request.getMethod();
     
      if(method.equals("HEAD")) {
         assertEquals(request.getMajor(), 1);
         assertEquals(request.getMinor(), 0);    
View Full Code Here

TOP

Related Classes of org.simpleframework.http.Form

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.