RerunHandler rerunHandler) {
ExceptionHelper.checkNotNullArgument(name, "name");
ExceptionHelper.checkNotNullArgument(project, "project");
TestSession session = nodeFactory != null
? new TestSession(name, project, TestSession.SessionType.TEST, nodeFactory)
: new TestSession(name, project, TestSession.SessionType.TEST);
// RerunHandler must be added right after creating the session
// otherwise it will be ignore by the rerun buttons.
if (rerunHandler != null) {
session.setRerunHandler(rerunHandler);
}
manager.testStarted(session);
return new NbGradleTestSessionImpl(manager, session);
}