Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.batik.ext.awt.image.codec
Class PNGEncoderTest  view PNGEncoderTest download PNGEncoderTest.java

java.lang.Object
  extended byorg.apache.batik.test.AbstractTest
      extended byorg.apache.batik.ext.awt.image.codec.PNGEncoderTest
All Implemented Interfaces:
org.apache.batik.test.Test
Direct Known Subclasses:
Base64PNGEncoderTest

public class PNGEncoderTest
extends org.apache.batik.test.AbstractTest

This test validates the PNGEncoder operation. It creates a BufferedImage, then encodes it with the PNGEncoder, then decodes it and compares the decoded image with the original one.

Version:
$Id: PNGEncoderTest.java,v 1.4 2005/04/01 02:28:16 deweese Exp $

Field Summary
static java.lang.String ERROR_CANNOT_DECODE_IMAGE
          Error when image cannot be decoded {0} = trace for the exception which was reported
static java.lang.String ERROR_CANNOT_ENCODE_IMAGE
          Error when image cannot be encoded {0} = trace for the exception which was reported
static java.lang.String ERROR_DECODED_DOES_NOT_MATCH_ENCODED
          Decoded image differs from encoded image
 
Fields inherited from class org.apache.batik.test.AbstractTest
id, name, parent
 
Constructor Summary
PNGEncoderTest()
           
 
Method Summary
 java.io.InputStream buildInputStream(java.io.ByteArrayOutputStream bos)
          Template method for building the PNG input stream.
 java.io.OutputStream buildOutputStream(java.io.ByteArrayOutputStream bos)
          Template method for building the PNG output stream.
static boolean checkIdentical(java.awt.image.BufferedImage imgA, java.awt.image.BufferedImage imgB)
          Compares the data for the two images
 org.apache.batik.test.TestReport runImpl()
          Subclasses should implement this method with the content of the test case.
 
Methods inherited from class org.apache.batik.test.AbstractTest
assertEquals, assertEquals, assertNull, assertTrue, error, getId, getName, getParent, getQualifiedId, reportError, reportException, reportSuccess, run, runImplBasic, setId, setName, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR_CANNOT_ENCODE_IMAGE

public static final java.lang.String ERROR_CANNOT_ENCODE_IMAGE
Error when image cannot be encoded {0} = trace for the exception which was reported

See Also:
Constant Field Values

ERROR_CANNOT_DECODE_IMAGE

public static final java.lang.String ERROR_CANNOT_DECODE_IMAGE
Error when image cannot be decoded {0} = trace for the exception which was reported

See Also:
Constant Field Values

ERROR_DECODED_DOES_NOT_MATCH_ENCODED

public static final java.lang.String ERROR_DECODED_DOES_NOT_MATCH_ENCODED
Decoded image differs from encoded image

See Also:
Constant Field Values
Constructor Detail

PNGEncoderTest

public PNGEncoderTest()
Method Detail

runImpl

public org.apache.batik.test.TestReport runImpl()
                                         throws java.lang.Exception
Description copied from class: org.apache.batik.test.AbstractTest
Subclasses should implement this method with the content of the test case. Typically, implementations will choose to catch and process all exceptions and error conditions they are looking for in the code they exercise but will let exceptions due to their own processing propagate.


buildOutputStream

public java.io.OutputStream buildOutputStream(java.io.ByteArrayOutputStream bos)
Template method for building the PNG output stream. This gives a chance to sub-classes (e.g., Base64PNGEncoderTest) to add an additional encoding.


buildInputStream

public java.io.InputStream buildInputStream(java.io.ByteArrayOutputStream bos)
Template method for building the PNG input stream. This gives a chance to sub-classes (e.g., Base64PNGEncoderTest) to add an additional decoding.


checkIdentical

public static boolean checkIdentical(java.awt.image.BufferedImage imgA,
                                     java.awt.image.BufferedImage imgB)
Compares the data for the two images