Java Code Examples for org.sonar.api.utils.TempFolder

The following examples show how to use org.sonar.api.utils.TempFolder. These examples are extracted from open source projects. 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 Project: SonarTsPlugin   Source File: TsLintExecutorImplTest.java    License: 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 Project: sonar-ruby-plugin   Source File: RubocopExecutor.java    License: MIT License 4 votes vote down vote up
public RubocopExecutor(System2 system, TempFolder tempFolder) {
    this.mustQuoteSpaceContainingPaths = system.isOsWindows();
    this.tempFolder = tempFolder;
}
 
Example 3
public CodeGuardIssuesProvider(final Settings settings, final TempFolder tempFolder) {
	this.reportsProvider = new CodeGuardExecutingReportsProvider(settings, tempFolder);
}
 
Example 4
public CodeGuardExecutingReportsProvider(final Settings settings, final TempFolder folder) {
	this.settings = settings;
	this.folder = folder;
}
 
Example 5
public CodeGuardIssuesLoaderSensor(final Settings settings, final TempFolder tempFolder) {
	super(new CodeGuardIssuesProvider(settings, tempFolder), Constants.PLUGIN_SKIP_CG, Constants.CG_REPO_KEY);
}
 
Example 6
Source Project: SonarTsPlugin   Source File: TsLintExecutorImpl.java    License: MIT License 4 votes vote down vote up
public TsLintExecutorImpl(System2 system, TempFolder tempFolder) {
    this.mustQuoteSpaceContainingPaths = system.isOsWindows();
    this.tempFolder = tempFolder;
}