filtering templates by frameworks

This commit is contained in:
Dmitry Avdeev
2014-03-07 13:43:45 +04:00
parent 2670f2de67
commit 3b799e4d8d
8 changed files with 112 additions and 39 deletions
@@ -91,10 +91,6 @@ public abstract class ProjectWizardTestCase<T extends AbstractProjectWizard> ext
throw new IllegalArgumentException(group + "/" + name + " template not found");
}
if (adjuster != null) {
adjuster.consume(step);
}
runWizard(new Consumer<Step>() {
@Override
public void consume(Step step) {
@@ -108,6 +104,23 @@ public abstract class ProjectWizardTestCase<T extends AbstractProjectWizard> ext
});
}
protected void runWizard(Consumer<Step> adjuster) {
while(true) {
ModuleWizardStep currentStep = myWizard.getCurrentStepObject();
if (adjuster != null) {
adjuster.consume(currentStep);
}
if (myWizard.isLast()) {
break;
}
myWizard.doNextAction();
if (currentStep == myWizard.getCurrentStepObject()) {
throw new RuntimeException(currentStep + " is not validated");
}
}
myWizard.doOk();
}
protected void createWizard(Project project) throws IOException {
File directory = FileUtil.createTempDirectory(getName(), "new", false);
myFilesToDelete.add(directory);
@@ -126,23 +139,6 @@ public abstract class ProjectWizardTestCase<T extends AbstractProjectWizard> ext
return (T)new AddModuleWizard(project, DefaultModulesProvider.createForProject(project), directory.getPath());
}
protected void runWizard(Consumer<Step> adjuster) {
while(true) {
ModuleWizardStep currentStep = myWizard.getCurrentStepObject();
if (adjuster != null) {
adjuster.consume(currentStep);
}
if (myWizard.isLast()) {
break;
}
myWizard.doNextAction();
if (currentStep == myWizard.getCurrentStepObject()) {
throw new RuntimeException(currentStep + " is not validated");
}
}
myWizard.doOk();
}
@Override
protected void setUp() throws Exception {
super.setUp();