diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2011-10-04 10:09:01 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2011-10-04 10:09:01 +0000 |
commit | 91c66d97428aa57c844ec58e1deb07a8ab745574 (patch) | |
tree | d6062f718053ad636c8f587d5d5f199e9d158252 /test/java/org/apache/fop/render/ps | |
parent | 7d33c81a0a079336dd1ffcac97e4ee1dfba16c36 (diff) | |
download | xmlgraphics-fop-91c66d97428aa57c844ec58e1deb07a8ab745574.tar.gz xmlgraphics-fop-91c66d97428aa57c844ec58e1deb07a8ab745574.zip |
Bugzilla #51928: Upgraded all tests to JUnit 4
Patch by Mehdi Houshmand, applied with minor cosmetics and error fixes
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1178747 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java/org/apache/fop/render/ps')
4 files changed, 26 insertions, 24 deletions
diff --git a/test/java/org/apache/fop/render/ps/AbstractPostScriptTestCase.java b/test/java/org/apache/fop/render/ps/AbstractPostScriptTestCase.java index 30e499846..cdd1ee567 100644 --- a/test/java/org/apache/fop/render/ps/AbstractPostScriptTestCase.java +++ b/test/java/org/apache/fop/render/ps/AbstractPostScriptTestCase.java @@ -19,6 +19,8 @@ package org.apache.fop.render.ps; +import static org.junit.Assert.assertEquals; + import java.io.File; import java.io.IOException; diff --git a/test/java/org/apache/fop/render/ps/ImageHandlingTestCase.java b/test/java/org/apache/fop/render/ps/ImageHandlingTestCase.java index c127d82a5..f4c3617e3 100644 --- a/test/java/org/apache/fop/render/ps/ImageHandlingTestCase.java +++ b/test/java/org/apache/fop/render/ps/ImageHandlingTestCase.java @@ -18,13 +18,16 @@ /* $Id$ */ package org.apache.fop.render.ps; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import java.io.File; import java.io.IOException; import java.io.InputStream; import org.apache.commons.io.IOUtils; - +import org.apache.fop.apps.FOUserAgent; +import org.apache.fop.render.intermediate.IFContext; import org.apache.xmlgraphics.ps.DSCConstants; import org.apache.xmlgraphics.ps.PSResource; import org.apache.xmlgraphics.ps.dsc.DSCException; @@ -33,9 +36,7 @@ import org.apache.xmlgraphics.ps.dsc.events.DSCCommentPage; import org.apache.xmlgraphics.ps.dsc.events.DSCCommentPages; import org.apache.xmlgraphics.ps.dsc.events.DSCCommentTitle; import org.apache.xmlgraphics.ps.dsc.events.DSCEvent; - -import org.apache.fop.apps.FOUserAgent; -import org.apache.fop.render.intermediate.IFContext; +import org.junit.Test; /** * Tests the image handling in PostScript output. @@ -46,6 +47,7 @@ public class ImageHandlingTestCase extends AbstractPostScriptTestCase { * Tests JPEG handling. * @throws Exception if an error occurs */ + @Test public void testJPEGImageLevel3() throws Exception { innerTestJPEGImage(3); } @@ -54,6 +56,7 @@ public class ImageHandlingTestCase extends AbstractPostScriptTestCase { * Tests JPEG handling. * @throws Exception if an error occurs */ + @Test public void testJPEGImageLevel2() throws Exception { innerTestJPEGImage(2); } diff --git a/test/java/org/apache/fop/render/ps/PSTestSuite.java b/test/java/org/apache/fop/render/ps/PSTestSuite.java index 05ba2dac7..cf66d4776 100644 --- a/test/java/org/apache/fop/render/ps/PSTestSuite.java +++ b/test/java/org/apache/fop/render/ps/PSTestSuite.java @@ -19,25 +19,17 @@ package org.apache.fop.render.ps; -import junit.framework.Test; -import junit.framework.TestSuite; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; /** * Test suite for FOP's PostScript output. */ +@RunWith(Suite.class) +@SuiteClasses({ + ImageHandlingTestCase.class, + ResourceOptimizationTestCase.class +}) public class PSTestSuite { - - /** - * Builds the test suite - * @return the test suite - */ - public static Test suite() { - TestSuite suite = new TestSuite( - "Test suite for PostScript output"); - //$JUnit-BEGIN$ - suite.addTest(new TestSuite(ImageHandlingTestCase.class)); - suite.addTest(new TestSuite(ResourceOptimizationTestCase.class)); - //$JUnit-END$ - return suite; - } } diff --git a/test/java/org/apache/fop/render/ps/ResourceOptimizationTestCase.java b/test/java/org/apache/fop/render/ps/ResourceOptimizationTestCase.java index 327c86548..91787aca1 100644 --- a/test/java/org/apache/fop/render/ps/ResourceOptimizationTestCase.java +++ b/test/java/org/apache/fop/render/ps/ResourceOptimizationTestCase.java @@ -19,6 +19,11 @@ package org.apache.fop.render.ps; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -27,7 +32,8 @@ import java.util.Collection; import java.util.Set; import org.apache.commons.io.IOUtils; - +import org.apache.fop.apps.FOUserAgent; +import org.apache.fop.render.intermediate.IFContext; import org.apache.xmlgraphics.ps.DSCConstants; import org.apache.xmlgraphics.ps.PSResource; import org.apache.xmlgraphics.ps.dsc.DSCException; @@ -43,9 +49,7 @@ import org.apache.xmlgraphics.ps.dsc.events.DSCCommentEndOfFile; import org.apache.xmlgraphics.ps.dsc.events.DSCCommentIncludeResource; import org.apache.xmlgraphics.ps.dsc.events.DSCCommentPage; import org.apache.xmlgraphics.ps.dsc.events.DSCCommentPages; - -import org.apache.fop.apps.FOUserAgent; -import org.apache.fop.render.intermediate.IFContext; +import org.junit.Test; /** * Tests the PostScript resource optimization (selective de-duplication of @@ -57,6 +61,7 @@ public class ResourceOptimizationTestCase extends AbstractPostScriptTestCase { * Tests resource optimization. * @throws Exception if an error occurs */ + @Test public void testResourceOptimization() throws Exception { FOUserAgent ua = fopFactory.newFOUserAgent(); PSDocumentHandler handler = new PSDocumentHandler(); |