Created
July 29, 2012 15:47
-
-
Save cexbrayat/3199637 to your computer and use it in GitHub Desktop.
Blog - Play!, MongoDB et Morphia - MongoPlayJUnitRunner.java
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 class MongoPlayJUnitRunner extends PlayJUnitRunner { | |
static int PORT = 27017; | |
static { | |
try { | |
MongodConfig config = new MongodConfig(Version.V2_0, PORT, Network.localhostIsIPv6()); | |
MongodExecutable prepared = MongoDBRuntime.getDefaultInstance().prepare(config); | |
prepared.start(); | |
new Mongo("localhost", PORT); | |
PlayJUnitRunner.StartPlay.rule(); | |
} catch (IOException e) { | |
Logger.error("Could not start embedmongo instance"); | |
} | |
} | |
public MongoPlayJUnitRunner(Class testClass) throws ClassNotFoundException, InitializationError, IOException { | |
super(testClass); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Gist for a blog post