예제 #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());
  }
  @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());
 }