Examples of EnvironmentInformation


Examples of org.sonar.batch.bootstrapper.EnvironmentInformation

  @Test
  public void should_execute_extension_provider() {
    BatchPluginRepository pluginRepository = mock(BatchPluginRepository.class);
    when(pluginRepository.getPluginsByMetadata()).thenReturn(newPlugin(new FooProvider(), new BarProvider()));
    ComponentContainer container = new ComponentContainer();
    ExtensionInstaller installer = new ExtensionInstaller(pluginRepository, new EnvironmentInformation("ant", "1.7"), mode);

    installer.install(container, new FooMatcher());

    assertThat(container.getComponentByType(Foo.class)).isNotNull();
    assertThat(container.getComponentByType(Bar.class)).isNull();
View Full Code Here

Examples of org.sonar.batch.bootstrapper.EnvironmentInformation

  @Test
  public void should_provide_list_of_extensions() {
    BatchPluginRepository pluginRepository = mock(BatchPluginRepository.class);
    when(pluginRepository.getPluginsByMetadata()).thenReturn(newPlugin(new FooBarProvider()));
    ComponentContainer container = new ComponentContainer();
    ExtensionInstaller installer = new ExtensionInstaller(pluginRepository, new EnvironmentInformation("ant", "1.7"), mode);

    installer.install(container, new TrueMatcher());

    assertThat(container.getComponentByType(Foo.class)).isNotNull();
    assertThat(container.getComponentByType(Bar.class)).isNotNull();
View Full Code Here

Examples of org.sonar.batch.bootstrapper.EnvironmentInformation

  public void should_not_install_on_unsupported_environment() {
    BatchPluginRepository pluginRepository = mock(BatchPluginRepository.class);
    when(pluginRepository.getPluginsByMetadata()).thenReturn(newPlugin(Foo.class, MavenExtension.class, AntExtension.class, new BarProvider()));

    ComponentContainer container = new ComponentContainer();
    ExtensionInstaller installer = new ExtensionInstaller(pluginRepository, new EnvironmentInformation("ant", "1.7"), mode);

    installer.install(container, new TrueMatcher());

    assertThat(container.getComponentByType(MavenExtension.class)).isNull();
    assertThat(container.getComponentByType(AntExtension.class)).isNotNull();
View Full Code Here

Examples of org.sonar.batch.bootstrapper.EnvironmentInformation

  @Test
  public void should_remove_url_ending_slash() throws Exception {
    BootstrapProperties settings = mock(BootstrapProperties.class);
    when(settings.property("sonar.host.url")).thenReturn("http://localhost:8080/sonar/");

    ServerClient client = new ServerClient(settings, new EnvironmentInformation("Junit", "4"));

    assertThat(client.getURL()).isEqualTo("http://localhost:8080/sonar");
  }
View Full Code Here

Examples of org.sonar.batch.bootstrapper.EnvironmentInformation

    assertThat(ServerClient.encodeForUrl("my value")).isEqualTo("my+value");
  }

  private ServerClient newServerClient() {
    when(bootstrapProps.property("sonar.host.url")).thenReturn("http://localhost:" + server.getPort());
    return new ServerClient(bootstrapProps, new EnvironmentInformation("Junit", "4"));
  }
View Full Code Here

Examples of org.sonar.batch.bootstrapper.EnvironmentInformation

    taskContainer.installCoreTasks();

    assertThat(taskContainer.getComponentByType(ProjectReactorBuilder.class)).isNotNull().isInstanceOf(ProjectReactorBuilder.class);

    container = BootstrapContainer.create(Collections.<String, String>emptyMap(),
      Lists.newArrayList(new BootstrapProperties(Collections.<String, String>emptyMap()), new EnvironmentInformation("SonarQubeRunner", "2.4")));
    taskContainer = new TaskContainer(container, Collections.<String, String>emptyMap());
    taskContainer.installCoreTasks();

    assertThat(taskContainer.getComponentByType(ProjectReactorBuilder.class)).isNotNull().isInstanceOf(ProjectReactorBuilder.class);
  }
View Full Code Here

Examples of org.sonar.batch.bootstrapper.EnvironmentInformation

  }

  @Test
  public void should_add_deprecated_project_reactor_builder_if_old_runner() {
    BootstrapContainer container = BootstrapContainer.create(Collections.<String, String>emptyMap(),
      Lists.newArrayList(new BootstrapProperties(Collections.<String, String>emptyMap()), new EnvironmentInformation("SonarRunner", "2.3")));
    TaskContainer taskContainer = new TaskContainer(container, Collections.<String, String>emptyMap());
    taskContainer.installCoreTasks();

    assertThat(taskContainer.getComponentByType(DeprecatedProjectReactorBuilder.class)).isNotNull().isInstanceOf(DeprecatedProjectReactorBuilder.class);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.