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 java.lang.String
DEFAULT_PACKAGE
Default package name for the JUnit reports.-
Fields inherited from class org.eclipse.epsilon.eol.EolModule
compilationContext, 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)
java.lang.Object
executeImpl()
static java.lang.String
getBasename(ModuleElement moduleElement)
java.lang.String
getClassName()
Returns the "class name" to be used for this module in JUnit-style reports.java.util.List<Pair<Operation,java.lang.String>>
getDataVariableNames()
java.util.ArrayList<Operation>
getInlineModelOperations()
protected java.util.List<ModelBindings>
getModelBindings(Operation opTest)
java.lang.String
getPackage()
Returns the package name to use in the reports.java.lang.String
getQualifiedName()
Returns the logical name of this module as if it was a Java class, for the JUnit-style reports.java.io.File
getReportDirectory()
Returns the destination directory for the JUnit-style XML report.java.util.List<?>
getSelectedOperations()
java.util.ArrayList<Operation>
getSetups()
EUnitTest
getSuiteRoot()
java.util.ArrayList<Operation>
getSuiteSetups()
java.util.ArrayList<Operation>
getSuiteTeardowns()
java.util.ArrayList<Operation>
getTeardowns()
java.util.ArrayList<Operation>
getTests()
boolean
isAnnotatedAs(Operation operation, java.lang.String annotation)
boolean
removeTestListener(EUnitTestListener listener)
void
runSuite(EUnitTest node)
void
setPackage(java.lang.String packageName)
Changes the package name to use in the reports.void
setReportDirectory(java.io.File reportFile)
Changes the destination directory for the JUnit-style XML report.void
setSelectedOperations(java.util.List<?> attribute)
-
Methods inherited from class org.eclipse.epsilon.eol.EolModule
adapt, build, checkImports, clearCache, compile, createLexer, createParser, execute, getCompilationContext, getContext, getDeclaredModelDeclarations, getDeclaredOperations, getImportConfiguration, getImports, getImportsByExtension, getMain, getMainRule, getModelDelcarations, 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, 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, getCompilationContext, getConfigurationProperties, getContext, getDeclaredModelDeclarations, getDeclaredOperations, getImports, getMain, getModelDelcarations, getOperations, getParentModule, getParseProblems, getPostOperationStatements, parse, setContext, setParentModule
-
Methods inherited from interface org.eclipse.epsilon.common.module.IModule
compile, createAst, getSourceUri, parse, parse, parse, parse, parse
-
Methods inherited from interface org.eclipse.epsilon.common.module.ModuleElement
build, getChildren, getComments, getFile, getModule, getParent, getRegion, getUri, setModule, setParent, setRegion, setUri
-
-
-
-
Field Detail
-
DEFAULT_PACKAGE
public static final java.lang.String DEFAULT_PACKAGE
Default package name for the JUnit reports.- See Also:
- Constant Field Values
-
-
Method Detail
-
getTests
public java.util.ArrayList<Operation> getTests()
- Specified by:
getTests
in interfaceIEUnitModule
-
getInlineModelOperations
public java.util.ArrayList<Operation> getInlineModelOperations()
- Specified by:
getInlineModelOperations
in interfaceIEUnitModule
-
getSetups
public java.util.ArrayList<Operation> getSetups()
- Specified by:
getSetups
in interfaceIEUnitModule
-
getTeardowns
public java.util.ArrayList<Operation> getTeardowns()
- Specified by:
getTeardowns
in interfaceIEUnitModule
-
getSuiteSetups
public java.util.ArrayList<Operation> getSuiteSetups()
- Specified by:
getSuiteSetups
in interfaceIEUnitModule
-
getSuiteTeardowns
public java.util.ArrayList<Operation> getSuiteTeardowns()
- Specified by:
getSuiteTeardowns
in interfaceIEUnitModule
-
getDataVariableNames
public java.util.List<Pair<Operation,java.lang.String>> getDataVariableNames()
- Specified by:
getDataVariableNames
in interfaceIEUnitModule
-
isAnnotatedAs
public boolean isAnnotatedAs(Operation operation, java.lang.String annotation)
- Specified by:
isAnnotatedAs
in interfaceIEUnitModule
-
executeImpl
public java.lang.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 java.util.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 java.util.List<?> getSelectedOperations()
- Specified by:
getSelectedOperations
in interfaceIEUnitModule
-
setSelectedOperations
public void setSelectedOperations(java.util.List<?> attribute) throws EolRuntimeException
- Specified by:
setSelectedOperations
in interfaceIEUnitModule
- Throws:
EolRuntimeException
-
setReportDirectory
public void setReportDirectory(java.io.File reportFile)
Changes the destination directory for the JUnit-style XML report. By default, it is the current directory. Ifnull
, no report will be written.- Specified by:
setReportDirectory
in interfaceIEUnitModule
-
getReportDirectory
public java.io.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 java.lang.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 java.lang.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(java.lang.String packageName)
Changes the package name to use in the reports. By default, it isDEFAULT_PACKAGE
.- Specified by:
setPackage
in interfaceIEUnitModule
-
getQualifiedName
public java.lang.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
-
getBasename
public static java.lang.String getBasename(ModuleElement moduleElement)
-
-