Search in sources :

Example 1 with AssetTypeHandler

use of org.terasology.engine.persistence.typeHandling.extensionTypes.AssetTypeHandler in project Terasology by MovingBlocks.

the class AssetTypeHandlerFactoryTest method testCreate.

@Test
public void testCreate() {
    TypeHandlerFactory factory = new AssetTypeHandlerFactory();
    List<TypeInfo<? extends Asset>> typesToTest = Lists.newArrayList(TypeInfo.of(Texture.class), TypeInfo.of(UIElement.class), TypeInfo.of(StaticSound.class), TypeInfo.of(StreamingSound.class));
    for (TypeInfo<? extends Asset> typeInfo : typesToTest) {
        Optional<? extends TypeHandler<? extends Asset>> typeHandler = factory.create(typeInfo, null);
        assertTrue(typeHandler.isPresent());
        assertTrue(typeHandler.get() instanceof AssetTypeHandler);
    }
}
Also used : UIElement(org.terasology.nui.asset.UIElement) StaticSound(org.terasology.engine.audio.StaticSound) AssetTypeHandler(org.terasology.engine.persistence.typeHandling.extensionTypes.AssetTypeHandler) Asset(org.terasology.gestalt.assets.Asset) TypeHandlerFactory(org.terasology.persistence.typeHandling.TypeHandlerFactory) StreamingSound(org.terasology.engine.audio.StreamingSound) TypeInfo(org.terasology.reflection.TypeInfo) Texture(org.terasology.engine.rendering.assets.texture.Texture) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 StaticSound (org.terasology.engine.audio.StaticSound)1 StreamingSound (org.terasology.engine.audio.StreamingSound)1 AssetTypeHandler (org.terasology.engine.persistence.typeHandling.extensionTypes.AssetTypeHandler)1 Texture (org.terasology.engine.rendering.assets.texture.Texture)1 Asset (org.terasology.gestalt.assets.Asset)1 UIElement (org.terasology.nui.asset.UIElement)1 TypeHandlerFactory (org.terasology.persistence.typeHandling.TypeHandlerFactory)1 TypeInfo (org.terasology.reflection.TypeInfo)1