Permalink
Browse files

replaced println with assert

  • Loading branch information...
jyemin committed Feb 24, 2012
1 parent f5db4e0 commit 0284c8aa1f83d39b760787ff00067f02b257465a
Showing with 9 additions and 17 deletions.
  1. +7 −12 src/test/com/mongodb/DBCollectionTest.java
  2. +2 −5 src/test/com/mongodb/MongoTest.java
@@ -16,15 +16,13 @@
package com.mongodb;
-import java.io.IOException;
-import java.util.List;
-
-import org.bson.types.*;
-import org.testng.annotations.Test;
+import com.mongodb.util.TestCase;
+import org.bson.types.ObjectId;
import org.testng.Assert;
+import org.testng.annotations.Test;
-
-import com.mongodb.util.TestCase;
+import java.io.IOException;
+import java.util.List;
public class DBCollectionTest extends TestCase {
@@ -255,12 +253,9 @@ public void testMultiInsertNoContinue() {
DBObject inserted2 = BasicDBObjectBuilder.start("_id", id).add("x",3).add("y",4).get();
DBObject inserted3 = BasicDBObjectBuilder.start().add("x",5).add("y",6).get();
WriteResult r = c.insert(inserted1,inserted2, inserted3);
- System.err.println( "Count: " + c.count() + " WriteConcern: " + c.getWriteConcern() );
+ assertEquals(1, c.count());
+ assertFalse(c.getWriteConcern().getContinueOnErrorForInsert());
- System.err.println( " Continue on Error? " + c.getWriteConcern().getContinueOnErrorForInsert() );
- for (DBObject doc : c.find( )) {
- System.err.println( doc );
- }
assertEquals( c.count(), 1);
}
@@ -18,13 +18,12 @@
package com.mongodb;
-import java.io.*;
-
+import com.mongodb.util.TestCase;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
-import com.mongodb.util.*;
+import java.io.IOException;
public class MongoTest extends TestCase {
@@ -44,8 +43,6 @@ public void setUp() {
@Test
public void testClose_shouldNotReturnUntilCleanupThreadIsFinished() throws Exception {
-
- System.out.println(Mongo.cleanerIntervalMS);
Mongo.cleanerIntervalMS = 250000; //set to a suitably large value to avoid race conditions in the test
Mongo mongo = new Mongo();

0 comments on commit 0284c8a

Please sign in to comment.