Search in sources :

Example 6 with CheckStyleChecker

use of org.infernus.idea.checkstyle.checker.CheckStyleChecker in project checkstyle-idea by jshiell.

the class VersionMixExceptionTest method testSunnyDay.

/**
 * Test that everything works fine even when class loaders change, provided that
 * {@link org.infernus.idea.checkstyle.csapi.CheckstyleInternalObject CheckstyleInternalObject}s associated with
 * the expired class loaders are recreated.
 */
public void testSunnyDay() throws IOException, URISyntaxException {
    Module module = mock(Module.class);
    when(module.getProject()).thenReturn(project);
    CheckStyleChecker checker = createChecker(module);
    runChecker(checker);
    try {
        assertNotEquals(OTHER_VERSION, BASE_VERSION);
        csService.activateCheckstyleVersion(OTHER_VERSION, null);
        checker = createChecker(module);
        runChecker(checker);
    } finally {
        csService.activateCheckstyleVersion(BASE_VERSION, null);
    }
}
Also used : CheckStyleChecker(org.infernus.idea.checkstyle.checker.CheckStyleChecker) Module(com.intellij.openapi.module.Module)

Aggregations

CheckStyleChecker (org.infernus.idea.checkstyle.checker.CheckStyleChecker)6 Test (org.junit.Test)3 Module (com.intellij.openapi.module.Module)2 Project (com.intellij.openapi.project.Project)2 ConfigurationLocation (org.infernus.idea.checkstyle.model.ConfigurationLocation)2 CheckstyleActionsImpl (org.infernus.idea.checkstyle.service.CheckstyleActionsImpl)2 StringConfigurationLocation (org.infernus.idea.checkstyle.service.StringConfigurationLocation)2 Checker (com.puppycrawl.tools.checkstyle.Checker)1 Configuration (com.puppycrawl.tools.checkstyle.api.Configuration)1 TabWidthAndBaseDirProvider (org.infernus.idea.checkstyle.csapi.TabWidthAndBaseDirProvider)1 CheckstyleToolException (org.infernus.idea.checkstyle.exception.CheckstyleToolException)1 CheckstyleVersionMixException (org.infernus.idea.checkstyle.exception.CheckstyleVersionMixException)1 Configurations (org.infernus.idea.checkstyle.service.Configurations)1 CheckerWithConfig (org.infernus.idea.checkstyle.service.entities.CheckerWithConfig)1 NotNull (org.jetbrains.annotations.NotNull)1