use of com.facebook.buck.artifact_cache.NoopArtifactCache in project buck by facebook.
the class FakeBuildEngineTest method buildRuleFutureHasResult.
@Test
public void buildRuleFutureHasResult() throws Exception {
BuildTarget fakeBuildTarget = BuildTargetFactory.newInstance("//foo:bar");
SourcePathResolver pathResolver = new SourcePathResolver(new SourcePathRuleFinder(new BuildRuleResolver(TargetGraph.EMPTY, new DefaultTargetNodeToBuildRuleTransformer())));
FakeBuildRule fakeBuildRule = new FakeBuildRule(fakeBuildTarget, pathResolver);
BuildResult fakeBuildResult = BuildResult.success(fakeBuildRule, BUILT_LOCALLY, CacheResult.miss());
FakeBuildEngine fakeEngine = new FakeBuildEngine(ImmutableMap.of(fakeBuildTarget, fakeBuildResult), ImmutableMap.of(fakeBuildTarget, new RuleKey("00")));
assertThat(fakeEngine.build(BuildEngineBuildContext.builder().setBuildContext(FakeBuildContext.NOOP_CONTEXT).setArtifactCache(new NoopArtifactCache()).setBuildId(new BuildId()).setObjectMapper(ObjectMappers.newDefaultInstance()).setClock(new DefaultClock()).build(), TestExecutionContext.newInstance(), fakeBuildRule).get(), equalTo(fakeBuildResult));
}
Aggregations