org.specrunner.junit
Class SpecRunnerStatement

java.lang.Object
  extended by org.junit.runners.model.Statement
      extended by org.specrunner.junit.SpecRunnerStatement

public class SpecRunnerStatement
extends org.junit.runners.model.Statement

Generic statement for SpecRunner Junit extensions.

Author:
Thiago Santos

Constructor Summary
SpecRunnerStatement(org.junit.runners.model.TestClass test, Object instance, List<INodeListener> listeners)
          The testing object.
 
Method Summary
protected  IConfiguration configure(IConfiguration cfg)
          Set configuration.
 void evaluate()
           
protected  File getInput(Class<?> clazz)
          Get input file name.
protected  ExpectedMessages getMessages()
          Get expected messages if any.
protected  File getOutput(Class<?> clazz)
          Get output file name.
static String getOutputName(String name)
          Get the output name adjusted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpecRunnerStatement

public SpecRunnerStatement(org.junit.runners.model.TestClass test,
                           Object instance,
                           List<INodeListener> listeners)
The testing object.

Parameters:
test - The test meta-data.
instance - The test instance.
listeners - The listeners to activate.
Method Detail

getInput

protected File getInput(Class<?> clazz)
Get input file name.

Parameters:
clazz - The class.
Returns:
The corresponding file name.

getOutput

protected File getOutput(Class<?> clazz)
Get output file name.

Parameters:
clazz - The class.
Returns:
The corresponding file name.

evaluate

public void evaluate()
              throws Throwable
Specified by:
evaluate in class org.junit.runners.model.Statement
Throws:
Throwable

getMessages

protected ExpectedMessages getMessages()
Get expected messages if any.

Returns:
The list of error messages.

configure

protected IConfiguration configure(IConfiguration cfg)
                            throws Throwable
Set configuration.

Parameters:
cfg - The configuration.
Returns:
The configuration itself.
Throws:
Throwable - On configuration errors.

getOutputName

public static String getOutputName(String name)
Get the output name adjusted.

Parameters:
name - The original name.
Returns:
The adjusted name. ie. Excel (.xls,.xlsx) test files are transformed to HTML (.html).


Copyright © 2014. All rights reserved.