Search in sources :

Example 1 with MongoDBVDatabase

use of de.fhg.igd.mongomvcc.impl.MongoDBVDatabase in project mongomvcc by igd-geo.

the class IndexTest method stackOverflow.

/**
 * This test checks if a stack overflows when there are too many commits in the database.
 * See https://github.com/igd-geo/mongomvcc/pull/2 for more information.
 * @throws StackOverflowError if the test fails
 */
@Test
@Ignore("Really slow. Not necessary in all situations. See GitHub issue for more information.")
public void stackOverflow() throws StackOverflowError {
    VCollection persons = _master.getCollection("stack");
    Map<String, Object> elvis = _factory.createDocument();
    elvis.put("name", "elvis");
    for (int i = 0; i < 2500; i++) {
        persons.insert(elvis);
        _master.commit();
    }
    VDatabase db = _factory.createDatabase();
    db.connect(((MongoDBVDatabase) _db).getDB().getName());
    VBranch master = db.checkout(VConstants.MASTER);
    persons = master.getCollection("stack");
    persons.find().size();
}
Also used : VDatabase(de.fhg.igd.mongomvcc.VDatabase) MongoDBVDatabase(de.fhg.igd.mongomvcc.impl.MongoDBVDatabase) MongoDBVDatabase(de.fhg.igd.mongomvcc.impl.MongoDBVDatabase) VBranch(de.fhg.igd.mongomvcc.VBranch) VCollection(de.fhg.igd.mongomvcc.VCollection) Ignore(org.junit.Ignore) Test(org.junit.Test) AbstractMongoDBVDatabaseTest(de.fhg.igd.mongomvcc.impl.AbstractMongoDBVDatabaseTest)

Aggregations

VBranch (de.fhg.igd.mongomvcc.VBranch)1 VCollection (de.fhg.igd.mongomvcc.VCollection)1 VDatabase (de.fhg.igd.mongomvcc.VDatabase)1 AbstractMongoDBVDatabaseTest (de.fhg.igd.mongomvcc.impl.AbstractMongoDBVDatabaseTest)1 MongoDBVDatabase (de.fhg.igd.mongomvcc.impl.MongoDBVDatabase)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1