Skip to content

Commit e0cd723

Browse files
committed
Skipping authentication tests for server 2.5 and up, since this branch does not support the new user CRUD commands that are going to be required in 2.6
1 parent cbfb4f0 commit e0cd723

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/test/com/mongodb/JavaClientTest.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.bson.types.MaxKey;
3030
import org.bson.types.MinKey;
3131
import org.bson.types.ObjectId;
32+
import org.testng.SkipException;
3233
import org.testng.annotations.Test;
3334

3435
import java.net.UnknownHostException;
@@ -653,6 +654,10 @@ public void testMulti(){
653654

654655
@Test
655656
public void testAuthenticate() throws UnknownHostException {
657+
if (serverIsAtLeastVersion(2.5)) {
658+
throw new SkipException("Authentication tests skipped for 2.5 and up");
659+
}
660+
656661
assertEquals( "26e3d12bd197368526409177b3e8aab6" , _db._hash( "e" , "j".toCharArray() ) );
657662

658663
Mongo m = new MongoClient();
@@ -689,6 +694,10 @@ public void testAuthenticate() throws UnknownHostException {
689694

690695
@Test
691696
public void testAuthenticateCommand() throws UnknownHostException {
697+
if (serverIsAtLeastVersion(2.5)) {
698+
throw new SkipException("Authentication tests skipped for 2.5 and up");
699+
}
700+
692701
Mongo m = new MongoClient();
693702
DB db = m.getDB(cleanupDB);
694703
DBCollection usersCollections = db.getCollection( "system.users" );
@@ -753,6 +762,10 @@ public void testAuthenticateWithCredentialsInURIAndNoDatabase() throws UnknownHo
753762

754763
@Test
755764
public void testAuthenticateWithCredentialsInURI() throws UnknownHostException {
765+
if (serverIsAtLeastVersion(2.5)) {
766+
throw new SkipException("Authentication tests skipped for 2.5 and up");
767+
}
768+
756769
// First add the user
757770
Mongo m = new MongoClient(new MongoClientURI("mongodb://localhost"));
758771
DB db = m.getDB(cleanupDB);
@@ -783,6 +796,10 @@ public void testAuthenticateWithCredentialsInURI() throws UnknownHostException {
783796

784797
@Test
785798
public void testAuthenticateCommandWithCredentialsInURI() throws UnknownHostException {
799+
if (serverIsAtLeastVersion(2.5)) {
800+
throw new SkipException("Authentication tests skipped for 2.5 and up");
801+
}
802+
786803
// First add the user
787804
Mongo m = new MongoClient(new MongoClientURI("mongodb://localhost"));
788805
DB db = m.getDB(cleanupDB);

0 commit comments

Comments
 (0)