Skip to content

Commit

Permalink
javadoc and unit test exception message assertions
Browse files Browse the repository at this point in the history
Signed-off-by: garyschulte <garyschulte@gmail.com>
  • Loading branch information
garyschulte committed Aug 31, 2023
1 parent de88169 commit 550d39b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3489,6 +3489,7 @@ private void setMergeConfigOptions() {
getActualGenesisConfigOptions().getTerminalTotalDifficulty().isPresent());
}

/** Set ignorable segments in RocksDB Storage Provider plugin. */
public void setIgnorableStorageSegments() {
if (!unstableChainPruningOptions.getChainDataPruningEnabled()) {
rocksDBPlugin.addIgnorableSegmentIdentifier(KeyValueSegmentIdentifier.CHAIN_PRUNER_STATE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ public RocksDBColumnarKeyValueStorage(
}
}

/**
* Parse RocksDBException and wrap in StorageException
*
* @param ex RocksDBException
* @param defaultSegments segments requested to open
* @param ignorableSegments segments which are ignorable if not present
* @return StorageException wrapping the RocksDB Exception
*/
protected static StorageException parseRocksDBException(
final RocksDBException ex,
final List<SegmentIdentifier> defaultSegments,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public void dbShouldNotIgnoreExperimentalSegmentsIfExisted(@TempDir final Path t
createSegmentedStore(testPath, Arrays.asList(TestSegment.FOO, TestSegment.BAR), List.of());
fail("DB without knowledge of experimental column family should fail");
} catch (StorageException e) {
assertThat(e.getMessage()).contains("Column families not opened");
assertThat(e.getMessage()).contains("Unhandled column families");
}

// Even if the column family is marked as ignored, as long as it exists, it will not be ignored
Expand Down Expand Up @@ -265,7 +265,7 @@ public void dbWillBeBackwardIncompatibleAfterExperimentalSegmentsAreAdded(
createSegmentedStore(testPath, Arrays.asList(TestSegment.FOO, TestSegment.BAR), List.of());
fail("DB without knowledge of experimental column family should fail");
} catch (StorageException e) {
assertThat(e.getMessage()).contains("Column families not opened");
assertThat(e.getMessage()).contains("Unhandled column families");
}
}

Expand Down

0 comments on commit 550d39b

Please sign in to comment.