• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IRuntimeConfig类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: before

import de.flapdoodle.embed.process.config.IRuntimeConfig; //导入依赖的package包/类
@Override
public void before() throws Throwable {

    int port = Network.getFreeServerPort();
    String portProp = System.getProperty(MONGO_PORT_PROP);
    if (portProp != null && !portProp.isEmpty()) {
        port = Integer.valueOf(portProp);
    }

    IMongodConfig conf =
            new MongodConfigBuilder().version(Version.Main.PRODUCTION)
                .net(new Net(port, Network.localhostIsIPv6())).build();

    Command command = Command.MongoD;
    IRuntimeConfig runtimeConfig =
            new RuntimeConfigBuilder()
                .defaultsWithLogger(command, LOGGER)
                .artifactStore(
                        new ArtifactStoreBuilder().defaults(command).download(
                                new DownloadConfigBuilder().defaultsForCommand(command).proxyFactory(new SystemProxy())))
                .build();

    MongodStarter runtime = MongodStarter.getInstance(runtimeConfig);
    mongoExec = runtime.prepare(conf);

    mongoProc = mongoExec.start();

    client = new MongoClient(new ServerAddress(conf.net().getServerAddress(), conf.net().getPort()));

    // set the property for our config...
    System.setProperty("dbhost", conf.net().getServerAddress().getHostAddress());
    System.setProperty("dbport", Integer.toString(conf.net().getPort()));
}
 
开发者ID:jimzucker,项目名称:hygieia-temp,代码行数:34,代码来源:EmbeddedMongoDBRule.java


示例17: 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();
    Process p = Runtime.getRuntime().exec(new String[]{
                    "scripts/mysql_install_db",
                    "--no-defaults",
                    format("--basedir=%s", baseDir),
                    format("--datadir=%s/data", baseDir)},
            null,
            baseDir);

    new ProcessRunner("scripts/mysql_install_db").run(p, runtimeConfig, config.getTimeout(NANOSECONDS));
}
 
开发者ID:wix,项目名称:wix-embedded-mysql,代码行数:14,代码来源:NixBefore57Initializer.java


示例18: apply

import de.flapdoodle.embed.process.config.IRuntimeConfig; //导入依赖的package包/类
public static void apply(MysqldConfig config, IExtractedFileSet files, IRuntimeConfig runtimeConfig) throws IOException {
    for (Initializer initializer : initializers) {
        if (initializer.matches(config.getVersion())) {
            initializer.apply(files, runtimeConfig, config);
        }
    }
}
 
开发者ID:wix,项目名称:wix-embedded-mysql,代码行数:8,代码来源:Setup.java


示例19: MysqldExecutable

import de.flapdoodle.embed.process.config.IRuntimeConfig; //导入依赖的package包/类
MysqldExecutable(
        final Distribution distribution,
        final MysqldConfig config,
        final IRuntimeConfig runtimeConfig,
        final IExtractedFileSet executable) {
    super(distribution, config, runtimeConfig, executable);
    this.executable = executable;
}
 
开发者ID:wix,项目名称:wix-embedded-mysql,代码行数:9,代码来源:MysqldExecutable.java


示例20: start

import de.flapdoodle.embed.process.config.IRuntimeConfig; //导入依赖的package包/类
@Override
protected MysqldProcess start(
        final Distribution distribution,
        final MysqldConfig config,
        final IRuntimeConfig runtime) throws IOException {
    logger.info("Preparing mysqld for startup");
    Setup.apply(config, executable, runtime);
    logger.info("Starting MysqldProcess");
    return new MysqldProcess(distribution, config, runtime, this);
}
 
开发者ID:wix,项目名称:wix-embedded-mysql,代码行数:11,代码来源:MysqldExecutable.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ParameterResolutionException类代码示例发布时间:2022-05-21
下一篇:
Java IAtomContainer类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap