use of org.infernus.idea.checkstyle.CheckstyleProjectService in project checkstyle-idea by jshiell.
the class OpLoadConfigurationTest method testLoadFromString.
@Test
public void testLoadFromString() throws IOException, URISyntaxException {
CheckstyleProjectService projectService = mock(CheckstyleProjectService.class);
when(projectService.underlyingClassLoader()).thenReturn(getClass().getClassLoader());
final String configXml = FileUtil.readFile("cmd/config-ok.xml");
CheckstyleInternalObject csConfig = new CheckstyleActionsImpl(PROJECT, projectService).loadConfiguration(configXml);
Assert.assertNotNull(csConfig);
}
use of org.infernus.idea.checkstyle.CheckstyleProjectService in project checkstyle-idea by jshiell.
the class OpLoadConfigurationTest method testLoadBundledGoogleChecks.
@Test
public void testLoadBundledGoogleChecks() {
final ConfigurationLocationFactory clf = new ConfigurationLocationFactory();
CheckstyleProjectService projectService = mock(CheckstyleProjectService.class);
when(projectService.underlyingClassLoader()).thenReturn(getClass().getClassLoader());
CheckstyleInternalObject csConfig = new CheckstyleActionsImpl(PROJECT, projectService).loadConfiguration(clf.create(BundledConfig.GOOGLE_CHECKS, mock(Project.class)), true, null);
Assert.assertNotNull(csConfig);
}
use of org.infernus.idea.checkstyle.CheckstyleProjectService in project checkstyle-idea by jshiell.
the class CodeStyleImporterTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
PluginConfigurationManager mockPluginConfig = mock(PluginConfigurationManager.class);
final PluginConfiguration mockConfigDto = PluginConfigurationBuilder.testInstance("8.0").build();
when(mockPluginConfig.getCurrent()).thenReturn(mockConfigDto);
when(project.getService(PluginConfigurationManager.class)).thenReturn(mockPluginConfig);
csService = new CheckstyleProjectService(project);
codeStyleSettings = CodeStyleSettingsManager.createTestSettings(CodeStyleSettings.getDefaults());
javaSettings = codeStyleSettings.getCommonSettings(JavaLanguage.INSTANCE);
}
Aggregations