Package org.sonar.api.platform

Examples of org.sonar.api.platform.PluginRepository


  DefaultI18n manager;

  @Before
  public void before() {
    PluginRepository pluginRepository = mock(PluginRepository.class);
    List<PluginMetadata> plugins = Arrays.asList(newPlugin("core"), newPlugin("sqale"), newPlugin("frpack"), newPlugin("checkstyle"), newPlugin("other"));
    when(pluginRepository.getMetadata()).thenReturn(plugins);

    manager = new DefaultI18n(pluginRepository, system2);
    manager.doStart(getClass().getClassLoader());
  }
View Full Code Here


  public void deployRubyRailsApps_no_apps() throws Exception {
    ServerFileSystem fileSystem = mock(ServerFileSystem.class);
    File tempDir = this.temp.getRoot();
    when(fileSystem.getTempDir()).thenReturn(tempDir);

    PluginRepository pluginRepository = mock(PluginRepository.class);
    when(pluginRepository.getMetadata()).thenReturn(Collections.<PluginMetadata>emptyList());
    new RailsAppsDeployer(fileSystem, pluginRepository).start();

    File appDir = new File(tempDir, "ror");
    assertThat(appDir.isDirectory(), is(true));
    assertThat(appDir.exists(), is(true));
View Full Code Here

    // but we don' have the "php-model.xml" one
    PluginMetadata phpPluginMetadata = mock(PluginMetadata.class);
    when(phpPluginMetadata.getKey()).thenReturn("php");

    PluginRepository repository = mock(PluginRepository.class);
    when(repository.getMetadata()).thenReturn(Lists.newArrayList(csharpPluginMetadata, phpPluginMetadata));
    FakePlugin fakePlugin = new FakePlugin();
    when(repository.getPlugin(anyString())).thenReturn(fakePlugin);
    modelFinder = new DebtModelPluginRepository(repository, TEST_XML_PREFIX_PATH);

    // when
    modelFinder.start();
View Full Code Here

  @Test
  public void should_create_plugin_referential() {
    PluginMetadata metadata = mock(DefaultPluginMetadata.class);
    when(metadata.getKey()).thenReturn("foo");
    PluginRepository pluginRepository = mock(PluginRepository.class);
    when(pluginRepository.getMetadata()).thenReturn(newArrayList(metadata));
    InstalledPluginReferentialFactory installedPluginReferentialFactory = new InstalledPluginReferentialFactory(pluginRepository);

    assertThat(installedPluginReferentialFactory.getInstalledPluginReferential()).isNull();
    installedPluginReferentialFactory.start();
    assertThat(installedPluginReferentialFactory.getInstalledPluginReferential()).isNotNull();
View Full Code Here

    assertThat(installedPluginReferentialFactory.getInstalledPluginReferential().getPlugins()).hasSize(1);
  }

  @Test(expected = RuntimeException.class)
  public void should_encapsulate_exception() {
    PluginRepository pluginRepository = mock(PluginRepository.class);
    when(pluginRepository.getMetadata()).thenThrow(new IllegalArgumentException());
    InstalledPluginReferentialFactory installedPluginReferentialFactory = new InstalledPluginReferentialFactory(pluginRepository);
    installedPluginReferentialFactory.start();
  }
View Full Code Here

    when(fileSystem.getPluginIndex()).thenReturn(index);
  }

  @Test
  public void shouldWriteIndex() throws IOException {
    PluginRepository repository = mock(PluginRepository.class);
    PluginMetadata sqale = newMetadata("sqale");
    PluginMetadata checkstyle = newMetadata("checkstyle");
    when(repository.getMetadata()).thenReturn(Arrays.asList(sqale, checkstyle));

    new GeneratePluginIndex(fileSystem, repository).start();

    List<String> lines = FileUtils.readLines(index);
    assertThat(lines.size(), Is.is(2));
View Full Code Here

TOP

Related Classes of org.sonar.api.platform.PluginRepository

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.