Package org.nutz.mvc.init

Source Code of org.nutz.mvc.init.MvcErrorCatchTest

package org.nutz.mvc.init;

import org.junit.Test;
import org.nutz.mvc.AbstractMvcTest;
import org.nutz.mvc.LoadingException;
import org.nutz.mvc.annotation.BlankAtException;
import org.nutz.mvc.init.errmodule.ErrorCatchMainModule;

public class MvcErrorCatchTest {

    private void _mvc(final Class<?> mainModuleType) throws Throwable {
        try {
            (new AbstractMvcTest() {
                protected void initServletConfig() {
                    servletConfig.addInitParameter("modules", mainModuleType.getName());
                }
            }).init();
        }
        catch (LoadingException e) {
            throw e.getCause();
        }
        catch (Exception e) {
            throw e;
        }
    }

    @Test(expected = BlankAtException.class)
    public void testTwoNullAt() throws Throwable {
        _mvc((Class<?>) ErrorCatchMainModule.class);
    }

}
TOP

Related Classes of org.nutz.mvc.init.MvcErrorCatchTest

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.