pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1826014 - in /pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox: cmap/TestCMap.java ttf/TTFSubsetterTest.java
Date Tue, 06 Mar 2018 17:53:46 GMT
Author: tilman
Date: Tue Mar  6 17:53:45 2018
New Revision: 1826014

URL: http://svn.apache.org/viewvc?rev=1826014&view=rev
Log:
PDFBOX-4143: load test files into repository

Modified:
    pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMap.java
    pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/ttf/TTFSubsetterTest.java

Modified: pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMap.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMap.java?rev=1826014&r1=1826013&r2=1826014&view=diff
==============================================================================
--- pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMap.java (original)
+++ pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMap.java Tue Mar
 6 17:53:45 2018
@@ -17,8 +17,6 @@
 package org.apache.fontbox.cmap;
 
 import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
 
 import org.apache.fontbox.ttf.CmapLookup;
 import org.apache.fontbox.ttf.TTFParser;
@@ -55,19 +53,7 @@ public class TestCMap extends TestCase
      */
     public void testPDFBox3997() throws IOException
     {
-        InputStream is;
-        try
-        {
-            System.out.println("Downloading Noto Emoji font...");
-            is = new URL("https://issues.apache.org/jira/secure/attachment/12896461/NotoEmoji-Regular.ttf").openStream();
-            System.out.println("Download finished!");
-        }
-        catch (IOException ex)
-        {
-            System.err.println("Noto Emoji font could not be downloaded, test skipped");
-            return;
-        }
-        TrueTypeFont ttf = new TTFParser().parse(is);
+        TrueTypeFont ttf = new TTFParser().parse("target/pdfs/NotoEmoji-Regular.ttf");
         CmapLookup cmap = ttf.getUnicodeCmapLookup(false);
         assertEquals(886, cmap.getGlyphId(0x1F681));
         ttf.close();

Modified: pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/ttf/TTFSubsetterTest.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/ttf/TTFSubsetterTest.java?rev=1826014&r1=1826013&r2=1826014&view=diff
==============================================================================
--- pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/ttf/TTFSubsetterTest.java
(original)
+++ pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/ttf/TTFSubsetterTest.java
Tue Mar  6 17:53:45 2018
@@ -19,9 +19,7 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.IOException;
-import java.io.InputStream;
 import java.net.URI;
-import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Locale;
@@ -49,8 +47,7 @@ public class TTFSubsetterTest
     @Test
     public void testEmptySubset() throws IOException
     {
-        final File testFile = new File("src/test/resources/ttf/LiberationSans-Regular.ttf");
-        TrueTypeFont x = new TTFParser().parse(testFile);
+        TrueTypeFont x = new TTFParser().parse("src/test/resources/ttf/LiberationSans-Regular.ttf");
         TTFSubsetter ttfSubsetter = new TTFSubsetter(x);
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -70,8 +67,7 @@ public class TTFSubsetterTest
     @Test
     public void testEmptySubset2() throws IOException
     {
-        final File testFile = new File("src/test/resources/ttf/LiberationSans-Regular.ttf");
-        TrueTypeFont x = new TTFParser().parse(testFile);
+        TrueTypeFont x = new TTFParser().parse("src/test/resources/ttf/LiberationSans-Regular.ttf");
         // List copied from TrueTypeEmbedder.java
         List<String> tables = new ArrayList<String>();
         tables.add("head");
@@ -103,8 +99,7 @@ public class TTFSubsetterTest
     @Test
     public void testNonEmptySubset() throws IOException
     {
-        final File testFile = new File("src/test/resources/ttf/LiberationSans-Regular.ttf");
-        TrueTypeFont full = new TTFParser().parse(testFile);
+        TrueTypeFont full = new TTFParser().parse("src/test/resources/ttf/LiberationSans-Regular.ttf");
         TTFSubsetter ttfSubsetter = new TTFSubsetter(full);
         ttfSubsetter.add('a');
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -199,20 +194,7 @@ public class TTFSubsetterTest
     @Test
     public void testPDFBox3379() throws IOException
     {
-        InputStream is;
-        try
-        {
-            // don't want to include this font into source download (300KB)
-            System.out.println("Downloading DejaVuSansMono font...");
-            is = new URL("https://issues.apache.org/jira/secure/attachment/12809395/DejaVuSansMono.ttf").openStream();
-            System.out.println("Download finished!");
-        }
-        catch (IOException ex)
-        {
-            System.err.println("DejaVuSansMono font could not be downloaded, test skipped");
-            return;
-        }
-        TrueTypeFont full = new TTFParser().parse(is);
+        TrueTypeFont full = new TTFParser().parse("target/pdfs/DejaVuSansMono.ttf");
         TTFSubsetter ttfSubsetter = new TTFSubsetter(full);
         ttfSubsetter.add('A');
         ttfSubsetter.add(' ');



Mime
View raw message