Search in sources :

Example 1 with Status

use of org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.Status in project ozone by apache.

the class TestResultCodes method codeMapping.

@Test
public void codeMapping() {
    Assert.assertEquals(ResultCodes.values().length, Status.values().length);
    for (int i = 0; i < ResultCodes.values().length; i++) {
        ResultCodes codeValue = ResultCodes.values()[i];
        Status protoBufValue = Status.values()[i];
        Assert.assertTrue(String.format("Protobuf/Enum constant name mismatch %s %s", codeValue, protoBufValue), sameName(codeValue.name(), protoBufValue.name()));
        ResultCodes converted = ResultCodes.values()[protoBufValue.ordinal()];
        Assert.assertEquals(codeValue, converted);
    }
}
Also used : ResultCodes(org.apache.hadoop.ozone.om.exceptions.OMException.ResultCodes) Status(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.Status) Test(org.junit.Test)

Aggregations

ResultCodes (org.apache.hadoop.ozone.om.exceptions.OMException.ResultCodes)1 Status (org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.Status)1 Test (org.junit.Test)1