"the expression you want to translate from");
}
continue;
}
Expression translated;
if (useTraceTranslator)
{
translated = TraceTranslator.getInstance().translate(
translation,
fromExpression,
null);
}
else
{
final ExpressionTest expressionConfig = (ExpressionTest)expressions.get(fromExpression);
String toExpression = expressionConfig.getTo();
Object modelElement = null;
// - only find the model element if we have a model
// defined in our AndroMDA configuration
final Repository[] repositories = this.configuration.getRepositories();
if (repositories != null && repositories.length > 0)
{
modelElement = this.findModelElement(
translation,
fromExpression);
}
else
{
logger.info("No repositories defined in configuration, not finding for model elements");
}
translated =
ExpressionTranslator.instance().translate(
translation,
fromExpression,
modelElement);
if (translated != null)
{
// remove the extra whitespace from both so as to
// have an accurrate comarison
toExpression = TranslationUtils.removeExtraWhitespace(toExpression);
if (logger.isInfoEnabled())
{
logger.info("translated: --> '" + translated.getTranslatedExpression() + "'");
logger.info("expected: --> '" + toExpression + "'");
}
TestCase.assertEquals(
toExpression,
translated.getTranslatedExpression());
}
}
}
}
}