Search in sources :

Example 71 with SimpleUri

use of org.terasology.engine.SimpleUri in project Terasology by MovingBlocks.

the class TranslationFormatTests method testEmptyDataGenRoot.

@Test
public void testEmptyDataGenRoot() throws IOException, InvalidAssetFilenameException {
    AssetDataFile assetDataFile = mockAssetDataFile("menu.lang", "{}".getBytes(StandardCharsets.UTF_8));
    ResourceUrn urn = createUrnFromFile(format, assetDataFile);
    TranslationData data = format.load(urn, Collections.singletonList(assetDataFile));
    Assert.assertEquals(new SimpleUri("engine:menu"), data.getProjectUri());
    Assert.assertEquals(Locale.ROOT, data.getLocale());
}
Also used : AssetDataFile(org.terasology.assets.format.AssetDataFile) SimpleUri(org.terasology.engine.SimpleUri) TranslationData(org.terasology.i18n.assets.TranslationData) ResourceUrn(org.terasology.assets.ResourceUrn) Test(org.junit.Test)

Aggregations

SimpleUri (org.terasology.engine.SimpleUri)71 Test (org.junit.Test)18 Map (java.util.Map)10 Name (org.terasology.naming.Name)9 ResourceUrn (org.terasology.assets.ResourceUrn)7 DefaultClassMetadata (org.terasology.reflection.metadata.DefaultClassMetadata)7 Config (org.terasology.config.Config)6 Input (org.terasology.input.Input)6 FBO (org.terasology.rendering.opengl.FBO)6 ModuleManager (org.terasology.engine.module.ModuleManager)5 Command (org.terasology.logic.console.commandSystem.annotations.Command)5 ModuleEnvironment (org.terasology.module.ModuleEnvironment)5 List (java.util.List)4 DependencyResolver (org.terasology.module.DependencyResolver)4 ResolutionResult (org.terasology.module.ResolutionResult)4 UILabel (org.terasology.rendering.nui.widgets.UILabel)4 Lists (com.google.common.collect.Lists)3 IOException (java.io.IOException)3 Type (java.lang.reflect.Type)3 Locale (java.util.Locale)3