Exemple #1
0
  @Before
  public void setUp() throws IOException, InterruptedException {
    console = new TestConsole();
    workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "target_command", tmp);
    workspace.setUp();

    filesystem = new ProjectFilesystem(workspace.getDestPath().toRealPath().normalize());
    Cell cell = new TestCellBuilder().setFilesystem(filesystem).build();
    AndroidDirectoryResolver androidDirectoryResolver = new FakeAndroidDirectoryResolver();
    ArtifactCache artifactCache = new NoopArtifactCache();
    BuckEventBus eventBus = BuckEventBusFactory.newInstance();
    objectMapper = new ObjectMapper();

    targetsCommand = new TargetsCommand();
    params =
        CommandRunnerParamsForTesting.createCommandRunnerParamsForTesting(
            console,
            cell,
            androidDirectoryResolver,
            artifactCache,
            eventBus,
            FakeBuckConfig.builder().build(),
            Platform.detect(),
            ImmutableMap.copyOf(System.getenv()),
            new FakeJavaPackageFinder(),
            objectMapper,
            Optional.<WebServer>absent());
    executor = MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor());
  }
  @Before
  public void setUp() throws IOException, InterruptedException {
    ProjectWorkspace workspace =
        TestDataHelper.createProjectWorkspaceForScenario(this, "query_command", tmp);
    workspace.setUp();
    Cell cell =
        new TestCellBuilder().setFilesystem(new ProjectFilesystem(workspace.getDestPath())).build();

    TestConsole console = new TestConsole();
    CommandRunnerParams params =
        CommandRunnerParamsForTesting.createCommandRunnerParamsForTesting(
            console,
            cell,
            new FakeAndroidDirectoryResolver(),
            new NoopArtifactCache(),
            BuckEventBusFactory.newInstance(),
            FakeBuckConfig.builder().build(),
            Platform.detect(),
            ImmutableMap.copyOf(System.getenv()),
            new FakeJavaPackageFinder(),
            new ObjectMapper(),
            Optional.<WebServer>absent());

    buckQueryEnvironment = new BuckQueryEnvironment(params, /* enableProfiling */ false);
    cellRoot = workspace.getDestPath();
    executor = MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor());
  }
 private CommandRunnerParams createAuditOwnerCommandRunnerParams(ProjectFilesystem filesystem)
     throws IOException, InterruptedException {
   ArtifactCache artifactCache = new NoopArtifactCache();
   BuckEventBus eventBus = BuckEventBusFactory.newInstance();
   AndroidDirectoryResolver androidDirectoryResolver = new FakeAndroidDirectoryResolver();
   Cell cell = new TestCellBuilder().setFilesystem(filesystem).build();
   return CommandRunnerParamsForTesting.createCommandRunnerParamsForTesting(
       console,
       cell,
       androidDirectoryResolver,
       artifactCache,
       eventBus,
       buckConfig,
       Platform.detect(),
       ImmutableMap.copyOf(System.getenv()),
       new FakeJavaPackageFinder(),
       new ObjectMapper(),
       Optional.<WebServer>absent());
 }