• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  *
3  */
4 package org.junit.experimental.results;
5 
6 import java.util.List;
7 
8 import org.junit.runner.Result;
9 import org.junit.runner.notification.Failure;
10 import org.junit.runner.notification.RunListener;
11 
12 class FailureList {
13 	private final List<Failure> failures;
14 
FailureList(List<Failure> failures)15 	public FailureList(List<Failure> failures) {
16 		this.failures= failures;
17 	}
18 
result()19 	public Result result() {
20 		Result result= new Result();
21 		RunListener listener= result.createListener();
22 		for (Failure failure : failures) {
23 			try {
24 				listener.testFailure(failure);
25 			} catch (Exception e) {
26 				throw new RuntimeException("I can't believe this happened");
27 			}
28 		}
29 		return result;
30 	}
31 }