Search in sources :

Example 1 with PdfFilter

use of org.omegat.filters2.pdf.PdfFilter in project omegat by omegat-org.

the class PdfFilterTest method testLoad.

@Test
public void testLoad() throws Exception {
    String f = "test/data/filters/pdf/file-PdfFilter.pdf";
    IProject.FileInfo fi = loadSourceFiles(new PdfFilter(), f);
    checkMultiStart(fi, f);
    checkMulti("This is some text. This is also some text.", null, null, null, null, null);
    checkMultiEnd();
}
Also used : PdfFilter(org.omegat.filters2.pdf.PdfFilter) IProject(org.omegat.core.data.IProject) Test(org.junit.Test)

Example 2 with PdfFilter

use of org.omegat.filters2.pdf.PdfFilter in project omegat by omegat-org.

the class PdfFilterTest method testPasswordProtected.

@Test
public void testPasswordProtected() throws Exception {
    String f = "test/data/filters/pdf/file-PdfFilter-password.pdf";
    try {
        loadSourceFiles(new PdfFilter(), f);
        fail("Password-protected PDFs are not supported");
    } catch (TranslationException ex) {
    // OK
    }
}
Also used : TranslationException(org.omegat.filters2.TranslationException) PdfFilter(org.omegat.filters2.pdf.PdfFilter) Test(org.junit.Test)

Example 3 with PdfFilter

use of org.omegat.filters2.pdf.PdfFilter in project omegat by omegat-org.

the class PdfFilterTest method testTranslate.

@Test
public void testTranslate() throws Exception {
    translate(new PdfFilter(), "test/data/filters/pdf/file-PdfFilter.pdf", Collections.emptyMap());
    compareBinary(new File("test/data/filters/pdf/file-PdfFilter-gold.txt"), outFile);
}
Also used : PdfFilter(org.omegat.filters2.pdf.PdfFilter) File(java.io.File) Test(org.junit.Test)

Example 4 with PdfFilter

use of org.omegat.filters2.pdf.PdfFilter in project omegat by omegat-org.

the class PdfFilterTest method testParse.

@Test
public void testParse() throws Exception {
    List<ParsedEntry> lines = parse3(new PdfFilter(), "test/data/filters/pdf/file-PdfFilter.pdf", null);
    assertEquals("This is some text. This is also some text. ", lines.get(0).source);
}
Also used : PdfFilter(org.omegat.filters2.pdf.PdfFilter) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)4 PdfFilter (org.omegat.filters2.pdf.PdfFilter)4 File (java.io.File)1 IProject (org.omegat.core.data.IProject)1 TranslationException (org.omegat.filters2.TranslationException)1