1/*2 * Licensed to the Apache Software Foundation (ASF) under one or more3 * contributor license agreements. See the NOTICE file distributed with4 * this work for additional information regarding copyright ownership.5 * The ASF licenses this file to You under the Apache License, Version 2.06 * (the "License"); you may not use this file except in compliance with7 * the License. You may obtain a copy of the License at8 *9 * http://www.apache.org/licenses/LICENSE-2.010 *11 * Unless required by applicable law or agreed to in writing, software12 * distributed under the License is distributed on an "AS IS" BASIS,13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.14 * See the License for the specific language governing permissions and15 * limitations under the License.16 */1718package org.apache.any23.extractor;
1920import org.junit.Assert;
21import org.junit.Test;
2223/**24 * Test case for {@link ExtractionParameters}.25 */26publicclassExtractionParametersTest {
2728 @Test
29publicvoid testReadDefaultConfig() {
30final ExtractionParameters extractionParameters = ExtractionParameters.newDefault();
31 Assert.assertEquals(false, extractionParameters.getFlag("any23.microdata.strict"));
32 Assert.assertEquals("http://schema.org/", extractionParameters.getProperty("any23.microdata.ns.default"));
33 }
3435 @Test
36publicvoid testReadOverridenConfig() {
37final ExtractionParameters extractionParameters = ExtractionParameters.newDefault();
38 extractionParameters.setFlag("any23.microdata.strict", true);
39final String CUSTOM_PROP = "http://fake/property";
40 extractionParameters.setProperty("any23.microdata.ns.default", CUSTOM_PROP);
4142 Assert.assertEquals(true, extractionParameters.getFlag("any23.microdata.strict"));
43 Assert.assertEquals(CUSTOM_PROP, extractionParameters.getProperty("any23.microdata.ns.default"));
44 }
4546 }