Skip to content

Commit

Permalink
fix sirixdb#582: Rectify failing test'
Browse files Browse the repository at this point in the history
  • Loading branch information
sband committed Jun 11, 2023
1 parent d7de235 commit 1e92222
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
import org.sirix.utils.OS;

import com.google.common.base.MoreObjects;
import com.google.common.base.Optional;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;

Expand Down Expand Up @@ -371,7 +372,9 @@ private ResourceConfiguration(final ResourceConfiguration.Builder builder) {
customCommitTimestamps = builder.customCommitTimestamps;
storeNodeHistory = builder.storeNodeHistory;
binaryVersion = builder.binaryEncodingVersion;
awsStoreInfo = builder.awsStoreInfo;
if(builder.awsStoreInfo != null) {
awsStoreInfo = builder.awsStoreInfo;
}
}

public BinaryEncodingVersion getBinaryEncodingVersion() {
Expand Down Expand Up @@ -648,13 +651,11 @@ public static ResourceConfiguration deserialize(final Path file) throws SirixIOE
name = jsonReader.nextName();
assert name.equals(JSONNAMES[16]);
final boolean storeChildCount = jsonReader.nextBoolean();
name = jsonReader.nextName();
//name = jsonReader.nextName();
AWSStorageInformation awsStoreInfo=null;
try {
name = jsonReader.nextName();
assert name.equals(JSONNAMES[17]);
/*Since awsStore information is optional, it is important that we add a check on this instead
* of test cases failing because of this change*/
/*Begin object to read the nested json properties required aws connection*/
jsonReader.beginObject();
if(jsonReader.hasNext()) {
final String awsProfile=jsonReader.nextString();
Expand All @@ -664,9 +665,8 @@ public static ResourceConfiguration deserialize(final Path file) throws SirixIOE
awsStoreInfo = new AWSStorageInformation(awsProfile,awsRegion, bucketName, shouldCreateBucketIfNotExists);
}
jsonReader.endObject();
/*End object to end reading the nested json properties*/
}catch(SirixIOException | EOFException io) {
/*Ignore exception, as this information is optional*/
}catch(SirixIOException | EOFException | IllegalStateException io) {

}
jsonReader.endObject();
jsonReader.close();
Expand Down

0 comments on commit 1e92222

Please sign in to comment.