Class TestInputFileBuilder

java.lang.Object
org.sonar.api.batch.fs.internal.TestInputFileBuilder

public class TestInputFileBuilder extends Object
Intended to be used in unit tests that need to create InputFiles. An InputFile is unambiguously identified by a module key and a relative path, so these parameters are mandatory.

A module base directory is only needed to construct absolute paths.

Examples of usage of the constructors:

 InputFile file1 = TestInputFileBuilder.create("module1", "myfile.java").build();
 InputFile file2 = TestInputFileBuilder.create("", fs.baseDir(), myfile).build();
 

file1 will have the "module1" as both module key and module base directory. file2 has an empty string as module key, and a relative path which is the path from the filesystem base directory to myfile.

Since:
6.3