예제 #1
0
 @Test
 public void testLoad() {
   assertTrue(prop.get("section1.a").equals("1"));
   assertTrue(prop.get("section1.a.b").equals("1999"));
   assertTrue(prop.get("section 2.a.b").equals("100"));
   assertTrue(prop.get("section 2.a.b.d").equals("5555555"));
   System.out.println("true");
 }
예제 #2
0
  @Test
  public void testStore() throws IOException {
    BufferedWriter writer = new BufferedWriter(new FileWriter("/home/x/tmp/ccc.prop"));
    // prop.store(writer);

    prop.add("section3", "abc.d", "abcccc", "some ttt");
    prop.add(null, "cc", "my name is cc", null);
    prop.store(writer);
  }
예제 #3
0
 @BeforeClass
 public static void setUpBeforeClass() throws Exception {
   prop = new Prop();
   prop.load(
       new BufferedReader(
           new InputStreamReader(new FileInputStream(filePath), Charset.forName("utf-8"))));
 }