Github user jdasch commented on a diff in the pull request:
https://github.com/apache/incubator-rya/pull/216#discussion_r135036771
--- Diff:
dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBRyaDAOIT.java ---
@@ -41,34 +40,38 @@
import org.junit.Before;
import org.junit.Test;
+import com.mongodb.MongoClient;
import com.mongodb.MongoException;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;
-public class MongoDBRyaDAOIT extends MongoRyaTestBase {
-
+public class MongoDBRyaDAOIT {
+ private MongoClient client;
private MongoDBRyaDAO dao;
- private MongoDBRdfConfiguration configuration;
+ private MongoDBRdfConfiguration conf;
+
+ private static final String DB_NAME = "testInstance";
@Before
public void setUp() throws IOException, RyaDAOException{
- final Configuration conf = new Configuration();
- conf.set(MongoDBRdfConfiguration.MONGO_DB_NAME, getDbName());
+ client = MockMongoSingleton.getInstance();
+ client.dropDatabase(DB_NAME);
--- End diff --
I think this client.dropDatabase, and the DB_NAME could be pushed into a
JUnit `@Rule` similar to what RyaTestInstanceRule does. That way we don't
forget to do it if we're using the `@Rule`. Also cuts down on redundant code
in the tests that deals with singleton specific issues.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---