@@ -0,0 +1,1515 @@
+/*%0A * Copyright 2016-present Facebook, Inc.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22); you may%0A * not use this file except in compliance with the License. You may obtain%0A * a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A * License for the specific language governing permissions and limitations%0A * under the License.%0A */%0A%0Apackage com.facebook.buck.rules;%0A%0Aimport com.facebook.buck.model.BuildTarget;%0A%0Aimport java.nio.file.Path;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0A/**%0A * Wrapper for %7B@link SourcePathResolver%7D with some helpers for tests..%0A */%0Apublic final class FakeSourcePathResolver extends SourcePathResolver %7B%0A  private Map%3CBuildTarget, BuildRule%3E knownRules = new HashMap%3C%3E();%0A%0A  public FakeSourcePathResolver(BuildRuleResolver ruleResolver) %7B%0A    super(ruleResolver);%0A  %7D%0A%0A  public void addRule(BuildRule rule) %7B%0A    knownRules.put(rule.getBuildTarget(), rule);%0A  %7D%0A%0A  @Override%0A  public Path getAbsolutePath(SourcePath sourcePath) %7B%0A    if (sourcePath instanceof BuildTargetSourcePath) %7B%0A      BuildRule rule = knownRules.get(((BuildTargetSourcePath) sourcePath).getTarget());%0A      if (rule != null) %7B%0A        return rule.getPathToOutput();%0A      %7D%0A    %7D%0A%0A    return super.getAbsolutePath(sourcePath);%0A  %7D%0A%7D%0A

Add FakeSourcePathResolver