Skip to content

Commit a9c652f

Browse files
author
Brendan W. McAdams
committed
New approach to skipping version 2.0 + tests
1 parent afa3d3f commit a9c652f

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/test/com/mongodb/DBCollectionTest.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,16 +250,21 @@ public void testMultiInsertNoContinue() {
250250
}
251251

252252

253-
@Test
253+
@Test(enabled=false)
254254
public void mongodIsVersion20Plus() {
255255
String version = (String) _db.command("serverStatus").get("version");
256256
System.err.println("Connected to MongoDB Version '" + version + "'");
257257
assert(Double.parseDouble(version.substring(0, 3)) >= 2.0);
258258
}
259259

260-
@Test(dependsOnMethods = { "mongodIsVersion20Plus" })
260+
@Test/*(dependsOnMethods = { "mongodIsVersion20Plus" })*/
261261
public void testMultiInsertWithContinue() {
262-
262+
try {
263+
mongodIsVersion20Plus();
264+
} catch (Throwable t) {
265+
throw new org.testng.SkipException("MongoDB 2.0 or higher is required for this test.");
266+
}
267+
263268
DBCollection c = _db.getCollection("testmultiinsertWithContinue");
264269
c.drop();
265270

0 commit comments

Comments
 (0)