use of org.apache.maven.scm.provider.integrity.command.edit.IntegrityEditCommand in project maven-scm by apache.
the class IntegrityScmProvider method edit.
/**
* Maps to si makewritable
*/
@Override
protected EditScmResult edit(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params) throws ScmException {
IntegrityEditCommand command = new IntegrityEditCommand();
command.setLogger(getLogger());
return (EditScmResult) command.execute(repository, fileSet, params);
}
use of org.apache.maven.scm.provider.integrity.command.edit.IntegrityEditCommand in project maven-scm by apache.
the class IntegrityCheckInCommandTest method testCheckInCommandTest.
/**
* Executes the IntegrityCheckInCommand and validates the result
*
* @throws Exception
*/
public void testCheckInCommandTest() throws Exception {
// First we need to make the workspace writable
IntegrityEditCommand edit = new IntegrityEditCommand();
edit.setLogger(logger);
assertResultIsSuccess(edit.execute(iRepo, fileSet, parameters));
// Now lets add something to the file we added in the add test
String nl = System.getProperty("line.separator");
BufferedWriter bw = new BufferedWriter(new FileWriter(fileSet.getBasedir() + File.separator + fileName, true));
bw.write(nl + nl + "A new change appended to file by the check-in command test" + nl);
bw.flush();
bw.close();
// Set the message parameter required for the check-in command to work
parameters.setString(CommandParameter.MESSAGE, "Attempting change to an existing file " + fileName);
// Now execute the check-in command and validate the results
IntegrityCheckInCommand checkin = new IntegrityCheckInCommand();
checkin.setLogger(logger);
assertResultIsSuccess(checkin.execute(iRepo, fileSet, parameters));
}
Aggregations