use of org.infernus.idea.checkstyle.service.CheckstyleActionsImpl in project checkstyle-idea by jshiell.
the class OpCreateCheckerTest method testCreateChecker_noConfigLoc.
@Test(expected = CheckStylePluginException.class)
public void testCreateChecker_noConfigLoc() {
// noinspection ConstantConditions
new CheckstyleActionsImpl(PROJECT, checkstyleProjectServiceMock).createChecker(moduleMock, null, emptyMap(), configurationsMock, getClass().getClassLoader());
fail("expected exception was not thrown");
}
use of org.infernus.idea.checkstyle.service.CheckstyleActionsImpl in project checkstyle-idea by jshiell.
the class OpCreateCheckerTest method testCreateCheckerWithConfigsMock.
@Test
public void testCreateCheckerWithConfigsMock() throws IOException, URISyntaxException {
final ConfigurationLocation configLoc = new StringConfigurationLocation(FileUtil.readFile("cmd/" + CONFIG_FILE), mock(Project.class));
final CheckStyleChecker checker = new CheckstyleActionsImpl(PROJECT, checkstyleProjectServiceMock).createChecker(moduleMock, configLoc, emptyMap(), configurationsMock, getClass().getClassLoader());
assertNotNull(checker);
}
use of org.infernus.idea.checkstyle.service.CheckstyleActionsImpl in project checkstyle-idea by jshiell.
the class OpCreateCheckerTest method testCreateChecker_noModule.
@Test
public void testCreateChecker_noModule() throws IOException, URISyntaxException {
final ConfigurationLocation configLoc = new StringConfigurationLocation(FileUtil.readFile("cmd/" + CONFIG_FILE), mock(Project.class));
// noinspection ConstantConditions
CheckStyleChecker checker = new CheckstyleActionsImpl(PROJECT, checkstyleProjectServiceMock).createChecker(null, configLoc, emptyMap(), configurationsMock, getClass().getClassLoader());
assertNotNull(checker);
}
use of org.infernus.idea.checkstyle.service.CheckstyleActionsImpl in project checkstyle-idea by jshiell.
the class OpDestroyCheckerTest method testDestroyChecker.
@Test
public void testDestroyChecker() {
CheckerWithConfig checkerWithConfig = new CheckerWithConfig(new Checker(), new DefaultConfiguration("testConfig"));
new CheckstyleActionsImpl(PROJECT, mock(CheckstyleProjectService.class)).destroyChecker(checkerWithConfig);
}
use of org.infernus.idea.checkstyle.service.CheckstyleActionsImpl in project checkstyle-idea by jshiell.
the class OpLoadConfigurationTest method testLoadBundledSunChecks.
@Test
public void testLoadBundledSunChecks() {
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.SUN_CHECKS, mock(Project.class)), true, null);
Assert.assertNotNull(csConfig);
}
Aggregations