|
@@ -17,12 +17,12 @@
|
|
*/
|
|
*/
|
|
package org.apache.hadoop.hdfs.server.datanode;
|
|
package org.apache.hadoop.hdfs.server.datanode;
|
|
|
|
|
|
-import org.apache.hadoop.hdfs.server.common.HdfsServerConstants.*;
|
|
|
|
-import org.junit.Test;
|
|
|
|
-
|
|
|
|
|
|
+import static org.junit.Assert.assertEquals;
|
|
import static org.junit.Assert.fail;
|
|
import static org.junit.Assert.fail;
|
|
-import static org.hamcrest.core.Is.is;
|
|
|
|
-import static org.junit.Assert.assertThat;
|
|
|
|
|
|
+
|
|
|
|
+import org.apache.hadoop.hdfs.server.common.HdfsServerConstants.RollingUpgradeStartupOption;
|
|
|
|
+import org.apache.hadoop.hdfs.server.common.HdfsServerConstants.StartupOption;
|
|
|
|
+import org.junit.Test;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -43,10 +43,10 @@ public class TestHdfsServerConstants {
|
|
RollingUpgradeStartupOption expectedRollupOption) {
|
|
RollingUpgradeStartupOption expectedRollupOption) {
|
|
|
|
|
|
StartupOption option = StartupOption.getEnum(value);
|
|
StartupOption option = StartupOption.getEnum(value);
|
|
- assertThat(option, is(expectedOption));
|
|
|
|
|
|
+ assertEquals(expectedOption, option);
|
|
|
|
|
|
if (expectedRollupOption != null) {
|
|
if (expectedRollupOption != null) {
|
|
- assertThat(option.getRollingUpgradeStartupOption(), is(expectedRollupOption));
|
|
|
|
|
|
+ assertEquals(expectedRollupOption, option.getRollingUpgradeStartupOption());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -86,6 +86,9 @@ public class TestHdfsServerConstants {
|
|
verifyStartupOptionResult("ROLLINGUPGRADE(DOWNGRADE)",
|
|
verifyStartupOptionResult("ROLLINGUPGRADE(DOWNGRADE)",
|
|
StartupOption.ROLLINGUPGRADE,
|
|
StartupOption.ROLLINGUPGRADE,
|
|
RollingUpgradeStartupOption.DOWNGRADE);
|
|
RollingUpgradeStartupOption.DOWNGRADE);
|
|
|
|
+ verifyStartupOptionResult("ROLLINGUPGRADE(STARTED)",
|
|
|
|
+ StartupOption.ROLLINGUPGRADE,
|
|
|
|
+ RollingUpgradeStartupOption.STARTED);
|
|
|
|
|
|
try {
|
|
try {
|
|
verifyStartupOptionResult("ROLLINGUPGRADE(UNKNOWNOPTION)", StartupOption.ROLLINGUPGRADE, null);
|
|
verifyStartupOptionResult("ROLLINGUPGRADE(UNKNOWNOPTION)", StartupOption.ROLLINGUPGRADE, null);
|