Skip to content

Commit ece70a9

Browse files
author
Ryan
committed
merged.
1 parent 4b0aa6d commit ece70a9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/test/com/mongodb/SecondaryReadTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ public void testSecondaryReadCursor() throws Exception {
184184

185185
final DBCursor cur = col.find();
186186

187+
cur.hasNext();
188+
187189
ServerAddress curServerAddress = cur.getServerAddress();
188190

189191
assertEquals(true, serverIsSecondary(curServerAddress, testHosts));
@@ -206,6 +208,9 @@ private boolean serverIsSecondary(final ServerAddress pServerAddr, final List<Te
206208
final int portIdx = h.hostnameAndPort.indexOf(":");
207209
final int port = Integer.parseInt(h.hostnameAndPort.substring(portIdx+1, h.hostnameAndPort.length()));
208210
final String hostname = h.hostnameAndPort.substring(0, portIdx);
211+
212+
//System.out.println("---- hostname: " + hostname + " + server addr host: " + pServerAddr.getHost());
213+
209214
if (pServerAddr.getPort() == port && hostname.equals(pServerAddr.getHost())) return true;
210215
}
211216

@@ -263,9 +268,7 @@ private List<ObjectId> insertTestData(final DBCollection pCol) throws Exception
263268
// Insert some test data.
264269
for (int idx=0; idx < INSERT_COUNT; idx++) {
265270
final ObjectId id = ObjectId.get();
266-
System.err.println("Inserting ID " + id + " with REPLICAS_SAFE");
267271
WriteResult writeResult = pCol.insert(new BasicDBObject("_id", id), WriteConcern.REPLICAS_SAFE);
268-
System.err.println("Inserted OK.");
269272
writeResult.getLastError().throwOnError();
270273
insertedIds.add(id);
271274
}

0 commit comments

Comments
 (0)