Package gobo.slim3.tester

Examples of gobo.slim3.tester.MockServletContext


     * @throws Exception
     *
     */
    @Test
    public void processLocaleForRequest() throws Exception {
        MockServletContext servletContext = new MockServletContext();
        MockHttpServletRequest request =
            new MockHttpServletRequest(servletContext);
        request.addLocale(Locale.GERMAN);
        FrontController frontController = new FrontController();
        assertThat(frontController.processLocale(request), is(Locale.GERMAN));
View Full Code Here


     * @throws Exception
     *
     */
    @Test
    public void processLocaleForNoSetting() throws Exception {
        MockServletContext servletContext = new MockServletContext();
        MockHttpServletRequest request =
            new MockHttpServletRequest(servletContext);
        FrontController frontController = new FrontController();
        assertThat(frontController.processLocale(request), is(Locale
            .getDefault()));
View Full Code Here

    /**
     * @throws Exception
     */
    @Test
    public void copyRB() throws Exception {
        MockServletContext servletContext = new MockServletContext();
        MockHttpServletRequest src = new MockHttpServletRequest(servletContext);
        src.setAttribute("aaa", "111");
        DestRB dest = new DestRB();
        BeanUtil.copy(src, dest);
        assertThat(dest.aaa, is("111"));
View Full Code Here

    /**
     * @throws Exception
     */
    @Test
    public void copyRBToReadOnly() throws Exception {
        MockServletContext servletContext = new MockServletContext();
        MockHttpServletRequest src = new MockHttpServletRequest(servletContext);
        src.setAttribute("bbb", "111");
        DestRB dest = new DestRB();
        BeanUtil.copy(src, dest);
        assertThat(dest.bbb, is(nullValue()));
View Full Code Here

    /**
     * @throws Exception
     */
    @Test
    public void copyRBToWriteOnly() throws Exception {
        MockServletContext servletContext = new MockServletContext();
        MockHttpServletRequest src = new MockHttpServletRequest(servletContext);
        src.setAttribute("ccc", "111");
        DestRB dest = new DestRB();
        BeanUtil.copy(src, dest);
        assertThat(dest.ccc, is("111"));
View Full Code Here

    /**
     * @throws Exception
     */
    @Test
    public void copyRBForInclude() throws Exception {
        MockServletContext servletContext = new MockServletContext();
        MockHttpServletRequest src = new MockHttpServletRequest(servletContext);
        src.setAttribute("aaa", "111");
        src.setAttribute("ccc", "222");
        DestRB dest = new DestRB();
        BeanUtil.copy(src, dest, new CopyOptions().include("aaa"));
View Full Code Here

    /**
     * @throws Exception
     */
    @Test
    public void copyRBForExclude() throws Exception {
        MockServletContext servletContext = new MockServletContext();
        MockHttpServletRequest src = new MockHttpServletRequest(servletContext);
        src.setAttribute("aaa", "111");
        src.setAttribute("ccc", "222");
        DestRB dest = new DestRB();
        BeanUtil.copy(src, dest, new CopyOptions().exclude("ccc"));
View Full Code Here

    /**
     * @throws Exception
     */
    @Test
    public void copyRBForNull() throws Exception {
        MockServletContext servletContext = new MockServletContext();
        MockHttpServletRequest src = new MockHttpServletRequest(servletContext);
        DestRB dest = new DestRB();
        dest.aaa = "111";
        BeanUtil.copy(src, dest);
        assertThat(dest.aaa, is("111"));
View Full Code Here

    /**
     * @throws Exception
     */
    @Test
    public void copyRBForExcludeNull() throws Exception {
        MockServletContext servletContext = new MockServletContext();
        MockHttpServletRequest src = new MockHttpServletRequest(servletContext);
        src.setAttribute("aaa", null);
        DestRB dest = new DestRB();
        dest.aaa = "111";
        BeanUtil.copy(src, dest, new CopyOptions().excludeNull());
View Full Code Here

    /**
     * @throws Exception
     */
    @Test
    public void copyRBForEmptyString() throws Exception {
        MockServletContext servletContext = new MockServletContext();
        MockHttpServletRequest src = new MockHttpServletRequest(servletContext);
        src.setAttribute("aaa", "");
        DestRB dest = new DestRB();
        dest.aaa = "111";
        BeanUtil.copy(src, dest);
View Full Code Here

TOP

Related Classes of gobo.slim3.tester.MockServletContext

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.