epgtools.dumpepgfromts.dataextractor.channel.ChannelDataExtractorTest.java Source code

Java tutorial

Introduction

Here is the source code for epgtools.dumpepgfromts.dataextractor.channel.ChannelDataExtractorTest.java

Source

/*
 * Copyright (C) 2016 normal
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package epgtools.dumpepgfromts.dataextractor.channel;

import epgtools.dumpepgfromts.test.common.TestSection;
import java.lang.invoke.MethodHandles;
import java.util.Set;
import libepg.epg.section.Section;
import org.apache.commons.codec.DecoderException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.After;
import org.junit.AfterClass;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 *
 * @author normal
 */
public class ChannelDataExtractorTest {

    private static final Log LOG;

    static {
        final Class<?> myClass = MethodHandles.lookup().lookupClass();
        LOG = LogFactory.getLog(myClass);
    }

    public ChannelDataExtractorTest() {
    }

    @BeforeClass
    public static void setUpClass() {
    }

    @AfterClass
    public static void tearDownClass() {
    }

    @Before
    public void setUp() {
    }

    @After
    public void tearDown() {
    }

    /**
     * Test of getChannels method, of class ChannelDataExtractor.
     */
    @Test
    public void testGetChannels() throws DecoderException {
        LOG.info("");
        Section sec = TestSection.getSdt1();
        ChannelDataExtractor instance = new ChannelDataExtractor();
        instance.makeDataSet(sec);
        Set<Channel> set = instance.getUnmodifiableDataSet();
        assertTrue(set.size() == 1);
        Channel ch = set.iterator().next();
        assertEquals(ch.getDisplay_name(), "");
    }

}