Skip to content

Commit

Permalink
Remove the workaround used in EntityManagerTest #193
Browse files Browse the repository at this point in the history
  • Loading branch information
sai-pullabhotla committed Feb 13, 2018
1 parent 9766c17 commit 6b612bd
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions src/test/java/com/jmethods/catatumbo/EntityManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
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
Expand Down Expand Up @@ -1562,17 +1561,7 @@ public void testUpdate_ThatDoesNotExist() {
em.delete(entity);
LongId entity2 = em.load(LongId.class, entity.getId());
if (entity2 == null) {
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);
}
}
em.update(entity);
}
}

Expand Down Expand Up @@ -3480,17 +3469,7 @@ public void testDuplicateKey() {
StringField entity = new StringField();
entity.setName("Dup Test");
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);
}
}
entity = em.insert(entity);
}

private static Calendar getToday() {
Expand Down

0 comments on commit 6b612bd

Please sign in to comment.