tableData.horizontalAlignment = GridData.FILL;
tableData.verticalAlignment = GridData.FILL;
tableData.grabExcessHorizontalSpace = true;
tableData.grabExcessVerticalSpace = true;
table.getTable().setLayoutData(tableData);
table.setInput(new TestSuite());
Group group = new Group(composite, SWT.NONE);
group.setText("�j teszteset hozz�ad�sa");
group.setLayout(new GridLayout(6, false));
GridData groupData = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
group.setLayoutData(groupData);
testCombo = new Combo(group, SWT.READ_ONLY);
for (TestStatement testStatement : statements) {
testCombo.add(testStatement.getName());
}
Label label = new Label(group, SWT.NONE);
label.setText("Sz�lak sz�ma:");
threadSpinner = new Spinner(group, SWT.NONE);
threadSpinner.setMinimum(1);
threadSpinner.setMaximum(100);
label = new Label(group, SWT.NONE);
label.setText("V�grehajt�sok sz�ma: ");
numExecSpinner = new Spinner(group, SWT.NONE);
numExecSpinner.setMinimum(1);
numExecSpinner.setMaximum(10);
Button addButton = new Button(group, SWT.PUSH);
addButton.setText("Hozz�ad");
addButton.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);
((TestSuite) table.getInput()).addTestCase(testCase);
table.refresh();
}
});
Button executeButton = new Button(group, SWT.PUSH);
executeButton.setText("V�grehajt");
executeButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
FileLogWriter writer = new FileLogWriter("D:\\valami.txt");
TestSuite testSuite = (TestSuite) table.getInput();
TestService.executeTestSuite(testSuite, writer);
writer.close();
}
});
}