use of org.infernus.idea.checkstyle.config.PluginConfiguration in project checkstyle-idea by jshiell.
the class CheckStyleConfigurableTest method buildMockPanel.
private CheckStyleConfigPanel buildMockPanel(final Project mockProject) {
CheckStyleConfigPanel mockPanel = mock(CheckStyleConfigPanel.class);
final SortedSet<ConfigurationLocation> mockLocations = buildMockLocations(mockProject, new ConfigurationLocationFactory());
final PluginConfiguration mockConfigDto = PluginConfigurationBuilder.testInstance("7.1.2").withLocations(mockLocations).withThirdPartyClassPath(Arrays.asList("cp1", "cp2")).withActiveLocation(mockLocations.first()).build();
when(mockPanel.getPluginConfiguration()).thenReturn(mockConfigDto);
return mockPanel;
}
use of org.infernus.idea.checkstyle.config.PluginConfiguration in project checkstyle-idea by jshiell.
the class ServiceLayerBasicTest method setUp.
@BeforeClass
public static void setUp() {
PluginConfigurationManager mockPluginConfig = mock(PluginConfigurationManager.class);
final PluginConfiguration mockConfigDto = PluginConfigurationBuilder.testInstance(currentCsVersion()).build();
when(mockPluginConfig.getCurrent()).thenReturn(mockConfigDto);
when(PROJECT.getService(PluginConfigurationManager.class)).thenReturn(mockPluginConfig);
checkstyleProjectService = new CheckstyleProjectService(PROJECT);
}
use of org.infernus.idea.checkstyle.config.PluginConfiguration in project checkstyle-idea by jshiell.
the class CheckStyleConfigurable method apply.
public void apply() {
final PluginConfiguration newConfig = PluginConfigurationBuilder.from(configPanel.getPluginConfiguration()).withScanBeforeCheckin(pluginConfigurationManager.getCurrent().isScanBeforeCheckin()).build();
pluginConfigurationManager.setCurrent(newConfig, true);
activateCurrentCheckstyleVersion(newConfig.getCheckstyleVersion(), newConfig.getThirdPartyClasspath());
if (!newConfig.isCopyLibs()) {
new TempDirProvider().deleteCopiedLibrariesDir(project);
}
}
use of org.infernus.idea.checkstyle.config.PluginConfiguration in project checkstyle-idea by jshiell.
the class VersionMixExceptionTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
PluginConfigurationManager mockPluginConfig = mock(PluginConfigurationManager.class);
final PluginConfiguration mockConfigDto = PluginConfigurationBuilder.testInstance(BASE_VERSION).build();
when(mockPluginConfig.getCurrent()).thenReturn(mockConfigDto);
when(project.getService(PluginConfigurationManager.class)).thenReturn(mockPluginConfig);
csService = new CheckstyleProjectService(project);
csService.activateCheckstyleVersion(BASE_VERSION, null);
}
use of org.infernus.idea.checkstyle.config.PluginConfiguration in project checkstyle-idea by jshiell.
the class CheckStyleConfigurableTest method mockPluginConfigurationManager.
private PluginConfigurationManager mockPluginConfigurationManager(@NotNull final Project project) {
final ConfigurationLocationFactory mockLocFactory = new ConfigurationLocationFactory();
final SortedSet<ConfigurationLocation> mockLocations = buildMockLocations(project, mockLocFactory);
final PluginConfiguration mockConfigDto = PluginConfigurationBuilder.testInstance("7.1.2").withLocations(mockLocations).withThirdPartyClassPath(Arrays.asList("cp1", "cp2")).withActiveLocation(mockLocations.first()).build();
PluginConfigurationManager mockConfig = mock(PluginConfigurationManager.class);
when(mockConfig.getCurrent()).thenReturn(mockConfigDto);
return mockConfig;
}
Aggregations