testCombo.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent arg0) {
String statementName = testCombo.getText();
TestStatement statement = getStatementByName(statementName);
sqlText.setText(statement.getStatement());
}
});
sqlText = new Text(composite, SWT.MULTI | SWT.BORDER);
GridData textData = new GridData();
textData.grabExcessHorizontalSpace = true;
textData.horizontalAlignment = GridData.FILL;
textData.horizontalSpan = 3;
textData.heightHint = 200;
sqlText.setLayoutData(textData);
testCombo.select(0);
Group executionGroup = new Group(composite, SWT.NONE);
executionGroup.setLayout(new GridLayout(5, false));
GridData groupData = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
groupData.horizontalSpan = 3;
executionGroup.setLayoutData(groupData);
Button executeButton = new Button(executionGroup, SWT.PUSH);
executeButton.setText("Teszt v�grehajt�sa");
executeButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
int numThreads = Integer.parseInt(threadSpinner.getText());
int numExecutions = Integer.parseInt(numExecSpinner.getText());
TestStatement statement = getStatementByName(testCombo.getText());
TestCase testCase = new TestCase(connectionData, statement, numThreads, numExecutions);
long duration = TestService.executeTestCase(testCase);
timeText.setText(String.valueOf(duration) + "ms");
}
});
label = new Label(executionGroup, SWT.NONE);
label.setText("Threadek sz�ma: ");
threadSpinner = new Spinner(executionGroup, SWT.NONE);
threadSpinner.setMinimum(1);
threadSpinner.setMaximum(100);
label = new Label(executionGroup, SWT.NONE);
label.setText("V�grehajt�sok sz�ma: ");
numExecSpinner = new Spinner(executionGroup, SWT.NONE);
numExecSpinner.setMinimum(1);
numExecSpinner.setMaximum(10);
label = new Label(executionGroup, SWT.NONE);
label.setText("V�grehajt�si id�: ");
timeText = new Text(executionGroup, SWT.SINGLE | SWT.BORDER);
GridData timeTextData = new GridData();
timeTextData.horizontalSpan = 2;
timeTextData.widthHint = 100;
timeText.setLayoutData(timeTextData);
timeText.setEnabled(false);
Button openTestSuiteDialog = new Button(executionGroup, SWT.PUSH);
openTestSuiteDialog.setText("Automatikus tesztek be�ll�t�sa");
openTestSuiteDialog.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
// TestSuiteDialog2 dialog = new
// TestSuiteDialog2(Display.getDefault().getActiveShell(),
// connectionData);
//
// dialog.open();
TestSuiteDialog dialog = new TestSuiteDialog(Display.getDefault().getActiveShell(), connectionData,
statements);
dialog.open();
}
});
Button planButton = new Button(composite, SWT.PUSH);
GridData planData = new GridData();
planData.horizontalSpan = 3;
planButton.setText("Execution plan");
planButton.setLayoutData(planData);
planButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
TestStatement statement = getStatementByName(testCombo.getText());
ArrayList<ExecutionPlanRow> plan = DatabaseService.getExecutionPlan(connectionData, statement
.getStatement());
planTable.setInput(plan);
}
});