Package org.apache.myfaces

Examples of org.apache.myfaces.TestRunner


                                                                                                        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 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.application.jsp.JspViewHandlerImpl#calculateLocale(javax.faces.context.FacesContext)}.
     */
    public void testCalculateLocaleNPE()
    {
        assertException(NullPointerException.class, new TestRunner()
        {
            public void run() throws Throwable
            {
                _testimpl.calculateLocale(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

        _facesContext.setProcessingEvents(eq(true));
        expect(_viewHandler.restoreView(same(_facesContext), eq("calculatedViewId"))).andReturn(null);
        _facesContext.setProcessingEvents(eq(false));

        _mocksControl.replay();
        assertException(ViewExpiredException.class, new TestRunner()
        {
            public void run() throws Throwable
            {
                _testimpl.doPrePhaseActions(_facesContext);
                _testimpl.execute(_facesContext);
View Full Code Here

    }

    @Test
    public void testEncodeAllNullContext() throws Exception
    {
        Assert.assertException(NullPointerException.class, new TestRunner()
        {
            public void run() throws Throwable
            {
                _testimpl.encodeAll(null);
            }
View Full Code Here

        //EasyMock.expect(_testimpl.getClientId(EasyMock.same(facesContext))).andReturn("xxxId");
        _contextCallback.invokeContextCallback(EasyMock.same(facesContext), EasyMock.same(testimpl));
        EasyMock.expectLastCall().andThrow(new RuntimeException());
        _mocksControl.replay();
       
        org.apache.myfaces.Assert.assertException(FacesException.class, new TestRunner()
        {
            public void run() throws Throwable
            {
                Assert.assertTrue(testimpl.invokeOnComponent(facesContext, "xxxId", _contextCallback));
            }
View Full Code Here

    }

    @Test
    public void testInvokeOnComponentExceptions() throws Exception
    {
        org.apache.myfaces.Assert.assertException(NullPointerException.class, new TestRunner()
        {
            public void run() throws Throwable
            {
                _testimpl.invokeOnComponent(null, "xxx", _contextCallback);
            }
        });
        org.apache.myfaces.Assert.assertException(NullPointerException.class, new TestRunner()
        {
            public void run() throws Throwable
            {
                _testimpl.invokeOnComponent(facesContext, null, _contextCallback);
            }
        });
        org.apache.myfaces.Assert.assertException(NullPointerException.class, new TestRunner()
        {
            public void run() throws Throwable
            {
                _testimpl.invokeOnComponent(facesContext, "xxx", null);
            }
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.