@OpenApi
public abstract class MagicDrawTestCase
extends com.nomagic.magicdraw.tests.NamedTestCase
| Constructor and Description |
|---|
MagicDrawTestCase()
Default test case initialization for executing test* methods.
|
MagicDrawTestCase(java.lang.String method)
Creates MagicDrawTestCase for executing specific test method.
|
MagicDrawTestCase(java.lang.String method,
java.lang.String testName)
Creates MagicDrawTestCase of specific name for executing specific test method.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkMemoryLeaks()
Force memory leaks test execution.
|
void |
closeAllProjects()
Close all currently opened MagicDraw projects with performing memory leaks test.
|
void |
closeProject(Project project)
Close opened MagicDraw project.
|
protected ProjectsComparator |
createProjectComparator(java.lang.String logText)
Creates project comparator with default model and diagram comparators implementation.
|
static java.io.File |
getFileWithExtension(java.io.File projectFile,
java.lang.String extension)
Computes test case specific properties file according given project file.
|
protected org.apache.log4j.Logger |
getLogger()
Gets logger for Test related output logging.
|
static java.io.File |
getPropertiesFile(java.io.File projectFile)
Computes test case specific properties file according given project file.
|
protected java.util.List<java.lang.String> |
getRequiredPlugins()
Is used to specify plug-ins required by test case.
|
protected java.lang.String |
getRequiredPluginsDescription()
Formats textual message about available plug-ins status(loaded/enabled).
|
static java.io.File |
getXmlFile(java.io.File projectFile)
Computes test case specific properties file according given project file.
|
static void |
invokeAndWaitOnDispatcher(java.lang.Runnable r)
Executes runnable on dispatcher thread and waits till runnable is done.
|
boolean |
isDoNotUseSilentMode()
Check if silent mode is not used for starting MagicDraw.
|
boolean |
isFailed()
Check if test has failed because of JUnit assertion or any other exception.
|
protected boolean |
isMemoryTestReady()
Check if memory leaks test might be performed.
|
protected boolean |
isRequiredPluginsLoaded()
Check if all plug-ins required by this test case are loaded and enabled.
|
static Project |
loadProject(java.lang.String file)
Opens MagicDraw project by absolute project file name.
|
static Project |
loadProject(java.lang.String projectPath,
boolean failIfProjectHasErrors)
Opens MagicDraw project by absolute project file name.
|
static Project |
loadProject(java.lang.String projectPath,
boolean failIfProjectHasErrors,
boolean loadAllDiagrams)
Opens MagicDraw project by absolute project file name.
|
protected Project |
openProject(java.lang.String projectFile)
Opens MagicDraw project by its absolute file name.
|
protected Project |
openProject(java.lang.String projectFile,
boolean loadAllDiagram)
Opens MagicDraw project by its absolute file name.
|
protected void |
saveProject(Project project,
java.io.File file)
Save opened MagicDraw project to specific file.
|
void |
setDoNotUseSilentMode(boolean doNotUseSilentMode)
Specify if MagicDraw should show GUI modal dialogs during startup and features testing.
|
void |
setMemoryTestReady(boolean memoryTestReady)
Specify if memory leaks test is ready, so it might be performed at the end of the test.
|
void |
setRunOnEventDispatcher(boolean runOnEventDispatcher)
Sets if test case should be executed on event dispatching thread.
|
void |
setRunOnEventDispather(boolean runOnEventDispatcher)
Deprecated.
spelling error in name, use set #setRunOnEventDispatcher
|
void |
setSkipMemoryTest(boolean skipMemoryTest)
Set to true in order to skip memory leaks test.
|
protected void |
setUpTest()
Override to prepare test case after MagicDraw application started.
|
protected void |
tearDownTest()
Tear down test case after it execution.
|
getFullTestName, getMethodName, getTestName, getTestNamePrefix, isOverridingTestName, runTest, setMethodName, setTestNameassertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, setName, setUp, tearDown, toString@OpenApi public MagicDrawTestCase()
@OpenApi public MagicDrawTestCase(java.lang.String method)
method - test method name to execute.@OpenApi
public MagicDrawTestCase(java.lang.String method,
java.lang.String testName)
method - test method name to execute.testName - name of created test. All none alpha numerical characters in name will be replaced by underscore character.@OpenApi public void setMemoryTestReady(boolean memoryTestReady)
memoryTestReady - @OpenApi public void setSkipMemoryTest(boolean skipMemoryTest)
skipMemoryTest - true if memory test should be skipped, false otherwise.@OpenApi @Deprecated public void setRunOnEventDispather(boolean runOnEventDispatcher)
runOnEventDispatcher - True if test case should be executed on event dispatching thread.@OpenApi public void setRunOnEventDispatcher(boolean runOnEventDispatcher)
runOnEventDispatcher - True if test case should be executed on event dispatching thread.@OpenApi public void setDoNotUseSilentMode(boolean doNotUseSilentMode)
doNotUseSilentMode - provide true value if GUI dialogs need to be shown during MagicDraw testing.@OpenApi public boolean isDoNotUseSilentMode()
@OpenApi protected boolean isMemoryTestReady()
@OpenApi protected java.util.List<java.lang.String> getRequiredPlugins()
@OpenApi protected java.lang.String getRequiredPluginsDescription()
@OpenApi protected boolean isRequiredPluginsLoaded()
@OpenApi
protected void setUpTest()
throws java.lang.Exception
java.lang.Exception - from default JUnit setUp()@OpenApi
protected void tearDownTest()
throws java.lang.Exception
java.lang.Exception - from default JUnit tearDown()@OpenApi public void closeProject(Project project)
project - MagicDraw Project to close.@OpenApi public void closeAllProjects()
@OpenApi protected void checkMemoryLeaks()
@OpenApi public static void invokeAndWaitOnDispatcher(java.lang.Runnable r)
r - Runnable to execute.@OpenApi public static java.io.File getPropertiesFile(java.io.File projectFile)
projectFile - project file@OpenApi public static java.io.File getXmlFile(java.io.File projectFile)
projectFile - project file@OpenApi
public static java.io.File getFileWithExtension(java.io.File projectFile,
java.lang.String extension)
projectFile - project file@OpenApi public static Project loadProject(java.lang.String file)
file - absolute file name of project to open.@OpenApi public static Project loadProject(java.lang.String projectPath, boolean failIfProjectHasErrors)
projectPath - absolute file name of project to open.failIfProjectHasErrors - Specifies if test should fail if loaded project has any model inconsistency errors. Recommended to run with silentMode turned on.@OpenApi public static Project loadProject(java.lang.String projectPath, boolean failIfProjectHasErrors, boolean loadAllDiagrams)
projectPath - absolute file name of project to open.failIfProjectHasErrors - Specifies if test should fail if loaded project has any model inconsistency errors. Recommended to run with silentMode turned on.@OpenApi protected org.apache.log4j.Logger getLogger()
Logger@OpenApi public boolean isFailed()
@OpenApi protected ProjectsComparator createProjectComparator(@CheckForNull java.lang.String logText)
logText - information message which should be printed to log at the beginning of comparison.@OpenApi protected Project openProject(java.lang.String projectFile)
projectFile - absolute file name of project to open.@OpenApi protected Project openProject(java.lang.String projectFile, boolean loadAllDiagram)
projectFile - absolute file name of project to open.loadAllDiagram - load content of all diagrams in the opened project@OpenApi protected void saveProject(Project project, java.io.File file)
project - MagicDraw opened project to save.file - File to save project.