コード例 #1
0
    public void beforeExecute(Task task) {
      assertThat(current, nullValue());
      assertTrue(planned.contains(task));
      current = task;

      String taskPath = path(task);
      if (taskPath.startsWith(":buildSrc:")) {
        return;
      }

      executedTasks.add(taskPath);
    }
コード例 #2
0
  @Test
  public void delegatesDidWork() {
    context.checking(
        new Expectations() {
          {
            allowing(delegate).getDidWork();
            will(onConsecutiveCalls(returnValue(true), returnValue(false)));
          }
        });

    assertTrue(visitor.getDidWork());
    assertFalse(visitor.getDidWork());
  }
コード例 #3
0
  @Test
  public void testResolveAndRethrowFailureWithMissingDependenciesShouldThrowResolveException()
      throws IOException, ParseException {
    ModuleDescriptor moduleDescriptor = createAnonymousModuleDescriptor();
    prepareTestsThatRetrieveDependencies(moduleDescriptor);
    Exception failure = new Exception("broken");
    prepareResolveReportWithError(failure);
    ResolvedConfiguration configuration = ivyDependencyResolver.resolve(configurationStub);

    assertTrue(configuration.hasError());
    try {
      configuration.rethrowFailure();
      fail();
    } catch (ResolveException e) {
      assertThat(
          e.getMessage(), startsWith("Could not resolve all dependencies for <configuration>"));
      assertThat(e.getCause(), sameInstance((Throwable) failure));
    }
  }
コード例 #4
0
 public void assertCanExecute() {
   assertNull(getExecutable());
   assertTrue(getEnvironmentVars().isEmpty());
 }