Search in sources :

Example 1 with PluginFilesAndMd5

use of org.sonar.server.plugins.PluginFilesAndMd5 in project sonarqube by SonarSource.

the class ServerPluginManagerTest method newPluginFilesAndMd5.

private static PluginFilesAndMd5 newPluginFilesAndMd5(String name) {
    FileAndMd5 jar = mock(FileAndMd5.class);
    when(jar.getFile()).thenReturn(new File(name));
    when(jar.getMd5()).thenReturn(name + "-md5");
    FileAndMd5 compressed = mock(FileAndMd5.class);
    when(compressed.getFile()).thenReturn(new File(name + "-compressed"));
    when(compressed.getMd5()).thenReturn(name + "-compressed-md5");
    return new PluginFilesAndMd5(jar, compressed);
}
Also used : FileAndMd5(org.sonar.server.plugins.PluginFilesAndMd5.FileAndMd5) File(java.io.File)

Example 2 with PluginFilesAndMd5

use of org.sonar.server.plugins.PluginFilesAndMd5 in project sonarqube by SonarSource.

the class RegisterPluginsTest method addPlugin.

private ServerPlugin addPlugin(String key, PluginType type, @Nullable String basePlugin) throws IOException {
    File file = createPluginFile(key);
    PluginFilesAndMd5.FileAndMd5 jar = new PluginFilesAndMd5.FileAndMd5(file);
    PluginInfo info = new PluginInfo(key).setBasePlugin(basePlugin).setJarFile(file);
    ServerPlugin serverPlugin = new ServerPlugin(info, type, null, jar, null, null);
    serverPluginRepository.addPlugin(serverPlugin);
    return serverPlugin;
}
Also used : PluginInfo(org.sonar.core.platform.PluginInfo) ServerPlugin(org.sonar.server.plugins.ServerPlugin) PluginFilesAndMd5(org.sonar.server.plugins.PluginFilesAndMd5) File(java.io.File)

Aggregations

File (java.io.File)2 PluginInfo (org.sonar.core.platform.PluginInfo)1 PluginFilesAndMd5 (org.sonar.server.plugins.PluginFilesAndMd5)1 FileAndMd5 (org.sonar.server.plugins.PluginFilesAndMd5.FileAndMd5)1 ServerPlugin (org.sonar.server.plugins.ServerPlugin)1