Package com.alibaba.citrus.service.moduleloader

Examples of com.alibaba.citrus.service.moduleloader.Module


    @Test
    public void execute() throws Exception {
        getInvocationContext("/app1");
        initRequestContext();

        Module module = moduleLoader.getModule("screens", "class.MyScreen");

        module.execute();

        assertEquals("execute", rundata.getAttribute("handler"));
    }
View Full Code Here


        names = moduleLoaderService.getModuleNames("screens");
        assertArrayEquals(new String[] { "AbstractScreen", "MyScreen" }, names.toArray(new String[names.size()]));

        // modules
        Module module = moduleLoaderService.getModule(" screens ", "myScreen");

        assertNotNull(module);
        assertEquals("app1.module.screens.MyScreen", module.getClass().getName());
        assertEquals(null, module.getClass().getMethod("getName").invoke(module));

        module = moduleLoaderService.getModule("control", "myprod.MyControl");

        assertNotNull(module);
        assertEquals(DataBindingAdapter.class, module.getClass());

        module = moduleLoaderService.getModule("action", "myprod.MyAction");

        assertNotNull(module);
        assertEquals(ActionEventAdapter.class, module.getClass());
    }
View Full Code Here

        names = moduleLoaderService.getModuleNames("screens");
        assertArrayEquals(new String[] { "app1.AbstractScreen", "app1.MyScreen" },
                          names.toArray(new String[names.size()]));

        // modules
        Module module = moduleLoaderService.getModule(" screens ", "app1/myScreen");

        assertNotNull(module);
        assertEquals("app1.module.screens.MyScreen", module.getClass().getName());
        assertEquals(null, module.getClass().getMethod("getName").invoke(module));

        module = moduleLoaderService.getModule("control", "app1.myprod.MyControl");

        assertNotNull(module);
        assertEquals(DataBindingAdapter.class, module.getClass());

        module = moduleLoaderService.getModule("action", "app1.myprod.MyAction");

        assertNotNull(module);
        assertEquals(ActionEventAdapter.class, module.getClass());
    }
View Full Code Here

        names = moduleLoaderService.getModuleNames("screen");
        assertArrayEquals(new String[] { "AbstractScreen", "MyScreen" }, names.toArray(new String[names.size()]));

        // modules
        Module module = moduleLoaderService.getModule(" screen ", "/myScreen");

        assertNotNull(module);
        assertEquals("app1.module.screens.MyScreen", module.getClass().getName());
        assertEquals("hello", module.getClass().getMethod("getName").invoke(module));

        module = moduleLoaderService.getModule("control", "app1.myprod.MyControl");

        assertNotNull(module);
        assertEquals(DataBindingAdapter.class, module.getClass());

        module = moduleLoaderService.getModule("action", "myprod.MyAction");

        assertNotNull(module);
        assertEquals(ActionEventAdapter.class, module.getClass());
    }
View Full Code Here

    @Test
    public void autowire() throws Exception {
        moduleLoaderService = (ModuleLoaderService) factory.getBean("search-multi");

        Module module = moduleLoaderService.getModule(" action ", "/myprod/myAction");

        assertEquals(ActionEventAdapter.class, module.getClass());

        // adapter.request != null
        assertNotNull(getFieldValue(module, "request", HttpServletRequest.class));

        // adapter.moduleObject.rundata
View Full Code Here

        names = moduleLoaderService.getModuleNames("screens");
        assertArrayEquals(new String[] { "MyScreen" }, names.toArray(new String[names.size()]));

        // modules
        Module module = moduleLoaderService.getModule(" screens ", "myScreen");

        assertNotNull(module);
        assertEquals(MyScreen.class, module.getClass());
        assertEquals(null, ((MyScreen) module).getName());

        module = moduleLoaderService.getModule("control", "myprod.MyControl");

        assertNotNull(module);
        assertEquals(DataBindingAdapter.class, module.getClass());

        module = moduleLoaderService.getModule("action", "myprod.MyAction");

        assertNotNull(module);
        assertEquals(ActionEventAdapter.class, module.getClass());
    }
View Full Code Here

        names = moduleLoaderService.getModuleNames("screens");
        assertArrayEquals(new String[] { "app1.MyScreen" }, names.toArray(new String[names.size()]));

        // modules
        Module module = moduleLoaderService.getModule(" screens ", "app1/myScreen");

        assertNotNull(module);
        assertEquals(MyScreen.class, module.getClass());
        assertEquals(null, ((MyScreen) module).getName());

        module = moduleLoaderService.getModule("control", "app1.myprod.MyControl");

        assertNotNull(module);
        assertEquals(DataBindingAdapter.class, module.getClass());

        module = moduleLoaderService.getModule("action", "app1.myprod.MyAction");

        assertNotNull(module);
        assertEquals(ActionEventAdapter.class, module.getClass());
    }
View Full Code Here

        names = moduleLoaderService.getModuleNames("screen");
        assertArrayEquals(new String[] { "MyScreen" }, names.toArray(new String[names.size()]));

        // modules
        Module module = moduleLoaderService.getModule(" screen ", "/myScreen");

        assertNotNull(module);
        assertEquals(MyScreen.class, module.getClass());
        assertEquals("hello", ((MyScreen) module).getName());

        module = moduleLoaderService.getModule("control", "app1.myprod.MyControl");

        assertNotNull(module);
        assertEquals(DataBindingAdapter.class, module.getClass());

        module = moduleLoaderService.getModule("action", "myprod.MyAction");

        assertNotNull(module);
        assertEquals(ActionEventAdapter.class, module.getClass());
    }
View Full Code Here

    @Test
    public void autowire_no() throws Exception {
        moduleLoaderService = (ModuleLoaderService) factory.getBean("search-multi");

        Module module = moduleLoaderService.getModule(" action ", "/myprod/myAction");

        assertEquals(ActionEventAdapter.class, module.getClass());

        // adapter.request != null
        assertNotNull(getFieldValue(module, "request", HttpServletRequest.class));

        // adapter.moduleObject.rundata
View Full Code Here

    @Test
    public void autowire_byType() throws Exception {
        moduleLoaderService = (ModuleLoaderService) factory.getBean("search-autowire");

        Module module = moduleLoaderService.getModule(" action ", "/myprod/myAction");

        assertEquals(ActionEventAdapter.class, module.getClass());

        // adapter.request != null
        assertNotNull(getFieldValue(module, "request", HttpServletRequest.class));

        // adapter.moduleObject.rundata
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.service.moduleloader.Module

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.