Package org.impalaframework.module.definition

Examples of org.impalaframework.module.definition.SimpleModuleDefinition


        List<Resource> resources = Arrays.asList((Resource)new FileSystemResource(new File("f1")));
        expect(moduleLocationResolver.getApplicationModuleClassLocations("m1")).andReturn(resources);
       
        replay(moduleLocationResolver);
       
        final ClassRetriever retriever = factory.newModuleClassResourceRetriever(new SimpleModuleDefinition("m1"));
        assertNotNull(retriever);
       
        verify(moduleLocationResolver);
    }
View Full Code Here


        List<Resource> resources = Arrays.asList((Resource)new FileSystemResource(new File("f1")));
        expect(moduleLocationResolver.getApplicationModuleLibraryLocations("m1")).andReturn(resources);
       
        replay(moduleLocationResolver);
       
        final ClassRetriever retriever = factory.newModuleLibraryResourceRetriever(new SimpleModuleDefinition("m1"));
        assertNotNull(retriever);
       
        verify(moduleLocationResolver);
    }
View Full Code Here

    public final void testCheckOriginal() {
        RootModuleDefinition parentSpec1 = ModificationTestUtils.spec("app-context1.xml", "plugin1, plugin2, plugin3");
        RootModuleDefinition parentSpec2 = ModificationTestUtils.spec("app-context1.xml", "plugin1, plugin2");

        ModuleDefinition plugin2 = parentSpec2.findChildDefinition("plugin2", true);
        ModuleDefinition plugin4 = new SimpleModuleDefinition(plugin2, "plugin4");
        new SimpleModuleDefinition(plugin4, "plugin5");
        new SimpleModuleDefinition(plugin4, "plugin6");

        ModificationExtractor calculator = new StrictModificationExtractor();
        TransitionSet transitions = calculator.getTransitions(application, parentSpec1, parentSpec2);
       
        Iterator<? extends ModuleStateChange> iterator = doAssertions(transitions, 4);
View Full Code Here

        assertModules("a,c,d,b,root,e,f,g", allModules);
    }
   
    public void testAddH() throws Exception {
        //add h with parent root and depend on h
        manager.addModule("root", new SimpleModuleDefinition(null, "h", ModuleTypes.APPLICATION, null, new String[]{"a"}, null, null, null, null, true));
        Collection<ModuleDefinition> allModules = manager.getAllModules();
        assertModules("a,c,d,b,root,e,h,f,g", allModules);
        assertDependees("root", "root,e,h,f,g");
        assertDependencies("g", "a,d,c,b,root,e,f,g");
        assertDependencies("h", "a,d,b,root,h");
View Full Code Here

        assertDependencies("h", "a,d,b,root,h");
    }
   
    public void testAddI() throws Exception {
        //add i with parent c, and depending on g
        manager.addModule("c", new SimpleModuleDefinition(null, "i", ModuleTypes.APPLICATION, null, new String[]{"c", "g"}, null, null, null, null, true));
        Collection<ModuleDefinition> allModules = manager.getAllModules();
        assertModules("a,c,d,b,root,e,f,g,i", allModules);
        assertDependencies("i", "c,a,d,b,root,e,f,g,i");
        assertDependees("root", "root,e,f,g,i");
        assertDependees("a", "a,root,e,f,g,i");
View Full Code Here

        assertModules("a,b,root,e,f", allModules);
    }
   
    public void testModuleNotPresent() throws Exception {
        try {
            manager.addModule("duffModule", new SimpleModuleDefinition("moduleWithDuffParent"));
            fail();
        } catch (InvalidStateException e) {
            assertDuffModule(e);
        }
       
View Full Code Here

    public void testSortHasInvalidModule() throws Exception {
        ModuleDefinition[] toSort = new ModuleDefinition[]{rootDefinition.getChildModuleDefinition("e"),rootDefinition.getChildModuleDefinition("f")};
        List<ModuleDefinition> sorted = manager.sort(Arrays.asList(toSort));
        System.out.println(sorted);
       
        toSort = new ModuleDefinition[]{rootDefinition.getChildModuleDefinition("e"), new SimpleModuleDefinition("duffModule")};
       
        try {
            manager.sort(Arrays.asList(toSort));
            fail();
        } catch (InvalidStateException e) {
View Full Code Here

            assertDuffModule(e);
        }
    }
   
    public void testAddModuleWithDuffDependency() throws Exception {
        manager.addModule("root", new SimpleModuleDefinition(null, "newmodule1", ModuleTypes.APPLICATION, null, new String[] {"e"}, null, null, null, null, true));

        try {
            manager.addModule("root", new SimpleModuleDefinition(null, "newmodule2", ModuleTypes.APPLICATION, null, new String[] {"duffModule"}, null, null, null, null, true));
        } catch (InvalidStateException e) {
            assertEquals("Unable to dependency named named 'duffModule' for module definition 'newmodule2'", e.getMessage());
        }
    }
View Full Code Here

        assertNull(successSet.getFirstError());
    }    
   
    public static TransitionResultSet newSuccessTransitionResultSet() {
        TransitionResultSet result = new TransitionResultSet();
        ModuleStateChange stateChange1 = new ModuleStateChange(Transition.LOADED_TO_UNLOADED, new SimpleModuleDefinition("module1"));
        result.addResult(new TransitionResult(stateChange1));
        ModuleStateChange stateChange2 = new ModuleStateChange(Transition.LOADED_TO_UNLOADED, new SimpleModuleDefinition("module2"));
        result.addResult(new TransitionResult(stateChange2));
        return result;
    }    
View Full Code Here

        return result;
    }    
   
    public static TransitionResultSet newFailedTransitionResultSet() {
        TransitionResultSet result = new TransitionResultSet();
        ModuleStateChange stateChange1 = new ModuleStateChange(Transition.LOADED_TO_UNLOADED, new SimpleModuleDefinition("module1"));
        result.addResult(new TransitionResult(stateChange1));
        ModuleStateChange stateChange2 = new ModuleStateChange(Transition.LOADED_TO_UNLOADED, new SimpleModuleDefinition("module2"));
        result.addResult(new TransitionResult(stateChange2, new RuntimeException("stuff went wrong1")));
        ModuleStateChange stateChange3 = new ModuleStateChange(Transition.LOADED_TO_UNLOADED, new SimpleModuleDefinition("module3"));
        result.addResult(new TransitionResult(stateChange3, new RuntimeException("stuff went wrong1")));
        return result;
    }
View Full Code Here

TOP

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

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.