Search in sources :

Example 6 with CheckstyleActionsImpl

use of org.infernus.idea.checkstyle.service.CheckstyleActionsImpl 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);
}
Also used : CheckstyleActionsImpl(org.infernus.idea.checkstyle.service.CheckstyleActionsImpl) CheckstyleInternalObject(org.infernus.idea.checkstyle.csapi.CheckstyleInternalObject) CheckstyleProjectService(org.infernus.idea.checkstyle.CheckstyleProjectService) Test(org.junit.Test)

Example 7 with CheckstyleActionsImpl

use of org.infernus.idea.checkstyle.service.CheckstyleActionsImpl 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);
}
Also used : CheckstyleActionsImpl(org.infernus.idea.checkstyle.service.CheckstyleActionsImpl) ConfigurationLocationFactory(org.infernus.idea.checkstyle.model.ConfigurationLocationFactory) CheckstyleInternalObject(org.infernus.idea.checkstyle.csapi.CheckstyleInternalObject) CheckstyleProjectService(org.infernus.idea.checkstyle.CheckstyleProjectService) Test(org.junit.Test)

Aggregations

CheckstyleActionsImpl (org.infernus.idea.checkstyle.service.CheckstyleActionsImpl)7 Test (org.junit.Test)7 CheckstyleProjectService (org.infernus.idea.checkstyle.CheckstyleProjectService)3 CheckstyleInternalObject (org.infernus.idea.checkstyle.csapi.CheckstyleInternalObject)3 Project (com.intellij.openapi.project.Project)2 CheckStyleChecker (org.infernus.idea.checkstyle.checker.CheckStyleChecker)2 ConfigurationLocation (org.infernus.idea.checkstyle.model.ConfigurationLocation)2 ConfigurationLocationFactory (org.infernus.idea.checkstyle.model.ConfigurationLocationFactory)2 StringConfigurationLocation (org.infernus.idea.checkstyle.service.StringConfigurationLocation)2 Checker (com.puppycrawl.tools.checkstyle.Checker)1 DefaultConfiguration (com.puppycrawl.tools.checkstyle.DefaultConfiguration)1 CheckerWithConfig (org.infernus.idea.checkstyle.service.entities.CheckerWithConfig)1