@Override
public void sendEvent(TcaEvent e) {
String ename = e.getEventName();
logger.info(ename);
if (ename.equals(TcaEventCommands.UPDATESTART)) {
Project project = model.getProject();
tfProjectName.setText(project.getName());
createTableHistory(project.getTestRuns());
repaint();
} else if (ename.equals(TcaEventCommands.UPDATERUN)) {
Project project = model.getProject();
Run run = project.getTestRuns().get(0);
Result result = run.getResult();
counterPanel.setRunValue(result.getRunCount());
counterPanel.setIgnoredValue(result.getIgnoreCount());
counterPanel.setOkValue(result.getRunCount()
- result.getFailureCount());
counterPanel.setFailureValue(result.getFailureCount());
if (result.getFailureCount() == 0) {
progressBar.setBackground(Color.GREEN);
} else {
progressBar.setBackground(Color.RED);
}
createTableHistory(project.getTestRuns());
repaint();
} else if (ename.equals(TcaEventCommands.SAVEPROJECT)) {
Project project = model.getProject();
project.setName(tfProjectName.getText());
}
}