Example #1
0
  private void configureTask() {
    test.useTestFramework(testFrameworkMock);
    test.setTestExecuter(testExecuterMock);

    test.setTestClassesDir(classesDir);
    test.setTestResultsDir(resultsDir);
    test.setTestReportDir(reportDir);
    test.setClasspath(classpathMock);
    test.setTestSrcDirs(Collections.<File>emptyList());
  }
Example #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));
          }
        });
  }