当前位置: 首页>>代码示例>>Java>>正文


Java IRuntimeConfig类代码示例

本文整理汇总了Java中de.flapdoodle.embed.process.config.IRuntimeConfig的典型用法代码示例。如果您正苦于以下问题:Java IRuntimeConfig类的具体用法?Java IRuntimeConfig怎么用?Java IRuntimeConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IRuntimeConfig类属于de.flapdoodle.embed.process.config包,在下文中一共展示了IRuntimeConfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setup

import de.flapdoodle.embed.process.config.IRuntimeConfig; //导入依赖的package包/类
private static void setup() throws UnknownHostException, IOException {
  IMongoCmdOptions cmdOptions = new MongoCmdOptionsBuilder().verbose(false)
      .enableAuth(authEnabled).build();

  IMongodConfig mongodConfig = new MongodConfigBuilder()
      .version(Version.Main.PRODUCTION)
      .net(new Net(LOCALHOST, MONGOS_PORT, Network.localhostIsIPv6()))
      .cmdOptions(cmdOptions).build();

  IRuntimeConfig runtimeConfig = new RuntimeConfigBuilder().defaults(
      Command.MongoD).build();
  mongodExecutable = MongodStarter.getInstance(runtimeConfig).prepare(
      mongodConfig);
  mongod = mongodExecutable.start();
  mongoClient = new MongoClient(new ServerAddress(LOCALHOST, MONGOS_PORT));
  createDbAndCollections(EMPLOYEE_DB, EMPINFO_COLLECTION, "employee_id");
  createDbAndCollections(EMPLOYEE_DB, SCHEMA_CHANGE_COLLECTION, "field_2");
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:19,代码来源:MongoTestSuit.java

示例2: setup

import de.flapdoodle.embed.process.config.IRuntimeConfig; //导入依赖的package包/类
private static void setup() throws UnknownHostException, IOException {
  IMongoCmdOptions cmdOptions = new MongoCmdOptionsBuilder().verbose(false)
      .enableAuth(authEnabled).build();

  IMongodConfig mongodConfig = new MongodConfigBuilder()
      .version(Version.Main.PRODUCTION)
      .net(new Net(LOCALHOST, MONGOS_PORT, Network.localhostIsIPv6()))
      .cmdOptions(cmdOptions).build();

  IRuntimeConfig runtimeConfig = new RuntimeConfigBuilder().defaults(
      Command.MongoD).build();
  mongodExecutable = MongodStarter.getInstance(runtimeConfig).prepare(
      mongodConfig);
  mongod = mongodExecutable.start();
  mongoClient = new MongoClient(new ServerAddress(LOCALHOST, MONGOS_PORT));
  createDbAndCollections(EMPLOYEE_DB, EMPINFO_COLLECTION, "employee_id");
  createDbAndCollections(EMPLOYEE_DB, SCHEMA_CHANGE_COLLECTION, "field_2");
  createDbAndCollections(EMPLOYEE_DB, EMPTY_COLLECTION, "field_2");
  createDbAndCollections(DATATYPE_DB, DATATYPE_COLLECTION, "_id");
}
 
开发者ID:axbaretto,项目名称:drill,代码行数:21,代码来源:MongoTestSuit.java

示例3: runtimeConfig

import de.flapdoodle.embed.process.config.IRuntimeConfig; //导入依赖的package包/类
private IRuntimeConfig runtimeConfig()
{
    FixedPath path = new FixedPath( "bin/" );
    IStreamProcessor mongodOutput;
    IStreamProcessor mongodError;
    IStreamProcessor commandsOutput;
    try
    {
        mongodOutput = Processors.named( "[mongod>]", new FileStreamProcessor( new File( logPath, "mongo.log" ) ) );

        mongodError = new FileStreamProcessor( new File( logPath, "mongo-err.log" ) );
        commandsOutput =
            Processors.named( "[mongod>]", new FileStreamProcessor( new File( logPath, "mongo.log" ) ) );
    }
    catch ( FileNotFoundException e )
    {
        throw Throwables.propagate( e );
    }
    return new RuntimeConfigBuilder().defaults( Command.MongoD )
        .processOutput( new ProcessOutput( mongodOutput, mongodError, commandsOutput ) )
        .artifactStore( new ArtifactStoreBuilder().downloader( new Downloader() )
            .executableNaming( new UserTempNaming() ).tempDir( path ).download(
                new DownloadConfigBuilder().defaultsForCommand( Command.MongoD ).artifactStorePath( path ) ) )
        .build();
}
 
开发者ID:cherimojava,项目名称:orchidae,代码行数:26,代码来源:cfgMongo.java

示例4: apply

import de.flapdoodle.embed.process.config.IRuntimeConfig; //导入依赖的package包/类
@Override
public void apply(IExtractedFileSet files, IRuntimeConfig runtimeConfig, MysqldConfig config) throws IOException {
    File baseDir = files.baseDir();
    // TODO: wait until https://github.com/flapdoodle-oss/de.flapdoodle.embed.process/pull/41 is merged
    FileUtils.deleteDirectory(new File(baseDir, "data"));

    Process p = Runtime.getRuntime().exec(new String[] {
                    files.executable().getAbsolutePath(),
                    "--no-defaults",
                    "--initialize-insecure",
                    "--ignore-db-dir",
                    format("--basedir=%s", baseDir),
                    format("--datadir=%s/data", baseDir)});

    new ProcessRunner(files.executable().getAbsolutePath()).run(p, runtimeConfig, config.getTimeout(NANOSECONDS));
}
 
开发者ID:wix,项目名称:wix-embedded-mysql,代码行数:17,代码来源:Mysql57Initializer.java

示例5: run

import de.flapdoodle.embed.process.config.IRuntimeConfig; //导入依赖的package包/类
void run(Process p, IRuntimeConfig runtimeConfig, long timeoutNanos) throws IOException {
    CollectingAndForwardingStreamProcessor wrapped =
            new CollectingAndForwardingStreamProcessor(runtimeConfig.getProcessOutput().getOutput());
    IStreamProcessor loggingWatch = StreamToLineProcessor.wrap(wrapped);

    try {
        ReaderProcessor processorOne = Processors.connect(new InputStreamReader(p.getInputStream()), loggingWatch);
        ReaderProcessor processorTwo = Processors.connect(new InputStreamReader(p.getErrorStream()), loggingWatch);

        int retCode = tope.waitFor(p, timeoutNanos);

        if (retCode != 0) {
            processorOne.join(10000);
            processorTwo.join(10000);
            resolveException(retCode, wrapped.getOutput());
        }

    } catch (InterruptedException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:wix,项目名称:wix-embedded-mysql,代码行数:22,代码来源:ProcessRunner.java

示例6: onAfterProcessStart

import de.flapdoodle.embed.process.config.IRuntimeConfig; //导入依赖的package包/类
@Override
public void onAfterProcessStart(final ProcessControl process, final IRuntimeConfig runtimeConfig) throws IOException {
    outputWatch = new NotifyingStreamProcessor(StreamToLineProcessor.wrap(runtimeConfig.getProcessOutput().getOutput()));
    Processors.connect(process.getReader(), outputWatch);
    Processors.connect(process.getError(), outputWatch);
    ResultMatchingListener startupListener = outputWatch.addListener(new ResultMatchingListener("ready for connections"));

    try {
        startupListener.waitForResult(getConfig().getTimeout(MILLISECONDS));

        if (!startupListener.isInitWithSuccess()) {
            throw new RuntimeException("mysql start failed with error: " + startupListener.getFailureFound());
        }
    } catch (Exception e) {
        // emit IO exception for {@link AbstractProcess} would try to stop running process gracefully
        throw new IOException(e);
    }
}
 
开发者ID:wix,项目名称:wix-embedded-mysql,代码行数:19,代码来源:MysqldProcess.java

示例7: EmbeddedMysql

import de.flapdoodle.embed.process.config.IRuntimeConfig; //导入依赖的package包/类
protected EmbeddedMysql(
        final MysqldConfig mysqldConfig,
        final DownloadConfig downloadConfig) {
    logger.info("Preparing EmbeddedMysql version '{}'...", mysqldConfig.getVersion());
    this.config = mysqldConfig;
    IRuntimeConfig runtimeConfig = new RuntimeConfigBuilder().defaults(mysqldConfig, downloadConfig).build();
    MysqldStarter mysqldStarter = new MysqldStarter(runtimeConfig);

    localRepository.lock();
    try {
        this.executable = mysqldStarter.prepare(mysqldConfig);
    } finally {
        localRepository.unlock();
    }

    try {
        executable.start();
        getClient(SCHEMA, mysqldConfig.getCharset()).executeCommands(
                format("CREATE USER '%s'@'%%' IDENTIFIED BY '%s';", mysqldConfig.getUsername(), mysqldConfig.getPassword()));
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:wix,项目名称:wix-embedded-mysql,代码行数:24,代码来源:EmbeddedMysql.java

示例8: getMongodStarter

import de.flapdoodle.embed.process.config.IRuntimeConfig; //导入依赖的package包/类
private static MongodStarter getMongodStarter(final LoggingTarget loggingTarget) {
    if (loggingTarget == null) {
        return MongodStarter.getDefaultInstance();
    }
    switch (loggingTarget) {
    case NULL:
        final Logger logger = LoggerFactory.getLogger(MongoDbTestRule.class.getName());
        final IRuntimeConfig runtimeConfig = new RuntimeConfigBuilder()
        // @formatter:off
            .defaultsWithLogger(Command.MongoD, logger)
            .processOutput(ProcessOutput.getDefaultInstanceSilent())
            .build();
        // @formatter:on

        return MongodStarter.getInstance(runtimeConfig);
    case CONSOLE:
        return MongodStarter.getDefaultInstance();
    default:
        throw new NotImplementedException(loggingTarget.toString());
    }
}
 
开发者ID:apache,项目名称:logging-log4j2,代码行数:22,代码来源:MongoDbTestRule.java

示例9: start

import de.flapdoodle.embed.process.config.IRuntimeConfig; //导入依赖的package包/类
public synchronized void start() throws IOException {
	if (process != null) {
		throw new IllegalStateException();
	}

	Command command = Command.Postgres;

	IDownloadConfig downloadConfig = new PostgresDownloadConfigBuilder()
			.defaultsForCommand(command)
			.artifactStorePath(new FixedPath(artifactStorePath))
			.build();

	ArtifactStoreBuilder artifactStoreBuilder = new PostgresArtifactStoreBuilder()
			.defaults(command)
			.download(downloadConfig);

	LogWatchStreamProcessor logWatch = new LogWatchStreamProcessor("started",
			new HashSet<>(singletonList("failed")),
			new Slf4jStreamProcessor(getLogger("postgres"), Slf4jLevel.TRACE));

	IRuntimeConfig runtimeConfig = new RuntimeConfigBuilder()
			.defaults(command)
			.processOutput(new ProcessOutput(logWatch, logWatch, logWatch))
			.artifactStore(artifactStoreBuilder)
			.build();

	PostgresStarter<PostgresExecutable, PostgresProcess> starter = new PostgresStarter<>(PostgresExecutable.class, runtimeConfig);

	PostgresConfig config = new PostgresConfig(version,
			new AbstractPostgresConfig.Net(host, port == 0 ? Network.getFreeServerPort() : port),
			new AbstractPostgresConfig.Storage(dbName),
			new AbstractPostgresConfig.Timeout(),
			new AbstractPostgresConfig.Credentials(username, password));
	process = starter.prepare(config).start();
	jdbcUrl = "jdbc:postgresql://" + config.net().host() + ":" + config.net().port() + "/" + config.storage().dbName();
}
 
开发者ID:honourednihilist,项目名称:gradle-postgresql-embedded,代码行数:37,代码来源:EmbeddedPostgres.java

示例10: MongoClientTestConfiguration

import de.flapdoodle.embed.process.config.IRuntimeConfig; //导入依赖的package包/类
public MongoClientTestConfiguration() throws IOException {

    Command command = Command.MongoD;
    IDownloadConfig downloadConfig = new DownloadConfigBuilder().defaultsForCommand(command)
                                                                .progressListener(new Slf4jProgressListener(LOGGER))
                                                                .build();
    IRuntimeConfig runtimeConfig = new RuntimeConfigBuilder().defaults(command)
                                                             .artifactStore(new ExtractedArtifactStoreBuilder()
                                                                                .defaults(command)
                                                                                .download(downloadConfig))
                                                             .build();
    final MongodStarter runtime = MongodStarter.getInstance(runtimeConfig);
    mongodExecutable = runtime.prepare(newMongodConfig(Version.Main.PRODUCTION));
    startMongodExecutable();
  }
 
开发者ID:krraghavan,项目名称:mongodb-aggregate-query-support,代码行数:16,代码来源:MongoClientTestConfiguration.java

示例11: MongoInstance

import de.flapdoodle.embed.process.config.IRuntimeConfig; //导入依赖的package包/类
public MongoInstance() throws IOException, InterruptedException {

        // Download Mongo artifacts into the project directory to ease cleanup
        IDownloadConfig downloadConfig = new DownloadConfigBuilder()
                .defaultsForCommand(Command.MongoD)
                .artifactStorePath(ARTIFACT_STORE_PATH)
                .build();

        // Extract Mongo artifacts into the project directory to ease cleanup
        IRuntimeConfig runtimeConfig = new RuntimeConfigBuilder()
                .defaults(Command.MongoD)
                .artifactStore(new ExtractedArtifactStoreBuilder()
                        .defaults(Command.MongoD)
                        .download(downloadConfig)
                        .extractDir(EXTRACTED_STORE_PATH)
                )
                .build();

        // Store Mongo data into the project directory to ease cleanup
        Storage replication = new Storage("./data/mongodb/data", null, 0);

        MongodStarter starter = MongodStarter.getInstance(runtimeConfig);

        IMongodConfig mongodConfig = new MongodConfigBuilder()
                .version(Version.Main.PRODUCTION)
                .cmdOptions(new MongoCmdOptionsBuilder()
                        .useNoJournal(false)
                        .useSmallFiles(true)
                        .build())
                .net(new Net(MongoProperties.DEFAULT_PORT, Network.localhostIsIPv6()))
                .replication(replication)
                .build();

        mongo = starter.prepare(mongodConfig);
        process = mongo.start();
    }
 
开发者ID:mike-plummer,项目名称:graylog-springboot,代码行数:37,代码来源:MongoInstance.java

示例12: EmbeddedMongoAutoConfiguration

import de.flapdoodle.embed.process.config.IRuntimeConfig; //导入依赖的package包/类
public EmbeddedMongoAutoConfiguration(MongoProperties properties,
		EmbeddedMongoProperties embeddedProperties, ApplicationContext context,
		IRuntimeConfig runtimeConfig) {
	this.properties = properties;
	this.embeddedProperties = embeddedProperties;
	this.context = context;
	this.runtimeConfig = runtimeConfig;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:EmbeddedMongoAutoConfiguration.java

示例13: embeddedMongoRuntimeConfig

import de.flapdoodle.embed.process.config.IRuntimeConfig; //导入依赖的package包/类
@Bean
public IRuntimeConfig embeddedMongoRuntimeConfig() {
	Logger logger = LoggerFactory
			.getLogger(getClass().getPackage().getName() + ".EmbeddedMongo");
	ProcessOutput processOutput = new ProcessOutput(
			Processors.logTo(logger, Slf4jLevel.INFO),
			Processors.logTo(logger, Slf4jLevel.ERROR), Processors.named(
					"[console>]", Processors.logTo(logger, Slf4jLevel.DEBUG)));
	return new RuntimeConfigBuilder().defaultsWithLogger(Command.MongoD, logger)
			.processOutput(processOutput).artifactStore(getArtifactStore(logger))
			.build();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:13,代码来源:EmbeddedMongoAutoConfiguration.java

示例14: startMongo

import de.flapdoodle.embed.process.config.IRuntimeConfig; //导入依赖的package包/类
private void startMongo(final List<IMongodConfig> mongodConfigList) throws IOException {
    // @formatter:off
    final ProcessOutput processOutput = new ProcessOutput(
            logTo(LOGGER, Slf4jLevel.INFO),
            logTo(LOGGER, Slf4jLevel.ERROR),
            named("[console>]", logTo(LOGGER, Slf4jLevel.DEBUG)));

    final IRuntimeConfig runtimeConfig = new RuntimeConfigBuilder()
            .defaultsWithLogger(Command.MongoD,LOGGER)
            .processOutput(processOutput)
            .artifactStore(new ExtractedArtifactStoreBuilder()
                .defaults(Command.MongoD)
                .download(new DownloadConfigBuilder()
                    .defaultsForCommand(Command.MongoD)
                    .progressListener(new Slf4jProgressListener(LOGGER))
                    .build()))
            .build();
    // @formatter:on
    final MongodStarter starter = MongodStarter.getInstance(runtimeConfig);

    for (final IMongodConfig mongodConfig : mongodConfigList) {
        final MongodExecutable mongodExecutable = starter.prepare(mongodConfig);
        final MongodProcess mongod = mongodExecutable.start();

        mongoProcesses.put(mongod, mongodExecutable);
    }
}
 
开发者ID:dadrus,项目名称:jpa-unit,代码行数:28,代码来源:MongodManager.java

示例15: embeddedMongoRuntimeConfig

import de.flapdoodle.embed.process.config.IRuntimeConfig; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean
@ConditionalOnClass(Logger.class)
public IRuntimeConfig embeddedMongoRuntimeConfig() {
	Logger logger = LoggerFactory
			.getLogger(getClass().getPackage().getName() + ".EmbeddedMongo");
	ProcessOutput processOutput = new ProcessOutput(
			Processors.logTo(logger, Slf4jLevel.INFO),
			Processors.logTo(logger, Slf4jLevel.ERROR), Processors.named("[console>]",
					Processors.logTo(logger, Slf4jLevel.DEBUG)));
	return new RuntimeConfigBuilder().defaultsWithLogger(Command.MongoD, logger)
			.processOutput(processOutput).artifactStore(getArtifactStore(logger))
			.build();
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:15,代码来源:EmbeddedMongoAutoConfiguration.java


注:本文中的de.flapdoodle.embed.process.config.IRuntimeConfig类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。