}
private void createTestData(EntityManager entityManager) {
// create abd configure all the DAOs:
JPAPushApplicationDao pushApplicationDao = new JPAPushApplicationDao();
// generic variant DAO:
JPAVariantDao variantDao = new JPAVariantDao();
pushApplicationDao.setEntityManager(entityManager);
variantDao.setEntityManager(entityManager);
this.installationDao = new JPAInstallationDao();
this.installationDao.setEntityManager(entityManager);
// create the PushApplication and a few variants:
PushApplication pa = new PushApplication();
pa.setName("PushApplication");
pushApplicationDao.create(pa);
AndroidVariant av = new AndroidVariant();
av.setGoogleKey("Key");
av.setName("Android");
av.setDeveloper("me");
// stash the ID:
this.androidVariantID = av.getVariantID();
variantDao.create(av);
SimplePushVariant sp = new SimplePushVariant();
sp.setDeveloper("me");
sp.setName("SimplePush");
// stash the ID:
this.simplePushVariantID = sp.getVariantID();
variantDao.create(sp);
// register the variants with the Push Application:
pa.getVariants().add(av);
pa.getVariants().add(sp);
pushApplicationDao.update(pa);
// ============== Android client installations =========
Installation android1 = new Installation();
android1.setAlias("foo@bar.org");
android1.setDeviceToken(DEVICE_TOKEN_1);