if (this.testResult == null)
{
throw new TranslationTestProcessorException(
"You must set the test result before attempting to run the suite");
}
final AndroMDA andromda = AndroMDA.newInstance();
MetafacadeFactory factory = MetafacadeFactory.getInstance();
andromda.initialize(this.configuration);
factory.setNamespace(Namespaces.DEFAULT);
if (this.model == null)
{
final Repositories repositoriesContainer = Repositories.instance();
final Repository[] repositories = this.configuration.getRepositories();
if (repositories != null && repositories.length > 0)
{
final int numberOfRepositories = repositories.length;
for (int ctr = 0; ctr < numberOfRepositories; ctr++)
{
final Repository repository = repositories[ctr];
final Model[] models = repository.getModels();
if (models != null)
{
// - we just load only the first model (since it doesn't
// make sense
// to test with more than one model)
final Model model = models[0];
repositoriesContainer.loadModel(model);
final RepositoryFacade repositoryImplementation =
repositoriesContainer.getImplementation(repository.getName());
this.model = repositoryImplementation.getModel();
// - make sure the factory has access to the model
factory.setModel(this.model, model.getType());
}
}
}
}
this.getSuite().run(this.testResult);
andromda.shutdown();
}