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

ru.yandex.qatools.embed.postgresql.CreateuserProcess Maven / Gradle / Ivy

The newest version!
package ru.yandex.qatools.embed.postgresql;

import de.flapdoodle.embed.process.config.IRuntimeConfig;
import de.flapdoodle.embed.process.distribution.Distribution;
import de.flapdoodle.embed.process.extract.IExtractedFileSet;
import ru.yandex.qatools.embed.postgresql.config.PostgresConfig;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import static java.util.Arrays.asList;

/**
 * createuser process
 * (helper to initialize the DB)
 */
public class CreateuserProcess extends AbstractPGProcess {

    public CreateuserProcess(Distribution distribution, PostgresConfig config, IRuntimeConfig runtimeConfig, E executable) throws IOException {
        super(distribution, config, runtimeConfig, executable);
    }

    @Override
    protected List getCommandLine(Distribution distribution, PostgresConfig config, IExtractedFileSet exe)
            throws IOException {
        List ret = new ArrayList<>();
        ret.add(exe.executable().getAbsolutePath());
        ret.addAll(asList(
                "-h", config.net().host(),
                "-p", String.valueOf(config.net().port())
        ));
        ret.addAll(config.args());
        return ret;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy