Java 类org.junit.contrib.java.lang.system.EnvironmentVariables 实例源码

项目:geowave    文件:BigtableStoreTestEnvironment.java   
@Override
public void setup() {
    // Bigtable IT's rely on an external gcloud emulator
    EnvironmentVariables environmentVariables = new EnvironmentVariables();
    environmentVariables.set(
            "BIGTABLE_EMULATOR_HOST",
            "localhost:8128");
    if (emulator == null) {
        emulator = new BigtableEmulator(
                null); // null uses tmp dir
    }

    // Make sure we clean up any old processes first
    if (emulator.isRunning()) {
        emulator.stop();
    }

    if (!emulator.start()) {
        LOGGER.error("Bigtable emulator startup failed");
    }
}