org.andromda.translation.ocl.testsuite
Class TranslationTestProcessor

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.andromda.translation.ocl.testsuite.TranslationTestProcessor
All Implemented Interfaces:
Test

public final class TranslationTestProcessor
extends TestCase

This object is used to test Translations during development.

Author:
Chad Brandon

Method Summary
protected  Object findModelElement(String translation, String expression)
          Finds the classifier having fullyQualifiedName in the model.
static TranslationTestProcessor instance()
          Gets the shared instance of this class.
 void runSuite()
          Runs the test suite.
 void setConfiguration(Configuration configuration)
          Sets AndroMDA configuration instance.
 void setResult(TestResult testResult)
          Sets the test result in which the result of the run will be stored.
 void setTestSourceDirectory(String testSourceDirectory)
          Sets the location of the directory that contains the test souce.
 void setTranslationName(String translationName)
          Sets the name of the translation to test.
 void setUseTraceTranslator(boolean useTraceTranslator)
          Sets whether or not to use the trace translator.
 void shutdown()
          Shuts down this instance.
 void testTranslation()
          Tests the current translation set in the currentTestTranslation property.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, 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, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

instance

public static final TranslationTestProcessor instance()
Gets the shared instance of this class.

Returns:
the shared instance of this class.

setUseTraceTranslator

public void setUseTraceTranslator(boolean useTraceTranslator)
Sets whether or not to use the trace translator.

Parameters:
useTraceTranslator - true/false

setTranslationName

public void setTranslationName(String translationName)
Sets the name of the translation to test.

Parameters:
translationName - the name of the translation to test.

setTestSourceDirectory

public void setTestSourceDirectory(String testSourceDirectory)
Sets the location of the directory that contains the test souce.

Parameters:
testSourceDirectory -

setResult

public void setResult(TestResult testResult)
Sets the test result in which the result of the run will be stored.

Parameters:
testResult - the test result instance.

runSuite

public void runSuite()
Runs the test suite.

See Also:
TestCase.run()

setConfiguration

public void setConfiguration(Configuration configuration)
Sets AndroMDA configuration instance.

Parameters:
configuration - the AndroMDA configuration instance.

findModelElement

protected Object findModelElement(String translation,
                                  String expression)
Finds the classifier having fullyQualifiedName in the model.

Parameters:
translation - the translation we're using
expression - the expression from which we'll find the model element.
Returns:
Object the found model element.

testTranslation

public void testTranslation()
Tests the current translation set in the currentTestTranslation property.


shutdown

public void shutdown()
Shuts down this instance.



Copyright © 2003-2012 AndroMDA.org. All Rights Reserved.