Removed Mongo ES tests based on embedded mongo Docker based ones are enough
POLYGENE-270 Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/d0c1ff58 Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/d0c1ff58 Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/d0c1ff58 Branch: refs/heads/master Commit: d0c1ff58d386b55a881893e9a762a043545eafe3 Parents: 49e6259 Author: Paul Merlin <[email protected]> Authored: Fri Jul 21 09:32:13 2017 +0200 Committer: Paul Merlin <[email protected]> Committed: Fri Jul 21 10:09:12 2017 +0200 ---------------------------------------------------------------------- dependencies.gradle | 2 - extensions/entitystore-mongodb/build.gradle | 1 - .../mongodb/EmbedMongoDBMapEntityStoreTest.java | 88 -------------------- .../EmbedMongoDBMapEntityStoreTestSuite.java | 84 ------------------- 4 files changed, 175 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d0c1ff58/dependencies.gradle ---------------------------------------------------------------------- diff --git a/dependencies.gradle b/dependencies.gradle index f9bc3de..b6446ad 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -183,7 +183,6 @@ def awaitilityVersion = '3.0.0' def dnsJavaVersion = '2.1.8' def dockerJUnitVersion = '0.3' def easyMockVersion = '3.4' -def embedMongoVersion = '2.0.0' // 2.0.0 exists def h2Version = '1.4.196' def hamcrestVersion = '1.3' def jaxRsApiVersion = '2.0.1' @@ -200,7 +199,6 @@ dependencies.libraries << [ dnsjava : "dnsjava:dnsjava:$dnsJavaVersion", docker_junit : "com.github.tdomzal:junit-docker-rule:$dockerJUnitVersion", easymock : "org.easymock:easymock:$easyMockVersion", - embed_mongo : "de.flapdoodle.embed:de.flapdoodle.embed.mongo:$embedMongoVersion", h2 : "com.h2database:h2:$h2Version", hamcrest : [ "org.hamcrest:hamcrest-core:$hamcrestVersion", "org.hamcrest:hamcrest-library:$hamcrestVersion" ], http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d0c1ff58/extensions/entitystore-mongodb/build.gradle ---------------------------------------------------------------------- diff --git a/extensions/entitystore-mongodb/build.gradle b/extensions/entitystore-mongodb/build.gradle index 940db5a..1d5a0ba 100644 --- a/extensions/entitystore-mongodb/build.gradle +++ b/extensions/entitystore-mongodb/build.gradle @@ -33,7 +33,6 @@ dependencies { runtimeOnly polygene.core.runtime testImplementation polygene.internals.testsupport - testImplementation libraries.embed_mongo testRuntimeOnly libraries.logback } http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d0c1ff58/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/EmbedMongoDBMapEntityStoreTest.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/EmbedMongoDBMapEntityStoreTest.java b/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/EmbedMongoDBMapEntityStoreTest.java deleted file mode 100644 index c362490..0000000 --- a/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/EmbedMongoDBMapEntityStoreTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.polygene.entitystore.mongodb; - -import de.flapdoodle.embed.mongo.MongodExecutable; -import de.flapdoodle.embed.mongo.MongodStarter; -import de.flapdoodle.embed.mongo.config.MongodConfigBuilder; -import de.flapdoodle.embed.mongo.config.Net; -import de.flapdoodle.embed.mongo.distribution.Version; -import de.flapdoodle.embed.process.runtime.Network; -import java.io.IOException; -import java.util.Collections; -import org.apache.polygene.api.common.Visibility; -import org.apache.polygene.bootstrap.AssemblyException; -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.entitystore.mongodb.assembly.MongoDBEntityStoreAssembler; -import org.apache.polygene.test.EntityTestAssembler; -import org.apache.polygene.test.entity.AbstractEntityStoreTest; -import org.apache.polygene.test.util.FreePortFinder; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.rules.TestName; - -public class EmbedMongoDBMapEntityStoreTest extends AbstractEntityStoreTest -{ - private static final MongodStarter MONGO_STARTER = MongodStarter.getDefaultInstance(); - - @Rule - public TestName testName = new TestName(); - private static int port; - private static MongodExecutable mongod; - - @BeforeClass - public static void startEmbedMongo() - throws IOException - { - port = FreePortFinder.findFreePortOnLoopback(); - mongod = MONGO_STARTER.prepare( new MongodConfigBuilder() - .version( Version.Main.PRODUCTION ) - .net( new Net( "localhost", port, Network.localhostIsIPv6() ) ) - .build() ); - mongod.start(); - } - - @AfterClass - public static void stopEmbedMongo() - { - if( mongod != null ) - { - mongod.stop(); - } - } - - @Override - public void assemble( ModuleAssembly module ) - throws AssemblyException - { - super.assemble( module ); - - ModuleAssembly config = module.layer().module( "config" ); - new EntityTestAssembler().defaultServicesVisibleIn( Visibility.layer ).assemble( config ); - - new MongoDBEntityStoreAssembler().withConfig( config, Visibility.layer ).assemble( module ); - - MongoDBEntityStoreConfiguration mongoConfig = config.forMixin( MongoDBEntityStoreConfiguration.class ) - .declareDefaults(); - mongoConfig.writeConcern().set( MongoDBEntityStoreConfiguration.WriteConcern.MAJORITY ); - mongoConfig.database().set( "polygene-test" ); - mongoConfig.collection().set( testName.getMethodName() ); - mongoConfig.nodes().set( Collections.singletonList( "localhost:" + port ) ); - } -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d0c1ff58/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/EmbedMongoDBMapEntityStoreTestSuite.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/EmbedMongoDBMapEntityStoreTestSuite.java b/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/EmbedMongoDBMapEntityStoreTestSuite.java deleted file mode 100644 index 57c1e16..0000000 --- a/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/EmbedMongoDBMapEntityStoreTestSuite.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.polygene.entitystore.mongodb; - -import de.flapdoodle.embed.mongo.MongodExecutable; -import de.flapdoodle.embed.mongo.MongodStarter; -import de.flapdoodle.embed.mongo.config.MongodConfigBuilder; -import de.flapdoodle.embed.mongo.config.Net; -import de.flapdoodle.embed.mongo.distribution.Version; -import de.flapdoodle.embed.process.runtime.Network; -import java.io.IOException; -import java.util.Collections; -import org.apache.polygene.api.common.Visibility; -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.entitystore.mongodb.assembly.MongoDBEntityStoreAssembler; -import org.apache.polygene.test.entity.model.EntityStoreTestSuite; -import org.apache.polygene.test.util.FreePortFinder; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.rules.TestName; - -public class EmbedMongoDBMapEntityStoreTestSuite extends EntityStoreTestSuite -{ - private static final MongodStarter MONGO_STARTER = MongodStarter.getDefaultInstance(); - - @Rule - public TestName testName = new TestName(); - private static int port; - private static MongodExecutable mongod; - - @BeforeClass - public static void startEmbedMongo() - throws IOException - { - port = FreePortFinder.findFreePortOnLoopback(); - mongod = MONGO_STARTER.prepare( new MongodConfigBuilder() - .version( Version.Main.PRODUCTION ) - .net( new Net( "localhost", port, Network.localhostIsIPv6() ) ) - .build() ); - mongod.start(); - } - - @AfterClass - public static void stopEmbedMongo() - { - if( mongod != null ) - { - mongod.stop(); - } - } - - @Override - protected void defineStorageModule( ModuleAssembly module ) - { - module.defaultServices(); - new MongoDBEntityStoreAssembler() - .visibleIn( Visibility.application ) - .withConfig( configModule, Visibility.application ) - .assemble( module ); - - MongoDBEntityStoreConfiguration mongoConfig = configModule.forMixin( MongoDBEntityStoreConfiguration.class ) - .declareDefaults(); - mongoConfig.writeConcern().set( MongoDBEntityStoreConfiguration.WriteConcern.MAJORITY ); - mongoConfig.database().set( "polygene-test" ); - mongoConfig.collection().set( testName.getMethodName() ); - mongoConfig.nodes().set( Collections.singletonList( "localhost:" + port ) ); - } -}
