public void testExecuteWithUnspecifiedTestResultsDir() { setUpMocks(test); test.setTestResultsDir(null); try { test.execute(); fail(); } catch (Exception e) { assertThat(e.getCause(), Matchers.instanceOf(InvalidUserDataException.class)); } }
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)); } }); }