Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.facebook.presto.sql.analyzer;
import static io.airlift.configuration.testing.ConfigAssertions.assertDeprecatedEquivalence;
import static io.airlift.configuration.testing.ConfigAssertions.assertFullMapping;
import static io.airlift.configuration.testing.ConfigAssertions.assertRecordedDefaults;
public class TestFeaturesConfig
    @Test
    public void testDefaults()
    {
        assertRecordedDefaults(ConfigAssertions.recordDefaults(FeaturesConfig.class)
                .setExperimentalSyntaxEnabled(false)
                .setDistributedIndexJoinsEnabled(false)
                .setDistributedJoinsEnabled(false)
                .setOptimizeMetadataQueries(false)
                .setOptimizeHashGeneration(false));
    }
    @Test
    public void testExplicitPropertyMappings()
    {
        Map<StringStringpropertiesLegacy = new ImmutableMap.Builder<StringString>()
                .put("analyzer.experimental-syntax-enabled""true")
                .put("distributed-index-joins-enabled""true")
                .put("distributed-joins-enabled""true")
                .put("optimizer.optimize-metadata-queries""true")
                .put("optimizer.optimize-hash-generation""true")
                .build();
        Map<StringStringproperties = new ImmutableMap.Builder<StringString>()
                .put("experimental-syntax-enabled""true")
                .put("distributed-index-joins-enabled""true")
                .put("distributed-joins-enabled""true")
                .put("optimizer.optimize-metadata-queries""true")
                .put("optimizer.optimize-hash-generation""true")
                .build();
        FeaturesConfig expected = new FeaturesConfig()
                .setExperimentalSyntaxEnabled(true)
                .setDistributedIndexJoinsEnabled(true)
                .setDistributedJoinsEnabled(true)
                .setOptimizeMetadataQueries(true)
                .setOptimizeHashGeneration(true);
        assertFullMapping(propertiesexpected);
        assertDeprecatedEquivalence(FeaturesConfig.classpropertiespropertiesLegacy);
    }
New to GrepCode? Check out our FAQ X