Package org.mojavemvc.core

Examples of org.mojavemvc.core.ControllerDatabase


    private <T> SetUp<T> setUp(Class<T> clazz, String methodName, String action) throws IOException {
       
        T cntrl = injector.getInstance(clazz);
        Set<Class<?>> controllerClasses = new HashSet<Class<?>>();
        controllerClasses.add(cntrl.getClass());
        ControllerDatabase db = newControllerDatabase(controllerClasses);

        FastClass fastClass = FastClass.create(clazz);
        int fastIndex = fastClass.getIndex(methodName, new Class<?>[] {});
        ActionSignature sig = mock(ActionSignature.class);
        when(sig.fastIndex()).thenReturn(fastIndex);
        when(sig.parameterTypes()).thenReturn(new Class<?>[] {});
        when(sig.methodName()).thenReturn(methodName);
        when(sig.getArgs(parametersMap, req.getInputStream())).thenReturn(new Object[] {});
       
        if (action == null) {
            when(sig.getInterceptorClasses(db, cntrl.getClass(), "")).thenReturn(
                    db.getInterceptorsForDefaultAction(cntrl.getClass()));
        } else {
            when(sig.getInterceptorClasses(db, cntrl.getClass(), action)).thenReturn(
                    db.getInterceptorsForAction(cntrl.getClass(), action));
        }
       
        when(sig.marshall(anyObject())).thenAnswer(new Answer<View>() {
            @Override
            public View answer(InvocationOnMock invocation) throws Throwable {
View Full Code Here

TOP

Related Classes of org.mojavemvc.core.ControllerDatabase

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.