mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
test fixed
This commit is contained in:
@@ -19,6 +19,7 @@ import com.intellij.ide.util.projectWizard.ModuleWizardStep;
|
||||
import com.intellij.ide.util.projectWizard.WizardContext;
|
||||
import com.intellij.platform.ProjectTemplate;
|
||||
import com.intellij.ui.components.JBCheckBox;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
@@ -77,4 +78,11 @@ public class ChooseTemplateStep extends ModuleWizardStep {
|
||||
public ProjectTemplateList getTemplateList() {
|
||||
return myTemplateList;
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
public boolean setSelectedTemplate(String name) {
|
||||
myCreateFromTemplateCheckBox.setSelected(true);
|
||||
return myTemplateList.setSelectedTemplate(name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.intellij.ui.components.JBList;
|
||||
import com.intellij.ui.popup.list.GroupedItemsListRenderer;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.ListSelectionEvent;
|
||||
@@ -185,6 +186,11 @@ public class ProjectTemplateList extends JPanel {
|
||||
myList.addListSelectionListener(listener);
|
||||
}
|
||||
|
||||
public void setPaintBusy(boolean b) {
|
||||
myList.setPaintBusy(b);
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
public boolean setSelectedTemplate(String name) {
|
||||
ListModel model1 = myList.getModel();
|
||||
for (int j = 0; j < model1.getSize(); j++) {
|
||||
@@ -196,8 +202,4 @@ public class ProjectTemplateList extends JPanel {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setPaintBusy(boolean b) {
|
||||
myList.setPaintBusy(b);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public abstract class ProjectWizardTestCase<T extends AbstractProjectWizard> ext
|
||||
return new NewModuleAction().createModuleFromWizard(myProject, null, myWizard);
|
||||
}
|
||||
|
||||
protected void runWizard(String group, String name, Project project, @Nullable Consumer<Step> adjuster) throws IOException {
|
||||
protected void runWizard(String group, final String name, Project project, @Nullable final Consumer<Step> adjuster) throws IOException {
|
||||
|
||||
createWizard(project);
|
||||
ProjectTypeStep step = (ProjectTypeStep)myWizard.getCurrentStepObject();
|
||||
@@ -95,7 +95,17 @@ public abstract class ProjectWizardTestCase<T extends AbstractProjectWizard> ext
|
||||
adjuster.consume(step);
|
||||
}
|
||||
|
||||
runWizard(adjuster);
|
||||
runWizard(new Consumer<Step>() {
|
||||
@Override
|
||||
public void consume(Step step) {
|
||||
if (name != null && step instanceof ChooseTemplateStep) {
|
||||
((ChooseTemplateStep)step).setSelectedTemplate(name);
|
||||
}
|
||||
if (adjuster != null) {
|
||||
adjuster.consume(step);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected void createWizard(Project project) throws IOException {
|
||||
|
||||
Reference in New Issue
Block a user