protected void pumpDataIntoTestCollection() {
// there should be 100 of each
String[] scientists = {"Einstein", "Darwin", "Copernicus", "Pasteur", "Curie", "Faraday", "Newton", "Bohr", "Galilei", "Maxwell"};
for (int i = 1; i <= 1000; i++) {
int index = i % scientists.length;
Formatter f = new Formatter();
String doc = f.format("{\"_id\":\"%d\", \"scientist\":\"%s\", \"fixedField\": \"fixedValue\"}", i, scientists[index]).toString();
IOHelper.close(f);
testCollection.insert((DBObject) JSON.parse(doc), WriteConcern.SAFE);
}
assertEquals("Data pumping of 1000 entries did not complete entirely", 1000L, testCollection.count());
}