Skip to content

Commit 062592d

Browse files
author
Joao Goncalves
committed
FOP-3087 Add fonts element after auto-detect element is added to it
1 parent 35a4327 commit 062592d

File tree

6 files changed

+27
-8
lines changed

6 files changed

+27
-8
lines changed

fop-core/src/main/java/org/apache/fop/svg/AbstractFOPTranscoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ protected Configuration getEffectiveConfiguration() {
160160
if (autoFonts) {
161161
DefaultConfiguration c = new DefaultConfiguration("cfg");
162162
DefaultConfiguration fonts = new DefaultConfiguration("fonts");
163-
c.addChild(fonts);
164163
DefaultConfiguration autodetect = new DefaultConfiguration("auto-detect");
165164
fonts.addChild(autodetect);
165+
c.addChild(fonts);
166166
effCfg = c;
167167
}
168168
}

fop-core/src/test/java/org/apache/fop/AbstractBasicTranscoderTest.java renamed to fop-core/src/test/java/org/apache/fop/svg/AbstractBasicTranscoderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
/* $Id$ */
1919

20-
package org.apache.fop;
20+
package org.apache.fop.svg;
2121

2222
import java.io.File;
2323
import java.io.InputStream;

fop-core/src/test/java/org/apache/fop/BasicPDFTranscoderTestCase.java renamed to fop-core/src/test/java/org/apache/fop/svg/BasicPDFTranscoderTestCase.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@
1717

1818
/* $Id$ */
1919

20-
package org.apache.fop;
20+
package org.apache.fop.svg;
21+
22+
import org.junit.Test;
23+
24+
import static org.junit.Assert.assertEquals;
2125

2226
import org.apache.batik.transcoder.Transcoder;
2327

24-
import org.apache.fop.svg.PDFTranscoder;
28+
import org.apache.fop.configuration.Configuration;
2529

2630
/**
2731
* Basic runtime test for the PDF transcoder. It is used to verify that
@@ -34,4 +38,18 @@ protected Transcoder createTranscoder() {
3438
return new PDFTranscoder();
3539
}
3640

41+
@Test
42+
public void testFontAutoDetect() {
43+
//Create transcoder
44+
PDFTranscoder transcoder = (PDFTranscoder) createTranscoder();
45+
46+
Configuration effectiveConfiguration = transcoder.getEffectiveConfiguration();
47+
Configuration autoDetectConf = effectiveConfiguration.getChild("fonts").getChild("auto-detect");
48+
49+
assertEquals("The auto-detect conf must be added to it's parent (fonts) "
50+
+ "before the parent (fonts) is added to cfg",
51+
"DefaultConfiguration",
52+
autoDetectConf.getClass().getSimpleName());
53+
}
54+
3755
}

fop-core/src/test/java/org/apache/fop/BasicPSTranscoderTestCase.java renamed to fop-core/src/test/java/org/apache/fop/svg/BasicPSTranscoderTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
/* $Id$ */
1919

20-
package org.apache.fop;
20+
package org.apache.fop.svg;
2121

2222
import org.apache.batik.transcoder.Transcoder;
2323

fop-core/src/test/java/org/apache/fop/BasicTranscoderTestSuite.java renamed to fop-core/src/test/java/org/apache/fop/svg/BasicTranscoderTestSuite.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
/* $Id$ */
1919

20-
package org.apache.fop;
20+
package org.apache.fop.svg;
2121

2222
import org.junit.runner.RunWith;
2323
import org.junit.runners.Suite;

fop/build.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,8 @@ list of possible build targets.
696696
<include name="fop-transcoder.jar"/>
697697
</fileset>
698698
</path>
699-
<junit-run classpath="transcoder-classpath" title="basic functionality for fop-transcoder.jar" testsuite="org.apache.fop.BasicTranscoderTestSuite" outfile="TEST-transcoder"/>
699+
<junit-run classpath="transcoder-classpath" title="basic functionality for fop-transcoder.jar"
700+
testsuite="org.apache.fop.svg.BasicTranscoderTestSuite" outfile="TEST-transcoder"/>
700701
<echo message="Running basic functionality tests for fop-transcoder-allinone.jar"/>
701702
<!-- These are the same tests as in the block above but testing the "allinone" JAR
702703
instead. Please don't add any additional paths other than the test classes, the
@@ -716,7 +717,7 @@ list of possible build targets.
716717
<include name="batik*.jar"/>
717718
</fileset>
718719
</path>
719-
<junit-run classpath="transcoder-all-classpath" title="basic functionality for fop-transcoder-allinone.jar" testsuite="org.apache.fop.BasicTranscoderTestSuite" outfile="TEST-transcoder-allinone"/>
720+
<junit-run classpath="transcoder-all-classpath" title="basic functionality for fop-transcoder-allinone.jar" testsuite="org.apache.fop.svg.BasicTranscoderTestSuite" outfile="TEST-transcoder-allinone"/>
720721
</target>
721722
<target name="hyphenation-present" depends="junit-compile" if="junit.present">
722723
<condition property="hyphenation.present">

0 commit comments

Comments
 (0)