aboutsummaryrefslogtreecommitdiffstats
path: root/test/java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2007-05-28 14:31:24 +0000
committerJeremias Maerki <jeremias@apache.org>2007-05-28 14:31:24 +0000
commit8c1aba3f976127d33ec50b67d760f56364c08487 (patch)
treeadfdca730f41c1b9029324bf53535aa25bf16d27 /test/java
parent7ada0a06fe2b9ce0e1867d2c9c47f71ea47a43b2 (diff)
downloadxmlgraphics-fop-8c1aba3f976127d33ec50b67d760f56364c08487.tar.gz
xmlgraphics-fop-8c1aba3f976127d33ec50b67d760f56364c08487.zip
Bugzilla #41831:
- Add support font auto-detection (easier font configuration) including a font cache to speed up the auto-detection process. - Refactoring of the configuration code: All Avalon configuration stuff is extracted into separate "Configurator" classes. - Refactoring of the FOURIResolver. Submitted by: Adrian Cumiskey <fop-dev.at.cumiskey.com> Changes to the patch by jeremias during the review: - Font cache simplified (Java object serialization instead of XML), functionality fixed and moved to the fonts.package. - Relocated default cache file location to user directory. - Fixed the font configuration for PDFDocumentGraphics2D/PDFTranscoder that got lost with the patch. - Fixed a problem with having a non-file URL as font base URL. - Simplified RendererContextInfo stuff to make it easier to understand. - Fixed handling of Type 1 fonts in auto-detection. - Reduced verbosity of font-related log output. - Updated Jakarta Commons IO to version 1.3.1 (the patch depends on it) - Various javadocs improvements git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@542237 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java')
-rw-r--r--test/java/org/apache/fop/config/BaseConstructiveUserConfigTestCase.java45
-rw-r--r--test/java/org/apache/fop/config/BaseDestructiveUserConfigTestCase.java45
-rw-r--r--test/java/org/apache/fop/config/BaseUserConfigTestCase.java75
-rw-r--r--test/java/org/apache/fop/config/FontAttributesMissingTestCase.java19
-rw-r--r--test/java/org/apache/fop/config/FontBaseBadTestCase.java19
-rw-r--r--test/java/org/apache/fop/config/FontEmbedUrlBadTestCase.java (renamed from test/java/org/apache/fop/config/EmbedUrlBadTestCase.java)18
-rw-r--r--test/java/org/apache/fop/config/FontEmbedUrlMalformedTestCase.java (renamed from test/java/org/apache/fop/config/EmbedUrlMalformedTestCase.java)21
-rw-r--r--test/java/org/apache/fop/config/FontMetricsUrlBadTestCase.java (renamed from test/java/org/apache/fop/config/MetricsUrlBadTestCase.java)20
-rw-r--r--test/java/org/apache/fop/config/FontMetricsUrlMalformedTestCase.java (renamed from test/java/org/apache/fop/config/MetricsUrlMalformedTestCase.java)21
-rw-r--r--test/java/org/apache/fop/config/FontTripletAttributeMissingTestCase.java19
-rw-r--r--test/java/org/apache/fop/config/FontsAutoDetectTestCase.java34
-rw-r--r--test/java/org/apache/fop/config/FontsDirectoryBadTestCase.java42
-rw-r--r--test/java/org/apache/fop/config/FontsDirectoryRecursiveTestCase.java37
-rw-r--r--test/java/org/apache/fop/config/UserConfigTestSuite.java10
-rw-r--r--test/java/org/apache/fop/render/pdf/BasePDFTestCase.java5
15 files changed, 309 insertions, 121 deletions
diff --git a/test/java/org/apache/fop/config/BaseConstructiveUserConfigTestCase.java b/test/java/org/apache/fop/config/BaseConstructiveUserConfigTestCase.java
new file mode 100644
index 000000000..cd1c26f8c
--- /dev/null
+++ b/test/java/org/apache/fop/config/BaseConstructiveUserConfigTestCase.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.config;
+
+public abstract class BaseConstructiveUserConfigTestCase extends BaseUserConfigTestCase {
+
+ /**
+ * @see junit.framework.TestCase#TestCase(String)
+ */
+ public BaseConstructiveUserConfigTestCase(String name) {
+ super(name);
+ }
+
+ /**
+ * Test using a standard FOP font
+ * @throws Exception checkstyle wants a comment here, even a silly one
+ */
+ public void testUserConfig() throws Exception {
+ try {
+ initConfig();
+ convertFO();
+ } catch (Exception e) {
+ // this should *not* happen!
+ e.printStackTrace();
+ fail(e.getMessage());
+ }
+ }
+}
diff --git a/test/java/org/apache/fop/config/BaseDestructiveUserConfigTestCase.java b/test/java/org/apache/fop/config/BaseDestructiveUserConfigTestCase.java
new file mode 100644
index 000000000..c02f99c03
--- /dev/null
+++ b/test/java/org/apache/fop/config/BaseDestructiveUserConfigTestCase.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.config;
+
+import org.apache.fop.apps.FOPException;
+
+public abstract class BaseDestructiveUserConfigTestCase extends BaseUserConfigTestCase {
+
+ /**
+ * @see junit.framework.TestCase#TestCase(String)
+ */
+ public BaseDestructiveUserConfigTestCase(String name) {
+ super(name);
+ }
+
+ public void testUserConfig() throws Exception {
+ try {
+ initConfig();
+ convertFO();
+ fail( getName() + ": Expected Configuration Exception" );
+ } catch (FOPException e) {
+ // this *should* happen!
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail( getName() + ": Expected FOPException but got: " + e.getMessage() );
+ }
+ }
+}
diff --git a/test/java/org/apache/fop/config/BaseUserConfigTestCase.java b/test/java/org/apache/fop/config/BaseUserConfigTestCase.java
index 3a97f4303..ae862664c 100644
--- a/test/java/org/apache/fop/config/BaseUserConfigTestCase.java
+++ b/test/java/org/apache/fop/config/BaseUserConfigTestCase.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id$ */
+/* $Id: $ */
package org.apache.fop.config;
@@ -28,7 +28,6 @@ import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.render.pdf.BasePDFTestCase;
import org.xml.sax.SAXException;
@@ -39,7 +38,7 @@ import org.xml.sax.SAXException;
*/
public abstract class BaseUserConfigTestCase extends BasePDFTestCase {
- protected static DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder();
+ protected DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder();
/** logging instance */
protected Log log = LogFactory.getLog(BaseUserConfigTestCase.class);
@@ -59,28 +58,19 @@ public abstract class BaseUserConfigTestCase extends BasePDFTestCase {
// do nothing
}
- /**
- * Test using a standard FOP font
- * @throws Exception checkstyle wants a comment here, even a silly one
- */
- public void testUserConfig() throws Exception {
- try {
- fopFactory.setUserConfig(getUserConfig());
- final File baseDir = getBaseDir();
- final String fontFOFilePath = getFontFOFilePath();
- File foFile = new File(baseDir, fontFOFilePath);
- final boolean dumpOutput = false;
- FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
- convertFO(foFile, foUserAgent, dumpOutput);
- fail( getName() + ": Expected Configuration Exception" );
- } catch (FOPException e) {
- // this *should* happen!
- } catch (Exception e) {
- fail( getName() + ": Expected FOPException but got: " + e.getMessage() );
- }
+ protected void initConfig() throws Exception {
+ fopFactory.setUserConfig(getUserConfig());
}
-
+ protected void convertFO() throws Exception {
+ final File baseDir = getBaseDir();
+ final String fontFOFilePath = getFontFOFilePath();
+ File foFile = new File(baseDir, fontFOFilePath);
+ final boolean dumpOutput = false;
+ FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
+ convertFO(foFile, foUserAgent, dumpOutput);
+ }
+
/**
* get test FOP config File
* @return fo test filepath
@@ -96,11 +86,31 @@ public abstract class BaseUserConfigTestCase extends BasePDFTestCase {
* @throws SAXException
* @throws ConfigurationException
*/
- protected Configuration getUserConfig(String configString)
- throws ConfigurationException, SAXException, IOException {
+ protected Configuration getUserConfig(String configString) throws ConfigurationException, SAXException, IOException {
return cfgBuilder.build(new ByteArrayInputStream(configString.getBytes()));
}
+ /** get base config directory */
+ protected String getBaseConfigDir() {
+ return "test/config";
+ }
+
+ /**
+ * @return user config File
+ */
+ abstract protected String getUserConfigFilename();
+
+ /*
+ * @see junit.framework.TestCase#getName()
+ */
+ public String getName() {
+ return getUserConfigFilename();
+ }
+
+ protected File getUserConfigFile() {
+ return new File(getBaseConfigDir() + File.separator + getUserConfigFilename());
+ }
+
/**
* get test FOP Configuration
* @return fo test filepath
@@ -108,18 +118,7 @@ public abstract class BaseUserConfigTestCase extends BasePDFTestCase {
* @throws SAXException
* @throws ConfigurationException
*/
- protected Configuration getUserConfig()
- throws ConfigurationException, SAXException, IOException {
+ protected Configuration getUserConfig() throws ConfigurationException, SAXException, IOException {
return cfgBuilder.buildFromFile(getUserConfigFile());
- }
-
- /** get base config directory */
- protected String getBaseConfigDir() {
- return "test/config";
- }
-
- /**
- * @return user config File
- */
- protected abstract File getUserConfigFile();
+ }
}
diff --git a/test/java/org/apache/fop/config/FontAttributesMissingTestCase.java b/test/java/org/apache/fop/config/FontAttributesMissingTestCase.java
index fc5b10a60..a6333009d 100644
--- a/test/java/org/apache/fop/config/FontAttributesMissingTestCase.java
+++ b/test/java/org/apache/fop/config/FontAttributesMissingTestCase.java
@@ -19,20 +19,19 @@
package org.apache.fop.config;
-import java.io.File;
-
-// this font is without a metrics-url or an embed-url
-public class FontAttributesMissingTestCase extends BaseUserConfigTestCase {
+/*
+ * this font is without a metrics-url or an embed-url
+ */
+public class FontAttributesMissingTestCase extends BaseDestructiveUserConfigTestCase {
public FontAttributesMissingTestCase(String name) {
super(name);
}
- protected File getUserConfigFile() {
- return new File( getBaseConfigDir() + "/test_fontattributes_missing.xconf");
- }
-
- public String getName() {
- return "test_fontattributes_missing.xconf";
+ /**
+ * @see org.apache.fop.config.BaseUserConfigTestCase#getUserConfigFilename()
+ */
+ public String getUserConfigFilename() {
+ return "test_font_attributes_missing.xconf";
}
}
diff --git a/test/java/org/apache/fop/config/FontBaseBadTestCase.java b/test/java/org/apache/fop/config/FontBaseBadTestCase.java
index 4280306d0..af9031199 100644
--- a/test/java/org/apache/fop/config/FontBaseBadTestCase.java
+++ b/test/java/org/apache/fop/config/FontBaseBadTestCase.java
@@ -19,10 +19,10 @@
package org.apache.fop.config;
-import java.io.File;
-
-// this font base does not exist and a relative font path is used
-public class FontBaseBadTestCase extends BaseUserConfigTestCase {
+/*
+ * this font base does not exist and a relative font path is used
+ */
+public class FontBaseBadTestCase extends BaseDestructiveUserConfigTestCase {
public FontBaseBadTestCase(String name) {
super(name);
@@ -34,16 +34,9 @@ public class FontBaseBadTestCase extends BaseUserConfigTestCase {
}
/**
- * @see org.apache.fop.config.BaseUserConfigTestCase#getUserConfigFile()
- */
- protected File getUserConfigFile() {
- return new File( getBaseConfigDir() + "/test_fontbase_bad.xconf");
- }
-
- /**
- * @return configuration filename
+ * @see org.apache.fop.config.BaseUserConfigTestCase#getUserConfigFilename()
*/
- public String getName() {
+ public String getUserConfigFilename() {
return "test_fontbase_bad.xconf";
}
}
diff --git a/test/java/org/apache/fop/config/EmbedUrlBadTestCase.java b/test/java/org/apache/fop/config/FontEmbedUrlBadTestCase.java
index 2934004fd..218cee795 100644
--- a/test/java/org/apache/fop/config/EmbedUrlBadTestCase.java
+++ b/test/java/org/apache/fop/config/FontEmbedUrlBadTestCase.java
@@ -19,23 +19,19 @@
package org.apache.fop.config;
-import java.io.File;
-
-//
/**
* this font has an embed-url that does not exist on filesystem.
*/
-public class EmbedUrlBadTestCase extends BaseUserConfigTestCase {
+public class FontEmbedUrlBadTestCase extends BaseDestructiveUserConfigTestCase {
- public EmbedUrlBadTestCase(String name) {
+ public FontEmbedUrlBadTestCase(String name) {
super(name);
}
- protected File getUserConfigFile() {
- return new File( getBaseConfigDir() + "/test_embedurl_bad.xconf");
- }
-
- public String getName() {
- return "test_embedurl_bad.xconf";
+ /**
+ * @see org.apache.fop.config.BaseUserConfigTestCase#getUserConfigFilename()
+ */
+ public String getUserConfigFilename() {
+ return "test_font_embedurl_bad.xconf";
}
}
diff --git a/test/java/org/apache/fop/config/EmbedUrlMalformedTestCase.java b/test/java/org/apache/fop/config/FontEmbedUrlMalformedTestCase.java
index ab622fd69..e87164e90 100644
--- a/test/java/org/apache/fop/config/EmbedUrlMalformedTestCase.java
+++ b/test/java/org/apache/fop/config/FontEmbedUrlMalformedTestCase.java
@@ -19,20 +19,19 @@
package org.apache.fop.config;
-import java.io.File;
-
-// this font has a malformed embed-url
-public class EmbedUrlMalformedTestCase extends BaseUserConfigTestCase {
+/**
+ * this font has a malformed embed-url
+ */
+public class FontEmbedUrlMalformedTestCase extends BaseDestructiveUserConfigTestCase {
- public EmbedUrlMalformedTestCase(String name) {
+ public FontEmbedUrlMalformedTestCase(String name) {
super(name);
}
- protected File getUserConfigFile() {
- return new File( getBaseConfigDir() + "/test_embedurl_malformed.xconf");
- }
-
- public String getName() {
- return "test_embedurl_malformed.xconf";
+ /**
+ * @see org.apache.fop.config.BaseUserConfigTestCase#getUserConfigFilename()
+ */
+ public String getUserConfigFilename() {
+ return "test_font_embedurl_malformed.xconf";
}
}
diff --git a/test/java/org/apache/fop/config/MetricsUrlBadTestCase.java b/test/java/org/apache/fop/config/FontMetricsUrlBadTestCase.java
index 80f7e285b..00c4db752 100644
--- a/test/java/org/apache/fop/config/MetricsUrlBadTestCase.java
+++ b/test/java/org/apache/fop/config/FontMetricsUrlBadTestCase.java
@@ -19,26 +19,22 @@
package org.apache.fop.config;
-import java.io.File;
-
-// this font has a metrics-url that does not exist on filesystem
-public class MetricsUrlBadTestCase extends BaseUserConfigTestCase {
+/*
+ * this font has a metrics-url that does not exist on filesystem
+ */
+public class FontMetricsUrlBadTestCase extends BaseDestructiveUserConfigTestCase {
/**
* @see junit.framework.TestCase#TestCase(String)
*/
- public MetricsUrlBadTestCase(String name) {
+ public FontMetricsUrlBadTestCase(String name) {
super(name);
}
/**
- * @see org.apache.fop.config.BaseUserConfigTestCase#getUserConfigFile()
+ * @see org.apache.fop.config.BaseUserConfigTestCase#getUserConfigFilename()
*/
- protected File getUserConfigFile() {
- return new File( getBaseConfigDir() + "/test_metricsurl_bad.xconf");
- }
-
- public String getName() {
- return "test_metricsurl_bad.xconf";
+ public String getUserConfigFilename() {
+ return "test_font_metricsurl_bad.xconf";
}
}
diff --git a/test/java/org/apache/fop/config/MetricsUrlMalformedTestCase.java b/test/java/org/apache/fop/config/FontMetricsUrlMalformedTestCase.java
index 6b623e06e..d5815b42f 100644
--- a/test/java/org/apache/fop/config/MetricsUrlMalformedTestCase.java
+++ b/test/java/org/apache/fop/config/FontMetricsUrlMalformedTestCase.java
@@ -19,20 +19,19 @@
package org.apache.fop.config;
-import java.io.File;
-
-// this font has a malformed metrics-url
-public class MetricsUrlMalformedTestCase extends BaseUserConfigTestCase {
+/*
+ * this font has a malformed metrics-url
+ */
+public class FontMetricsUrlMalformedTestCase extends BaseDestructiveUserConfigTestCase {
- public MetricsUrlMalformedTestCase(String name) {
+ public FontMetricsUrlMalformedTestCase(String name) {
super(name);
}
- protected File getUserConfigFile() {
- return new File( getBaseConfigDir() + "/test_metricsurl_malformed.xconf");
- }
-
- public String getName() {
- return "test_metricsurl_malformed.xconf";
+ /**
+ * @see org.apache.fop.config.BaseUserConfigTestCase#getUserConfigFilename()
+ */
+ public String getUserConfigFilename() {
+ return "test_font_metricsurl_malformed.xconf";
}
}
diff --git a/test/java/org/apache/fop/config/FontTripletAttributeMissingTestCase.java b/test/java/org/apache/fop/config/FontTripletAttributeMissingTestCase.java
index c321926f8..aed07ed48 100644
--- a/test/java/org/apache/fop/config/FontTripletAttributeMissingTestCase.java
+++ b/test/java/org/apache/fop/config/FontTripletAttributeMissingTestCase.java
@@ -19,20 +19,19 @@
package org.apache.fop.config;
-import java.io.File;
-
-// this font has an embed-url that does not exist on filesystem
-public class FontTripletAttributeMissingTestCase extends BaseUserConfigTestCase {
+/*
+ * this font has a missing font triplet attribute
+ */
+public class FontTripletAttributeMissingTestCase extends BaseDestructiveUserConfigTestCase {
public FontTripletAttributeMissingTestCase(String name) {
super(name);
}
- protected File getUserConfigFile() {
- return new File( getBaseConfigDir() + "/test_fonttripletattribute_missing.xconf");
- }
-
- public String getName() {
- return "test_fonttripletattribute_missing.xconf";
+ /**
+ * @see org.apache.fop.config.BaseUserConfigTestCase#getUserConfigFilename()
+ */
+ public String getUserConfigFilename() {
+ return "test_font_tripletattribute_missing.xconf";
}
}
diff --git a/test/java/org/apache/fop/config/FontsAutoDetectTestCase.java b/test/java/org/apache/fop/config/FontsAutoDetectTestCase.java
new file mode 100644
index 000000000..3e188a3e9
--- /dev/null
+++ b/test/java/org/apache/fop/config/FontsAutoDetectTestCase.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.config;
+
+public class FontsAutoDetectTestCase extends BaseConstructiveUserConfigTestCase {
+
+ public FontsAutoDetectTestCase(String name) {
+ super(name);
+ }
+
+ /**
+ * @see org.apache.fop.config.BaseUserConfigTestCase#getUserConfigFilename()
+ */
+ public String getUserConfigFilename() {
+ return "test_fonts_autodetect.xconf";
+ }
+}
diff --git a/test/java/org/apache/fop/config/FontsDirectoryBadTestCase.java b/test/java/org/apache/fop/config/FontsDirectoryBadTestCase.java
new file mode 100644
index 000000000..b439e37b2
--- /dev/null
+++ b/test/java/org/apache/fop/config/FontsDirectoryBadTestCase.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.config;
+
+/*
+ * this font has a metrics-url that does not exist on filesystem
+ */
+public class FontsDirectoryBadTestCase extends BaseDestructiveUserConfigTestCase {
+
+ public FontsDirectoryBadTestCase(String name) {
+ super(name);
+ }
+
+ /**
+ * @see org.apache.fop.config.BaseUserConfigTestCase#getUserConfigFilename()
+ */
+ public String getUserConfigFilename() {
+ return "test_fonts_directory_bad.xconf";
+ }
+
+ /** get test FOP config File */
+ protected String getFontFOFilePath() {
+ return "test/xml/bugtests/font-dir.fo";
+ }
+}
diff --git a/test/java/org/apache/fop/config/FontsDirectoryRecursiveTestCase.java b/test/java/org/apache/fop/config/FontsDirectoryRecursiveTestCase.java
new file mode 100644
index 000000000..1759f532d
--- /dev/null
+++ b/test/java/org/apache/fop/config/FontsDirectoryRecursiveTestCase.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.config;
+
+/**
+ * tests font directory on system
+ */
+public class FontsDirectoryRecursiveTestCase extends BaseConstructiveUserConfigTestCase {
+
+ public FontsDirectoryRecursiveTestCase(String name) {
+ super(name);
+ }
+
+ /**
+ * @see org.apache.fop.config.BaseUserConfigTestCase#getUserConfigFilename()
+ */
+ protected String getUserConfigFilename() {
+ return "test_fonts_directory_recursive.xconf";
+ }
+}
diff --git a/test/java/org/apache/fop/config/UserConfigTestSuite.java b/test/java/org/apache/fop/config/UserConfigTestSuite.java
index ab612d043..439a2c031 100644
--- a/test/java/org/apache/fop/config/UserConfigTestSuite.java
+++ b/test/java/org/apache/fop/config/UserConfigTestSuite.java
@@ -38,10 +38,12 @@ public class UserConfigTestSuite {
suite.addTest(new TestSuite(FontBaseBadTestCase.class));
suite.addTest(new TestSuite(FontAttributesMissingTestCase.class));
suite.addTest(new TestSuite(FontTripletAttributeMissingTestCase.class));
- suite.addTest(new TestSuite(MetricsUrlBadTestCase.class));
- suite.addTest(new TestSuite(EmbedUrlBadTestCase.class));
- suite.addTest(new TestSuite(MetricsUrlMalformedTestCase.class));
- suite.addTest(new TestSuite(EmbedUrlMalformedTestCase.class));
+ suite.addTest(new TestSuite(FontMetricsUrlBadTestCase.class));
+ suite.addTest(new TestSuite(FontEmbedUrlBadTestCase.class));
+ suite.addTest(new TestSuite(FontMetricsUrlMalformedTestCase.class));
+ suite.addTest(new TestSuite(FontEmbedUrlMalformedTestCase.class));
+ suite.addTest(new TestSuite(FontsDirectoryRecursiveTestCase.class));
+ suite.addTest(new TestSuite(FontsAutoDetectTestCase.class));
//$JUnit-END$
return suite;
}
diff --git a/test/java/org/apache/fop/render/pdf/BasePDFTestCase.java b/test/java/org/apache/fop/render/pdf/BasePDFTestCase.java
index 3e399e064..3b4e03118 100644
--- a/test/java/org/apache/fop/render/pdf/BasePDFTestCase.java
+++ b/test/java/org/apache/fop/render/pdf/BasePDFTestCase.java
@@ -93,7 +93,10 @@ public class BasePDFTestCase extends AbstractFOPTestCase {
return result;
}
- /** get FOP config File */
+ /**
+ * get FOP config File
+ * @return user config file to be used for testing
+ */
protected File getUserConfigFile() {
return new File("test/test.xconf");
}