Package qurtext.factory.test

Source Code of qurtext.factory.test.TranslationParserTest

package qurtext.factory.test;

import java.util.TreeMap;
import java.util.TreeSet;

import qurtext.factory.TranslationParser;
import junit.framework.TestCase;

public class TranslationParserTest extends TestCase {

  TranslationParser translationParser;
 
  public void setUp() {
    translationParser=new TranslationParser("war/WEB-INF/quran.txt");
  }
 
  public void testGetTranslations() {
    TreeMap<String, String> translations = translationParser.getTranslations();
    assertEquals(6235+112,translations.size());
    String firstTranslation = translations.get("1:1");
    assertEquals("In the name of God, the Almighty, the Merciful.", firstTranslation.trim());
    String lastTranslation = translations.get("114:6");
    assertEquals("\"From the Jinn and the people.\"", lastTranslation.trim());
  }

  public void testGetTopics() {
    TreeMap<String,String> topics = translationParser.getTopics();
    assertEquals(267,topics.size());
    assertEquals("'AAD",topics.keySet().iterator().next());
  }

  public void testGetVerseTopics() {
    TreeMap<String, TreeSet<String>> verseTopics = translationParser.getVerseTopics();
    assertNull(verseTopics.get("1:1"));
  }

}
TOP

Related Classes of qurtext.factory.test.TranslationParserTest

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.