View Javadoc

1   package org.apache.commons.configuration;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one or more
5    * contributor license agreements.  See the NOTICE file distributed with
6    * this work for additional information regarding copyright ownership.
7    * The ASF licenses this file to You under the Apache License, Version 2.0
8    * (the "License"); you may not use this file except in compliance with
9    * the License.  You may obtain a copy of the License at
10   *
11   *     http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   */
19  
20  import static org.junit.Assert.assertEquals;
21  
22  import java.util.List;
23  
24  import org.junit.Before;
25  import org.junit.Test;
26  
27  /**
28   * A base class for testing {@link
29   * org.apache.commons.configuration.BasePropertiesConfiguration}
30   * extensions.
31   *
32   * @version $Id: TestThreesomeConfiguration.java 1225021 2011-12-27 21:23:22Z oheger $
33   */
34  public class TestThreesomeConfiguration
35  {
36      protected Configuration conf;
37  
38      @Before
39      public void setUp() throws Exception
40      {
41          conf = new PropertiesConfiguration("threesome.properties");
42      }
43  
44      @Test
45      public void testList1() throws Exception
46      {
47          List<Object> packages = conf.getList("test.threesome.one");
48          // we should get 3 packages here
49          assertEquals(3, packages.size());
50      }
51  
52      @Test
53      public void testList2() throws Exception
54      {
55          List<Object> packages = conf.getList("test.threesome.two");
56          // we should get 3 packages here
57          assertEquals(3, packages.size());
58      }
59  
60      @Test
61      public void testList3() throws Exception
62      {
63          List<Object> packages = conf.getList("test.threesome.three");
64          // we should get 3 packages here
65          assertEquals(3, packages.size());
66      }
67  }