|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| package org.jconfig; |
|
7 |
| |
|
8 |
| import junit.framework.TestCase; |
|
9 |
| |
|
10 |
| import org.jconfig.parser.DefaultConfigParser; |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
16 |
| |
|
17 |
| public class IncludePropertiesTest extends TestCase { |
|
18 |
| |
|
19 |
1
| public IncludePropertiesTest(String name) {
|
|
20 |
1
| super(name);
|
|
21 |
| } |
|
22 |
| |
|
23 |
| |
|
24 |
| |
|
25 |
| |
|
26 |
| |
|
27 |
0
| public static void main(String[] args) {
|
|
28 |
0
| junit.textui.TestRunner.run(IncludePropertiesTest.class);
|
|
29 |
| } |
|
30 |
| |
|
31 |
1
| protected void setUp() {
|
|
32 |
1
| ConfigurationManager.getInstance().removeConfiguration("default");
|
|
33 |
1
| System.setProperty("jconfig.parser", DefaultConfigParser.class.getName());
|
|
34 |
| } |
|
35 |
| |
|
36 |
1
| protected void tearDown() {
|
|
37 |
| } |
|
38 |
| |
|
39 |
1
| public void testGetInclude() {
|
|
40 |
1
| Configuration config = ConfigurationManager.getConfiguration();
|
|
41 |
1
| String val = config.getProperty("varprop1",null,"includeTest");
|
|
42 |
1
| assertNotNull(val);
|
|
43 |
1
| assertEquals("value1",val);
|
|
44 |
| } |
|
45 |
| } |