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


Java MongodProcess类代码示例

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


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

示例1: beforeClass

import de.flapdoodle.embed.mongo.MongodProcess; //导入依赖的package包/类
@BeforeClass
public static void beforeClass() throws Exception {
  MongodStarter runtime = MongodStarter.getDefaultInstance();
  mongodExe = runtime.prepare(
    new MongodConfigBuilder().version(Version.V3_3_1)
      .net(new Net(12345, Network.localhostIsIPv6()))
      .build());
  MongodProcess process = mongodExe.start();
  await().until(() -> process != null);
}
 
开发者ID:vert-x3,项目名称:vertx-service-discovery,代码行数:11,代码来源:MongoDataSourceTest.java

示例2: startMongo

import de.flapdoodle.embed.mongo.MongodProcess; //导入依赖的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

示例3: run

import de.flapdoodle.embed.mongo.MongodProcess; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public IResponse run(IContext context) throws CommandException
{
	// Creates the response
	IResponse response = new Response();
	
	// If the embedded server is not already stated or starting
	if(context.getState() != State.STARTING && context.getState() != State.STARTED) {
	
		// Sets the starting state
		context.setState(State.STARTING);

		// Creates and starts a MongodExecutable
		MongodStarter starter = MongodStarter.getInstance(context.getMongoContext().getRuntimeConfig());
		MongodExecutable mongodExecutable = starter.prepare(context.getMongoContext().getMongodConfig());
		
		try {
			MongodProcess mongodProcess = mongodExecutable.start();
			context.getMongoContext().setMongodProcess(mongodProcess);
		} catch (IOException ioException) {
			throw new CommandException(ioException);
		}

		context.getMongoContext().setMongodExecutable(mongodExecutable);

		// Sets the started state
		context.setState(State.STARTED);

	}

	// Otherwise this is an error because the server is already started
	else {
		
		// TODO: Trouver un moyen de modéliser une erreur générique
		
	}

	return response;
}
 
开发者ID:gomoob,项目名称:embedded-mongo,代码行数:42,代码来源:StartCommand.java

示例4: start

import de.flapdoodle.embed.mongo.MongodProcess; //导入依赖的package包/类
public void start() throws Throwable {
    this.mongodProcessList = new ArrayList<MongodProcess>();
    Set<Entry<String, List<IMongodConfig>>> entries = replicaSet.entrySet();
    for (Entry<String, List<IMongodConfig>> entry : entries) {
        initializeReplicaSet(entry);
    }
}
 
开发者ID:CA-APM,项目名称:ca-apm-fieldpack-mongodb,代码行数:8,代码来源:MongoReplicaSetForTestFactory.java

示例5: mongod

import de.flapdoodle.embed.mongo.MongodProcess; //导入依赖的package包/类
@Bean(destroyMethod = "stop")
@DependsOn("mongodExecutable")
public MongodProcess mongod() throws IOException {
    return mongodExecutable().start();
}
 
开发者ID:nerdcoding,项目名称:angular2-spring-boot,代码行数:6,代码来源:EmbeddedMongoConfiguration.java

示例6: mongod

import de.flapdoodle.embed.mongo.MongodProcess; //导入依赖的package包/类
@Bean(destroyMethod = "stop")
public MongodProcess mongod() throws IOException {
    return mongodExe().start();
}
 
开发者ID:Spectingular,项目名称:spectingular.spock,代码行数:5,代码来源:EmbeddedMongoDbConfig.java

示例7: getMongodProcess

import de.flapdoodle.embed.mongo.MongodProcess; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public MongodProcess getMongodProcess() {
	return this.mongodProcess;
}
 
开发者ID:gomoob,项目名称:embedded-mongo,代码行数:7,代码来源:MongoContext.java

示例8: setMongodProcess

import de.flapdoodle.embed.mongo.MongodProcess; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public void setMongodProcess(MongodProcess mongodProcess)
{
	this.mongodProcess = mongodProcess;
}
 
开发者ID:gomoob,项目名称:embedded-mongo,代码行数:8,代码来源:MongoContext.java

示例9: stop

import de.flapdoodle.embed.mongo.MongodProcess; //导入依赖的package包/类
public void stop() {
    for (MongodProcess process : this.mongodProcessList) {
        process.stop();
    }
}
 
开发者ID:CA-APM,项目名称:ca-apm-fieldpack-mongodb,代码行数:6,代码来源:MongoReplicaSetForTestFactory.java

示例10: getMongodProcess

import de.flapdoodle.embed.mongo.MongodProcess; //导入依赖的package包/类
public MongodProcess getMongodProcess() {
    return mongodProcess;
}
 
开发者ID:apache,项目名称:logging-log4j2,代码行数:4,代码来源:MongoDbTestRule.java

示例11: getMongodProcess

import de.flapdoodle.embed.mongo.MongodProcess; //导入依赖的package包/类
/**
 * Gets a reference to the Mongo DB process.
 * 
 * @return a reference to the Mongo DB process.
 */
public MongodProcess getMongodProcess();
 
开发者ID:gomoob,项目名称:embedded-mongo,代码行数:7,代码来源:IMongoContext.java

示例12: setMongodProcess

import de.flapdoodle.embed.mongo.MongodProcess; //导入依赖的package包/类
/**
 * Sets a reference to the Mongo DB process.
 * 
 * @param mongodProcess A reference to the Mongo DB process.
 */
void setMongodProcess(MongodProcess mongodProcess);
 
开发者ID:gomoob,项目名称:embedded-mongo,代码行数:7,代码来源:IMongoContext.java


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