Package fr.adrienbrault.idea.symfony2plugin.tests.translation.parser

Source Code of fr.adrienbrault.idea.symfony2plugin.tests.translation.parser.DomainMappingsTest

package fr.adrienbrault.idea.symfony2plugin.tests.translation.parser;

import fr.adrienbrault.idea.symfony2plugin.translation.dict.DomainFileMap;
import fr.adrienbrault.idea.symfony2plugin.translation.parser.DomainMappings;
import org.junit.Assert;
import org.junit.Test;

import java.io.File;
import java.util.ArrayList;
import java.util.List;


public class DomainMappingsTest extends Assert {

    @Test
    public void testParser() {
        File testFile = new File(this.getClass().getResource("appDevDebugProjectContainer.xml").getFile());

        DomainMappings bla = new DomainMappings();
        bla.parser(testFile);
        List<DomainFileMap> map = bla.getDomainFileMaps();

        assertEquals(10, map.size());

        DomainFileMap firstDomain = map.iterator().next();

        assertEquals("CraueFormFlowBundle", firstDomain.getDomain());
        assertEquals("de", firstDomain.getLanguageKey());
        assertEquals("yml", firstDomain.getLoader());
        assertTrue(firstDomain.getPath().endsWith("CraueFormFlowBundle.de.yml"));

    }

}
TOP

Related Classes of fr.adrienbrault.idea.symfony2plugin.tests.translation.parser.DomainMappingsTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.