Skip to content

Commit 74f6477

Browse files
committed
Disable snapshot cursor tests for MongoDB version >= 3.7
1 parent 62ed3e7 commit 74f6477

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

driver-legacy/src/test/functional/com/mongodb/DBCursorOldTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@
3030
import java.util.concurrent.TimeoutException;
3131

3232
import static com.mongodb.ClusterFixture.serverVersionAtLeast;
33+
import static com.mongodb.ClusterFixture.serverVersionLessThan;
3334
import static java.util.concurrent.TimeUnit.SECONDS;
3435
import static org.hamcrest.CoreMatchers.is;
3536
import static org.junit.Assert.assertEquals;
3637
import static org.junit.Assert.assertNotNull;
3738
import static org.junit.Assert.assertTrue;
3839
import static org.junit.Assert.fail;
3940
import static org.junit.Assume.assumeThat;
41+
import static org.junit.Assume.assumeTrue;
4042

4143
public class DBCursorOldTest extends DatabaseTestCase {
4244

@@ -82,6 +84,7 @@ public void testCount() {
8284

8385
@Test
8486
public void testSnapshot() {
87+
assumeTrue(serverVersionLessThan("3.7"));
8588
insertTestData(collection, 100);
8689
assertEquals(100, collection.find().count());
8790
assertEquals(100, collection.find().toArray().size());

driver-legacy/src/test/functional/com/mongodb/DBCursorTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import static com.mongodb.ClusterFixture.enableMaxTimeFailPoint;
3131
import static com.mongodb.ClusterFixture.isSharded;
3232
import static com.mongodb.ClusterFixture.serverVersionAtLeast;
33+
import static com.mongodb.ClusterFixture.serverVersionLessThan;
3334
import static org.hamcrest.CoreMatchers.not;
3435
import static org.hamcrest.core.Is.is;
3536
import static org.junit.Assert.assertEquals;
@@ -39,6 +40,7 @@
3940
import static org.junit.Assert.assertTrue;
4041
import static org.junit.Assert.fail;
4142
import static org.junit.Assume.assumeThat;
43+
import static org.junit.Assume.assumeTrue;
4244

4345
public class DBCursorTest extends DatabaseTestCase {
4446
private static final int NUMBER_OF_DOCUMENTS = 10;
@@ -380,6 +382,7 @@ public void testShowDiskLoc() {
380382

381383
@Test
382384
public void testSnapshot() {
385+
assumeTrue(serverVersionLessThan("3.7"));
383386
DBCursor cursor = new DBCursor(collection, new BasicDBObject(), new BasicDBObject(), ReadPreference.primary())
384387
.addSpecial("$snapshot", true);
385388
try {

0 commit comments

Comments
 (0)