Package de.learnlib.driver.reflect
Class SimplePOJOExceptionMapper
- java.lang.Object
-
- de.learnlib.driver.reflect.SimplePOJOExceptionMapper
-
- All Implemented Interfaces:
Mapper<MethodInput,MethodOutput,MethodInput,MethodOutput>
,Mapper.SynchronousMapper<MethodInput,MethodOutput,MethodInput,MethodOutput>
,SULMapper<MethodInput,MethodOutput,MethodInput,MethodOutput>
public class SimplePOJOExceptionMapper extends Object implements SULMapper<MethodInput,MethodOutput,MethodInput,MethodOutput>
A mapper that wraps any kind ofRuntimeException
that occurs duringsteps
of theSimplePOJOTestDriver
into aMappedException
whose output is anError
object, followed by repeatedUnobserved
outputs.
-
-
Constructor Summary
Constructors Constructor Description SimplePOJOExceptionMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canFork()
Checks whether it is possible tofork
this mapper.SimplePOJOExceptionMapper
fork()
Forks this mapper, i.e., returns a mapper that behaves in exactly the same way as this mapper, but allows for being used independently of this mapper.MethodInput
mapInput(MethodInput input)
Method that maps an abstract input to a corresponding concrete input.MethodOutput
mapOutput(MethodOutput output)
Method that maps a concrete output to a corresponding abstract output.MappedException<? extends MethodOutput>
mapUnwrappedException(RuntimeException exception)
Maps an unwrappedRuntimeException
to an abstract output symbol, or rethrows it if it is unmappable.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.learnlib.sul.SULMapper
mapWrappedException
-
-
-
-
Method Detail
-
mapInput
public MethodInput mapInput(MethodInput input)
Description copied from interface:Mapper
Method that maps an abstract input to a corresponding concrete input.- Specified by:
mapInput
in interfaceMapper<MethodInput,MethodOutput,MethodInput,MethodOutput>
- Parameters:
input
- the abstract input- Returns:
- the concrete input
-
mapOutput
public MethodOutput mapOutput(MethodOutput output)
Description copied from interface:Mapper
Method that maps a concrete output to a corresponding abstract output.- Specified by:
mapOutput
in interfaceMapper<MethodInput,MethodOutput,MethodInput,MethodOutput>
- Parameters:
output
- the concrete output- Returns:
- the abstract output
-
canFork
public boolean canFork()
Description copied from interface:SULMapper
Checks whether it is possible tofork
this mapper.- Specified by:
canFork
in interfaceSULMapper<MethodInput,MethodOutput,MethodInput,MethodOutput>
- Returns:
true
if this mapper can be forked,false
otherwise.
-
fork
public SimplePOJOExceptionMapper fork()
Description copied from interface:SULMapper
Forks this mapper, i.e., returns a mapper that behaves in exactly the same way as this mapper, but allows for being used independently of this mapper.If
SULMapper.canFork()
returnedfalse
, this method must throw anUnsupportedOperationException
. Otherwise, it must return a non-null
object representing the fork of this mapper.- Specified by:
fork
in interfaceSULMapper<MethodInput,MethodOutput,MethodInput,MethodOutput>
- Returns:
- a fork of this mapper (for stateless mappers, generally
this
should be returned)
-
mapUnwrappedException
public MappedException<? extends MethodOutput> mapUnwrappedException(RuntimeException exception)
Description copied from interface:SULMapper
Maps an unwrappedRuntimeException
to an abstract output symbol, or rethrows it if it is unmappable.- Specified by:
mapUnwrappedException
in interfaceSULMapper<MethodInput,MethodOutput,MethodInput,MethodOutput>
- Parameters:
exception
- the runtime exception that was thrown- Returns:
- the concrete output symbol the exception was mapped to, if applicable
-
-