org.sonar.api.utils.TempFolder Java Examples

The following examples show how to use org.sonar.api.utils.TempFolder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TsLintExecutorImplTest.java    From SonarTsPlugin with MIT License 6 votes vote down vote up
@Before
public void setUp() throws Exception {
    this.system = mock(System2.class);
    this.tempFolder = mock(TempFolder.class);

    this.tempOutputFile = mock(File.class);
    when(this.tempOutputFile.getAbsolutePath()).thenReturn("path/to/temp");
    when(this.tempFolder.newFile()).thenReturn(this.tempOutputFile);

    this.commandExecutor = mock(CommandExecutor.class);

    this.executorImpl = spy(new TsLintExecutorImpl(this.system, this.tempFolder));
    when(this.executorImpl.createExecutor()).thenReturn(this.commandExecutor);
    doReturn(mock(BufferedReader.class)).when(this.executorImpl).getBufferedReaderForFile(any(File.class));

    // Setup a default config, which each method will mutate as required
    this.config = new TsLintExecutorConfig();
    this.config.setPathToNode("node");
    this.config.setPathToTsLint("path/to/tslint");
    this.config.setConfigFile("path/to/config");
    this.config.setRulesDir("path/to/rules");
    this.config.setTimeoutMs(40000);
}
 
Example #2
Source File: RubocopExecutor.java    From sonar-ruby-plugin with MIT License 4 votes vote down vote up
public RubocopExecutor(System2 system, TempFolder tempFolder) {
    this.mustQuoteSpaceContainingPaths = system.isOsWindows();
    this.tempFolder = tempFolder;
}
 
Example #3
Source File: CodeGuardIssuesProvider.java    From sonar-tsql-plugin with GNU General Public License v3.0 4 votes vote down vote up
public CodeGuardIssuesProvider(final Settings settings, final TempFolder tempFolder) {
	this.reportsProvider = new CodeGuardExecutingReportsProvider(settings, tempFolder);
}
 
Example #4
Source File: CodeGuardExecutingReportsProvider.java    From sonar-tsql-plugin with GNU General Public License v3.0 4 votes vote down vote up
public CodeGuardExecutingReportsProvider(final Settings settings, final TempFolder folder) {
	this.settings = settings;
	this.folder = folder;
}
 
Example #5
Source File: CodeGuardIssuesLoaderSensor.java    From sonar-tsql-plugin with GNU General Public License v3.0 4 votes vote down vote up
public CodeGuardIssuesLoaderSensor(final Settings settings, final TempFolder tempFolder) {
	super(new CodeGuardIssuesProvider(settings, tempFolder), Constants.PLUGIN_SKIP_CG, Constants.CG_REPO_KEY);
}
 
Example #6
Source File: TsLintExecutorImpl.java    From SonarTsPlugin with MIT License 4 votes vote down vote up
public TsLintExecutorImpl(System2 system, TempFolder tempFolder) {
    this.mustQuoteSpaceContainingPaths = system.isOsWindows();
    this.tempFolder = tempFolder;
}