mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
investigate RemoteTemplatesTest.testHelloWorld — more informative message
This commit is contained in:
@@ -639,6 +639,19 @@ public class ProjectTypeStep extends ModuleWizardStep implements SettingsStep, D
|
||||
}
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
public String availableTemplateGroupsToString() {
|
||||
ListModel model = myProjectTypeList.getModel();
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (int i = 0; i < model.getSize(); i++) {
|
||||
if (builder.length() > 0) {
|
||||
builder.append(", ");
|
||||
}
|
||||
builder.append(((TemplatesGroup)model.getElementAt(i)).getName());
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
public boolean setSelectedTemplate(@NotNull String group, @Nullable String name) {
|
||||
ListModel model = myProjectTypeList.getModel();
|
||||
|
||||
@@ -98,8 +98,9 @@ public abstract class ProjectWizardTestCase<T extends AbstractProjectWizard> ext
|
||||
|
||||
protected void runWizard(@NotNull String group, @Nullable final String name, Project project, @Nullable final Consumer<Step> adjuster) throws IOException {
|
||||
createWizard(project);
|
||||
if (!((ProjectTypeStep)myWizard.getCurrentStepObject()).setSelectedTemplate(group, name)) {
|
||||
throw new IllegalArgumentException(group + '/' + name + " template not found");
|
||||
ProjectTypeStep step = (ProjectTypeStep)myWizard.getCurrentStepObject();
|
||||
if (!step.setSelectedTemplate(group, name)) {
|
||||
throw new IllegalArgumentException(group + '/' + name + " template not found, available groups " + step.availableTemplateGroupsToString());
|
||||
}
|
||||
|
||||
runWizard(new Consumer<Step>() {
|
||||
|
||||
Reference in New Issue
Block a user