Package org.impalaframework.module.definition

Examples of org.impalaframework.module.definition.SimpleRootModuleDefinition


        ModuleDefinition c = newDefinition(definitions, null, "c", null);
       
        ModuleDefinition d = newDefinition(definitions, null, "d", null);
       
        //root has siblings a and c, and depends on a
        SimpleRootModuleDefinition root = new SimpleRootModuleDefinition("root",
                new String[] {"root.xml"},
                new String[] {"a"},
                null,
                new ModuleDefinition[] {a, c, d}, null, null, true);
       
View Full Code Here


        ModuleDefinition c = newDefinition(definitions, null, "c", null);
       
        ModuleDefinition d = newDefinition(definitions, null, "d", null);
       
        //root has siblings a and c, and depends on a
        SimpleRootModuleDefinition root = new SimpleRootModuleDefinition("root",
                new String[] {"root.xml"},
                new String[] {"a"},
                null,
                new ModuleDefinition[] {a, c, d}, null, null, true);
       
View Full Code Here

    public void testNewApplicationContext() throws Exception {
        BaseSpringModuleLoader loader = new BaseSpringModuleLoader() {
        };
       
        GenericApplicationContext parentContext = new GenericApplicationContext();
        SimpleRootModuleDefinition rootDefinition = new SimpleRootModuleDefinition("project1", "context.xml");
        ClassLoader classLoader = ClassUtils.getDefaultClassLoader();
        GenericApplicationContext context = loader.newApplicationContext(null, parentContext, rootDefinition, classLoader);

        ModuleTestUtils.checkHasPostProcessor(false, context, ModuleDefinitionPostProcessor.class);
    }
View Full Code Here

        ApplicationModuleLoader rootModuleLoader = new ApplicationModuleLoader();
        moduleLoaderRegistry.addItem(ModuleTypes.ROOT, rootModuleLoader);
        ApplicationModuleLoader applicationModuleLoader = new ApplicationModuleLoader();
        moduleLoaderRegistry.addItem(ModuleTypes.APPLICATION, applicationModuleLoader);

        ModuleDefinition p = new SimpleRootModuleDefinition(rootModuleName, new String[] { "parent-context.xml" });
        assertTrue(moduleLoaderRegistry.getModuleLoader(p.getType()) instanceof ApplicationModuleLoader);

        DelegatingContextLoader delegatingLoader = new DelegatingContextLoader() {
            public ConfigurableApplicationContext loadApplicationContext(ApplicationContext parent,
                    ModuleDefinition definition) {
                return null;
View Full Code Here

public class SingleStringModuleDefinitionSourceTest extends TestCase {

    private String rootModuleName = "project1";

    public void testEmptyString() {
        SimpleRootModuleDefinition rootDefinition = new SimpleRootModuleDefinition(rootModuleName , new String[] { "parent-context" });
        String moduleString = "";
        SingleStringModuleDefinitionSource builder = new SingleStringModuleDefinitionSource(rootDefinition, moduleString);
        RootModuleDefinition result = builder.getModuleDefinition();
        assertSame(result, rootDefinition);
    }
View Full Code Here

        RootModuleDefinition result = builder.getModuleDefinition();
        assertSame(result, rootDefinition);
    }
   
    public void testModuleWithoutBeanSpec() {
        SimpleRootModuleDefinition rootDefinition = new SimpleRootModuleDefinition(rootModuleName, new String[] { "parent-context" });
        String moduleString = " example-hibernate , example-dao ";
        SingleStringModuleDefinitionSource builder = new SingleStringModuleDefinitionSource(rootDefinition, moduleString);
        RootModuleDefinition result = builder.getModuleDefinition();
        assertSame(result, rootDefinition);
        assertEquals(2, rootDefinition.getChildModuleNames().size());
        System.out.println(rootDefinition.getChildModuleNames());
        assertNotNull(result.getChildModuleDefinition("example-hibernate"));
        assertNotNull(result.getChildModuleDefinition("example-dao"));
    }
View Full Code Here

        assertNotNull(result.getChildModuleDefinition("example-hibernate"));
        assertNotNull(result.getChildModuleDefinition("example-dao"));
    }
   
    public void testInvalidBrackets() {
        SimpleRootModuleDefinition rootDefinition = new SimpleRootModuleDefinition(rootModuleName, new String[] { "parent-context" });
        String moduleString = "module (( null: set1, set2; mock: set3, duff )";
        SingleStringSourceDelegate builder = new SingleStringSourceDelegate(rootDefinition, moduleString);
        try {
            builder.doDefinitionSplit();
            fail(IllegalArgumentException.class.getName());
View Full Code Here

        return definition;
    }

    public static SimpleRootModuleDefinition cloneAndMarkStale(SimpleRootModuleDefinition root1,
            final String toReload) {
        final SimpleRootModuleDefinition clone = (SimpleRootModuleDefinition) SerializationUtils.clone(root1);
        final ModuleDefinition child = clone.findChildDefinition(toReload, true);
        System.out.println("Marking " + toReload + " as stale");
        child.setState(ModuleState.STALE);
        return clone;
    }
View Full Code Here

        loadTransitionProcessor = createMock(TransitionProcessor.class);
        unloadTransitionProcessor = createMock(TransitionProcessor.class);
        processor.setLoadTransitionProcessor(loadTransitionProcessor);
        processor.setUnloadTransitionProcessor(unloadTransitionProcessor);

        rootDefinition = new SimpleRootModuleDefinition("project1", "p1");
        definition = new SimpleModuleDefinition(rootDefinition, "p3");
        application = TestApplicationManager.newApplicationManager().getCurrentApplication();
    }
View Full Code Here

        application = TestApplicationManager.newApplicationManager().getCurrentApplication();
    }
   
    public void testProcess() {
       
        SimpleRootModuleDefinition a = new SimpleRootModuleDefinition("a", (String)null);
        ModuleDefinition a1 = newDefinition(a, "a1", null);
        ModuleDefinition a2 = newDefinition(a1, "a2", null);
        ModuleDefinition a3 = newDefinition(a2, "a3", null);
        ModuleDefinition a4 = newDefinition(a3, "a4", null);
       
View Full Code Here

TOP

Related Classes of org.impalaframework.module.definition.SimpleRootModuleDefinition

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.