Exemplo n.º 1
0
  @Test
  public void test() throws Exception {
    assertThat(preferencesBot.getServersCount(), is(0));

    // can add
    SonarServerWizardBot addWizard = preferencesBot.add();
    assertThat(addWizard.getServerUrl(), is("http://localhost:9000")); // default url
    assertThat(addWizard.getUsername(), is(""));
    assertThat(addWizard.getPassword(), is(""));
    testConnection(addWizard, ProjectUtils.getSonarServerUrl() + "/", true); // test for SONARIDE-90
    testConnection(addWizard, ProjectUtils.getSonarServerUrl(), true);
    testConnection(addWizard, "http://fake", false);
    addWizard.finish();
    assertThat(preferencesBot.getServersCount(), is(1));

    // can edit
    SonarServerWizardBot editWizard = preferencesBot.select("http://fake").edit();
    assertThat(editWizard.getServerUrl(), is("http://fake"));
    assertThat(editWizard.getUsername(), is(""));
    assertThat(editWizard.getPassword(), is(""));
    editWizard.setServerUrl("http://fake2");
    editWizard.finish();
    assertThat(preferencesBot.getServersCount(), is(1));

    // can remove
    preferencesBot.select("http://fake2").remove();
    assertThat(preferencesBot.getServersCount(), is(0));
  }
Exemplo n.º 2
0
 @AfterClass
 public static void closeProperties() {
   preferencesBot.ok();
 }