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);
}
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;
}
Aggregations