use of com.google.devtools.build.lib.testutil.Scratch in project bazel by bazelbuild.
the class RepositoryCacheTest method setUp.
@Before
public void setUp() throws Exception {
scratch = new Scratch("/");
repositoryCachePath = scratch.dir("/repository_cache");
repositoryCache = new RepositoryCache();
repositoryCache.setRepositoryCachePath(repositoryCachePath);
contentAddressableCachePath = repositoryCache.getContentAddressableCachePath();
downloadedFile = scratch.file("file.tmp", Charset.defaultCharset(), "contents");
downloadedFileSha256 = "bfe5ed57e6e323555b379c660aa8d35b70c2f8f07cf03ad6747266495ac13be0";
}
use of com.google.devtools.build.lib.testutil.Scratch in project bazel by bazelbuild.
the class PackageFactoryTestBase method initializeFileSystem.
@Before
public final void initializeFileSystem() throws Exception {
FileSystem fs = new InMemoryFileSystem() {
@Override
public Collection<Dirent> readdir(Path path, boolean followSymlinks) throws IOException {
if (path.equals(throwOnReaddir)) {
throw new FileNotFoundException(path.getPathString());
}
return super.readdir(path, followSymlinks);
}
};
Path tmpPath = fs.getPath("/tmp");
scratch = new Scratch(tmpPath);
}
use of com.google.devtools.build.lib.testutil.Scratch in project bazel by bazelbuild.
the class TopLevelArtifactHelperTest method setRootDir.
@Before
public final void setRootDir() throws Exception {
Scratch scratch = new Scratch();
path = scratch.dir("/foo");
root = Root.asDerivedRoot(scratch.dir("/"));
}
use of com.google.devtools.build.lib.testutil.Scratch in project bazel by bazelbuild.
the class ScratchAttributeWriter method write.
/**
* Writes this scratch target to this ScratchAttributeWriter's Scratch instance, and returns the
* target in the given configuration.
*/
public ConfiguredTarget write(BuildConfiguration config) throws Exception {
Scratch scratch = testCase.getScratch();
buildString.append(")");
scratch.file(String.format("%s/BUILD", packageName), buildString.toString());
return testCase.getConfiguredTarget(String.format("//%s:%s", packageName, targetName), config);
}
use of com.google.devtools.build.lib.testutil.Scratch in project bazel by bazelbuild.
the class GrpcActionCacheTest method setUp.
@Before
public final void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
scratch = new Scratch();
rootDir = Root.asDerivedRoot(scratch.dir("/exec/root"));
server.start();
}
Aggregations