Package org.eclipse.epsilon.eunit
Class EUnitModule
- java.lang.Object
-
- org.eclipse.epsilon.common.module.AbstractModuleElement
-
- org.eclipse.epsilon.eol.AbstractModule
-
- org.eclipse.epsilon.eol.EolModule
-
- org.eclipse.epsilon.eunit.EUnitModule
-
- All Implemented Interfaces:
IModule
,ModuleElement
,IEolModule
,IEUnitModule
public class EUnitModule extends EolModule implements IEUnitModule
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_PACKAGE
Default package name for the JUnit reports.-
Fields inherited from class org.eclipse.epsilon.eol.EolModule
context, declaredModelDeclarations, declaredOperations, imports, main, modelDeclarations, operations, postOperationStatements
-
Fields inherited from class org.eclipse.epsilon.eol.AbstractModule
parseProblems, parser, sourceFile, sourceUri
-
-
Constructor Summary
Constructors Constructor Description EUnitModule()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addTestListener(EUnitTestListener listener)
Object
executeImpl()
static String
getBasename(ModuleElement moduleElement)
String
getClassName()
Returns the "class name" to be used for this module in JUnit-style reports.List<IModelComparator>
getCustomComparators()
List<Pair<Operation,String>>
getDataVariableNames()
List<Operation>
getInlineModelOperations()
protected List<ModelBindings>
getModelBindings(Operation opTest)
File
getModelCloneDirectory()
Returns the path to the directory which will store the clones used to freeze models during comparisons.String
getPackage()
Returns the package name to use in the reports.String
getQualifiedName()
Returns the logical name of this module as if it was a Java class, for the JUnit-style reports.File
getReportDirectory()
Returns the destination directory for the JUnit-style XML report.List<?>
getSelectedOperations()
List<Operation>
getSetups()
EUnitTest
getSuiteRoot()
List<Operation>
getSuiteSetups()
List<Operation>
getSuiteTeardowns()
List<Operation>
getTeardowns()
List<Operation>
getTests()
boolean
isAnnotatedAs(Operation operation, String annotation)
boolean
removeTestListener(EUnitTestListener listener)
void
runSuite(EUnitTest node)
void
setModelCloneDirectory(File modelCloneDirectory)
Changes the model clone directory.void
setPackage(String packageName)
Changes the package name to use in the reports.void
setReportDirectory(File reportFile)
If not null, a JUnit-style XML report will be saved to the specific destination directory.void
setSelectedOperations(List<?> attribute)
-
Methods inherited from class org.eclipse.epsilon.eol.EolModule
adapt, build, checkImports, clearCache, createLexer, createParser, execute, getContext, getDeclaredModelDeclarations, getDeclaredOperations, getImportConfiguration, getImports, getImportsByExtension, getMain, getMainRule, getModelDeclarations, getOperations, getParentModule, getPostOperationStatements, prepareContext, setContext, setMain, setParentModule, toString
-
Methods inherited from class org.eclipse.epsilon.eol.AbstractModule
assignAnnotations, assignComment, assignComments, createAst, extractComments, getParseProblems, getSourceFile, getSourceUri, invokeMainRule, parse, parse
-
Methods inherited from class org.eclipse.epsilon.common.module.AbstractModuleElement
equals, getChildren, getComments, getData, getDebugInfo, getFile, getModule, getParent, getRegion, getUri, hashCode, setModule, setParent, setRegion, setUri
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.epsilon.eol.IEolModule
configure, execute, getConfigurationProperties, getContext, getDeclaredModelDeclarations, getDeclaredOperations, getImports, getMain, getModelDeclarations, getOperations, getParentModule, getParseProblems, getPostOperationStatements, parse, setContext, setParentModule
-
Methods inherited from interface org.eclipse.epsilon.common.module.IModule
createAst, getSourceUri, parse, parse, parse, parse, parse
-
Methods inherited from interface org.eclipse.epsilon.common.module.ModuleElement
build, getChildren, getComments, getData, getFile, getModule, getParent, getRegion, getUri, setModule, setParent, setRegion, setUri
-
-
-
-
Field Detail
-
DEFAULT_PACKAGE
public static final String DEFAULT_PACKAGE
Default package name for the JUnit reports.- See Also:
- Constant Field Values
-
-
Method Detail
-
getTests
public List<Operation> getTests()
- Specified by:
getTests
in interfaceIEUnitModule
-
getInlineModelOperations
public List<Operation> getInlineModelOperations()
- Specified by:
getInlineModelOperations
in interfaceIEUnitModule
-
getSetups
public List<Operation> getSetups()
- Specified by:
getSetups
in interfaceIEUnitModule
-
getTeardowns
public List<Operation> getTeardowns()
- Specified by:
getTeardowns
in interfaceIEUnitModule
-
getSuiteSetups
public List<Operation> getSuiteSetups()
- Specified by:
getSuiteSetups
in interfaceIEUnitModule
-
getSuiteTeardowns
public List<Operation> getSuiteTeardowns()
- Specified by:
getSuiteTeardowns
in interfaceIEUnitModule
-
getCustomComparators
public List<IModelComparator> getCustomComparators()
- Specified by:
getCustomComparators
in interfaceIEUnitModule
-
getDataVariableNames
public List<Pair<Operation,String>> getDataVariableNames()
- Specified by:
getDataVariableNames
in interfaceIEUnitModule
-
isAnnotatedAs
public boolean isAnnotatedAs(Operation operation, String annotation)
- Specified by:
isAnnotatedAs
in interfaceIEUnitModule
-
executeImpl
public Object executeImpl() throws EolRuntimeException
- Overrides:
executeImpl
in classEolModule
- Throws:
EolRuntimeException
-
getSuiteRoot
public EUnitTest getSuiteRoot() throws EolRuntimeException
- Specified by:
getSuiteRoot
in interfaceIEUnitModule
- Throws:
EolRuntimeException
-
runSuite
public void runSuite(EUnitTest node) throws EolRuntimeException
- Specified by:
runSuite
in interfaceIEUnitModule
- Throws:
EolRuntimeException
-
getModelBindings
protected List<ModelBindings> getModelBindings(Operation opTest) throws EolRuntimeException
- Throws:
EolRuntimeException
-
addTestListener
public boolean addTestListener(EUnitTestListener listener)
- Specified by:
addTestListener
in interfaceIEUnitModule
-
removeTestListener
public boolean removeTestListener(EUnitTestListener listener)
- Specified by:
removeTestListener
in interfaceIEUnitModule
-
getSelectedOperations
public List<?> getSelectedOperations()
- Specified by:
getSelectedOperations
in interfaceIEUnitModule
-
setSelectedOperations
public void setSelectedOperations(List<?> attribute) throws EolRuntimeException
- Specified by:
setSelectedOperations
in interfaceIEUnitModule
- Throws:
EolRuntimeException
-
setReportDirectory
public void setReportDirectory(File reportFile)
If not null, a JUnit-style XML report will be saved to the specific destination directory. By default, it is not generated.- Specified by:
setReportDirectory
in interfaceIEUnitModule
-
getReportDirectory
public File getReportDirectory()
Returns the destination directory for the JUnit-style XML report. For details about possible values, seesetReportDirectory(File)
.- Specified by:
getReportDirectory
in interfaceIEUnitModule
-
getClassName
public String getClassName()
Returns the "class name" to be used for this module in JUnit-style reports. It is the basename of the .eunit file, without the extension.- Specified by:
getClassName
in interfaceIEUnitModule
-
getPackage
public String getPackage()
Returns the package name to use in the reports. By default, it isDEFAULT_PACKAGE
.- Specified by:
getPackage
in interfaceIEUnitModule
-
setPackage
public void setPackage(String packageName)
Changes the package name to use in the reports. By default, it isDEFAULT_PACKAGE
.- Specified by:
setPackage
in interfaceIEUnitModule
-
getQualifiedName
public String getQualifiedName()
Returns the logical name of this module as if it was a Java class, for the JUnit-style reports.- Specified by:
getQualifiedName
in interfaceIEUnitModule
-
getModelCloneDirectory
public File getModelCloneDirectory()
Description copied from interface:IEUnitModule
Returns the path to the directory which will store the clones used to freeze models during comparisons. By default, this will be#DEFAULT_EUNIT_MODEL_CLONE_DIR
in the current directory. If set tonull
, the operating system's system-wide temporary folder will be used.- Specified by:
getModelCloneDirectory
in interfaceIEUnitModule
-
setModelCloneDirectory
public void setModelCloneDirectory(File modelCloneDirectory)
Description copied from interface:IEUnitModule
Changes the model clone directory.- Specified by:
setModelCloneDirectory
in interfaceIEUnitModule
- See Also:
IEUnitModule.getModelCloneDirectory()
-
getBasename
public static String getBasename(ModuleElement moduleElement)
-
-