Coverage Report - liquibase.exception.PreconditionFailedException
 
Classes in this File Line Coverage Branch Coverage Complexity
PreconditionFailedException
100%
10/10
N/A
1
 
 1  
 package liquibase.exception;
 2  
 
 3  
 import liquibase.changelog.DatabaseChangeLog;
 4  
 import liquibase.precondition.Precondition;
 5  
 import liquibase.precondition.core.FailedPrecondition;
 6  
 
 7  
 import java.util.ArrayList;
 8  
 import java.util.List;
 9  
 
 10  
 /**
 11  
  * Thrown when a precondition failed.
 12  
  */
 13  
 public class PreconditionFailedException extends Exception {
 14  
 
 15  
     private static final long serialVersionUID = 1L;
 16  
     private List<FailedPrecondition> failedPreconditions;
 17  
 
 18  
     public PreconditionFailedException(String message, DatabaseChangeLog changeLog, Precondition precondition) {
 19  1
         this(new FailedPrecondition(message, changeLog, precondition));
 20  1
     }
 21  
 
 22  
     public PreconditionFailedException(FailedPrecondition failedPrecondition) {
 23  1
         super("Preconditions Failed");
 24  1
         this.failedPreconditions = new ArrayList<FailedPrecondition>();
 25  1
         failedPreconditions.add(failedPrecondition);
 26  1
     }
 27  
 
 28  
     public PreconditionFailedException(List<FailedPrecondition> failedPreconditions) {
 29  1
         super("Preconditions Failed");
 30  1
         this.failedPreconditions = failedPreconditions;
 31  1
     }
 32  
 
 33  
     public List<FailedPrecondition> getFailedPreconditions() {
 34  3
         return failedPreconditions;
 35  
     }
 36  
 
 37  
 }