use of org.infernus.idea.checkstyle.util.ProjectPaths in project checkstyle-idea by jshiell.
the class RelativeFileConfigurationLocationTest method setUp.
@Before
public void setUp() {
ProjectPaths projectPaths = mock(ProjectPaths.class);
Function<File, String> absolutePathOf = file -> {
// a nasty hack to pretend we're on a Windows box when required...
if (file.getPath().startsWith("c:")) {
return file.getPath().replace('/', '\\').replaceAll("\\\\\\\\", "\\\\");
}
return FilenameUtils.separatorsToUnix(file.getPath());
};
ProjectFilePaths testProjectFilePaths = new ProjectFilePaths(project, '/', absolutePathOf, projectPaths);
when(project.getService(ProjectFilePaths.class)).thenReturn(testProjectFilePaths);
when(projectBase.getPath()).thenReturn(PROJECT_BASE_PATH);
when(projectPaths.projectPath(project)).thenReturn(projectBase);
underTest = new RelativeFileConfigurationLocation(project);
underTest.setLocation("aLocation");
underTest.setDescription("aDescription");
}
Aggregations