use of org.apache.maven.scm.provider.accurev.FileDifference in project maven-scm by apache.
the class DiffConsumerTest method testDiffXML.
@Test
public void testDiffXML() throws Exception {
List<FileDifference> differences = new ArrayList<FileDifference>();
XppStreamConsumer consumer = new DiffConsumer(new DefaultLog(), differences);
AccuRevJUnitUtil.consume("/diff-vvt.xml", consumer);
assertThat(differences.size(), is(3));
assertThat(differences, hasItem(new FileDifference(8L, "/tcktests/src/main/java/Application.java", "2/3", null, null)));
assertThat(differences, hasItem(new FileDifference(9L, "/tcktests/hello-world.txt", "2/4", "/tcktests/hello.world", "6/1")));
}
use of org.apache.maven.scm.provider.accurev.FileDifference in project maven-scm by apache.
the class DiffConsumer method startTag.
@Override
protected void startTag(List<String> tagPath, Map<String, String> attributes) {
String tagName = getTagName(tagPath);
if ("Element".equals(tagName)) {
currentDifference = new FileDifference();
} else if ("Stream2".equals(tagName) && attributes.get("Name") != null) {
currentDifference.setElementId(Long.parseLong(attributes.get("eid")));
currentDifference.setNewVersion(attributes.get("Name"), attributes.get("Version"));
} else if ("Stream1".equals(tagName) && attributes.get("Name") != null) {
currentDifference.setElementId(Long.parseLong(attributes.get("eid")));
currentDifference.setOldVersion(attributes.get("Name"), attributes.get("Version"));
}
}
Aggregations