@@ -0,0 +1,2366 @@
+/*%0A * Licensed to the University of California, Berkeley under one or more contributor license%0A * agreements. See the NOTICE file distributed with this work for additional information regarding%0A * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the%0A * %22License%22); you may not use this file except in compliance with the License. You may obtain a%0A * copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software distributed under the License%0A * is distributed on an %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express%0A * or implied. See the License for the specific language governing permissions and limitations under%0A * the License.%0A */%0A%0Apackage tachyon.hadoop;%0A%0Aimport org.apache.hadoop.conf.Configuration;%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0Aimport tachyon.Constants;%0Aimport tachyon.conf.TachyonConf;%0A%0Apublic final class ConfUtilsTest %7B%0A  private static final String TEST_S3_ACCCES_KEY = %22TEST ACCESS KEY%22;%0A  private static final String TEST_S3_SECRET_KEY = %22TEST SECRET KEY%22;%0A  private static final String TEST_WORKER_MEMORY_SIZE = Integer.toString(654321);%0A%0A  @Test%0A  public void loadFromEmptyHadoopConfigurationTest() %7B%0A    Configuration hadoopConfig = new Configuration();%0A    TachyonConf tachyonConf = ConfUtils.loadFromHadoopConfiguration(hadoopConfig);%0A    Assert.assertEquals(0, tachyonConf.toMap().size());%0A  %7D%0A%0A  @Test%0A  public void loadFromHadoopConfigurationTest() %7B%0A    Configuration hadoopConfig = new Configuration();%0A    hadoopConfig.set(Constants.S3_ACCESS_KEY, TEST_S3_ACCCES_KEY);%0A    hadoopConfig.set(Constants.S3_SECRET_KEY, TEST_S3_SECRET_KEY);%0A    hadoopConfig.set(Constants.WORKER_MEMORY_SIZE, TEST_WORKER_MEMORY_SIZE);%0A    // This hadoop config will not be loaded into TachyonConf.%0A    hadoopConfig.set(%22hadoop.config.parameter%22, %22hadoop config value%22);%0A%0A    TachyonConf tachyonConf = ConfUtils.loadFromHadoopConfiguration(hadoopConfig);%0A    Assert.assertEquals(3, tachyonConf.toMap().size());%0A    Assert.assertEquals(TEST_S3_ACCCES_KEY, tachyonConf.get(Constants.S3_ACCESS_KEY));%0A    Assert.assertEquals(TEST_S3_SECRET_KEY, tachyonConf.get(Constants.S3_SECRET_KEY));%0A    Assert.assertEquals(TEST_WORKER_MEMORY_SIZE, tachyonConf.get(Constants.WORKER_MEMORY_SIZE));%0A  %7D%0A%7D%0A

Add unit test for loading from hadoop conf