當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。