final List<GbEntity> midData =
gss.getDataOrNull(spreadsheet.getKey(), KIND_NAME, 3, COUNT);
// Compare
for (int i = 0; i < srcData.size(); i++) {
final GbEntity src = srcData.get(i);
for (int j = 0; j < midData.size(); j++) {
final GbEntity dest = midData.get(j);
if (src.getKey().equals(dest.getKey())) {
List<GbProperty> srcProps = src.getProperties();
List<GbProperty> destProps = dest.getProperties();
for (GbProperty srcProp : srcProps) {
final String srcName = srcProp.getName();
for (GbProperty destProp : destProps) {
final String destName = destProp.getName();
if (srcName.equals(destName)) {
if (destProp.getValueType().equals(GbProperty.SHORT_BLOB)) {
assertThat(
destProp.getValue().toString(),
is("'" + GbProperty.NOT_SUPPORTED));
} else {
assertThat(destProp.asDatastoreValue(), equalTo(srcProp
.getValue()));
}
}
}
}
}
}
}
// Restore Data to Datastore
GbDatastoreService.restoreData(KIND_NAME, midData);
// Get Data from Datastore.
final List<GbEntity> destData = GbDatastoreService.getData(null, KIND_NAME, COUNT);
// Compare
for (int i = 0; i < srcData.size(); i++) {
final GbEntity src = srcData.get(i);
for (int j = 0; j < destData.size(); j++) {
final GbEntity dest = destData.get(j);
if (src.getKey().equals(dest.getKey())) {
List<GbProperty> srcProps = src.getProperties();
List<GbProperty> destProps = dest.getProperties();
for (GbProperty srcProp : srcProps) {
final String srcName = srcProp.getName();
for (GbProperty destProp : destProps) {
final String destName = destProp.getName();
if (srcName.equals(destName)) {