|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.maven.it.Verifier
public class Verifier
Constructor Summary | |
---|---|
Verifier(String basedir)
|
|
Verifier(String basedir,
boolean debug)
|
|
Verifier(String basedir,
String settingsFile)
|
|
Verifier(String basedir,
String settingsFile,
boolean debug)
|
|
Verifier(String basedir,
String settingsFile,
boolean debug,
boolean forkJvm)
|
|
Verifier(String basedir,
String settingsFile,
boolean debug,
boolean forkJvm,
String[] defaultCliOptions)
|
|
Verifier(String basedir,
String settingsFile,
boolean debug,
String[] defaultCliOptions)
|
Method Summary | |
---|---|
void |
addCliOption(String option)
|
void |
assertArtifactContents(String org,
String artifact,
String version,
String type,
String contents)
|
void |
assertArtifactNotPresent(String org,
String name,
String version,
String ext)
|
void |
assertArtifactPresent(String org,
String name,
String version,
String ext)
|
void |
assertFileMatches(String file,
String regex)
Check that given file's content matches an regular expression. |
void |
assertFileNotPresent(String file)
|
void |
assertFilePresent(String file)
|
void |
deleteArtifact(String org,
String name,
String version,
String ext)
|
void |
deleteArtifacts(String gid)
Deletes all artifacts in the specified group id from the local repository. |
void |
deleteArtifacts(String gid,
String aid,
String version)
Deletes all artifacts in the specified g:a:v from the local repository. |
void |
deleteDirectory(String path)
Deletes the specified directory. |
void |
displayStreamBuffers()
|
void |
executeGoal(String goal)
|
void |
executeGoal(String goal,
Map<String,String> envVars)
|
void |
executeGoals(List<String> goals)
|
void |
executeGoals(List<String> goals,
Map<String,String> envVars)
|
void |
executeHook(String filename)
|
File |
filterFile(String srcPath,
String dstPath,
String fileEncoding,
Map<String,String> filterProperties)
Filters a text file by replacing some user-defined tokens. |
File |
filterFile(String srcPath,
String dstPath,
String fileEncoding,
Properties filterProperties)
Deprecated. use filterFile(String, String, String, Map) |
List<String> |
getArtifactFileNameList(String org,
String name,
String version,
String ext)
|
String |
getArtifactMetadataPath(String gid,
String aid)
Gets the path to the local artifact metadata. |
String |
getArtifactMetadataPath(String gid,
String aid,
String version)
Gets the path to the local artifact metadata. |
String |
getArtifactMetadataPath(String gid,
String aid,
String version,
String filename)
Gets the path to a file in the local artifact directory. |
String |
getArtifactPath(String org,
String name,
String version,
String ext)
|
String |
getArtifactPath(String gid,
String aid,
String version,
String ext,
String classifier)
Returns the absolute path to the artifact denoted by groupId, artifactId, version, extension and classifier. |
String |
getBasedir()
|
List<String> |
getCliOptions()
|
Map<String,String> |
getEnvironmentVariables()
|
String |
getExecutable()
|
String |
getLocalRepoLayout()
|
String |
getLocalRepository()
|
String |
getLogFileName()
Gets the name of the file used to log build output. |
String |
getMavenVersion()
|
Properties |
getSystemProperties()
|
Properties |
getVerifierProperties()
|
boolean |
isAutoclean()
|
boolean |
isDebugJvm()
|
boolean |
isMavenDebug()
|
static void |
launchSubversion(String line,
String basedir)
|
List<String> |
loadFile(File file,
boolean hasCommand)
|
List<String> |
loadFile(String basedir,
String filename,
boolean hasCommand)
|
List<String> |
loadLines(String filename,
String encoding)
Loads the (non-empty) lines of the specified text file. |
Properties |
loadProperties(String filename)
|
static void |
main(String[] args)
|
Properties |
newDefaultFilterProperties()
Gets a new copy of the default filter properties. |
void |
resetStreams()
|
void |
setAutoclean(boolean autoclean)
|
void |
setCliOptions(List<String> cliOptions)
|
void |
setDebug(boolean debug)
|
void |
setDebugJvm(boolean debugJvm)
|
void |
setEnvironmentVariable(String key,
String value)
|
void |
setEnvironmentVariables(Map<String,String> environmentVariables)
|
void |
setForkJvm(boolean forkJvm)
|
void |
setLocalRepo(String localRepo)
|
void |
setLocalRepoLayout(String localRepoLayout)
|
void |
setLogFileName(String logFileName)
Sets the name of the file used to log build output. |
void |
setMavenDebug(boolean mavenDebug)
|
void |
setSystemProperties(Properties systemProperties)
|
void |
setSystemProperty(String key,
String value)
|
void |
setVerifierProperties(Properties verifierProperties)
|
void |
verify(boolean chokeOnErrorOutput)
|
void |
verifyErrorFreeLog()
|
void |
verifyTextInLog(String text)
Throws an exception if the text is not present in the log. |
void |
writeFile(String path,
String contents)
Writes a text file with the specified contents. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Verifier(String basedir) throws VerificationException
VerificationException
public Verifier(String basedir, boolean debug) throws VerificationException
VerificationException
public Verifier(String basedir, String settingsFile) throws VerificationException
VerificationException
public Verifier(String basedir, String settingsFile, boolean debug) throws VerificationException
VerificationException
public Verifier(String basedir, String settingsFile, boolean debug, String[] defaultCliOptions) throws VerificationException
VerificationException
public Verifier(String basedir, String settingsFile, boolean debug, boolean forkJvm) throws VerificationException
VerificationException
public Verifier(String basedir, String settingsFile, boolean debug, boolean forkJvm, String[] defaultCliOptions) throws VerificationException
VerificationException
Method Detail |
---|
public void setLocalRepo(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(String text) throws VerificationException
text
- the text to assert present
VerificationException
public Properties loadProperties(String filename) throws VerificationException
VerificationException
public List<String> loadLines(String filename, String encoding) throws 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
.
IOException
- If the file could not be loaded.public List<String> loadFile(String basedir, String filename, boolean hasCommand) throws VerificationException
VerificationException
public List<String> loadFile(File file, boolean hasCommand) throws VerificationException
VerificationException
public String getArtifactPath(String org, String name, String version, String ext)
public String getArtifactPath(String gid, String aid, String version, String ext, String classifier)
gid
- The groupId, must not be null.aid
- The artifactId, must not be null.version
- The version, must not be null.ext
- The extension, must not be null.classifier
- The classifier, may be null to be omitted.
public List<String> getArtifactFileNameList(String org, String name, String version, String ext)
public String getArtifactMetadataPath(String gid, String aid, String version)
gid
- The group id, must not be null
.aid
- The artifact id, must not be null
.version
- The artifact version, may be null
.
null
.public String getArtifactMetadataPath(String gid, String aid, String version, String filename)
gid
- The group id, must not be null
.aid
- The artifact id, may be null
.version
- The artifact version, may be null
.filename
- The filename to use, must not be null
.
null
.public String getArtifactMetadataPath(String gid, String aid)
gid
- The group id, must not be null
.aid
- The artifact id, must not be null
.
null
.public void executeHook(String filename) throws VerificationException
VerificationException
public static void launchSubversion(String line, String basedir) throws VerificationException
VerificationException
public void deleteArtifact(String org, String name, String version, String ext) throws IOException
IOException
public void deleteArtifacts(String gid) throws IOException
gid
- The group id whose artifacts should be deleted, must not be null
.
IOException
- If the artifacts could not be deleted.public void deleteArtifacts(String gid, String aid, String version) throws IOException
gid
- The group id whose artifacts should be deleted, must not be null
.aid
- The artifact id whose artifacts should be deleted, must not be null
.version
- The (base) version whose artifacts should be deleted, must not be null
.
IOException
- If the artifacts could not be deleted.public void deleteDirectory(String path) throws IOException
path
- The path to the directory to delete, relative to the base directory, must not be null
.
IOException
- If the directory could not be deleted.public void writeFile(String path, String contents) throws 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
.
IOException
- If the file could not be written.public File filterFile(String srcPath, String dstPath, String fileEncoding, Map<String,String> filterProperties) throws 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
.
IOException
- If the file could not be filtered.public File filterFile(String srcPath, String dstPath, String fileEncoding, Properties filterProperties) throws IOException
filterFile(String, String, String, Map)
newDefaultFilterProperties()
. Need to remove both methods and update all clients eventually/
IOException
public Properties newDefaultFilterProperties()
file:
URL, respectively.
null
.public void assertFilePresent(String file)
public void assertFileMatches(String file, String regex)
file
- the file to check.regex
- a regular expression.Pattern
public void assertFileNotPresent(String file)
public void assertArtifactPresent(String org, String name, String version, String ext)
public void assertArtifactNotPresent(String org, String name, String version, String ext)
public void executeGoal(String goal) throws VerificationException
VerificationException
public void executeGoal(String goal, Map<String,String> envVars) throws VerificationException
VerificationException
public void executeGoals(List<String> goals) throws VerificationException
VerificationException
public String getExecutable()
public void executeGoals(List<String> goals, Map<String,String> envVars) throws VerificationException
VerificationException
public String getMavenVersion() throws VerificationException
VerificationException
public static void main(String[] args) throws VerificationException
VerificationException
public void assertArtifactContents(String org, String artifact, String version, String type, String contents) throws IOException
IOException
public List<String> getCliOptions()
public void setCliOptions(List<String> cliOptions)
public void addCliOption(String option)
public Properties getSystemProperties()
public void setSystemProperties(Properties systemProperties)
public void setSystemProperty(String key, String value)
public Map<String,String> getEnvironmentVariables()
public void setEnvironmentVariables(Map<String,String> environmentVariables)
public void setEnvironmentVariable(String key, String value)
public Properties getVerifierProperties()
public void setVerifierProperties(Properties verifierProperties)
public boolean isAutoclean()
public void setAutoclean(boolean autoclean)
public String getBasedir()
public String getLogFileName()
null
.public void setLogFileName(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)
public void setForkJvm(boolean forkJvm)
public boolean isDebugJvm()
public void setDebugJvm(boolean debugJvm)
public String getLocalRepoLayout()
public void setLocalRepoLayout(String localRepoLayout)
public String getLocalRepository()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |