use of org.apache.maven.scm.ScmFile in project maven-scm by apache.
the class ClearCaseEditConsumerTest method testConsumer.
public void testConsumer() throws IOException {
InputStream inputStream = getResourceAsStream("/clearcase/edit/edit.txt");
BufferedReader in = new BufferedReader(new InputStreamReader(inputStream));
String s = in.readLine();
ClearCaseEditConsumer consumer = new ClearCaseEditConsumer(new DefaultLog());
while (s != null) {
consumer.consumeLine(s);
s = in.readLine();
}
Collection<ScmFile> entries = consumer.getEditFiles();
assertEquals("Wrong number of entries returned", 1, entries.size());
ScmFile scmFile = (ScmFile) entries.iterator().next();
assertEquals("test.java", scmFile.getPath());
assertEquals(ScmFileStatus.EDITED, scmFile.getStatus());
}
use of org.apache.maven.scm.ScmFile in project maven-scm by apache.
the class ClearCaseStatusConsumerTest method testConsumer.
public void testConsumer() throws IOException {
InputStream inputStream = getResourceAsStream("/clearcase/status/status.txt");
BufferedReader in = new BufferedReader(new InputStreamReader(inputStream));
String s = in.readLine();
ClearCaseStatusConsumer consumer = new ClearCaseStatusConsumer(new DefaultLog(), getWorkingDirectory());
while (s != null) {
consumer.consumeLine(s);
s = in.readLine();
}
Collection<ScmFile> entries = consumer.getCheckedOutFiles();
assertEquals("Wrong number of entries returned", 1, entries.size());
ScmFile scmFile = entries.iterator().next();
String scmFilePath = StringUtils.replace(scmFile.getPath(), "\\", File.separator);
assertEquals(new File(getWorkingDirectory(), "test.java").getAbsolutePath(), scmFilePath);
assertEquals(ScmFileStatus.CHECKED_OUT, scmFile.getStatus());
}
use of org.apache.maven.scm.ScmFile in project maven-scm by apache.
the class ClearCaseTagConsumerTest method testConsumer.
public void testConsumer() throws IOException {
InputStream inputStream = getResourceAsStream("/clearcase/tag/tag.txt");
BufferedReader in = new BufferedReader(new InputStreamReader(inputStream));
String s = in.readLine();
ClearCaseTagConsumer consumer = new ClearCaseTagConsumer(new DefaultLog());
while (s != null) {
consumer.consumeLine(s);
s = in.readLine();
}
Collection<ScmFile> entries = consumer.getTaggedFiles();
assertEquals("Wrong number of entries returned", 1, entries.size());
ScmFile scmFile = entries.iterator().next();
assertEquals("test.java", scmFile.getPath());
assertEquals(ScmFileStatus.TAGGED, scmFile.getStatus());
}
use of org.apache.maven.scm.ScmFile in project maven-scm by apache.
the class ClearCaseUnEditConsumer method consumeLine.
// ----------------------------------------------------------------------
// Stream Consumer Implementation
// ----------------------------------------------------------------------
/**
* {@inheritDoc}
*/
public void consumeLine(String line) {
if (logger.isDebugEnabled()) {
logger.debug(line);
}
if (line.indexOf("Checkout cancelled") > -1) {
int beginIndex = line.indexOf('"');
if (beginIndex != -1) {
String fileName = line.substring(beginIndex + 1, line.indexOf('"', beginIndex + 1));
unEditFiles.add(new ScmFile(fileName, ScmFileStatus.UNKNOWN));
}
}
}
use of org.apache.maven.scm.ScmFile in project maven-scm by apache.
the class ClearCaseEditConsumer method consumeLine.
// ----------------------------------------------------------------------
// Stream Consumer Implementation
// ----------------------------------------------------------------------
/**
* {@inheritDoc}
*/
public void consumeLine(String line) {
if (logger.isDebugEnabled()) {
logger.debug(line);
}
int beginIndex = line.indexOf('"');
if (beginIndex != -1) {
String fileName = line.substring(beginIndex + 1, line.indexOf('"', beginIndex + 1));
editFiles.add(new ScmFile(fileName, ScmFileStatus.EDITED));
}
}
Aggregations