Skip to content

Instantly share code, notes, and snippets.

View cexbrayat's full-sized avatar

Cédric Exbrayat cexbrayat

View GitHub Profile

Keybase proof

I hereby claim:

  • I am cexbrayat on github.
  • I am cexbrayat (https://keybase.io/cexbrayat) on keybase.
  • I have a public key whose fingerprint is 2FE5 4D6B 6141 6BC3 0539 E6BC ADA5 BF0D D06C 7207

To claim this, I am signing this object:

@cexbrayat
cexbrayat / AppMongoTest.java
Created July 29, 2012 15:48
Blog - Play!, MongoDB et Morphia - AppMongoTest.java
import models.App;
import org.junit.Test;
import java.util.List;
public class AppMongoTest extends MongoTest {
@Test
public void saveNewApp() {
App app = new App();
app.name = "camel-ref";
@cexbrayat
cexbrayat / MongoPlayJUnitRunner.java
Created July 29, 2012 15:47
Blog - Play!, MongoDB et Morphia - MongoPlayJUnitRunner.java
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);
@cexbrayat
cexbrayat / MongoTest.java
Created July 29, 2012 15:46
Blog - Play!, MongoDB et Morphia - MongoTest.java
@RunWith(MongoPlayJUnitRunner.class)
public class MongoTest extends org.junit.Assert {
@Rule
public PlayJUnitRunner.StartPlay startPlayBeforeTests = PlayJUnitRunner.StartPlay.rule();
}
@cexbrayat
cexbrayat / AppTest.java
Created July 29, 2012 15:41
Blog - Play!, MongoDB et Morphia - AppTest.java
import models.App;
import org.junit.Test;
import play.test.UnitTest;
import java.util.List;
public class AppTest extends UnitTest {
@Test
public void saveNewApp() {
App app = new App();
@cexbrayat
cexbrayat / App.java
Created July 29, 2012 15:28
Blog - Play!, MongoDB et Morphia - App.java
@Entity
public class App extends Model {
public String name;
}