blob: 11c249c5cdbfe815d45f32bd1840c3cfd03dc69f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.query.properties.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import java.util.Arrays;
import java.util.HashSet;
import com.yahoo.processing.request.properties.PropertyMap;
import org.junit.Test;
import com.yahoo.search.query.properties.SubProperties;
/**
* @author <a href="mailto:arnebef@yahoo-inc.com">Arne Bergene Fossaa</a>
*/
public class SubPropertiesTestCase {
@Test
public void testSubProperties() {
PropertyMap map = new PropertyMap() {{
set("a.e","1");
set("a.f",2);
set("b.e","3");
set("f",3);
set("e","2");
set("d","a");
}};
SubProperties sub = new SubProperties("a", map);
assertEquals("1",sub.get("e"));
assertEquals(2,sub.get("f"));
assertNull(sub.get("d"));
assertEquals(new HashSet<>(Arrays.asList("e", "f")), sub.listProperties("").keySet());
}
}
|