Search in sources :

Example 6 with NoopArtifactCache

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));
}
Also used : NoopArtifactCache(com.facebook.buck.artifact_cache.NoopArtifactCache) BuildId(com.facebook.buck.model.BuildId) BuildTarget(com.facebook.buck.model.BuildTarget) DefaultClock(com.facebook.buck.timing.DefaultClock) Test(org.junit.Test)

Aggregations

NoopArtifactCache (com.facebook.buck.artifact_cache.NoopArtifactCache)6 FakeAndroidDirectoryResolver (com.facebook.buck.android.FakeAndroidDirectoryResolver)4 ArtifactCache (com.facebook.buck.artifact_cache.ArtifactCache)4 BuckEventBus (com.facebook.buck.event.BuckEventBus)4 FakeJavaPackageFinder (com.facebook.buck.jvm.java.FakeJavaPackageFinder)4 Cell (com.facebook.buck.rules.Cell)4 TestCellBuilder (com.facebook.buck.rules.TestCellBuilder)4 FakeProjectFilesystem (com.facebook.buck.testutil.FakeProjectFilesystem)4 TestConsole (com.facebook.buck.testutil.TestConsole)4 Before (org.junit.Before)3 AndroidDirectoryResolver (com.facebook.buck.android.AndroidDirectoryResolver)2 ProjectFilesystem (com.facebook.buck.io.ProjectFilesystem)2 BuildId (com.facebook.buck.model.BuildId)2 DefaultClock (com.facebook.buck.timing.DefaultClock)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 Test (org.junit.Test)2 AndroidPlatformTarget (com.facebook.buck.android.AndroidPlatformTarget)1 ArtifactInfo (com.facebook.buck.artifact_cache.ArtifactInfo)1 SingletonArtifactCacheFactory (com.facebook.buck.artifact_cache.SingletonArtifactCacheFactory)1 BroadcastEventListener (com.facebook.buck.event.listener.BroadcastEventListener)1