diff options
author | Simon Pepping <spepping@apache.org> | 2008-01-09 20:46:29 +0000 |
---|---|---|
committer | Simon Pepping <spepping@apache.org> | 2008-01-09 20:46:29 +0000 |
commit | a1277036591ec9c08c993ee66278d4457eac2cd3 (patch) | |
tree | 0125201b7620e14011a6238dff5a3418215006a6 /test/java | |
parent | 6836775511943c2b3b3ec7d8bc89f4a895e647c9 (diff) | |
download | xmlgraphics-fop-a1277036591ec9c08c993ee66278d4457eac2cd3.tar.gz xmlgraphics-fop-a1277036591ec9c08c993ee66278d4457eac2cd3.zip |
Merged revisions 598746-603942 via svnmerge from
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk
........
r599536 | vhennebert | 2007-11-29 19:31:13 +0100 (Thu, 29 Nov 2007) | 4 lines
Added fixes-bug attributes for:
- wrong element generation in table when glues are produced
- border-resolution on row-spanning cells
........
r599746 | jeremias | 2007-11-30 10:04:54 +0100 (Fri, 30 Nov 2007) | 2 lines
Bugzilla #37993:
Bugfix: allow multiple bookmarks to point at the same destination.
........
r600195 | adelmelle | 2007-12-01 22:11:53 +0100 (Sat, 01 Dec 2007) | 1 line
Correction and simplification of the PropertyCache: subclass WeakReference and remove internal threading
........
r600467 | jeremias | 2007-12-03 11:16:27 +0100 (Mon, 03 Dec 2007) | 2 lines
Log RuntimeExceptions during rendering so that they are at least visible somewhere if someone doesn't set an ErrorListener on the XSLT processor (this could lead to exceptions being swallowed). This is a temporary measure until we have time to improve the exception handling in FOP.
The original problem that led to this change was: "The number of this PDFNumber must not be empty" while producing a PDF/A with customized filter entries in the PDF configuration. The exception was a follow-up exception after a PDFConformanceException that was swallowed by a default ErrorListener.
........
r600521 | jeremias | 2007-12-03 14:21:06 +0100 (Mon, 03 Dec 2007) | 1 line
Added a possibility to rerun the whole run a defined number of times to test for possible issues outside a single rendering run.
........
r600529 | jeremias | 2007-12-03 14:32:04 +0100 (Mon, 03 Dec 2007) | 1 line
Oops.
........
r601413 | vhennebert | 2007-12-05 17:56:47 +0100 (Wed, 05 Dec 2007) | 2 lines
Typo in property: svn:kewords -> svn:keywords
........
r601415 | acumiskey | 2007-12-05 18:11:44 +0100 (Wed, 05 Dec 2007) | 2 lines
Corrected javadocs
........
r601416 | acumiskey | 2007-12-05 18:12:54 +0100 (Wed, 05 Dec 2007) | 2 lines
Corrected javadoc
........
r601417 | acumiskey | 2007-12-05 18:13:31 +0100 (Wed, 05 Dec 2007) | 2 lines
Corrected javadoc
........
r601419 | acumiskey | 2007-12-05 18:15:46 +0100 (Wed, 05 Dec 2007) | 2 lines
Improved use of logging
........
r601423 | acumiskey | 2007-12-05 18:19:43 +0100 (Wed, 05 Dec 2007) | 2 lines
Corrected javadoc, fixed checkstyle issues, and now also correctly caters for negative number conversions
........
r601424 | acumiskey | 2007-12-05 18:21:15 +0100 (Wed, 05 Dec 2007) | 2 lines
Fixed checkstyle issues
........
r601426 | acumiskey | 2007-12-05 18:24:15 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601427 | acumiskey | 2007-12-05 18:25:07 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601428 | acumiskey | 2007-12-05 18:25:58 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601429 | acumiskey | 2007-12-05 18:27:06 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601430 | acumiskey | 2007-12-05 18:28:03 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601431 | acumiskey | 2007-12-05 18:28:48 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601432 | acumiskey | 2007-12-05 18:29:31 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601433 | acumiskey | 2007-12-05 18:30:04 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601434 | acumiskey | 2007-12-05 18:31:20 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601435 | acumiskey | 2007-12-05 18:32:29 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601436 | acumiskey | 2007-12-05 18:34:44 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601437 | acumiskey | 2007-12-05 18:35:31 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601438 | acumiskey | 2007-12-05 18:36:12 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes and cleanup
........
r601439 | acumiskey | 2007-12-05 18:37:40 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601440 | acumiskey | 2007-12-05 18:39:54 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601442 | acumiskey | 2007-12-05 18:42:13 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601443 | acumiskey | 2007-12-05 18:42:48 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601444 | acumiskey | 2007-12-05 18:43:46 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601445 | acumiskey | 2007-12-05 18:44:36 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601446 | acumiskey | 2007-12-05 18:45:20 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601447 | acumiskey | 2007-12-05 18:47:44 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601448 | acumiskey | 2007-12-05 18:48:56 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601449 | acumiskey | 2007-12-05 18:49:46 +0100 (Wed, 05 Dec 2007) | 2 lines
Checkstyle fixes
........
r601712 | acumiskey | 2007-12-06 12:57:14 +0100 (Thu, 06 Dec 2007) | 2 lines
Temporary fix to the build
........
r602045 | jeremias | 2007-12-07 10:20:28 +0100 (Fri, 07 Dec 2007) | 1 line
Avoid a NPE in toString().
........
r602125 | maxberger | 2007-12-07 16:36:53 +0100 (Fri, 07 Dec 2007) | 6 lines
Updated xmlgraphics from SVN
Added autodetection of fonts in jar files (x-font and x-font-truetype)
Added files needed for testcase
Please note: Actual testcase is still missing!
........
r602898 | maxberger | 2007-12-10 14:35:33 +0100 (Mon, 10 Dec 2007) | 2 lines
Added documentation for font-in-jar-files
........
r603590 | acumiskey | 2007-12-12 13:24:10 +0100 (Wed, 12 Dec 2007) | 4 lines
* Added an SVG handler and Graphics2D implementation for AFP which injects AFP GOCA structured fields into the AFPDataStream.
* Fixed many checkstyle problems.
* Updated xmlgraphics-commons-1.3svn.jar to include changes to TextHandler
........
r603592 | acumiskey | 2007-12-12 13:26:39 +0100 (Wed, 12 Dec 2007) | 2 lines
Updated status with SVG support for AFP.
........
r603890 | vhennebert | 2007-12-13 12:35:17 +0100 (Thu, 13 Dec 2007) | 2 lines
Fixed @throws statements in javadoc
........
r603926 | adelmelle | 2007-12-13 15:43:08 +0100 (Thu, 13 Dec 2007) | 4 lines
Minor tweaks:
* only add text to a fo:wrapper if it is not a direct flow-descendant
* error if an fo:wrapper that is a direct flow-descendant contains inline-level children
........
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking@610559 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java')
-rw-r--r-- | test/java/org/apache/fop/memory/MemoryEater.java | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/test/java/org/apache/fop/memory/MemoryEater.java b/test/java/org/apache/fop/memory/MemoryEater.java index ed8f46441..555ddf19c 100644 --- a/test/java/org/apache/fop/memory/MemoryEater.java +++ b/test/java/org/apache/fop/memory/MemoryEater.java @@ -23,15 +23,19 @@ import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.OutputStream; +import java.net.MalformedURLException; import javax.xml.transform.Result; import javax.xml.transform.Source; +import javax.xml.transform.Templates; import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.sax.SAXResult; import javax.xml.transform.sax.SAXTransformerFactory; import javax.xml.transform.stream.StreamSource; import org.apache.commons.io.output.NullOutputStream; + import org.apache.fop.apps.Fop; import org.apache.fop.apps.FopFactory; import org.apache.fop.apps.MimeConstants; @@ -41,17 +45,21 @@ import org.apache.fop.apps.MimeConstants; */ public class MemoryEater { - private static void eatMemory(File foFile, int replicatorRepeats) throws Exception { - - SAXTransformerFactory tFactory = (SAXTransformerFactory)SAXTransformerFactory.newInstance(); - FopFactory fopFactory = FopFactory.newInstance(); - + private SAXTransformerFactory tFactory + = (SAXTransformerFactory)SAXTransformerFactory.newInstance(); + private FopFactory fopFactory = FopFactory.newInstance(); + private Templates replicatorTemplates; + + public MemoryEater() throws TransformerConfigurationException, MalformedURLException { File xsltFile = new File("test/xsl/fo-replicator.xsl"); Source xslt = new StreamSource(xsltFile); - + replicatorTemplates = tFactory.newTemplates(xslt); + } + + private void eatMemory(File foFile, int replicatorRepeats) throws Exception { Source src = new StreamSource(foFile); - Transformer transformer = tFactory.newTransformer(xslt); + Transformer transformer = replicatorTemplates.newTransformer(); transformer.setParameter("repeats", new Integer(replicatorRepeats)); OutputStream out = new NullOutputStream(); //write to /dev/nul @@ -78,13 +86,17 @@ public class MemoryEater { boolean doPrompt = true; //true if you want a chance to start the monitoring console try { int replicatorRepeats = 2; + int runRepeats = 1; if (args.length > 0) { replicatorRepeats = Integer.parseInt(args[0]); } + if (args.length > 1) { + runRepeats = Integer.parseInt(args[1]); + } File testFile = new File("examples/fo/basic/readme.fo"); System.out.println("MemoryEater! About to replicate the test file " - + replicatorRepeats + " times..."); + + replicatorRepeats + " times and run it " + runRepeats + " times..."); if (doPrompt) { prompt(); } @@ -92,7 +104,10 @@ public class MemoryEater { System.out.println("Processing..."); long start = System.currentTimeMillis(); - eatMemory(testFile, replicatorRepeats); + MemoryEater app = new MemoryEater(); + for (int i = 0; i < runRepeats; i++) { + app.eatMemory(testFile, replicatorRepeats); + } long duration = System.currentTimeMillis() - start; System.out.println("Success! Job took " + duration + " ms"); |