Package test.controller

Examples of test.controller.Book


    request.setParameter("text", "ddd");
    request.setParameter("id", "345");
    request.setParameter("price", "23.3");
    MockHttpServletResponse response = new MockHttpServletResponse();
    dispatcherController.dispatcher(request, response);
    Book book = (Book) request.getAttribute("book");
    Assert.assertThat(book.getText(), is("ddd"));
    Assert.assertThat(book.getPrice(), is(23.3));
    Assert.assertThat(book.getId(), is(345));
  }
View Full Code Here


    request.setParameter("id", "330");
    request.setParameter("price", "79.9");
    request.setParameter("sell", "true");
    MockHttpServletResponse response = new MockHttpServletResponse();
    dispatcherController.dispatcher(request, response);
    Book book = (Book) request.getAttribute("book");
    Assert.assertThat(book.getText(), is("一本好书"));
    Assert.assertThat(book.getPrice(), is(79.9));
    Assert.assertThat(book.getId(), is(330));
    Assert.assertThat(book.getSell(), is(true));
  }
View Full Code Here

    request.setParameter("text", "ddd");
    request.setParameter("id", "345");
    request.setParameter("price", "23.3");
    MockHttpServletResponse response = new MockHttpServletResponse();
    dispatcherController.dispatcher(request, response);
    Book book = (Book) request.getAttribute("book");
    Assert.assertThat(book.getText(), is("ddd"));
    Assert.assertThat(book.getPrice(), is(23.3));
    Assert.assertThat(book.getId(), is(345));
  }
View Full Code Here

    request.setParameter("id", "330");
    request.setParameter("price", "79.9");
    request.setParameter("sell", "true");
    MockHttpServletResponse response = new MockHttpServletResponse();
    dispatcherController.dispatcher(request, response);
    Book book = (Book) request.getAttribute("book");
    Assert.assertThat(book.getText(), is("一本好书"));
    Assert.assertThat(book.getPrice(), is(79.9));
    Assert.assertThat(book.getId(), is(330));
    Assert.assertThat(book.getSell(), is(true));
  }
View Full Code Here

    request.setParameter("text", "ddd");
    request.setParameter("id", "345");
    request.setParameter("price", "23.3");
    MockHttpServletResponse response = new MockHttpServletResponse();
    dispatcherController.dispatch(request, response);
    Book book = (Book) request.getAttribute("book");
    Assert.assertThat(book.getText(), is("ddd"));
    Assert.assertThat(book.getPrice(), is(23.3));
    Assert.assertThat(book.getId(), is(345));
  }
View Full Code Here

    request.setParameter("id", "330");
    request.setParameter("price", "79.9");
    request.setParameter("sell", "true");
    MockHttpServletResponse response = new MockHttpServletResponse();
    dispatcherController.dispatch(request, response);
    Book book = (Book) request.getAttribute("book");
    Assert.assertThat(book.getText(), is("一本好书"));
    Assert.assertThat(book.getPrice(), is(79.9));
    Assert.assertThat(book.getId(), is(330));
    Assert.assertThat(book.getSell(), is(true));
  }
View Full Code Here

    request.setParameter("sell", "false");
    MockHttpServletResponse response = new MockHttpServletResponse();
    dispatcherController.dispatch(request, response);
    log.info(response.getAsString());
    Assert.assertThat(response.getAsString().length(), greaterThan(10));
    Book book = Json.toObject(response.getAsString(), Book.class);
    Assert.assertThat(book.getId(), is(331));
    Assert.assertThat(book.getSell(), is(false));
    Assert.assertThat(book.getTitle(), is("good book"));
  }
View Full Code Here

TOP

Related Classes of test.controller.Book

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.