You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by vh...@apache.org on 2008/07/24 11:37:16 UTC
svn commit: r679326 [32/33] - in /xmlgraphics/fop/trunk:
examples/embedding/java/embedding/ examples/embedding/java/embedding/events/
examples/embedding/java/embedding/intermediate/
examples/embedding/java/embedding/model/ examples/embedding/java/embed...
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/intermediate/AreaTreeParserTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/intermediate/AreaTreeParserTestCase.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/intermediate/AreaTreeParserTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/intermediate/AreaTreeParserTestCase.java Thu Jul 24 02:35:34 2008
@@ -63,25 +63,25 @@
// configure fopFactory as desired
private static FopFactory fopFactory = FopFactory.newInstance();
-
- private static SAXTransformerFactory tFactory
+
+ private static SAXTransformerFactory tFactory
= (SAXTransformerFactory)SAXTransformerFactory.newInstance();
private static Templates stylesheet = null;
-
+
private File mainDir = new File("test/layoutengine");
private File testDir = new File(mainDir, "standard-testcases");
-
+
private String name;
private File testFile;
private File outputDir;
private Document intermediate;
-
+
/** @see junit.framework.TestCase#TestCase(String) */
public AreaTreeParserTestCase(String name) {
super(name);
}
-
+
/**
* Constructor for the test suite that is used for each test file.
* @param testFile the test file to run
@@ -90,7 +90,7 @@
super(testFile.getName());
this.testFile = testFile;
}
-
+
private Templates getStylesheet() throws TransformerConfigurationException {
if (stylesheet == null) {
File xsltFile = new File(mainDir, "testcase2fo.xsl");
@@ -98,7 +98,7 @@
}
return stylesheet;
}
-
+
/** @see junit.framework.TestCase#setUp() */
protected void setUp() throws Exception {
super.setUp();
@@ -127,17 +127,17 @@
* @throws Exception if the test fails
*/
public void testParserToAT() throws Exception {
-
+
Source src = new DOMSource(intermediate);
Document doc = parseAndRenderToAreaTree(src);
if (outputDir != null) {
File tgtFile = new File(outputDir, name + ".at2.xml");
saveDOM(doc, tgtFile);
}
-
+
assertXMLEqual(intermediate, doc);
}
-
+
private void saveDOM(Document doc, File tgtFile) throws Exception {
Transformer transformer = tFactory.newTransformer();
Source src = new DOMSource(doc);
@@ -166,7 +166,7 @@
IOUtils.closeQuietly(out);
}
}
-
+
private FOUserAgent createUserAgent() {
FOUserAgent userAgent = fopFactory.newFOUserAgent();
try {
@@ -191,41 +191,41 @@
TransformerHandler handler = tFactory.newTransformerHandler();
DOMResult domResult = new DOMResult();
handler.setResult(domResult);
-
+
FOUserAgent userAgent = createUserAgent();
//Create an instance of the target renderer so the XMLRenderer can use its font setup
Renderer targetRenderer = userAgent.getRendererFactory().createRenderer(
- userAgent, MimeConstants.MIME_PDF);
-
+ userAgent, MimeConstants.MIME_PDF);
+
XMLRenderer renderer = new XMLRenderer();
renderer.mimicRenderer(targetRenderer);
renderer.setContentHandler(handler);
renderer.setUserAgent(userAgent);
userAgent.setRendererOverride(renderer);
-
+
Fop fop = fopFactory.newFop(MimeConstants.MIME_FOP_AREA_TREE, userAgent);
Result res = new SAXResult(fop.getDefaultHandler());
transformer.transform(src, res);
-
+
return (Document)domResult.getNode();
}
-
+
private void parseAndRender(Source src, OutputStream out, String mime) throws Exception {
AreaTreeParser parser = new AreaTreeParser();
-
+
FOUserAgent userAgent = createUserAgent();
FontInfo fontInfo = new FontInfo();
- AreaTreeModel treeModel = new RenderPagesModel(userAgent,
- mime, fontInfo, out);
+ AreaTreeModel treeModel = new RenderPagesModel(userAgent,
+ mime, fontInfo, out);
parser.parse(src, treeModel, userAgent);
treeModel.endDocument();
}
-
+
private Document parseAndRenderToAreaTree(Source src) throws Exception {
AreaTreeParser parser = new AreaTreeParser();
-
+
//Set up XMLRenderer to render to a DOM
TransformerHandler handler = tFactory.newTransformerHandler();
DOMResult domResult = new DOMResult();
@@ -238,12 +238,12 @@
renderer.setUserAgent(userAgent);
FontInfo fontInfo = new FontInfo();
- AreaTreeModel treeModel = new RenderPagesModel(userAgent,
- MimeConstants.MIME_FOP_AREA_TREE, fontInfo, null);
+ AreaTreeModel treeModel = new RenderPagesModel(userAgent,
+ MimeConstants.MIME_FOP_AREA_TREE, fontInfo, null);
parser.parse(src, treeModel, userAgent);
treeModel.endDocument();
return (Document)domResult.getNode();
}
-
+
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/intermediate/IntermediateFormatTestSuite.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/intermediate/IntermediateFormatTestSuite.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/intermediate/IntermediateFormatTestSuite.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/intermediate/IntermediateFormatTestSuite.java Thu Jul 24 02:35:34 2008
@@ -48,11 +48,11 @@
File f = (File)i.next();
addTestCase(suite, f);
}
-
+
return suite;
}
-
- private static void addTestCase(TestSuite suite,
+
+ private static void addTestCase(TestSuite suite,
final File f) {
suite.addTest(new AreaTreeParserTestCase(f) {
public void runTest() throws Exception {
@@ -67,5 +67,5 @@
}
});
}
-
+
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/ElementListCheck.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/ElementListCheck.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/ElementListCheck.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/ElementListCheck.java Thu Jul 24 02:35:34 2008
@@ -41,7 +41,7 @@
private String id;
private int index = -1;
private Element checkElement;
-
+
/**
* Creates a new instance from a DOM node.
* @param node DOM node that defines this check
@@ -68,7 +68,7 @@
NodeList children = checkElement.getChildNodes();
int pos = -1;
for (int i = 0; i < children.getLength(); i++) {
- Node node = children.item(i);
+ Node node = children.item(i);
if (node instanceof Element) {
pos++;
Element domEl = (Element)node;
@@ -78,14 +78,14 @@
} else if ("box".equals(domEl.getLocalName())) {
if (!(knuthEl instanceof KnuthBox)) {
fail("Expected KnuthBox"
- + " at position " + pos
+ + " at position " + pos
+ " but got: " + knuthEl.getClass().getName());
}
if (domEl.getAttribute("w").length() > 0) {
int w = Integer.parseInt(domEl.getAttribute("w"));
if (w != knuthEl.getW()) {
- fail("Expected w=" + w
- + " at position " + pos
+ fail("Expected w=" + w
+ + " at position " + pos
+ " but got: " + knuthEl.getW());
}
}
@@ -104,29 +104,29 @@
} else if ("penalty".equals(domEl.getLocalName())) {
if (!(knuthEl instanceof KnuthPenalty)) {
fail("Expected KnuthPenalty "
- + " at position " + pos
+ + " at position " + pos
+ " but got: " + knuthEl.getClass().getName());
}
KnuthPenalty pen = (KnuthPenalty)knuthEl;
if (domEl.getAttribute("w").length() > 0) {
int w = Integer.parseInt(domEl.getAttribute("w"));
if (w != knuthEl.getW()) {
- fail("Expected w=" + w
- + " at position " + pos
+ fail("Expected w=" + w
+ + " at position " + pos
+ " but got: " + knuthEl.getW());
}
}
if (domEl.getAttribute("p").length() > 0) {
if ("<0".equals(domEl.getAttribute("p"))) {
if (knuthEl.getP() >= 0) {
- fail("Expected p<0"
- + " at position " + pos
+ fail("Expected p<0"
+ + " at position " + pos
+ " but got: " + knuthEl.getP());
}
} else if (">0".equals(domEl.getAttribute("p"))) {
if (knuthEl.getP() <= 0) {
- fail("Expected p>0"
- + " at position " + pos
+ fail("Expected p>0"
+ + " at position " + pos
+ " but got: " + knuthEl.getP());
}
} else {
@@ -143,8 +143,8 @@
p = Integer.parseInt(domEl.getAttribute("p"));
}
if (p != knuthEl.getP()) {
- fail("Expected p=" + p
- + " at position " + pos
+ fail("Expected p=" + p
+ + " at position " + pos
+ " but got: " + knuthEl.getP());
}
}
@@ -152,7 +152,7 @@
if ("true".equals(domEl.getAttribute("flagged"))) {
if (!pen.isFlagged()) {
fail("Expected flagged penalty"
- + " at position " + pos);
+ + " at position " + pos);
}
} else if ("false".equals(domEl.getAttribute("flagged"))) {
if (pen.isFlagged()) {
@@ -163,57 +163,57 @@
if ("true".equals(domEl.getAttribute("aux"))) {
if (!pen.isAuxiliary()) {
fail("Expected auxiliary penalty"
- + " at position " + pos);
+ + " at position " + pos);
}
} else if ("false".equals(domEl.getAttribute("aux"))) {
if (pen.isAuxiliary()) {
fail("Expected non-auxiliary penalty"
- + " at position " + pos);
+ + " at position " + pos);
}
}
} else if ("glue".equals(domEl.getLocalName())) {
if (!(knuthEl instanceof KnuthGlue)) {
- fail("Expected KnuthGlue"
- + " at position " + pos
+ fail("Expected KnuthGlue"
+ + " at position " + pos
+ " but got: " + knuthEl.getClass().getName());
}
KnuthGlue glue = (KnuthGlue)knuthEl;
if (domEl.getAttribute("w").length() > 0) {
int w = Integer.parseInt(domEl.getAttribute("w"));
if (w != knuthEl.getW()) {
- fail("Expected w=" + w
- + " at position " + pos
+ fail("Expected w=" + w
+ + " at position " + pos
+ " but got: " + knuthEl.getW());
}
}
if (domEl.getAttribute("y").length() > 0) {
int stretch = Integer.parseInt(domEl.getAttribute("y"));
if (stretch != knuthEl.getY()) {
- fail("Expected y=" + stretch
- + " (stretch) at position " + pos
+ fail("Expected y=" + stretch
+ + " (stretch) at position " + pos
+ " but got: " + knuthEl.getY());
}
}
if (domEl.getAttribute("z").length() > 0) {
int shrink = Integer.parseInt(domEl.getAttribute("z"));
if (shrink != knuthEl.getZ()) {
- fail("Expected z=" + shrink
- + " (shrink) at position " + pos
+ fail("Expected z=" + shrink
+ + " (shrink) at position " + pos
+ " but got: " + knuthEl.getZ());
}
}
} else {
- throw new IllegalArgumentException("Invalid child node for 'element-list': "
+ throw new IllegalArgumentException("Invalid child node for 'element-list': "
+ domEl.getLocalName()
+ " at position " + pos + " (" + this + ")");
}
-
+
}
}
pos++;
if (elementList.getElementList().size() > pos) {
- fail("There are "
- + (elementList.getElementList().size() - pos)
+ fail("There are "
+ + (elementList.getElementList().size() - pos)
+ " unchecked elements at the end of the list");
}
}
@@ -221,7 +221,7 @@
private void fail(String msg) {
throw new RuntimeException(msg + " (" + this + ")");
}
-
+
private boolean haveID() {
return (this.id != null && this.id.length() > 0);
}
@@ -262,7 +262,7 @@
}
return sb.toString();
}
-
+
/** @see java.lang.Object#toString() */
public String toString() {
StringBuffer sb = new StringBuffer("element-list");
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/ElementListCollector.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/ElementListCollector.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/ElementListCollector.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/ElementListCollector.java Thu Jul 24 02:35:34 2008
@@ -30,21 +30,21 @@
public class ElementListCollector implements Observer {
private List elementLists = new java.util.ArrayList();
-
+
/**
* Resets the collector.
*/
public void reset() {
elementLists.clear();
}
-
+
/**
* @return the list of ElementList instances.
*/
public List getElementLists() {
return this.elementLists;
}
-
+
/** @see org.apache.fop.layoutmgr.ElementListObserver.Observer */
public void observe(List elementList, String category, String id) {
elementLists.add(new ElementList(elementList, category, id));
@@ -54,11 +54,11 @@
* Data object representing an element list along with additional information.
*/
public static class ElementList {
-
+
private List elementList;
private String category;
private String id;
-
+
/**
* Creates a new ElementList instance
* @param elementList the element list
@@ -70,21 +70,21 @@
this.category = category;
this.id = id;
}
-
+
/** @return the element list */
public List getElementList() {
return elementList;
}
-
+
/** @return the category */
public String getCategory() {
return category;
}
-
+
/** @return the ID, may be null */
public String getID() {
return id;
}
}
-
+
}
\ No newline at end of file
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/EvalCheck.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/EvalCheck.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/EvalCheck.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/EvalCheck.java Thu Jul 24 02:35:34 2008
@@ -36,7 +36,7 @@
private String xpath;
private double tolerance;
private PrefixResolver prefixResolver;
-
+
/**
* Creates a new instance
* @param expected expected value
@@ -46,7 +46,7 @@
this.expected = expected;
this.xpath = xpath;
}
-
+
/**
* Creates a new instance from a DOM node.
* @param node DOM node that defines this check
@@ -60,7 +60,7 @@
}
this.prefixResolver = new PrefixResolverDefault(node);
}
-
+
/** @see org.apache.fop.layoutengine.LayoutEngineCheck */
public void check(LayoutResult result) {
XObject res;
@@ -75,13 +75,13 @@
double v2 = Double.parseDouble(actual);
if (Math.abs(v1 - v2) > tolerance) {
throw new RuntimeException(
- "Expected XPath expression to evaluate to '" + expected + "', but got '"
+ "Expected XPath expression to evaluate to '" + expected + "', but got '"
+ actual + "' (" + this + ", outside tolerance)");
}
} else {
if (!expected.equals(actual)) {
throw new RuntimeException(
- "Expected XPath expression to evaluate to '" + expected + "', but got '"
+ "Expected XPath expression to evaluate to '" + expected + "', but got '"
+ actual + "' (" + this + ")");
}
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/LayoutEngineCheck.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/LayoutEngineCheck.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/LayoutEngineCheck.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/LayoutEngineCheck.java Thu Jul 24 02:35:34 2008
@@ -29,5 +29,5 @@
* @param result the results from the processing run
*/
void check(LayoutResult result);
-
+
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java Thu Jul 24 02:35:34 2008
@@ -61,7 +61,7 @@
static {
DebugHelper.registerStandardElementListObservers();
}
-
+
public static String[] readDisabledTestcases(File f) throws IOException {
List lines = new java.util.ArrayList();
Source stylesheet = new StreamSource(
@@ -78,7 +78,7 @@
}
return (String[])lines.toArray(new String[lines.size()]);
}
-
+
private static class FilenameHandler extends DefaultHandler {
private StringBuffer buffer = new StringBuffer(128);
private boolean readingFilename = false;
@@ -88,7 +88,7 @@
this.filenames = filenames;
}
- public void startElement(String namespaceURI, String localName, String qName,
+ public void startElement(String namespaceURI, String localName, String qName,
Attributes atts) throws SAXException {
if (qName != null && qName.equals("file")) {
buffer.setLength(0);
@@ -99,7 +99,7 @@
}
}
- public void endElement(String namespaceURI, String localName, String qName)
+ public void endElement(String namespaceURI, String localName, String qName)
throws SAXException {
if (qName != null && qName.equals("file")) {
readingFilename = false;
@@ -116,7 +116,7 @@
}
}
}
-
+
public static IOFileFilter decorateWithDisabledList(IOFileFilter filter) throws IOException {
String disabled = System.getProperty("fop.layoutengine.disabled");
if (disabled != null && disabled.length() > 0) {
@@ -126,7 +126,7 @@
}
return filter;
}
-
+
/**
* @return a Collection of File instances containing all the test cases set up for processing.
* @throws IOException if there's a problem gathering the list of test files
@@ -150,18 +150,18 @@
if (testset == null) {
testset = "standard";
}
- Collection files = FileUtils.listFiles(new File(mainDir, testset + "-testcases"),
+ Collection files = FileUtils.listFiles(new File(mainDir, testset + "-testcases"),
filter, TrueFileFilter.INSTANCE);
String privateTests = System.getProperty("fop.layoutengine.private");
if ("true".equalsIgnoreCase(privateTests)) {
Collection privateFiles = FileUtils.listFiles(
- new File(mainDir, "private-testcases"),
+ new File(mainDir, "private-testcases"),
filter, TrueFileFilter.INSTANCE);
files.addAll(privateFiles);
}
return files;
}
-
+
/**
* @return the test suite with all the tests (one for each XML file)
* @throws IOException in case of an I/O problem
@@ -180,11 +180,11 @@
File f = (File)i.next();
addTestCase(suite, tester, f);
}
-
+
return suite;
}
-
- private static void addTestCase(TestSuite suite,
+
+ private static void addTestCase(TestSuite suite,
final LayoutEngineTester tester, final File f) {
suite.addTest(new LayoutEngineTestCase(f.getName()) {
public void runTest() throws Exception {
@@ -199,24 +199,24 @@
}
});
}
-
+
private static class LayoutEngineTestCase extends TestCase {
-
+
private LayoutEngineTester tester;
private File testFile;
-
+
public LayoutEngineTestCase(String name) {
super(name);
}
-
+
public void prepare(LayoutEngineTester tester, File testFile) {
//super(testFile.getName());
this.tester = tester;
this.testFile = testFile;
}
-
+
public void testMain() throws Exception {
tester.runTest(testFile);
}
- }
+ }
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/LayoutResult.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/LayoutResult.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/LayoutResult.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/LayoutResult.java Thu Jul 24 02:35:34 2008
@@ -30,7 +30,7 @@
private Document areaTree;
private ElementListCollector elCollector;
private FormattingResults results;
-
+
/**
* Creates a new LayoutResult instance.
* @param areaTree the area tree DOM
@@ -43,12 +43,12 @@
this.elCollector = elCollector;
this.results = results;
}
-
+
/** @return the generated area tree as DOM tree */
public Document getAreaTree() {
return this.areaTree;
}
-
+
/** @return the element list collector */
public ElementListCollector getElementListCollector() {
return this.elCollector;
@@ -60,5 +60,5 @@
public FormattingResults getResults() {
return results;
}
-
+
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/ResultCheck.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/ResultCheck.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/ResultCheck.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/ResultCheck.java Thu Jul 24 02:35:34 2008
@@ -29,7 +29,7 @@
private String expected;
private String property;
-
+
/**
* Creates a new instance
* @param expected expected value
@@ -39,7 +39,7 @@
this.expected = expected;
this.property = property;
}
-
+
/**
* Creates a new instance from a DOM node.
* @param node DOM node that defines this check
@@ -48,7 +48,7 @@
this.expected = node.getAttributes().getNamedItem("expected").getNodeValue();
this.property = node.getAttributes().getNamedItem("property").getNodeValue();
}
-
+
/* (non-Javadoc)
* @see LayoutEngineCheck#check(LayoutResult)
*/
@@ -62,7 +62,7 @@
}
if (!expected.equals(actual)) {
throw new RuntimeException(
- "Expected property to evaluate to '" + expected + "', but got '"
+ "Expected property to evaluate to '" + expected + "', but got '"
+ actual + "' (" + this + ")");
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/TrueCheck.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/TrueCheck.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/TrueCheck.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/TrueCheck.java Thu Jul 24 02:35:34 2008
@@ -36,7 +36,7 @@
private String xpath;
private String failureMessage;
private PrefixResolver prefixResolver;
-
+
/**
* Creates a new instance
* @param xpath XPath statement that needs to be evaluated
@@ -44,7 +44,7 @@
public TrueCheck(String xpath) {
this.xpath = xpath;
}
-
+
/**
* Creates a new instance from a DOM node.
* @param node DOM node that defines this check
@@ -57,7 +57,7 @@
}
this.prefixResolver = new PrefixResolverDefault(node);
}
-
+
/** @see org.apache.fop.layoutengine.LayoutEngineCheck */
public void check(LayoutResult result) {
XObject res;
@@ -71,7 +71,7 @@
throw new RuntimeException(failureMessage);
} else {
throw new RuntimeException(
- "Expected XPath expression to evaluate to 'true', but got '"
+ "Expected XPath expression to evaluate to 'true', but got '"
+ res + "' (" + this + ")");
}
}
@@ -82,5 +82,5 @@
public String toString() {
return "XPath: " + xpath;
}
-
+
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/memory/MemoryEater.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/memory/MemoryEater.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/memory/MemoryEater.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/memory/MemoryEater.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
@@ -50,29 +50,29 @@
= (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 = replicatorTemplates.newTransformer();
transformer.setParameter("repeats", new Integer(replicatorRepeats));
-
+
OutputStream out = new NullOutputStream(); //write to /dev/nul
FOUserAgent userAgent = fopFactory.newFOUserAgent();
userAgent.setBaseURL(foFile.getParentFile().toURL().toExternalForm());
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent, out);
Result res = new SAXResult(fop.getDefaultHandler());
-
+
transformer.transform(src, res);
-
+
System.out.println("Generated " + fop.getResults().getPageCount() + " pages.");
-
+
}
private static void prompt() throws IOException {
@@ -80,7 +80,7 @@
System.out.print("Press return to continue...");
in.readLine();
}
-
+
/**
* Main method.
* @param args the command-line arguments
@@ -97,24 +97,24 @@
runRepeats = Integer.parseInt(args[1]);
}
File testFile = new File("examples/fo/basic/readme.fo");
-
- System.out.println("MemoryEater! About to replicate the test file "
+
+ System.out.println("MemoryEater! About to replicate the test file "
+ replicatorRepeats + " times and run it " + runRepeats + " times...");
if (doPrompt) {
prompt();
}
-
- System.out.println("Processing...");
+
+ System.out.println("Processing...");
long start = System.currentTimeMillis();
-
+
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");
-
+
if (doPrompt) {
prompt();
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFObjectTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFObjectTestCase.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFObjectTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFObjectTestCase.java Thu Jul 24 02:35:34 2008
@@ -32,7 +32,7 @@
public class PDFObjectTestCase extends TestCase {
/**
- * Tests date/time formatting in PDFObject.
+ * Tests date/time formatting in PDFObject.
* @throws Exception if an error occurs
*/
public void testDateFormatting() throws Exception {
@@ -40,7 +40,7 @@
cal.set(2008, Calendar.FEBRUARY, 07, 15, 11, 07);
cal.set(Calendar.MILLISECOND, 0);
Date dt = cal.getTime();
-
+
MyPDFObject obj = new MyPDFObject();
String s = obj.formatDateTime(dt, TimeZone.getTimeZone("GMT"));
assertEquals("D:20080207151107Z", s);
@@ -51,9 +51,9 @@
s = obj.formatDateTime(dt, TimeZone.getTimeZone("GMT-08:00"));
assertEquals("D:20080207071107-08'00'", s);
}
-
+
private class MyPDFObject extends PDFObject {
-
+
}
-
+
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/BasePDFTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/BasePDFTestCase.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/BasePDFTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/BasePDFTestCase.java Thu Jul 24 02:35:34 2008
@@ -113,7 +113,7 @@
return e;
}
- /**
+ /**
* get FOP config File
* @return user config file to be used for testing
*/
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFAMetadataTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFAMetadataTestCase.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFAMetadataTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFAMetadataTestCase.java Thu Jul 24 02:35:34 2008
@@ -46,11 +46,11 @@
dc.setTitle("MyTitle");
dc.setDescription(null, "MySubject");
dc.addCreator("That's me");
-
+
AdobePDFAdapter pdf = AdobePDFSchema.getAdapter(meta);
pdf.setKeywords("XSL-FO XML");
pdf.setProducer("SuperFOP");
-
+
XMPBasicAdapter xmp = XMPBasicSchema.getAdapter(meta);
xmp.setCreatorTool("WonderFOP");
Calendar cal1 = Calendar.getInstance(TimeZone.getTimeZone("Europe/Zurich"));
@@ -61,11 +61,11 @@
cal2.set(2007, Calendar.JUNE, 6, 8, 15, 59);
cal2.set(Calendar.MILLISECOND, 0);
xmp.setModifyDate(cal2.getTime());
-
+
PDFInfo info = new PDFInfo();
assertNull(info.getTitle());
PDFMetadata.updateInfoFromMetadata(meta, info);
-
+
assertEquals("MyTitle", info.getTitle());
assertEquals("MySubject", info.getSubject());
assertEquals("That's me", info.getAuthor());
@@ -75,7 +75,7 @@
assertEquals(cal1.getTime(), info.getCreationDate());
assertEquals(cal2.getTime(), info.getModDate());
}
-
+
public void testXMPUpdate() throws Exception {
PDFDocument doc = new PDFDocument("SuperFOP");
PDFInfo info = doc.getInfo();
@@ -93,9 +93,9 @@
cal2.set(2007, Calendar.JUNE, 6, 8, 15, 59);
cal2.set(Calendar.MILLISECOND, 0);
info.setModDate(cal2.getTime());
-
+
Metadata meta = PDFMetadata.createXMPFromPDFDocument(doc);
-
+
DublinCoreAdapter dc = DublinCoreSchema.getAdapter(meta);
assertEquals("MyTitle", dc.getTitle());
assertEquals("MySubject", dc.getDescription());
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
@@ -27,10 +27,10 @@
/** Simple sanity test of the PDFCmap class */
public class PDFCMapTestCase extends TestCase {
-
+
public void testPDFCMapFillInPDF() throws Exception {
final String EOL = "\n";
- final String expected =
+ final String expected =
"%!PS-Adobe-3.0 Resource-CMap" + EOL
+"%%DocumentNeededResources: ProcSet (CIDInit)" + EOL
+"%%IncludeResource: ProcSet (CIDInit)" + EOL
@@ -60,7 +60,7 @@
+"%%EndResource" + EOL
+"%%EOF" + EOL
;
-
+
final StringWriter w = new StringWriter();
final CMapBuilder builder = new CMapBuilder(w, "test");
builder.writeCMap();
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFEncodingTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFEncodingTestCase.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFEncodingTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFEncodingTestCase.java Thu Jul 24 02:35:34 2008
@@ -59,15 +59,15 @@
*/
public void testPDFEncodingWithStandardFont() throws Exception {
- /* If the PDF encoding is correct, a text dump of the generated PDF file contains this (excerpts)
+ /* If the PDF encoding is correct, a text dump of the generated PDF file contains this (excerpts)
* ...Tm [(PDFE_TEST_MARK_2:) ( ) (This) ( ) (is) ...(acute:) ( ) (XX_\351_XX) ] TJ
* ...Tm [(PDFE_TEST_MARK_3:) ( ) (This) ( ) (is) ...(letter:) ( ) (XX_\342\352\356\364\373_XX) ] TJ
* The following array is used to look for these patterns
- */
- final String[] testPatterns = {
+ */
+ final String[] testPatterns = {
TEST_MARKER + "1", "Standard",
- TEST_MARKER + "2", "XX_\\351_XX",
- TEST_MARKER + "3", "XX_\\342\\352\\356\\364\\373_XX"
+ TEST_MARKER + "2", "XX_\\351_XX",
+ TEST_MARKER + "3", "XX_\\342\\352\\356\\364\\373_XX"
};
runTest("test-standard-font.fo", testPatterns);
@@ -78,21 +78,21 @@
* encoding when custom font is used.
* TODO This should be tested using PDFBox. If PDFBox can extract the text correctly,
* everything is fine. The tests here are too unstable.
- *
+ *
* @throws Exception
* checkstyle wants a comment here, even a silly one
*/
public void DISABLEDtestPDFEncodingWithCustomFont() throws Exception {
- /* If the PDF encoding is correct, a text dump of the generated PDF file contains this (excerpts)
+ /* If the PDF encoding is correct, a text dump of the generated PDF file contains this (excerpts)
* ...Tm [(PDFE_TEST_MARK_2:) ( ) (This) ( ) (is) ...(acute:) ( ) (XX_\351_XX) ] TJ
* ...Tm [(PDFE_TEST_MARK_3:) ( ) (This) ( ) (is) ...(letter:) ( ) (XX_\342\352\356\364\373_XX) ] TJ
* The following array is used to look for these patterns
- */
- final String[] testPatterns = {
+ */
+ final String[] testPatterns = {
TEST_MARKER + "1", "(Gladiator)",
- TEST_MARKER + "2", "XX_\\351_XX",
- TEST_MARKER + "3", "XX_\\342\\352\\356\\364\\373_XX"
+ TEST_MARKER + "2", "XX_\\351_XX",
+ TEST_MARKER + "3", "XX_\\342\\352\\356\\364\\373_XX"
};
runTest("test-custom-font.fo", testPatterns);
@@ -109,7 +109,7 @@
/**
* Check character encodings in the generated PDF data, by reading text
* lines identified by markers and checking their content
- *
+ *
* @throws IOException
*/
private void checkEncoding(byte[] pdf, String[] testPattern)
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFsRGBSettingsTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFsRGBSettingsTestCase.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFsRGBSettingsTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFsRGBSettingsTestCase.java Thu Jul 24 02:35:34 2008
@@ -46,7 +46,7 @@
a.getRendererOptions().put("disable-srgb-colorspace", Boolean.TRUE);
return a;
}
-
+
/**
* Verify that the PDFRenderer complains if PDF/A or PDF/X is used when sRGB is disabled.
* @throws Exception if the test fails
@@ -60,5 +60,5 @@
//exception expected!
}
}
-
+
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/Bug39607TestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/Bug39607TestCase.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/Bug39607TestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/Bug39607TestCase.java Thu Jul 24 02:35:34 2008
@@ -51,7 +51,7 @@
paragraph.newText("Testing fop - rtf module - class RtfTableRow");
paragraph.close();
- RtfTable table = section.newTable(null);
+ RtfTable table = section.newTable(null);
RtfTableRow row = table.newTableRow();
row.newTableCell(2000).newParagraph().newText("blah");
row.newTableCell(5000).newParagraph().newText("doubleBlah");
@@ -61,5 +61,5 @@
doc.close();
f.flush();
}
-
+
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/RichTextFormatTestSuite.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/RichTextFormatTestSuite.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/RichTextFormatTestSuite.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/RichTextFormatTestSuite.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.rtf;
import junit.framework.Test;
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/BasicLink.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/BasicLink.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/BasicLink.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/BasicLink.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/CreateTestDocuments.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/CreateTestDocuments.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/CreateTestDocuments.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/CreateTestDocuments.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/DummyTableColumnsInfo.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/DummyTableColumnsInfo.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/DummyTableColumnsInfo.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/DummyTableColumnsInfo.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/ExternalGraphic.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/ExternalGraphic.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/ExternalGraphic.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/ExternalGraphic.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/ListInTable.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/ListInTable.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/ListInTable.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/ListInTable.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/MergedTableCells.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/MergedTableCells.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/MergedTableCells.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/MergedTableCells.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/NestedTable.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/NestedTable.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/NestedTable.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/NestedTable.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/ParagraphAlignment.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/ParagraphAlignment.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/ParagraphAlignment.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/ParagraphAlignment.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/SimpleDocument.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/SimpleDocument.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/SimpleDocument.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/SimpleDocument.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/SimpleLists.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/SimpleLists.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/SimpleLists.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/SimpleLists.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/SimpleTable.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/SimpleTable.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/SimpleTable.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/SimpleTable.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/TestDocument.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/TestDocument.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/TestDocument.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/TestDocument.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/TextAttributes.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/TextAttributes.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/TextAttributes.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/TextAttributes.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/Whitespace.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/Whitespace.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/Whitespace.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/rtf/rtflib/testdocs/Whitespace.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/text/linebreak/LineBreakStatusTest.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/text/linebreak/LineBreakStatusTest.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/text/linebreak/LineBreakStatusTest.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/text/linebreak/LineBreakStatusTest.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
@@ -31,7 +31,7 @@
/*
* These symbols are used to indicate the break action returned
* by the paragraph breaking. Their meaning is as per Unicode
- * <a href="http://unicode.org/reports/tr14/#PairBasedImplementation">technical
+ * <a href="http://unicode.org/reports/tr14/#PairBasedImplementation">technical
* report #14</a>.
*/
private static final String BREAK_ACTION = "_%#@^!";
@@ -51,7 +51,7 @@
*/
public static Test suite() {
TestSuite suite = new TestSuite(LineBreakStatusTest.class);
-
+
return suite;
}
@@ -69,106 +69,106 @@
*/
public void testNextChar() {
System.out.println("testNextChar");
-
+
// AL -- Ordinary Alphabetic and Symbol Characters (XP)
assertTrue(testBreak(
- "Nobreak",
+ "Nobreak",
"^^^^^^^"
));
-
+
// BA -- Break Opportunity After (A)
assertTrue(testBreak(
- "Thin Space" + "\u2009" + "break",
+ "Thin Space" + "\u2009" + "break",
"^^^^^%^^^^" + "^" + "_^^^^"
));
assertTrue(testBreak(
- "Shy" + "\u00AD" + "break",
+ "Shy" + "\u00AD" + "break",
"^^^" + "^" + "_^^^^"
));
// BB -- Break opportunites before characters (B)
assertTrue(testBreak(
- "Acute Accent" + "\u00B4" + "break",
+ "Acute Accent" + "\u00B4" + "break",
"^^^^^^%^^^^^" + "_" + "^^^^^"
));
// B2 -- Break Opportunity Before and After (B/A/XP)
assertTrue(testBreak(
- "Em Dash" + "\u2014" + "break",
+ "Em Dash" + "\u2014" + "break",
"^^^%^^^" + "_" + "_^^^^"
));
assertTrue(testBreak(
- "Em Dash Dash" + "\u2014" + "\u2014" + "break",
+ "Em Dash Dash" + "\u2014" + "\u2014" + "break",
"^^^%^^^^%^^^" + "_" + "^" + "_^^^^"
));
// BK Mandatory Break (A) -- normative
assertTrue(testBreak(
- "Form Feed" + "\u000C" + "break",
+ "Form Feed" + "\u000C" + "break",
"^^^^^%^^^" + "^" + "!^^^^"
));
assertTrue(testBreak(
- "Line Separator" + "\u2028" + "break",
+ "Line Separator" + "\u2028" + "break",
"^^^^^%^^^^^^^^" + "^" + "!^^^^"
));
assertTrue(testBreak(
- "Paragraph Separator" + "\u2029" + "break",
+ "Paragraph Separator" + "\u2029" + "break",
"^^^^^^^^^^%^^^^^^^^" + "^" + "!^^^^"
));
// CB Contingent Break Opportunity (B/A) -- normative
// TODO Don't know quite what to do here
-
+
// CL -- Closing Punctuation (XB)
assertTrue(testBreak(
- "Right Parenthesis ) break",
+ "Right Parenthesis ) break",
"^^^^^^%^^^^^^^^^^^^^%^^^^"
));
-
+
// CM -- Attached Characters and Combining Marks (XB) -- normative
assertTrue(testBreak(
- "Grave Accent" + "\u0300" + " break",
+ "Grave Accent" + "\u0300" + " break",
"^^^^^^%^^^^^" + "^" + "^%^^^^"
));
-
+
// CR -- Carriage Return (A) -- normative
assertTrue(testBreak(
- "CR" + "\r" + "break",
+ "CR" + "\r" + "break",
"^^" + "^" + "!^^^^"
));
-
+
assertTrue(testBreak(
- "CRLF" + "\r\n" + "break",
+ "CRLF" + "\r\n" + "break",
"^^^^" + "^^" + "!^^^^"
));
-
+
// EX -- Exclamation / interrogation (XB)
assertTrue(testBreak(
- "EX CL ! ) break",
+ "EX CL ! ) break",
"^^^%^^^^^^%^^^^"
));
-
+
assertTrue(testBreak(
- "EX Wave Dash ! " + "\u301C" + " break",
+ "EX Wave Dash ! " + "\u301C" + " break",
"^^^%^^^^%^^^^^^" + "%" + "^_^^^^"
));
-
+
// GL -- Non-breaking ("Glue") (XB/XA) -- normative
assertTrue(testBreak(
- "No" + "\u00a0" + "break",
+ "No" + "\u00a0" + "break",
"^^" + "^" + "^^^^^"
));
-
+
assertTrue(testBreak(
- "Non" + "\u2011" + " Hyphen",
+ "Non" + "\u2011" + " Hyphen",
"^^^" + "^" + "^%^^^^^"
));
-
+
// H2 -- Hangul LVT Syllable (B/A)
// TODO
@@ -177,40 +177,40 @@
// HY -- Hyphen Minus
assertTrue(testBreak(
- "Normal-Hyphen",
+ "Normal-Hyphen",
"^^^^^^^_^^^^^"
));
assertTrue(testBreak(
- "Normal - Hyphen",
+ "Normal - Hyphen",
"^^^^^^^%^_^^^^^"
));
assertTrue(testBreak(
- "123-456",
+ "123-456",
"^^^^^^^"
));
assertTrue(testBreak(
- "123 - 456",
+ "123 - 456",
"^^^^%^%^^"
));
// ID -- Ideographic (B/A)
assertTrue(testBreak(
- "\u4E00" + "\u3000" + "\u4E02",
+ "\u4E00" + "\u3000" + "\u4E02",
"^" + "_" + "_"
));
// IN -- Inseperable characters (XP)
assertTrue(testBreak(
- "IN " + "\u2024" + "\u2025" + "\u2026",
+ "IN " + "\u2024" + "\u2025" + "\u2026",
"^^^" + "%" + "^" + "^"
));
// IS -- Numeric Separator (Infix) (XB)
assertTrue(testBreak(
- "123,456.00 12:59",
+ "123,456.00 12:59",
"^^^^^^^^^^^%^^^^"
));
@@ -225,13 +225,13 @@
// LF -- Line Feed (A) -- normative
assertTrue(testBreak(
- "Simple" + "\n" + "\n" + "break",
+ "Simple" + "\n" + "\n" + "break",
"^^^^^^" + "^" + "!" + "!^^^^"
));
// NL -- Next Line (A) -- normative
assertTrue(testBreak(
- "NL" + "\u0085" + "break",
+ "NL" + "\u0085" + "break",
"^^" + "^" + "!^^^^"
));
@@ -243,80 +243,80 @@
// OP -- Opening Punctuation (XA)
assertTrue(testBreak(
- "[ Bracket ( Parenthesis",
+ "[ Bracket ( Parenthesis",
"^^^^^^^^^^%^^^^^^^^^^^^"
));
-
+
// PO -- Postfix (Numeric) (XB)
assertTrue(testBreak(
- "(12.00)%",
+ "(12.00)%",
"^^^^^^^^"
));
// PR -- Prefix (Numeric) (XA)
assertTrue(testBreak(
- "$1000.00",
+ "$1000.00",
"^^^^^^^^"
));
// QU -- Ambiguous Quotation (XB/XA)
assertTrue(testBreak(
- "'In Quotes'",
+ "'In Quotes'",
"^^^^%^^^^^^"
));
assertTrue(testBreak(
- "' (In Quotes) '",
+ "' (In Quotes) '",
"^^^^^^%^^^^^^^%"
));
// SA -- Complex-context Dependent Characters (South East Asian) (P)
// TODO
-
+
// SP -- Space (A) -- normative
assertTrue(testBreak(
- "Simple break",
+ "Simple break",
"^^^^^^^%^^^^"
));
assertTrue(testBreak(
- "Simple break2",
+ "Simple break2",
"^^^^^^^^^^%^^^^^"
));
// SY -- Symbols Allowing Break After (A)
assertTrue(testBreak(
- "http://xmlgraphics.apache.org/fop",
+ "http://xmlgraphics.apache.org/fop",
"^^^^^^^_^^^^^^^^^^^^^^^^^^^^^^_^^"
));
assertTrue(testBreak(
- "1/2 31/10/2005",
+ "1/2 31/10/2005",
"^^^^%^^^^^^^^^"
));
// WJ -- Word Joiner (XA/XB) -- (normative)
assertTrue(testBreak(
- "http://" + "\u2060" + "xmlgraphics.apache.org/" + "\uFEFF" + "fop",
+ "http://" + "\u2060" + "xmlgraphics.apache.org/" + "\uFEFF" + "fop",
"^^^^^^^" + "^" + "^^^^^^^^^^^^^^^^^^^^^^^" + "^" + "^^^"
));
assertTrue(testBreak(
- "Simple " + "\u2060" + "break",
+ "Simple " + "\u2060" + "break",
"^^^^^^^" + "^" + "^^^^^"
));
assertTrue(testBreak(
- "Simple" + "\u200B" + "\u2060" + "break",
+ "Simple" + "\u200B" + "\u2060" + "break",
"^^^^^^" + "^" + "_" + "^^^^^"
));
// XX -- Unknown (XP)
// TODO
-
+
// ZW -- Zero Width Space (A) -- (normative)
assertTrue(testBreak(
- "Simple" + "\u200B" + "break",
+ "Simple" + "\u200B" + "break",
"^^^^^^" + "^" + "_^^^^"
));
@@ -340,8 +340,8 @@
if (BREAK_ACTION.charAt(breakAction) != breakActions.charAt(i)) {
System.err.println(paragraph);
System.err.println(breakActions);
- System.err.println("pos = " + i
- + " expected '" + breakActions.charAt(i)
+ System.err.println("pos = " + i
+ + " expected '" + breakActions.charAt(i)
+ "' got '" + BREAK_ACTION.charAt(breakAction) + "'");
result = false;
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/text/linebreak/LineBreakUtilsTest.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/text/linebreak/LineBreakUtilsTest.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/text/linebreak/LineBreakUtilsTest.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/text/linebreak/LineBreakUtilsTest.java Thu Jul 24 02:35:34 2008
@@ -1,13 +1,13 @@
-/*
+/*
* 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.
@@ -23,7 +23,7 @@
/**
* TODO add javadoc
- *
+ *
*
*/
public class LineBreakUtilsTest extends TestCase {
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/threading/FOPTestbed.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/threading/FOPTestbed.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/threading/FOPTestbed.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/threading/FOPTestbed.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
@@ -46,7 +46,7 @@
* Testbed for multi-threading tests. The class can run a configurable set of task a number of
* times in a configurable number of threads to easily reproduce multi-threading issues.
*/
-public class FOPTestbed extends AbstractLogEnabled
+public class FOPTestbed extends AbstractLogEnabled
implements Configurable, Initializable {
private int repeat;
@@ -57,7 +57,7 @@
private FOProcessor foprocessor;
private int counter = 0;
-
+
/** {@inheritDoc} */
public void configure(Configuration configuration) throws ConfigurationException {
this.threads = configuration.getChild("threads").getValueAsInteger(10);
@@ -83,7 +83,7 @@
getLogger().info("Starting stress test...");
long start = System.currentTimeMillis();
this.counter = 0;
-
+
//Initialize threads
List threadList = new java.util.LinkedList();
for (int ti = 0; ti < this.threads; ti++) {
@@ -92,13 +92,13 @@
Thread thread = new Thread(runner);
threadList.add(thread);
}
-
+
//Start threads
Iterator i = threadList.iterator();
while (i.hasNext()) {
((Thread)i.next()).start();
}
-
+
//Wait for threads to end
while (threadList.size() > 0) {
Thread t = (Thread)threadList.get(0);
@@ -116,7 +116,7 @@
}
private class TaskRunner extends AbstractLogEnabled implements Runnable {
-
+
public void run() {
try {
for (int r = 0; r < repeat; r++) {
@@ -134,14 +134,14 @@
}
}
-
+
/**
* Creates a new FOProcessor.
* @return the newly created instance
*/
public FOProcessor createFOProcessor() {
try {
- Class clazz = Class.forName(this.fopCfg.getAttribute("class",
+ Class clazz = Class.forName(this.fopCfg.getAttribute("class",
"org.apache.fop.threading.FOProcessorImpl"));
FOProcessor fop = (FOProcessor)clazz.newInstance();
ContainerUtil.enableLogging(fop, getLogger());
@@ -152,7 +152,7 @@
throw new CascadingRuntimeException("Error creating FO Processor", e);
}
}
-
+
private class TaskDef {
private String fo;
@@ -228,7 +228,7 @@
try {
InputStream in;
Templates templates;
-
+
if (def.getFO() != null) {
in = new java.io.FileInputStream(new File(def.getFO()));
templates = null;
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/threading/FOProcessor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/threading/FOProcessor.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/threading/FOProcessor.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/threading/FOProcessor.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/threading/FOProcessorImpl.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/threading/FOProcessorImpl.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/threading/FOProcessorImpl.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/threading/FOProcessorImpl.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
@@ -71,7 +71,7 @@
}
/** {@inheritDoc} */
- public void process(InputStream in, Templates templates, OutputStream out)
+ public void process(InputStream in, Templates templates, OutputStream out)
throws org.apache.fop.apps.FOPException, java.io.IOException {
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
Fop fop = fopFactory.newFop(this.mime, foUserAgent, out);
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/threading/Main.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/threading/Main.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/threading/Main.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/threading/Main.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* 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.
@@ -39,7 +39,7 @@
System.out.print("Press return to continue...");
in.readLine();
}
-
+
/**
* Main method.
* @param args the command-line arguments
@@ -50,21 +50,21 @@
File cfgFile = new File(args[0]);
DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
Configuration cfg = builder.buildFromFile(cfgFile);
-
+
boolean doPrompt = cfg.getAttributeAsBoolean("prompt", false);
if (doPrompt) {
prompt();
}
-
+
//Setup testbed
FOPTestbed testbed = new FOPTestbed();
ContainerUtil.enableLogging(testbed, new ConsoleLogger(ConsoleLogger.LEVEL_INFO));
ContainerUtil.configure(testbed, cfg);
ContainerUtil.initialize(testbed);
-
+
//Start tests
testbed.doStressTest();
-
+
System.exit(0);
} catch (Exception e) {
System.err.println(ExceptionUtil.printStackTrace(e));
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/traits/BorderPropsTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/traits/BorderPropsTestCase.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/traits/BorderPropsTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/traits/BorderPropsTestCase.java Thu Jul 24 02:35:34 2008
@@ -39,18 +39,18 @@
Color col = new Color(1.0f, 1.0f, 0.5f, 1.0f);
//Normalize: Avoid false alarms due to color conversion (rounding)
col = ColorUtil.parseColorString(null, ColorUtil.colorToString(col));
-
- BorderProps b1 = new BorderProps(Constants.EN_DOUBLE, 1250,
+
+ BorderProps b1 = new BorderProps(Constants.EN_DOUBLE, 1250,
col, BorderProps.COLLAPSE_OUTER);
String ser = b1.toString();
BorderProps b2 = BorderProps.valueOf(null, ser);
assertEquals(b1, b2);
- b1 = new BorderProps(Constants.EN_INSET, 9999,
+ b1 = new BorderProps(Constants.EN_INSET, 9999,
col, BorderProps.SEPARATE);
ser = b1.toString();
b2 = BorderProps.valueOf(null, ser);
assertEquals(b1, b2);
}
-
+
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/util/AdvancedMessageFormatTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/util/AdvancedMessageFormatTestCase.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/util/AdvancedMessageFormatTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/util/AdvancedMessageFormatTestCase.java Thu Jul 24 02:35:34 2008
@@ -36,7 +36,7 @@
public void testFormatting() throws Exception {
String msg;
AdvancedMessageFormat format;
-
+
String pattern
= "Element \"{elementName}\" is missing[ required property \"{propertyName}\"]!";
format = new AdvancedMessageFormat(pattern);
@@ -45,14 +45,14 @@
params.put("node", new Object());
params.put("elementName", "fo:external-graphic");
params.put("propertyName", "src");
-
+
msg = format.format(params);
assertEquals("Element \"fo:external-graphic\" is missing required property \"src\"!", msg);
-
+
params.remove("propertyName");
msg = format.format(params);
assertEquals("Element \"fo:external-graphic\" is missing!", msg);
-
+
pattern
= "Testing \\{escaped \\[characters\\], now a normal field {elementName}!";
format = new AdvancedMessageFormat(pattern);
@@ -61,11 +61,11 @@
pattern = "Multi-conditional: [case1: {var1}|case2: {var2}|case3: {var3}]";
format = new AdvancedMessageFormat(pattern);
-
+
params = new java.util.HashMap();
msg = format.format(params);
assertEquals("Multi-conditional: ", msg);
-
+
params.put("var3", "value3");
msg = format.format(params);
assertEquals("Multi-conditional: case3: value3", msg);
@@ -73,11 +73,11 @@
msg = format.format(params);
assertEquals("Multi-conditional: case1: value1", msg);
}
-
+
public void testObjectFormatting() throws Exception {
String msg;
AdvancedMessageFormat format;
-
+
String pattern
= "Here's a Locator: {locator}";
format = new AdvancedMessageFormat(pattern);
@@ -87,15 +87,15 @@
loc.setColumnNumber(7);
loc.setLineNumber(12);
params.put("locator", loc);
-
+
msg = format.format(params);
assertEquals("Here\'s a Locator: 12:7", msg);
}
-
+
public void testIfFormatting() throws Exception {
String msg;
AdvancedMessageFormat format;
-
+
format = new AdvancedMessageFormat("You are{isBad,if, not} nice!");
Map params = new java.util.HashMap();
@@ -138,11 +138,11 @@
msg = format.format(params);
assertEquals("You are very, very nice!", msg);
}
-
+
public void testEqualsFormatting() throws Exception {
String msg;
AdvancedMessageFormat format;
-
+
format = new AdvancedMessageFormat(
"Error{severity,equals,EventSeverity:FATAL,,\nSome explanation!}");
@@ -156,11 +156,11 @@
msg = format.format(params);
assertEquals("Error\nSome explanation!", msg);
}
-
+
public void testChoiceFormatting() throws Exception {
String msg;
AdvancedMessageFormat format;
-
+
format = new AdvancedMessageFormat(
"You have {amount,choice,0#nothing|0<{amount} bucks|100<more than enough}.");
@@ -179,5 +179,5 @@
assertEquals("You have more than enough.", msg);
}
-
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org