Package org.springframework.ide.eclipse.wizard.gettingstarted.boot

Examples of org.springframework.ide.eclipse.wizard.gettingstarted.boot.NewSpringBootWizardModel


import org.springframework.ide.eclipse.wizard.gettingstarted.boot.NewSpringBootWizardModel;

public class ZipUrlImportWizardTest extends TestCase {
 
  public void testImportBasic() throws Exception {
    NewSpringBootWizardModel wizard = new NewSpringBootWizardModel();
    wizard.allowUIThread(true);
    wizard.performFinish(new NullProgressMonitor());
    IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(wizard.getProjectName().getValue());
    assertTrue(p.isAccessible());
  }
View Full Code Here


  @Override
  protected void setUp() throws Exception {
    super.setUp();
    if (projectName==null) {
      NewSpringBootWizardModel wizard = new NewSpringBootWizardModel();
      wizard.allowUIThread(true);
      projectName = wizard.getProjectName().getValue();
      wizard.performFinish(new NullProgressMonitor());
      project = SpringBootCore.create(ResourcesPlugin.getWorkspace().getRoot().getProject(projectName));
     
      knownStarters = new HashMap<String, SpringBootStarter>();
     
      for (SpringBootStarter s : project.getKnownStarters()) {
View Full Code Here

    super.setUp();
  }
 
  public static NewSpringBootWizardModel parseFrom(String resourcePath) throws Exception {
    URL formUrl = resourceUrl(resourcePath);
    return new NewSpringBootWizardModel(new URLConnectionFactory(), formUrl.toString(), "application/json");
  }
View Full Code Here

    URL formUrl = NewSpringBootWizardModelTest.class.getResource(resourcePath);
    return formUrl;
  }
 
  public void testParsedRadios() throws Exception {
    NewSpringBootWizardModel model = parseFrom("initializr.json");
    RadioGroups radioGroups = model.getRadioGroups();
    assertGroupNames(radioGroups, "type", "packaging", "javaVersion", "language", "bootVersion");
  }
View Full Code Here

    RadioGroups radioGroups = model.getRadioGroups();
    assertGroupNames(radioGroups, "type", "packaging", "javaVersion", "language", "bootVersion");
  }

  public void testPackagingRadios() throws Exception {
    NewSpringBootWizardModel model = parseFrom("initializr.json");
    RadioGroup packagingTypes = model.getRadioGroups().getGroup("packaging");
    assertNotNull(packagingTypes);
    assertGroupValues(packagingTypes, "jar", "war");
    assertEquals("jar", packagingTypes.getDefault().getValue());
  }
View Full Code Here

    assertGroupValues(packagingTypes, "jar", "war");
    assertEquals("jar", packagingTypes.getDefault().getValue());
  }

  public void testJavaVersionRadios() throws Exception {
    NewSpringBootWizardModel model = parseFrom("initializr.json");
    RadioGroup group = model.getRadioGroups().getGroup("javaVersion");
    assertNotNull(group);
    assertGroupValues(group, "1.6", "1.7", "1.8");
    assertEquals("1.7", group.getDefault().getValue());
  }
View Full Code Here

 
  public void testBuildTypeRadios() throws Exception {
    String mavenId = "maven-project";
    String gradleId = "gradle-project";
    String jsonFile = "initializr.json";
    NewSpringBootWizardModel model = parseFrom(jsonFile);
    String starterZipUrl = resourceUrl(jsonFile).toURI().resolve("/starter.zip").toString();
    assertEquals(starterZipUrl, model.baseUrl.getValue());
   
    RadioGroup group = model.getRadioGroups().getGroup("type");
    assertNotNull(group);
    assertGroupValues(group, mavenId, gradleId);
    assertEquals(mavenId, group.getDefault().getValue());
   
    group.getSelection().selection.setValue(group.getRadio(mavenId));
    assertEquals(BuildType.MAVEN, model.getBuildType());
    assertEquals(starterZipUrl, model.baseUrl.getValue());
   
    group.getSelection().selection.setValue(group.getRadio(gradleId));
    assertEquals(BuildType.GRADLE, model.getBuildType());
    assertEquals(starterZipUrl, model.baseUrl.getValue());
  }
View Full Code Here

    String jsonFile = "initializr-variant.json";
   
    String mavenZipUrl = resourceUrl(jsonFile).toURI().resolve("/maven.zip").toString();
    String gradleZipUrl = resourceUrl(jsonFile).toURI().resolve("/gradle.zip").toString();
   
    NewSpringBootWizardModel model = parseFrom(jsonFile);
   
    RadioGroup group = model.getRadioGroups().getGroup("type");
    assertNotNull(group);
    assertGroupValues(group, gradleId, mavenId);
    assertEquals(mavenId, group.getDefault().getValue());
    assertEquals(mavenZipUrl, model.baseUrl.getValue());
   
    group.getSelection().selection.setValue(group.getRadio(gradleId));
    assertEquals(BuildType.GRADLE, model.getBuildType());
    assertEquals(gradleZipUrl, model.baseUrl.getValue());
   
    group.getSelection().selection.setValue(group.getRadio(mavenId));
    assertEquals(BuildType.MAVEN, model.getBuildType());
    assertEquals(mavenZipUrl, model.baseUrl.getValue());
  }
View Full Code Here

    assertEquals(BuildType.MAVEN, model.getBuildType());
    assertEquals(mavenZipUrl, model.baseUrl.getValue());
  }
 
  public void testStarters() throws Exception {
    NewSpringBootWizardModel model = parseFrom("initializr.json");
    String[] styles = model.style.getChoices();
    assertNotNull(styles);
    assertTrue(styles.length>10);
   
    String lastLabel = null; //check that style labels are sorted
View Full Code Here

    }
   
  }
   
  public void testLabels() throws Exception {
    NewSpringBootWizardModel model = parseFrom("initializr.json");
    Iterator<FieldModel<String>> stringInputs = model.stringInputs.iterator();
    while (stringInputs.hasNext()) {
      FieldModel<String> input = stringInputs.next();
      assertRealLabel(input.getLabel());
    }
   
    for (RadioGroup group : model.getRadioGroups().getGroups()) {
      String label = group.getLabel();
      assertRealLabel(label);
     
      for (RadioInfo radio : group.getRadios()) {
        label = radio.getLabel();
View Full Code Here

TOP

Related Classes of org.springframework.ide.eclipse.wizard.gettingstarted.boot.NewSpringBootWizardModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.