use of com.google.gerrit.server.util.git.DelegateSystemReader in project gerrit by GerritCodeReview.
the class StandaloneSiteTest method setFakeSystemReader.
private static SystemReader setFakeSystemReader(File tempDir) {
SystemReader oldSystemReader = SystemReader.getInstance();
SystemReader.setInstance(new DelegateSystemReader(oldSystemReader) {
@Override
public FileBasedConfig openJGitConfig(Config parent, FS fs) {
return new FileBasedConfig(parent, new File(tempDir, "jgit.config"), FS.detect());
}
@Override
public FileBasedConfig openUserConfig(Config parent, FS fs) {
return new FileBasedConfig(parent, new File(tempDir, "user.config"), FS.detect());
}
@Override
public FileBasedConfig openSystemConfig(Config parent, FS fs) {
return new FileBasedConfig(parent, new File(tempDir, "system.config"), FS.detect());
}
});
return oldSystemReader;
}
use of com.google.gerrit.server.util.git.DelegateSystemReader in project gerrit by GerritCodeReview.
the class AbstractDaemonTest method setFakeSystemReader.
private static SystemReader setFakeSystemReader(File tempDir) {
SystemReader oldSystemReader = SystemReader.getInstance();
SystemReader.setInstance(new DelegateSystemReader(oldSystemReader) {
@Override
public FileBasedConfig openJGitConfig(Config parent, FS fs) {
return new FileBasedConfig(parent, new File(tempDir, "jgit.config"), FS.detect());
}
@Override
public FileBasedConfig openUserConfig(Config parent, FS fs) {
return new FileBasedConfig(parent, new File(tempDir, "user.config"), FS.detect());
}
@Override
public FileBasedConfig openSystemConfig(Config parent, FS fs) {
return new FileBasedConfig(parent, new File(tempDir, "system.config"), FS.detect());
}
});
return oldSystemReader;
}
Aggregations