Skip to content

Commit

Permalink
Reverting previous changes for #193
Browse files Browse the repository at this point in the history
  • Loading branch information
sai-pullabhotla committed Feb 19, 2018

Verified

This commit was signed with the committer’s verified signature.
erijo Erik Flodin
1 parent f633086 commit 49fae7a
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/test/java/com/jmethods/catatumbo/EntityManagerTest.java
Original file line number Diff line number Diff line change
@@ -128,6 +128,7 @@
import com.jmethods.catatumbo.entities.WrappedLongIdEntity;
import com.jmethods.catatumbo.entities.WrappedLongObjectIdEntity;
import com.jmethods.catatumbo.entities.ZonedDateTimeField;
import com.jmethods.catatumbo.impl.DefaultEntityManager;

/**
* @author Sai Pullabhotla
@@ -1561,7 +1562,17 @@ public void testUpdate_ThatDoesNotExist() {
em.delete(entity);
LongId entity2 = em.load(LongId.class, entity.getId());
if (entity2 == null) {
em.update(entity);
try {
em.update(entity);
} catch (EntityNotFoundException exp) {
throw exp;
} catch (EntityManagerException exp) {
String host = ((DefaultEntityManager) em).getDatastore().getOptions().getHost();
if (!ConnectionParameters.DEFAULT_SERVICE_URL.equals(host)) {
// Running on emulator that has a bug.
throw new EntityNotFoundException(exp);
}
}
}
}

@@ -3501,7 +3512,17 @@ public void testDuplicateKey() {
StringField entity = new StringField();
entity.setName("Dup Test");
entity = em.insert(entity);
entity = em.insert(entity);
try {
entity = em.insert(entity);
} catch (EntityAlreadyExistsException exp) {
throw exp;
} catch (EntityManagerException exp) {
String host = ((DefaultEntityManager) em).getDatastore().getOptions().getHost();
if (!ConnectionParameters.DEFAULT_SERVICE_URL.equals(host)) {
// Running on emulator that has a bug.
throw new EntityAlreadyExistsException(exp);
}
}
}

private static Calendar getToday() {

0 comments on commit 49fae7a

Please sign in to comment.