@@ -0,0 +1,2048 @@
+/*%0A * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0%0A * (the %22License%22). You may not use this work except in compliance with the License, which is%0A * available at www.apache.org/licenses/LICENSE-2.0%0A *%0A * This software is distributed on an %22AS IS%22 basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,%0A * either express or implied, as more fully set forth in the License.%0A *%0A * See the NOTICE file distributed with this work for information regarding copyright ownership.%0A */%0A%0Apackage alluxio.master.file;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport alluxio.AlluxioURI;%0Aimport alluxio.master.file.StartupConsistencyCheck.Status;%0A%0Aimport com.google.common.collect.ImmutableList;%0Aimport org.junit.Test;%0A%0Aimport java.util.Collections;%0Aimport java.util.List;%0A%0A/**%0A * Unit tests for %7B@link StartupConsistencyCheck%7D.%0A */%0Apublic final class StartupConsistencyCheckTest %7B%0A    @Test%0A    public void createCompleteCheck() %7B%0A        List%3CAlluxioURI%3E uris = ImmutableList.of(new AlluxioURI(%22/%22), new AlluxioURI(%22/dir%22));%0A        StartupConsistencyCheck check = StartupConsistencyCheck.complete(uris);%0A        assertEquals(Status.COMPLETE, check.getStatus());%0A        assertEquals(uris, check.getInconsistentUris());%0A    %7D%0A%0A    @Test%0A    public void createDisabledCheck() %7B%0A        StartupConsistencyCheck check = StartupConsistencyCheck.disabled();%0A        assertEquals(Status.DISABLED, check.getStatus());%0A        assertEquals(Collections.EMPTY_LIST, check.getInconsistentUris());%0A    %7D%0A%0A    @Test%0A    public void createFailedCheck() %7B%0A        StartupConsistencyCheck check = StartupConsistencyCheck.failed();%0A        assertEquals(Status.FAILED, check.getStatus());%0A        assertEquals(Collections.EMPTY_LIST, check.getInconsistentUris());%0A    %7D%0A%0A    @Test%0A    public void createRunningCheck() %7B%0A        StartupConsistencyCheck check = StartupConsistencyCheck.running();%0A        assertEquals(Status.RUNNING, check.getStatus());%0A        assertEquals(Collections.EMPTY_LIST, check.getInconsistentUris());%0A    %7D%0A%7D%0A

Add startup consistency check unit test