Skip to content

Commit

Permalink
JAVA-425 - Support MongoDB Server 2.0 getLastError Changes (j, w=stri…
Browse files Browse the repository at this point in the history
…ng/number)

* TEst WriteConcern interface still works; had to adjust test to call getW() instead of package protected internal value
  • Loading branch information
Brendan W. McAdams committed Sep 8, 2011
1 parent 585de5f commit 5026b1b
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions src/test/com/mongodb/JavaClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -754,11 +754,29 @@ public void testWriteConcernValueOf() {
WriteConcern wc1 = WriteConcern.NORMAL;
WriteConcern wc2 = WriteConcern.valueOf( "normal" );
WriteConcern wc3 = WriteConcern.valueOf( "NORMAL" );

assertEquals( wc1._w, wc2._w );
assertEquals( wc1._w, wc3._w );

assertEquals( wc1, wc2 );
assertEquals( wc1, wc3 );
assertEquals( wc1.getW(), wc2.getW() );
assertEquals( wc1.getWValue(), wc2.getWValue() );
assertEquals( wc1.getW(), wc3.getW() );
assertEquals( wc1.getWValue(), wc3.getWValue() );
}


@Test
public void testWriteConcernMajority() {
WriteConcern wc1 = WriteConcern.MAJORITY;
WriteConcern wc2 = WriteConcern.valueOf( "majority" );
WriteConcern wc3 = WriteConcern.valueOf( "MAJORITY" );

assertEquals( wc1, wc2 );
assertEquals( wc1, wc3 );
assertEquals( wc1.getWString(), wc2.getWString() );
assertEquals( wc1.getWValue(), wc2.getWValue() );
assertEquals( wc1.getWString(), wc3.getWString() );
assertEquals( wc1.getWValue(), wc3.getWValue() );
}

@Test
public void testFindAndModify(){
DBCollection c = _db.getCollection( "findandmodify" );
Expand Down

0 comments on commit 5026b1b

Please sign in to comment.