Package grails.core

Examples of grails.core.DefaultGrailsApplication.initialise()


        gcl.parseClass("class Super { Long id;Long version;}\n" +
                       "class Sub extends Super { }\n" +
                       "class Sub2 extends Sub { }");

        GrailsApplication ga = new DefaultGrailsApplication(gcl.getLoadedClasses(),gcl);
        ga.initialise();

        GrailsDomainClass gdc1 = (GrailsDomainClass) ga.getArtefact(DomainClassArtefactHandler.TYPE, "Super");
        assertNotNull(gdc1);
        assertTrue(gdc1.isRoot());
        assertEquals(2,gdc1.getSubClasses().size());
View Full Code Here


        MockApplicationContext context = new MockApplicationContext();
        MockServletContext servletContext = new MockServletContext();
        servletContext.setAttribute(GrailsApplicationAttributes.APPLICATION_CONTEXT,context);

        GrailsApplication app = new DefaultGrailsApplication(classes,gcl);
        app.initialise();
        context.registerMockBean(GrailsApplication.APPLICATION_ID,app);

        GrailsClass[] controllers = app.getArtefacts(ControllerArtefactHandler.TYPE);
        for (int i = 0; i < controllers.length; i++) {
            context.registerMockBean(controllers[i].getFullName(), controllers[i].newInstance());
View Full Code Here

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.