001    package org.apache.commons.configuration;
002    
003    /*
004     * Licensed to the Apache Software Foundation (ASF) under one or more
005     * contributor license agreements.  See the NOTICE file distributed with
006     * this work for additional information regarding copyright ownership.
007     * The ASF licenses this file to You under the Apache License, Version 2.0
008     * (the "License"); you may not use this file except in compliance with
009     * the License.  You may obtain a copy of the License at
010     *
011     *     http://www.apache.org/licenses/LICENSE-2.0
012     *
013     * Unless required by applicable law or agreed to in writing, software
014     * distributed under the License is distributed on an "AS IS" BASIS,
015     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016     * See the License for the specific language governing permissions and
017     * limitations under the License.
018     */
019    
020    import static org.junit.Assert.assertEquals;
021    
022    import java.util.List;
023    
024    import org.junit.Before;
025    import org.junit.Test;
026    
027    /**
028     * A base class for testing {@link
029     * org.apache.commons.configuration.BasePropertiesConfiguration}
030     * extensions.
031     *
032     * @version $Id: TestThreesomeConfiguration.java 1225021 2011-12-27 21:23:22Z oheger $
033     */
034    public class TestThreesomeConfiguration
035    {
036        protected Configuration conf;
037    
038        @Before
039        public void setUp() throws Exception
040        {
041            conf = new PropertiesConfiguration("threesome.properties");
042        }
043    
044        @Test
045        public void testList1() throws Exception
046        {
047            List<Object> packages = conf.getList("test.threesome.one");
048            // we should get 3 packages here
049            assertEquals(3, packages.size());
050        }
051    
052        @Test
053        public void testList2() throws Exception
054        {
055            List<Object> packages = conf.getList("test.threesome.two");
056            // we should get 3 packages here
057            assertEquals(3, packages.size());
058        }
059    
060        @Test
061        public void testList3() throws Exception
062        {
063            List<Object> packages = conf.getList("test.threesome.three");
064            // we should get 3 packages here
065            assertEquals(3, packages.size());
066        }
067    }