Package org.apache.click.servlet

Examples of org.apache.click.servlet.MockRequest.removeParameter()


        valid = form.onSubmitCheck(page, "/invalid-submit.html");
        Assert.assertTrue(valid);
       
        // Now imagine the SUBMIT_CHECK token is removed by a hacker. To simulate
        // such a scenario we remove the submitTokenName from the request paramters.
        request.removeParameter(submitTokenName);
        valid = form.onSubmitCheck(page, "/invalid-submit.html");
        Assert.assertFalse(valid);
    }

    /**
 
View Full Code Here


        valid = form.onSubmitCheck(page, "/invalid-submit.html");
        Assert.assertTrue(valid);
       
        // Now imagine the SUBMIT_CHECK token is removed by a hacker. To simulate
        // such a scenario we remove the submitTokenName from the request paramters.
        request.removeParameter(submitTokenName);
        valid = form.onSubmitCheck(page, "/invalid-submit.html");
        Assert.assertFalse(valid);
    }

    /**
 
View Full Code Here

        valid = form.onSubmitCheck(page, "/invalid-submit.html");
        Assert.assertTrue(valid);
       
        // Now imagine the SUBMIT_CHECK token is removed by a hacker. To simulate
        // such a scenario we remove the submitTokenName from the request paramters.
        request.removeParameter(submitTokenName);
        valid = form.onSubmitCheck(page, "/invalid-submit.html");
        Assert.assertFalse(valid);
    }

    /**
 
View Full Code Here

        valid = form.onSubmitCheck(page, "/invalid-submit.html");
        Assert.assertTrue(valid);

        // Now imagine the SUBMIT_CHECK token is removed by a hacker. To simulate
        // such a scenario we remove the submitTokenName from the request paramters.
        request.removeParameter(submitTokenName);
        valid = form.onSubmitCheck(page, "/invalid-submit.html");
        Assert.assertFalse(valid);
    }

    /**
 
View Full Code Here

                return false;
            }
        });

        // No request param -> no action listener executed
        request.removeParameter("button");
        assertTrue(button.onProcess());
        context.executeActionListeners();
        assertFalse(check[0]);

        // Disabled button with request param
View Full Code Here

        assertTrue(button.onProcess());
        assertTrue(button.isValid());
        assertFalse(button.isDisabled());

        // Diasabled button without request param
        request.removeParameter("button");
        button.setDisabled(true);
        assertTrue(button.onProcess());
        assertTrue(button.isValid());
        assertTrue(button.isDisabled());
    }
View Full Code Here

        assertTrue(checkbox.isValid());
        assertEquals("true", checkbox.getValue());
        assertEquals(Boolean.TRUE, checkbox.getValueObject());
       
        checkbox.setRequired(true);
        request.removeParameter("checkbox");
       
        assertTrue(checkbox.onProcess());
        assertFalse(checkbox.isValid());
        assertEquals("false", checkbox.getValue());
        assertEquals(Boolean.FALSE, checkbox.getValueObject());
View Full Code Here

                return false;
            }
        });

        // No request param -> no action listener executed
        request.removeParameter("button");
        assertTrue(button.onProcess());
        context.executeActionListeners();
        assertFalse(check[0]);
       
        request.setParameter("button", "true");
View Full Code Here

        assertTrue(button.onProcess());
        context.executeActionListeners();
        assertFalse(check[0]);

        // ajax request, but no request param -> no action listener executed
        request.removeParameter("button");
        request.setParameter("X-Requested-With", "true");
        assertTrue(button.onProcess());
        context.executeActionListeners();
        assertFalse(check[0]);
View Full Code Here

        button.setDisabled(true);
        assertTrue(button.onProcess());
        assertTrue(button.isValid());
        assertFalse(button.isDisabled());

        request.removeParameter("button");
       
        button.setDisabled(true);
        assertTrue(button.onProcess());
        assertTrue(button.isValid());
        assertTrue(button.isDisabled());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.