Search in sources :

Example 1 with CheckStyleConfigPanel

use of org.infernus.idea.checkstyle.ui.CheckStyleConfigPanel 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;
}
Also used : CheckStyleConfigPanel(org.infernus.idea.checkstyle.ui.CheckStyleConfigPanel) ConfigurationLocationFactory(org.infernus.idea.checkstyle.model.ConfigurationLocationFactory) ConfigurationLocation(org.infernus.idea.checkstyle.model.ConfigurationLocation) PluginConfiguration(org.infernus.idea.checkstyle.config.PluginConfiguration)

Example 2 with CheckStyleConfigPanel

use of org.infernus.idea.checkstyle.ui.CheckStyleConfigPanel in project checkstyle-idea by jshiell.

the class CheckStyleConfigurableTest method testIsModified.

@Test
public void testIsModified() {
    Project mockProject = mock(Project.class);
    CheckStyleConfigPanel mockPanel = buildMockPanel(mockProject);
    CheckStyleConfigurable classUnderTest = new CheckStyleConfigurable(mockProject, mockPanel, mock(CheckstyleProjectService.class), mockPluginConfigurationManager(mockProject));
    assertFalse(classUnderTest.isModified());
}
Also used : Project(com.intellij.openapi.project.Project) CheckStyleConfigPanel(org.infernus.idea.checkstyle.ui.CheckStyleConfigPanel) Test(org.junit.Test)

Aggregations

CheckStyleConfigPanel (org.infernus.idea.checkstyle.ui.CheckStyleConfigPanel)2 Project (com.intellij.openapi.project.Project)1 PluginConfiguration (org.infernus.idea.checkstyle.config.PluginConfiguration)1 ConfigurationLocation (org.infernus.idea.checkstyle.model.ConfigurationLocation)1 ConfigurationLocationFactory (org.infernus.idea.checkstyle.model.ConfigurationLocationFactory)1 Test (org.junit.Test)1