Package org.japprove.repositories
Interface BaselineRepository
- All Known Implementing Classes:
BaselineRepositoryImpl
public interface BaselineRepository
A central administration point for the baselines and the baseline candidates.
-
Method Summary
Modifier and Type Method Description booleanbaselineExists(java.lang.String baselineCandidateName)Returns true if the baseline exists and false otherwise.voidcopyBaselineCandidateToBaseline(java.lang.String baselineCandidateName)Copies the content of the baseline candidate to the baseline.voidcreateBaselineCandidate(com.fasterxml.jackson.databind.JsonNode data, java.lang.String name)Creates a newJsonFileand writes the data into this file.voidcreateBaselineCandidate(java.lang.String data, java.lang.String name)Creates a newTextFileand writes the data into this file.java.io.FilegetBaselineAsFile(java.lang.String name)Returns the content of the baseline in a file.java.io.FilegetBaselineCandidateAsFile(java.lang.String name)Returns the content of the baseline candidate in a file.java.util.List<java.lang.String>getBaselineCandidateNames()Returns a list of all baseline candidates names.com.fasterxml.jackson.databind.JsonNodegetContentOfJsonBaseline(java.lang.String baseline)Returns the content of the requested baseline.java.lang.StringgetContentOfTextBaseline(java.lang.String baseline)Returns the content of the requested baseline.java.lang.StringgetDifferences(java.lang.String baselineCandidateName)Computes differences of the baseline candidate and the baseline.booleanremoveBaselineCandidate(java.lang.String name)Removes an baseline candidate by its name.
-
Method Details
-
createBaselineCandidate
void createBaselineCandidate(java.lang.String data, java.lang.String name) throws BaselineCandidateCreationFailedExceptionCreates a newTextFileand writes the data into this file.- Parameters:
data- The data that should be stored in theTextFilename- The name of the current baseline- Throws:
BaselineCandidateCreationFailedException- if the baseline candidate cannot be created
-
createBaselineCandidate
void createBaselineCandidate(com.fasterxml.jackson.databind.JsonNode data, java.lang.String name) throws BaselineCandidateCreationFailedExceptionCreates a newJsonFileand writes the data into this file.- Parameters:
data- The data that should be stored in theJsonFilename- The name of the current baseline- Throws:
BaselineCandidateCreationFailedException- if the baseline candidate cannot be created
-
removeBaselineCandidate
boolean removeBaselineCandidate(java.lang.String name)Removes an baseline candidate by its name.- Parameters:
name- the name of the baseline candidate that should be removed- Returns:
- true if the baseline candidate has successfully been removed, false otherwise.
-
getBaselineCandidateNames
java.util.List<java.lang.String> getBaselineCandidateNames()Returns a list of all baseline candidates names.- Returns:
- a list of all baseline candidates names.
-
getContentOfJsonBaseline
com.fasterxml.jackson.databind.JsonNode getContentOfJsonBaseline(java.lang.String baseline) throws BaselineNotFoundExceptionReturns the content of the requested baseline.- Parameters:
baseline- the baseline for which the content should be returned- Returns:
- the content of the baseline
- Throws:
BaselineNotFoundException- if the baseline cannot be found
-
getContentOfTextBaseline
java.lang.String getContentOfTextBaseline(java.lang.String baseline) throws BaselineNotFoundExceptionReturns the content of the requested baseline.- Parameters:
baseline- the baseline for which the content should be returned- Returns:
- the content of the baseline
- Throws:
BaselineNotFoundException- if the baseline cannot be found
-
copyBaselineCandidateToBaseline
void copyBaselineCandidateToBaseline(java.lang.String baselineCandidateName) throws BaselineCandidateNotFoundException, BaselineCreationFailedException, CopyingFailedExceptionCopies the content of the baseline candidate to the baseline.- Parameters:
baselineCandidateName- the name of the baseline candidate- Throws:
BaselineCandidateNotFoundException- if the candidate of the baseline cannot be foundBaselineCreationFailedException- if the baseline cannot be createdCopyingFailedException- in the case the content of the baseline candidate cannot be copied to the baseline
-
getDifferences
java.lang.String getDifferences(java.lang.String baselineCandidateName) throws BaselineCandidateNotFoundException, BaselineNotFoundExceptionComputes differences of the baseline candidate and the baseline.- Parameters:
baselineCandidateName- the name of the baseline candidate- Returns:
- a string with the differences
- Throws:
BaselineCandidateNotFoundException- if the candidate of the baseline cannot be foundBaselineNotFoundException- if the baseline cannot be found
-
baselineExists
boolean baselineExists(java.lang.String baselineCandidateName)Returns true if the baseline exists and false otherwise.- Parameters:
baselineCandidateName- the baseline candidate for which the baseline should be found.- Returns:
- true if the baseline exists and false otherwise.
-
getBaselineCandidateAsFile
java.io.File getBaselineCandidateAsFile(java.lang.String name) throws java.io.IOExceptionReturns the content of the baseline candidate in a file.- Parameters:
name- the name of the baseline candidate.- Returns:
- the content of the baseline candidate in a file.
- Throws:
java.io.IOException- in the case of problems with the created file.
-
getBaselineAsFile
java.io.File getBaselineAsFile(java.lang.String name) throws java.io.IOExceptionReturns the content of the baseline in a file.- Parameters:
name- the name of the baseline.- Returns:
- the content of the baseline in a file.
- Throws:
java.io.IOException- in the case of problems with the created file.
-