Permalink
Browse files

Merge branch 'master' of github.com:mongodb/mongo-java-driver

  • Loading branch information...
2 parents 49410ef + 4247808 commit 3c917af52e422ba62162bf63463c3d381196a94e @jyemin jyemin committed Jan 8, 2013
Showing with 83 additions and 15 deletions.
  1. +1 −0 .gitignore
  2. +20 −0 .travis.yml
  3. +41 −0 CONTRIBUTING.md
  4. +8 −5 README.md
  5. +2 −9 src/main/com/mongodb/DBApiLayer.java
  6. +1 −1 src/main/com/mongodb/DBCursor.java
  7. +10 −0 src/test/com/mongodb/DBCursorTest.java
View
@@ -49,6 +49,7 @@ TAGS
src/test/ed/webtests/webtest-local.bash
*.ipr
+*.iml
*.iws
*.iml
.idea
View
@@ -0,0 +1,20 @@
+language: java
+
+jdk:
+ - oraclejdk7
+ - openjdk6
+
+notifications:
+ email:
+ recipients:
+ - jeff.yemin@10gen.com
+ - trisha.gee@10gen.com
+ on_success: change
+ on_failure: always
+
+services:
+ - mongodb
+
+branches:
+ only:
+ - master
View
@@ -0,0 +1,41 @@
+## Contributing to the MongoDB Java Driver
+
+Thank you for your interest in contributing to the MongoDB Java driver.
+
+We are building this software together and strongly encourage contributions
+from the community that are within the guidelines set forth below.
+
+Bug Fixes and New Features
+--------------------------
+
+Before starting to write code, look for existing [tickets]
+(https://jira.mongodb.org/browse/JAVA) or [create one]
+(https://jira.mongodb.org/secure/CreateIssue!default.jspa)
+for your bug, issue, or feature request. This helps the community
+avoid working on something that might not be of interest or which
+has already been addressed.
+
+Pull Requests
+-------------
+
+Pull requests should be made against the master (development)
+branch and include relevant tests, if applicable. The driver follows
+the Git-Flow branching model where the traditional master branch is
+known as release and the master (default) branch is considered under
+development.
+
+Code should compile and tests should pass under all Java versions
+which the driver currently supports. Currently the Java driver supports
+a minimum version of Java 5. Please run 'ant test' to confirm. If your
+tests modify code related to replica sets, please ensure that you run the
+tests with a replica set where the primary is on port 27017.
+
+The results of pull request testing will be appended to the request.
+If any tests do not pass, or relevant tests are not included the pull
+request will not be considered.
+
+Talk To Us
+----------
+
+If you want to work on something or have questions / complaints please reach
+out to us by creating a Question issue at (https://jira.mongodb.org/secure/CreateIssue!default.jspa).
View
@@ -8,19 +8,23 @@
* mailing list: http://groups.google.com/group/mongodb-user
* jira: http://jira.mongodb.org/browse/JAVA
+### Build status:
+[![Build Status](https://jenkins.10gen.com/job/mongo-java-driver/badge/icon)](https://jenkins.10gen.com/job/mongo-java-driver/)
+
### Maintainers
* Jeff Yemin jeff.yemin@10gen.com
-* Antoine Girbal antoine@10gen.com
-* Scott Hernandez scott@10gen.com
-* Brendan McAdams brendan@10gen.com
+* Trisha Gee trisha.gee@10gen.com
### Contributors:
+* Scott Hernandez scott@10gen.com
+* Ryan Nitz ryan@10gen.com
+* Antoine Girbal antoine@10gen.com
+* Brendan McAdams brendan@10gen.com
* Eliot Horowitz eliot@10gen.com
* Kristina Chodorow kristina@10gen.com
* Geir Magnusson geir@pobox.com
* Keith Branton mongoDBjira@branton.co.uk
* Dave Brosius dbrosius@mebigfatguy.com
-* Scott Hernandez scotthernandez@gmail.com
* Hans Meiser hmeiser@example.com
* Benedikt Waldvogel mail@bwaldvogel.de
* William Shulman william.shulman@gmail.com
@@ -38,4 +42,3 @@
* Matthew Foemmel git@foemmel.com
* Jim Dickinson jdickinson@shopwiki.com
* Jorge Ortiz jorge.ortiz@gmail.com
-* Ryan Nitz
@@ -22,14 +22,7 @@
import org.bson.BSONObject;
import org.bson.types.ObjectId;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.logging.Level;
@@ -406,7 +399,7 @@ public DBObject next(){
}
if ( ! _curResult.hasGetMore( _options ) )
- throw new RuntimeException( "no more" );
+ throw new NoSuchElementException("no more");
_advance();
return next();
@@ -496,7 +496,7 @@ public DBObject next() {
/**
* Returns the element the cursor is at.
- * @return the next element
+ * @return the current element
*/
public DBObject curr(){
_checkType( CursorType.ITERATOR );
@@ -22,6 +22,7 @@
import java.io.IOException;
import java.net.UnknownHostException;
import java.util.Iterator;
+import java.util.NoSuchElementException;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
@@ -463,6 +464,15 @@ public void testSort(){
}
}
+ @Test(expectedExceptions = NoSuchElementException.class)
+ public void testShouldThrowNoSuchElementException() {
+ DBCollection c = _db.getCollection("emptyCollection");
+
+ DBCursor cursor = c.find();
+
+ cursor.next();
+ }
+
@Test
public void testHasFinalizer() throws UnknownHostException {
DBCollection c = _db.getCollection( "HasFinalizerTest" );

0 comments on commit 3c917af

Please sign in to comment.