36 System.getProperty("test.src", ".") +"/k1.conf"); |
36 System.getProperty("test.src", ".") +"/k1.conf"); |
37 Config config = Config.getInstance(); |
37 Config config = Config.getInstance(); |
38 config.listTable(); |
38 config.listTable(); |
39 String s; |
39 String s; |
40 |
40 |
41 // Latter overwrites former for root section |
41 // root section merged |
42 s = config.get("libdefaults", "default_realm"); |
42 s = config.get("libdefaults", "default_realm"); |
43 if (s != null) { |
43 if (!s.equals("R1")) { |
44 throw new Exception(); |
44 throw new Exception(); |
45 } |
45 } |
46 // Latter overwrites former for strings |
46 // Former is preferred to latter for strings and sections |
47 s = config.get("libdefaults", "default_tkt_enctypes"); |
47 s = config.get("libdefaults", "default_tkt_enctypes"); |
48 if (!s.equals("aes256-cts")) { |
48 if (!s.equals("aes128-cts")) { |
49 throw new Exception(); |
49 throw new Exception(); |
50 } |
50 } |
51 // Latter overwrites former for sub-section |
|
52 s = config.get("realms", "R1", "kdc"); |
51 s = config.get("realms", "R1", "kdc"); |
53 if (!s.equals("k2")) { |
52 if (!s.equals("k1")) { |
54 throw new Exception(s); |
53 throw new Exception(s); |
55 } |
54 } |
56 // Duplicate keys in [realms] are merged |
55 // Duplicate keys in [realms] are merged, and sections with the same |
|
56 // name in between ignored |
57 s = config.getAll("realms", "R2", "kdc"); |
57 s = config.getAll("realms", "R2", "kdc"); |
58 if (!s.equals("k1 k2 k3 k4")) { |
58 if (!s.equals("k1 k2 k3 k4")) { |
59 throw new Exception(s); |
59 throw new Exception(s); |
60 } |
60 } |
61 // Duplicate keys in [capaths] are merged |
61 // Duplicate keys in [capaths] are merged |