org.apache.maven.it
public class Verifier extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.lang.String |
localRepo |
Constructor and Description |
---|
Verifier(java.lang.String basedir) |
Verifier(java.lang.String basedir,
boolean debug) |
Verifier(java.lang.String basedir,
java.lang.String settingsFile) |
Verifier(java.lang.String basedir,
java.lang.String settingsFile,
boolean debug) |
Verifier(java.lang.String basedir,
java.lang.String settingsFile,
boolean debug,
boolean forkJvm) |
Modifier and Type | Method and Description |
---|---|
void |
assertArtifactContents(java.lang.String org,
java.lang.String artifact,
java.lang.String version,
java.lang.String type,
java.lang.String contents) |
void |
assertArtifactNotPresent(java.lang.String org,
java.lang.String name,
java.lang.String version,
java.lang.String ext) |
void |
assertArtifactPresent(java.lang.String org,
java.lang.String name,
java.lang.String version,
java.lang.String ext) |
void |
assertFileMatches(java.lang.String file,
java.lang.String regex)
Check that given file's content matches an regular expression.
|
void |
assertFileNotPresent(java.lang.String file) |
void |
assertFilePresent(java.lang.String file) |
void |
deleteArtifact(java.lang.String org,
java.lang.String name,
java.lang.String version,
java.lang.String ext) |
void |
deleteArtifacts(java.lang.String gid)
Deletes all artifacts in the specified group id from the local repository.
|
void |
deleteDirectory(java.lang.String path)
Deletes the specified directory.
|
void |
displayStreamBuffers() |
void |
executeGoal(java.lang.String goal) |
void |
executeGoal(java.lang.String goal,
java.util.Map envVars) |
void |
executeGoals(java.util.List goals) |
void |
executeGoals(java.util.List goals,
java.util.Map envVars) |
void |
executeHook(java.lang.String filename) |
java.io.File |
filterFile(java.lang.String srcPath,
java.lang.String dstPath,
java.lang.String fileEncoding,
java.util.Map filterProperties)
Filters a text file by replacing some user-defined tokens.
|
java.util.List |
getArtifactFileNameList(java.lang.String org,
java.lang.String name,
java.lang.String version,
java.lang.String ext) |
java.lang.String |
getArtifactMetadataPath(java.lang.String gid,
java.lang.String aid)
Gets the path to the local artifact metadata.
|
java.lang.String |
getArtifactMetadataPath(java.lang.String gid,
java.lang.String aid,
java.lang.String version)
Gets the path to the local artifact metadata.
|
java.lang.String |
getArtifactPath(java.lang.String org,
java.lang.String name,
java.lang.String version,
java.lang.String ext) |
java.lang.String |
getBasedir() |
java.util.List |
getCliOptions() |
java.lang.String |
getExecutable() |
java.lang.String |
getLogFileName()
Gets the name of the file used to log build output.
|
java.lang.String |
getMavenVersion() |
java.util.Properties |
getSystemProperties() |
java.util.Properties |
getVerifierProperties() |
boolean |
isAutoclean() |
boolean |
isMavenDebug() |
static void |
launchSubversion(java.lang.String line,
java.lang.String basedir) |
java.util.List |
loadFile(java.io.File file,
boolean hasCommand) |
java.util.List |
loadFile(java.lang.String basedir,
java.lang.String filename,
boolean hasCommand) |
java.util.List |
loadLines(java.lang.String filename,
java.lang.String encoding)
Loads the (non-empty) lines of the specified text file.
|
java.util.Properties |
loadProperties(java.lang.String filename) |
static void |
main(java.lang.String[] args) |
java.util.Properties |
newDefaultFilterProperties()
Gets a new copy of the default filter properties.
|
void |
resetStreams() |
void |
setAutoclean(boolean autoclean) |
void |
setCliOptions(java.util.List cliOptions) |
void |
setDebug(boolean debug) |
void |
setLocalRepo(java.lang.String localRepo) |
void |
setLogFileName(java.lang.String logFileName)
Sets the name of the file used to log build output.
|
void |
setMavenDebug(boolean mavenDebug) |
void |
setSystemProperties(java.util.Properties systemProperties) |
void |
setVerifierProperties(java.util.Properties verifierProperties) |
void |
verify(boolean chokeOnErrorOutput) |
void |
verifyErrorFreeLog() |
void |
verifyTextInLog(java.lang.String text)
Throws an exception if the text is not present in the log.
|
void |
writeFile(java.lang.String path,
java.lang.String contents)
Writes a text file with the specified contents.
|
public Verifier(java.lang.String basedir, java.lang.String settingsFile) throws VerificationException
VerificationException
public Verifier(java.lang.String basedir, java.lang.String settingsFile, boolean debug) throws VerificationException
VerificationException
public Verifier(java.lang.String basedir, java.lang.String settingsFile, boolean debug, boolean forkJvm) throws VerificationException
VerificationException
public Verifier(java.lang.String basedir) throws VerificationException
VerificationException
public Verifier(java.lang.String basedir, boolean debug) throws VerificationException
VerificationException
public void setLocalRepo(java.lang.String localRepo)
public void resetStreams()
public void displayStreamBuffers()
public void verify(boolean chokeOnErrorOutput) throws VerificationException
VerificationException
public void verifyErrorFreeLog() throws VerificationException
VerificationException
public void verifyTextInLog(java.lang.String text) throws VerificationException
text
- VerificationException
public java.util.Properties loadProperties(java.lang.String filename) throws VerificationException
VerificationException
public java.util.List loadLines(java.lang.String filename, java.lang.String encoding) throws java.io.IOException
filename
- The path to the text file to load, relative to the base directory, must not be null
.encoding
- The character encoding of the file, may be null
or empty to use the platform default
encoding.null
.java.io.IOException
- If the file could not be loaded.public java.util.List loadFile(java.lang.String basedir, java.lang.String filename, boolean hasCommand) throws VerificationException
VerificationException
public java.util.List loadFile(java.io.File file, boolean hasCommand) throws VerificationException
VerificationException
public java.lang.String getArtifactPath(java.lang.String org, java.lang.String name, java.lang.String version, java.lang.String ext)
public java.util.List getArtifactFileNameList(java.lang.String org, java.lang.String name, java.lang.String version, java.lang.String ext)
public java.lang.String getArtifactMetadataPath(java.lang.String gid, java.lang.String aid, java.lang.String version)
gid
- The group id, must not be null
.aid
- The artifact id, must not be null
.version
- The artifact version, must not be null
.null
.public java.lang.String getArtifactMetadataPath(java.lang.String gid, java.lang.String aid)
gid
- The group id, must not be null
.aid
- The artifact id, must not be null
.null
.public void executeHook(java.lang.String filename) throws VerificationException
VerificationException
public static void launchSubversion(java.lang.String line, java.lang.String basedir) throws VerificationException
VerificationException
public void deleteArtifact(java.lang.String org, java.lang.String name, java.lang.String version, java.lang.String ext) throws java.io.IOException
java.io.IOException
public void deleteArtifacts(java.lang.String gid) throws java.io.IOException
gid
- The group id whose artifacts should be deleted, must not be null
.java.io.IOException
- If the artifacts could not be deleted.public void deleteDirectory(java.lang.String path) throws java.io.IOException
path
- The path to the directory to delete, relative to the base directory, must not be null
.java.io.IOException
- If the directory could not be deleted.public void writeFile(java.lang.String path, java.lang.String contents) throws java.io.IOException
path
- The path to the file, relative to the base directory, must not be null
.contents
- The contents to write, must not be null
.java.io.IOException
- If the file could not be written.public java.io.File filterFile(java.lang.String srcPath, java.lang.String dstPath, java.lang.String fileEncoding, java.util.Map filterProperties) throws java.io.IOException
srcPath
- The path to the input file, relative to the base directory, must not be null
.dstPath
- The path to the output file, relative to the base directory and possibly equal to the input file,
must not be null
.fileEncoding
- The file encoding to use, may be null
or empty to use the platform's default
encoding.filterProperties
- The mapping from tokens to replacement values, must not be null
.null
.java.io.IOException
- If the file could not be filtered.public java.util.Properties newDefaultFilterProperties()
file:
URL, respectively.null
.public void assertFilePresent(java.lang.String file)
public void assertFileMatches(java.lang.String file, java.lang.String regex)
file
- the file to check.regex
- a regular expression.Pattern
public void assertFileNotPresent(java.lang.String file)
public void assertArtifactPresent(java.lang.String org, java.lang.String name, java.lang.String version, java.lang.String ext)
public void assertArtifactNotPresent(java.lang.String org, java.lang.String name, java.lang.String version, java.lang.String ext)
public void executeGoal(java.lang.String goal) throws VerificationException
VerificationException
public void executeGoal(java.lang.String goal, java.util.Map envVars) throws VerificationException
VerificationException
public void executeGoals(java.util.List goals) throws VerificationException
VerificationException
public java.lang.String getExecutable()
public void executeGoals(java.util.List goals, java.util.Map envVars) throws VerificationException
VerificationException
public java.lang.String getMavenVersion() throws VerificationException
VerificationException
public static void main(java.lang.String[] args) throws VerificationException
VerificationException
public void assertArtifactContents(java.lang.String org, java.lang.String artifact, java.lang.String version, java.lang.String type, java.lang.String contents) throws java.io.IOException
java.io.IOException
public java.util.List getCliOptions()
public void setCliOptions(java.util.List cliOptions)
public java.util.Properties getSystemProperties()
public void setSystemProperties(java.util.Properties systemProperties)
public java.util.Properties getVerifierProperties()
public void setVerifierProperties(java.util.Properties verifierProperties)
public boolean isAutoclean()
public void setAutoclean(boolean autoclean)
public java.lang.String getBasedir()
public java.lang.String getLogFileName()
null
.public void setLogFileName(java.lang.String logFileName)
logFileName
- The name of the log file, relative to the base directory, must not be empty or
null
.public void setDebug(boolean debug)
public boolean isMavenDebug()
public void setMavenDebug(boolean mavenDebug)
Copyright © 2014. All Rights Reserved.