OSDN Git Service

デフォルトコメントを削除
[coroid/inqubus.git] / frontend / test / yukihane / inqubus / config / PropertiesTest.java
1 package yukihane.inqubus.config;
2
3 import yukihane.inqubus.conifg.Properties;
4 import java.lang.reflect.Field;
5 import org.apache.commons.configuration.ConfigurationException;
6 import org.junit.After;
7 import org.junit.AfterClass;
8 import org.junit.Before;
9 import org.junit.BeforeClass;
10 import org.junit.Test;
11 import static org.junit.Assert.*;
12
13 /**
14  *
15  * @author yuki
16  */
17 public class PropertiesTest {
18
19     @Test
20     public void test() throws ConfigurationException, IllegalArgumentException, IllegalAccessException {
21         Properties p = Properties.INSTANCE;
22         p.load();
23         Field[] fields = p.getClass().getDeclaredFields();
24         for(Field f: fields){
25             f.setAccessible(true);
26             System.out.println(f.get(p));
27         }
28     }
29     @Test
30     public void test2() throws ConfigurationException, IllegalArgumentException, IllegalAccessException {
31         Properties p = Properties.INSTANCE;
32         p.load();
33         p.setDbLocation("d_loc");
34         p.save();
35         Field[] fields = p.getClass().getDeclaredFields();
36         for(Field f: fields){
37             f.setAccessible(true);
38             System.out.println(f.get(p));
39         }
40     }
41 }