use of org.apache.hadoop.ozone.OmUtils in project ozone by apache.
the class TestOzoneManagerRatisServer method testIsReadOnlyCapturesAllCmdTypeEnums.
/**
* Test that all of {@link OzoneManagerProtocolProtos.Type} enum values are
* categorized in {@link OmUtils#isReadOnly(OMRequest)}.
*/
@Test
public void testIsReadOnlyCapturesAllCmdTypeEnums() throws Exception {
GenericTestUtils.LogCapturer logCapturer = GenericTestUtils.LogCapturer.captureLogs(LoggerFactory.getLogger(OmUtils.class));
OzoneManagerProtocolProtos.Type[] cmdTypes = OzoneManagerProtocolProtos.Type.values();
for (OzoneManagerProtocolProtos.Type cmdtype : cmdTypes) {
OMRequest request = OMRequest.newBuilder().setCmdType(cmdtype).setClientId(clientId).build();
OmUtils.isReadOnly(request);
assertFalse(cmdtype + " is not categorized in " + "OmUtils#isReadyOnly", logCapturer.getOutput().contains("CmdType " + cmdtype + " is not " + "categorized as readOnly or not."));
logCapturer.clearOutput();
}
}
Aggregations