1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.configuration2;
19
20 import static org.junit.jupiter.api.Assertions.assertEquals;
21
22 import java.util.List;
23
24 import org.apache.commons.configuration2.convert.LegacyListDelimiterHandler;
25 import org.apache.commons.configuration2.io.FileHandler;
26 import org.junit.jupiter.api.BeforeEach;
27 import org.junit.jupiter.api.Test;
28
29
30
31
32 public class TestThreesomeConfiguration {
33 protected Configuration conf;
34
35 @BeforeEach
36 public void setUp() throws Exception {
37 final PropertiesConfiguration c = new PropertiesConfiguration();
38 c.setListDelimiterHandler(new LegacyListDelimiterHandler(','));
39 final FileHandler handler = new FileHandler(c);
40 handler.setFileName("threesome.properties");
41 handler.load();
42 conf = c;
43 }
44
45 @Test
46 public void testList1() throws Exception {
47 final List<Object> packages = conf.getList("test.threesome.one");
48
49 assertEquals(3, packages.size());
50 }
51
52 @Test
53 public void testList2() throws Exception {
54 final List<Object> packages = conf.getList("test.threesome.two");
55
56 assertEquals(3, packages.size());
57 }
58
59 @Test
60 public void testList3() throws Exception {
61 final List<Object> packages = conf.getList("test.threesome.three");
62
63 assertEquals(3, packages.size());
64 }
65 }