OSDN Git Service

how to mirror to SourceForge.jp
[xerial/xerial-core.git] / src / test / java / org / xerial / util / template / TemplateTest.java
1 /*--------------------------------------------------------------------------
2  *  Copyright 2007 Taro L. Saito
3  *
4  *  Licensed under the Apache License, Version 2.0 (the "License");
5  *  you may not use this file except in compliance with the License.
6  *  You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an "AS IS" BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License.
15  *--------------------------------------------------------------------------*/
16 //--------------------------------------
17 // XerialJ
18 //
19 // TemplateTest.java
20 // Since: Jul 25, 2007 4:20:22 PM
21 //
22 // $URL$
23 // $Author$
24 //--------------------------------------
25 package org.xerial.util.template;
26
27
28 import static org.junit.Assert.*;
29
30 import java.util.Properties;
31
32 import org.junit.After;
33 import org.junit.Before;
34 import org.junit.Test;
35
36 public class TemplateTest
37 {
38
39     @Before
40     public void setUp() throws Exception
41     {}
42
43     @After
44     public void tearDown() throws Exception
45     {}
46     
47     @Test
48     public void apply()
49     {
50         Template t = new Template("hello $name$!");
51         Properties prop = new Properties();
52         prop.put("name", "Leo");
53         String result = t.apply(prop);
54         assertEquals("hello Leo!", result);
55     }
56
57 }