Package org.apache.myfaces

Examples of org.apache.myfaces.TestRunner


        assertSetValueExpressionException(NullPointerException.class, null);
    }

    private void assertSetValueExpressionException(Class<? extends Throwable> expected, final String name)
    {
        Assert.assertException(expected, new TestRunner()
        {
            public void run() throws Throwable
            {
                _testImpl.setValueExpression(name, null);
            }
View Full Code Here


        expect(_externalContext.getRequestMap()).andReturn(emptyMap);
        expect(_externalContext.getRequestPathInfo()).andReturn(null);
        expect(_externalContext.getRequestServletPath()).andReturn(null);

        _mocksControl.replay();
        Assert.assertException(FacesException.class, new TestRunner()
        {
            public void run() throws Throwable
            {
                _testimpl.calculateViewId(_facesContext);
            }
View Full Code Here

     * Test method for
     * {@link org.apache.myfaces.el.convert.ValueExpressionToValueBinding#ValueExpressionToValueBinding(javax.el.ValueExpression)}.
     */
    public void testValueExpressionToValueBindingValueExpression()
    {
        assertException(IllegalArgumentException.class, new TestRunner()
        {
            public void run() throws Throwable
            {
                new ValueExpressionToValueBinding(null);
            }
View Full Code Here

    public void testValueBindingToValueExpression()
    {
        testimpl = new ValueBindingToValueExpression();
        assertNull(testimpl.getValueBinding());
        assertNull(testimpl.getExpectedType());
        assertException(IllegalStateException.class, new TestRunner()
        {
            public void run() throws Throwable
            {
                testimpl.getExpressionString();
                testimpl.getType(elContext);
View Full Code Here

     * Test method for
     * {@link org.apache.myfaces.el.convert._ValueExpressionToValueBinding#_ValueExpressionToValueBinding(javax.el.ValueExpression)}.
     */
    public void testValueExpressionToValueBindingValueExpression()
    {
        assertException(IllegalArgumentException.class, new TestRunner()
        {
            public void run() throws Throwable
            {
                new _ValueExpressionToValueBinding(null);
            }
View Full Code Here

    public void testValueBindingToValueExpression()
    {
        testimpl = new _ValueBindingToValueExpression();
        assertNull(testimpl.getValueBinding());
        assertNull(testimpl.getExpectedType());
        assertException(IllegalStateException.class, new TestRunner()
        {
            public void run() throws Throwable
            {
                testimpl.getExpressionString();
                testimpl.getType(elContext);
View Full Code Here

                                                                                                        new Class[] { FacesContext.class }) });
        expect(handler.calculateCharacterEncoding(_facesContext)).andReturn("xxx");
        _externalContext.setRequestCharacterEncoding(eq("xxx"));
        expectLastCall().andThrow(new UnsupportedEncodingException());
        _mocksControl.replay();
        Assert.assertException(FacesException.class, new TestRunner()
        {
            public void run() throws Throwable
            {
                handler.initView(_facesContext);
            }
View Full Code Here

        assertSetValueExpressionException(NullPointerException.class, null);
    }

    private void assertSetValueExpressionException(Class<? extends Throwable> expected, final String name)
    {
        Assert.assertException(expected, new TestRunner()
        {
            public void run() throws Throwable
            {
                _testImpl.setValueExpression(name, null);
            }
View Full Code Here

     * Test method for
     * {@link javax.faces.component._MethodBindingToMethodExpression#_MethodBindingToMethodExpression(javax.faces.el.MethodBinding)}.
     */
    public void test_MethodBindingToMethodExpressionMethodBinding()
    {
        Assert.assertException(IllegalArgumentException.class, new TestRunner()
        {
            public void run() throws Throwable
            {
                new _MethodBindingToMethodExpression(null);
            }
View Full Code Here

    private void assertGetMethodInfoException(Class<? extends Throwable> expected, final Throwable firedFromMBGetType)
    {
        final _MethodBindingToMethodExpression testimpl = new _MethodBindingToMethodExpression(_methodBinding);
        expect(_methodBinding.getType(same(_facesContext))).andThrow(firedFromMBGetType);
        _mocksControl.replay();
        Assert.assertException(expected, new TestRunner()
        {
            public void run() throws Throwable
            {
                testimpl.getMethodInfo(_elContext);
            }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.TestRunner

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.