use of org.omegat.core.data.ProjectException in project omegat by omegat-org.
the class ProjectFileStorageTest method testLoadDefaults.
@Test
public void testLoadDefaults() throws Exception {
ProjectProperties props = ProjectFileStorage.loadPropertiesFile(tempDir, new File(PROJECT_DIR, "defaultdirs.project"));
try {
props.verifyProject();
fail("Project props should fail verification when dirs don't exist yet");
} catch (ProjectException ex) {
}
props.autocreateDirectories();
props.verifyProject();
assertTrue(props.getSourceRoot().endsWith("source/"));
assertTrue(props.getTargetRoot().endsWith("target/"));
assertTrue(props.getGlossaryRoot().endsWith("glossary/"));
assertTrue(props.getWriteableGlossary().endsWith("glossary/glossary.txt"));
assertTrue(props.getTMRoot().endsWith("tm/"));
assertTrue(props.getDictRoot().endsWith("dictionary/"));
assertEquals(tempDir.getName(), props.getProjectName());
assertEquals(new Language("en-us"), props.getSourceLanguage());
assertEquals(new Language("fr-fr"), props.getTargetLanguage());
assertEquals(LuceneEnglishTokenizer.class, props.getSourceTokenizer());
assertEquals(LuceneFrenchTokenizer.class, props.getTargetTokenizer());
assertTrue(props.isSentenceSegmentingEnabled());
assertTrue(props.isSupportDefaultTranslations());
assertFalse(props.isRemoveTags());
assertTrue(props.getExternalCommand().isEmpty());
List<String> excludes = props.getSourceRootExcludes();
assertEquals(6, excludes.size());
assertEquals("**/.svn/**", excludes.get(0));
}
Aggregations