Search in sources :

Example 16 with DependencyResolver

use of org.terasology.module.DependencyResolver in project Terasology by MovingBlocks.

the class ModuleDownloadListGeneratorTest method testSingleModuleNeedsUpdate.

@Test
public void testSingleModuleNeedsUpdate() throws DependencyResolutionFailedException {
    Module moduleV1 = buildSimpleModule("myModule", "1.0.0");
    Module moduleV2 = buildSimpleModule("myModule", "2.0.0");
    ModuleRegistry localRegistry = buildRegistry("1.0.0", moduleV1);
    DependencyResolver resolver = mockResolver(true, moduleV2, buildEngineModule("1.0.0"));
    ModuleDownloadListGenerator listGenerator = new ModuleDownloadListGenerator(localRegistry, resolver);
    assertEquals(Collections.singleton(moduleV2), buildList(listGenerator));
}
Also used : TableModuleRegistry(org.terasology.module.TableModuleRegistry) ModuleRegistry(org.terasology.module.ModuleRegistry) BaseModule(org.terasology.module.BaseModule) Module(org.terasology.module.Module) DependencyResolver(org.terasology.module.DependencyResolver) Test(org.junit.Test)

Aggregations

DependencyResolver (org.terasology.module.DependencyResolver)16 ResolutionResult (org.terasology.module.ResolutionResult)11 Module (org.terasology.module.Module)10 ModuleEnvironment (org.terasology.module.ModuleEnvironment)9 ModuleManager (org.terasology.engine.module.ModuleManager)7 Name (org.terasology.naming.Name)7 ModuleRegistry (org.terasology.module.ModuleRegistry)5 Test (org.junit.Test)4 TableModuleRegistry (org.terasology.module.TableModuleRegistry)4 FromModule (org.terasology.module.predicates.FromModule)4 List (java.util.List)3 SimpleUri (org.terasology.engine.SimpleUri)3 HashSet (java.util.HashSet)2 EnvironmentSwitchHandler (org.terasology.engine.bootstrap.EnvironmentSwitchHandler)2 Vector2i (org.terasology.math.geom.Vector2i)2 BaseModule (org.terasology.module.BaseModule)2 Canvas (org.terasology.rendering.nui.Canvas)2 ReadOnlyBinding (org.terasology.rendering.nui.databinding.ReadOnlyBinding)2 UIButton (org.terasology.rendering.nui.widgets.UIButton)2 UILabel (org.terasology.rendering.nui.widgets.UILabel)2