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

Quick Search    Search Deep

org.apache.batik.apps.rasterizer
Class TranscoderConfigTest  view TranscoderConfigTest download TranscoderConfigTest.java

java.lang.Object
  extended byorg.apache.batik.test.AbstractTest
      extended byorg.apache.batik.apps.rasterizer.AbstractConfigTest
          extended byorg.apache.batik.apps.rasterizer.TranscoderConfigTest
All Implemented Interfaces:
SVGConverterController, org.apache.batik.test.Test

class TranscoderConfigTest
extends AbstractConfigTest

Provides a simple string constructor which allows the user to create a given test to check that a specific transcoder class is used for a given mime type.


Nested Class Summary
(package private) static class AbstractConfigTest.Config
          Configuration Description
 
Field Summary
protected  AbstractConfigTest.Config computedConfig
           
(package private) static java.lang.String DEST_FILE_NAME
           
protected  DestinationType dstType
           
static java.lang.String ENTRY_KEY_COMPUTED_DEST_AT_INDEX
           
static java.lang.String ENTRY_KEY_COMPUTED_DEST_LIST
           
static java.lang.String ENTRY_KEY_COMPUTED_HINT_VALUE
           
static java.lang.String ENTRY_KEY_COMPUTED_HINTS
           
static java.lang.String ENTRY_KEY_COMPUTED_NUMBER_OF_DEST
           
static java.lang.String ENTRY_KEY_COMPUTED_NUMBER_OF_HINTS
           
static java.lang.String ENTRY_KEY_COMPUTED_NUMBER_OF_SOURCES
           
static java.lang.String ENTRY_KEY_COMPUTED_SOURCE_AT_INDEX
           
static java.lang.String ENTRY_KEY_COMPUTED_SOURCES_LIST
           
static java.lang.String ENTRY_KEY_COMPUTED_TRANSCODER_CLASS
           
static java.lang.String ENTRY_KEY_EXPECTED_DEST_AT_INDEX
           
static java.lang.String ENTRY_KEY_EXPECTED_DEST_LIST
           
static java.lang.String ENTRY_KEY_EXPECTED_HINT_KEY
           
static java.lang.String ENTRY_KEY_EXPECTED_HINT_VALUE
           
static java.lang.String ENTRY_KEY_EXPECTED_HINTS
           
static java.lang.String ENTRY_KEY_EXPECTED_NUMBER_OF_DEST
           
static java.lang.String ENTRY_KEY_EXPECTED_NUMBER_OF_HINTS
           
static java.lang.String ENTRY_KEY_EXPECTED_NUMBER_OF_SOURCES
           
static java.lang.String ENTRY_KEY_EXPECTED_SOURCE_AT_INDEX
           
static java.lang.String ENTRY_KEY_EXPECTED_SOURCES_LIST
           
static java.lang.String ENTRY_KEY_EXPECTED_TRANSCODER_CLASS
           
static java.lang.String ERROR_NO_COMPUTED_TASK
          The 'proceedWithComputedTask' handler was not called
static java.lang.String ERROR_UNEXPECTED_DEST_LIST
          Error if the dest do not match
static java.lang.String ERROR_UNEXPECTED_NUMBER_OF_HINTS
          Error if the hints do not match
static java.lang.String ERROR_UNEXPECTED_SOURCES_LIST
          Error if the sources do not match
static java.lang.String ERROR_UNEXPECTED_TRANSCODER_CLASS
          The transcoderClass is not the one expected.
static java.lang.String ERROR_UNEXPECTED_TRANSCODING_HINT
           
protected  AbstractConfigTest.Config expectedConfig
           
(package private) static java.lang.String SOURCE_FILE
           
 
Fields inherited from class org.apache.batik.test.AbstractTest
id, name, parent
 
Constructor Summary
TranscoderConfigTest(DestinationType dstType, java.lang.Class expectedTranscoderClass)
           
 
Method Summary
 void configure(SVGConverter c)
          Configures the test with the given mime type
 java.lang.String getName()
          Returns this Test's name.
protected  java.lang.String makeHintsString(java.util.HashMap map)
           
protected  java.lang.String makeSourceList(java.util.Vector v)
           
 void onSourceTranscodingSuccess(SVGConverterSource source, java.io.File dest)
          Invoked when the rasterizer successfully transcoded the input source.
 boolean proceedOnSourceTranscodingFailure(SVGConverterSource source, java.io.File dest, java.lang.String errorCode)
          Invoked when the rasterizer got an error while transcoding the input source.
 boolean proceedWithComputedTask(org.apache.batik.transcoder.Transcoder transcoder, java.util.Map hints, java.util.Vector sources, java.util.Vector dest)
          Invoked when the rasterizer has computed the exact description of what it should do.
 boolean proceedWithSourceTranscoding(SVGConverterSource source, java.io.File dest)
          Invoked when the rasterizer is about to start transcoding of a given source.
 org.apache.batik.test.TestReport runImpl()
          Subclasses should implement this method with the content of the test case.
protected  void setExpectedConfig(AbstractConfigTest.Config expectedConfig)
           
 
Methods inherited from class org.apache.batik.test.AbstractTest
assertEquals, assertEquals, assertNull, assertTrue, error, getId, 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

SOURCE_FILE

static final java.lang.String SOURCE_FILE
See Also:
Constant Field Values

DEST_FILE_NAME

static final java.lang.String DEST_FILE_NAME
See Also:
Constant Field Values

dstType

protected DestinationType dstType

ERROR_NO_COMPUTED_TASK

public static final java.lang.String ERROR_NO_COMPUTED_TASK
The 'proceedWithComputedTask' handler was not called

See Also:
Constant Field Values

ERROR_UNEXPECTED_TRANSCODER_CLASS

public static final java.lang.String ERROR_UNEXPECTED_TRANSCODER_CLASS
The transcoderClass is not the one expected.

See Also:
Constant Field Values

ENTRY_KEY_EXPECTED_TRANSCODER_CLASS

public static final java.lang.String ENTRY_KEY_EXPECTED_TRANSCODER_CLASS
See Also:
Constant Field Values

ENTRY_KEY_COMPUTED_TRANSCODER_CLASS

public static final java.lang.String ENTRY_KEY_COMPUTED_TRANSCODER_CLASS
See Also:
Constant Field Values

ERROR_UNEXPECTED_NUMBER_OF_HINTS

public static final java.lang.String ERROR_UNEXPECTED_NUMBER_OF_HINTS
Error if the hints do not match

See Also:
Constant Field Values

ENTRY_KEY_EXPECTED_NUMBER_OF_HINTS

public static final java.lang.String ENTRY_KEY_EXPECTED_NUMBER_OF_HINTS
See Also:
Constant Field Values

ENTRY_KEY_COMPUTED_NUMBER_OF_HINTS

public static final java.lang.String ENTRY_KEY_COMPUTED_NUMBER_OF_HINTS
See Also:
Constant Field Values

ENTRY_KEY_EXPECTED_HINTS

public static final java.lang.String ENTRY_KEY_EXPECTED_HINTS
See Also:
Constant Field Values

ENTRY_KEY_COMPUTED_HINTS

public static final java.lang.String ENTRY_KEY_COMPUTED_HINTS
See Also:
Constant Field Values

ERROR_UNEXPECTED_TRANSCODING_HINT

public static final java.lang.String ERROR_UNEXPECTED_TRANSCODING_HINT
See Also:
Constant Field Values

ENTRY_KEY_EXPECTED_HINT_KEY

public static final java.lang.String ENTRY_KEY_EXPECTED_HINT_KEY
See Also:
Constant Field Values

ENTRY_KEY_COMPUTED_HINT_VALUE

public static final java.lang.String ENTRY_KEY_COMPUTED_HINT_VALUE
See Also:
Constant Field Values

ENTRY_KEY_EXPECTED_HINT_VALUE

public static final java.lang.String ENTRY_KEY_EXPECTED_HINT_VALUE
See Also:
Constant Field Values

ERROR_UNEXPECTED_SOURCES_LIST

public static final java.lang.String ERROR_UNEXPECTED_SOURCES_LIST
Error if the sources do not match

See Also:
Constant Field Values

ENTRY_KEY_EXPECTED_NUMBER_OF_SOURCES

public static final java.lang.String ENTRY_KEY_EXPECTED_NUMBER_OF_SOURCES
See Also:
Constant Field Values

ENTRY_KEY_COMPUTED_NUMBER_OF_SOURCES

public static final java.lang.String ENTRY_KEY_COMPUTED_NUMBER_OF_SOURCES
See Also:
Constant Field Values

ENTRY_KEY_EXPECTED_SOURCE_AT_INDEX

public static final java.lang.String ENTRY_KEY_EXPECTED_SOURCE_AT_INDEX
See Also:
Constant Field Values

ENTRY_KEY_COMPUTED_SOURCE_AT_INDEX

public static final java.lang.String ENTRY_KEY_COMPUTED_SOURCE_AT_INDEX
See Also:
Constant Field Values

ENTRY_KEY_COMPUTED_SOURCES_LIST

public static final java.lang.String ENTRY_KEY_COMPUTED_SOURCES_LIST
See Also:
Constant Field Values

ENTRY_KEY_EXPECTED_SOURCES_LIST

public static final java.lang.String ENTRY_KEY_EXPECTED_SOURCES_LIST
See Also:
Constant Field Values

ERROR_UNEXPECTED_DEST_LIST

public static final java.lang.String ERROR_UNEXPECTED_DEST_LIST
Error if the dest do not match

See Also:
Constant Field Values

ENTRY_KEY_EXPECTED_NUMBER_OF_DEST

public static final java.lang.String ENTRY_KEY_EXPECTED_NUMBER_OF_DEST
See Also:
Constant Field Values

ENTRY_KEY_COMPUTED_NUMBER_OF_DEST

public static final java.lang.String ENTRY_KEY_COMPUTED_NUMBER_OF_DEST
See Also:
Constant Field Values

ENTRY_KEY_EXPECTED_DEST_AT_INDEX

public static final java.lang.String ENTRY_KEY_EXPECTED_DEST_AT_INDEX
See Also:
Constant Field Values

ENTRY_KEY_COMPUTED_DEST_AT_INDEX

public static final java.lang.String ENTRY_KEY_COMPUTED_DEST_AT_INDEX
See Also:
Constant Field Values

ENTRY_KEY_COMPUTED_DEST_LIST

public static final java.lang.String ENTRY_KEY_COMPUTED_DEST_LIST
See Also:
Constant Field Values

ENTRY_KEY_EXPECTED_DEST_LIST

public static final java.lang.String ENTRY_KEY_EXPECTED_DEST_LIST
See Also:
Constant Field Values

expectedConfig

protected AbstractConfigTest.Config expectedConfig

computedConfig

protected AbstractConfigTest.Config computedConfig
Constructor Detail

TranscoderConfigTest

public TranscoderConfigTest(DestinationType dstType,
                            java.lang.Class expectedTranscoderClass)
Method Detail

configure

public void configure(SVGConverter c)
Configures the test with the given mime type

Specified by:
configure in class AbstractConfigTest

setExpectedConfig

protected void setExpectedConfig(AbstractConfigTest.Config expectedConfig)

makeSourceList

protected java.lang.String makeSourceList(java.util.Vector v)

makeHintsString

protected java.lang.String makeHintsString(java.util.HashMap map)

getName

public java.lang.String getName()
Description copied from class: org.apache.batik.test.AbstractTest
Returns this Test's name.

Specified by:
getName in interface org.apache.batik.test.Test

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.


proceedWithComputedTask

public boolean proceedWithComputedTask(org.apache.batik.transcoder.Transcoder transcoder,
                                       java.util.Map hints,
                                       java.util.Vector sources,
                                       java.util.Vector dest)
Description copied from interface: SVGConverterController
Invoked when the rasterizer has computed the exact description of what it should do. The controller should return true if the transcoding process should proceed or false otherwise.

Specified by:
proceedWithComputedTask in interface SVGConverterController

proceedWithSourceTranscoding

public boolean proceedWithSourceTranscoding(SVGConverterSource source,
                                            java.io.File dest)
Description copied from interface: SVGConverterController
Invoked when the rasterizer is about to start transcoding of a given source. The controller should return true if the source should be transcoded and false otherwise.

Specified by:
proceedWithSourceTranscoding in interface SVGConverterController

proceedOnSourceTranscodingFailure

public boolean proceedOnSourceTranscodingFailure(SVGConverterSource source,
                                                 java.io.File dest,
                                                 java.lang.String errorCode)
Description copied from interface: SVGConverterController
Invoked when the rasterizer got an error while transcoding the input source. The controller should return true if the transcoding process should continue on other sources and it should return false if it should not.

Specified by:
proceedOnSourceTranscodingFailure in interface SVGConverterController

onSourceTranscodingSuccess

public void onSourceTranscodingSuccess(SVGConverterSource source,
                                       java.io.File dest)
Description copied from interface: SVGConverterController
Invoked when the rasterizer successfully transcoded the input source.

Specified by:
onSourceTranscodingSuccess in interface SVGConverterController