Пример #1
0
 public void testExecuteWithUnspecifiedCompiledTestsDir() {
   setUpMocks(test);
   test.setTestClassesDir(null);
   try {
     test.execute();
     fail();
   } catch (Exception e) {
     assertThat(e.getCause(), Matchers.instanceOf(InvalidUserDataException.class));
   }
 }
Пример #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));
          }
        });
  }