Exemple #1
0
  @org.junit.Test
  public void testExecuteWithNonExistingCompiledTestsDir() {
    setUpMocks(test);
    test.setUnmanagedClasspath(null);
    context.checking(
        new Expectations() {
          {
            allowing(existentDirsFilterMock)
                .checkExistenceAndThrowStopActionIfNot(TEST_TEST_CLASSES_DIR);
            will(throwException(new StopActionException()));
          }
        });
    test.existingDirsFilter = existentDirsFilterMock;

    test.execute();
  }
Exemple #2
0
  private void setUpMocks(final Test test) {
    test.setTestClassesDir(TEST_TEST_CLASSES_DIR);
    test.setTestResultsDir(TEST_TEST_RESULTS_DIR);
    test.setTestReportDir(TEST_TEST_REPORT_DIR);
    test.setUnmanagedClasspath(TEST_UNMANAGED_CLASSPATH);
    test.setConfiguration(configurationMock);
    test.classpathConverter = classpathConverterMock;

    context.checking(
        new Expectations() {
          {
            allowing(configurationMock).iterator();
            will(returnIterator(TEST_DEPENDENCY_MANAGER_CLASSPATH));
            allowing(classpathConverterMock)
                .createFileClasspath(
                    TEST_ROOT_DIR,
                    GUtil.addLists(
                        WrapUtil.toList(TEST_TEST_CLASSES_DIR),
                        TEST_UNMANAGED_CLASSPATH,
                        TEST_DEPENDENCY_MANAGER_CLASSPATH));
            will(returnValue(TEST_CONVERTED_CLASSPATH));
          }
        });
  }