All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.ultreia.java4all.config.io.spi.ConfigModelReaderTest Maven / Gradle / Ivy

There is a newer version: 1.0.29
Show newest version
package io.ultreia.java4all.config.io.spi;

/*-
 * #%L
 * Config :: IO Tests
 * %%
 * Copyright (C) 2016 - 2018 Code Lutin, Ultreia.io
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Lesser Public License for more details.
 * 
 * You should have received a copy of the GNU General Lesser Public
 * License along with this program.  If not, see
 * .
 * #L%
 */

import org.junit.Before;
import org.junit.Test;

import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * Created on 01/10/16.
 *
 * @author Tony Chemit - [email protected]
 * @since 3.0
 */
public abstract class ConfigModelReaderTest {

    private ConfigModelReader modelReader;
    private ConfigModelIOFixtures ioFixtures;

    @Before
    public void setUp() {
        modelReader = createModelReader();
        ioFixtures = new ConfigModelIOFixtures();
    }

    public abstract ConfigModelReader createModelReader();

    @Test
    public void read() throws Exception {

        Path path = Paths.get(new File("").getAbsolutePath(), "src", "test", "resources", modelReader.getFilename("model"));

        ConfigModel configModel = modelReader.read(path);

        ioFixtures.assertConfigModel(configModel);

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy