OSDN Git Service

index on dev20110528_setting_reduce: 9817594 フィールド名修正
[coroid/inqubus.git] / frontend / test / yukihane / inqubuss / config / PropertiesTest.java
1 /*
2  * To change this template, choose Tools | Templates
3  * and open the template in the editor.
4  */
5 package yukihane.inqubuss.config;
6
7 import yukihane.inqubuss.conifg.Properties;
8 import java.lang.reflect.Field;
9 import org.apache.commons.configuration.ConfigurationException;
10 import org.junit.After;
11 import org.junit.AfterClass;
12 import org.junit.Before;
13 import org.junit.BeforeClass;
14 import org.junit.Test;
15 import static org.junit.Assert.*;
16
17 /**
18  *
19  * @author yuki
20  */
21 public class PropertiesTest {
22
23     @Test
24     public void test() throws ConfigurationException, IllegalArgumentException, IllegalAccessException {
25         Properties p = Properties.INSTANCE;
26         p.load();
27         Field[] fields = p.getClass().getDeclaredFields();
28         for(Field f: fields){
29             f.setAccessible(true);
30             System.out.println(f.get(p));
31         }
32     }
33     @Test
34     public void test2() throws ConfigurationException, IllegalArgumentException, IllegalAccessException {
35         Properties p = Properties.INSTANCE;
36         p.load();
37         p.setDbLocation("d_loc");
38         p.save();
39         Field[] fields = p.getClass().getDeclaredFields();
40         for(Field f: fields){
41             f.setAccessible(true);
42             System.out.println(f.get(p));
43         }
44     }
45 }