Created
July 26, 2012 07:44
-
-
Save gscheibel/3180802 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void testConnectionTimeout() { | |
Map<String, Object> cfg = new HashMap<String, Object>(); | |
cfg.put( Environment.MONGODB_TIMEOUT, "50" ); | |
cfg.put( Environment.MONGODB_HOST, "203.0.113.1" ); | |
cfg.put( Environment.MONGODB_DATABASE, "ogm_test_database" ); | |
MongoDBDatastoreProvider provider = new MongoDBDatastoreProvider(); | |
provider.configure( cfg ); | |
final long start = System.nanoTime(); | |
try { | |
provider.start(); | |
} | |
catch(Exception e){ | |
final long end = System.nanoTime(); | |
System.out.println( start ); | |
System.out.println( end ); | |
assertThat( end - 50 ).isGreaterThanOrEqualTo( start ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment