use of org.absmodels.abs.plugin.actions.ABSUnitTestJavaExecutionJob in project abstools by abstools.
the class JavaRunConfiguration method launch.
@Override
public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
JavaLaunchConfig launchConfig = new JavaLaunchConfig(config);
IAction action = createNewAction(launchConfig);
IProject project = ActionUtils.getProject(config);
IFile file = null;
ActionUtils.saveDirtyEditors(project);
JavaJob job = new JavaJob(JavaJob.RUN_JOB, action, project, file);
String product = launchConfig.getProductName();
if (product != null) {
try {
Model model = JavaJob.getModelFromProject(project);
job.setProduct(model.findProduct(product));
} catch (WrongProgramArgumentException e) {
throw new CoreException(new Status(IStatus.ERROR, Constants.PLUGIN_ID, "Launch failed", e));
} catch (AbsJobException e) {
throw new CoreException(new Status(IStatus.ERROR, Constants.PLUGIN_ID, "Launch failed", e));
}
}
if (launchConfig.getTestExecution()) {
List<String> obs = launchConfig.getDebuggerObserverList();
obs.add(ABSTestObserver.class.getName());
}
modifyDebuggerArguments(launchConfig, job);
if (launchConfig.getTestExecution()) {
// execution of unit tests
Job testJob = new ABSUnitTestJavaExecutionJob(project, product, job);
testJob.schedule();
} else {
// normal execution
job.schedule();
}
}
Aggregations