Package gobo.slim3.tester

Examples of gobo.slim3.tester.MockServletContext


    /**
     * @throws Exception
     */
    @Test
    public void copyRBForExcludeEmptyString() 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, new CopyOptions().excludeEmptyString());
View Full Code Here


    /**
     * @throws Exception
     */
    @Test
    public void copyRBForExcludeNullAndCopyEmptyString() 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, new CopyOptions()
View Full Code Here

    /**
     * @throws Exception
     */
    @Test
    public void copyRBForConverter() throws Exception {
        MockServletContext servletContext = new MockServletContext();
        MockHttpServletRequest src = new MockHttpServletRequest(servletContext);
        src.setAttribute("ddd", "1,000");
        DestRB dest = new DestRB();
        BeanUtil.copy(src, dest, new CopyOptions().numberConverter("#,##0"));
        assertThat(dest.ddd, is(1000));
View Full Code Here

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

     */
    @Test
    public void copyBRFromReadOnly() throws Exception {
        SrcBR src = new SrcBR();
        src.bbb = "111";
        MockServletContext servletContext = new MockServletContext();
        MockHttpServletRequest dest =
            new MockHttpServletRequest(servletContext);
        BeanUtil.copy(src, dest);
        assertThat((String) dest.getAttribute("bbb"), is("111"));
    }
View Full Code Here

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

    @Test
    public void copyBRForInclude() throws Exception {
        SrcBR src = new SrcBR();
        src.aaa = "111";
        src.bbb = "222";
        MockServletContext servletContext = new MockServletContext();
        MockHttpServletRequest dest =
            new MockHttpServletRequest(servletContext);
        BeanUtil.copy(src, dest, new CopyOptions().include("aaa"));
        assertThat((String) dest.getAttribute("aaa"), is("111"));
        assertThat(dest.getAttribute("bbb"), is(nullValue()));
View Full Code Here

    @Test
    public void copyBRForExclude() throws Exception {
        SrcBR src = new SrcBR();
        src.aaa = "111";
        src.bbb = "222";
        MockServletContext servletContext = new MockServletContext();
        MockHttpServletRequest dest =
            new MockHttpServletRequest(servletContext);
        BeanUtil.copy(src, dest, new CopyOptions().exclude("bbb"));
        assertThat((String) dest.getAttribute("aaa"), is("111"));
        assertThat(dest.getAttribute("bbb"), is(nullValue()));
View Full Code Here

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

     * @throws Exception
     */
    @Test
    public void copyBRForExcludeNull() throws Exception {
        SrcBR src = new SrcBR();
        MockServletContext servletContext = new MockServletContext();
        MockHttpServletRequest dest =
            new MockHttpServletRequest(servletContext);
        dest.setAttribute("aaa", "111");
        BeanUtil.copy(src, dest, new CopyOptions().excludeNull());
        assertThat((String) dest.getAttribute("aaa"), is("111"));
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.