Search in sources :

Example 6 with FileDifference

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")));
}
Also used : DefaultLog(org.apache.maven.scm.log.DefaultLog) ArrayList(java.util.ArrayList) FileDifference(org.apache.maven.scm.provider.accurev.FileDifference) Test(org.junit.Test)

Example 7 with FileDifference

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"));
    }
}
Also used : FileDifference(org.apache.maven.scm.provider.accurev.FileDifference)

Aggregations

FileDifference (org.apache.maven.scm.provider.accurev.FileDifference)7 Transaction (org.apache.maven.scm.provider.accurev.Transaction)5 Date (java.util.Date)4 ChangeFile (org.apache.maven.scm.ChangeFile)4 Stream (org.apache.maven.scm.provider.accurev.Stream)4 Test (org.junit.Test)4 File (java.io.File)3 ChangeFileMatcher.changeFile (org.apache.maven.scm.ChangeFileMatcher.changeFile)3 ChangeSet (org.apache.maven.scm.ChangeSet)3 CommandParameters (org.apache.maven.scm.CommandParameters)3 ScmFileSet (org.apache.maven.scm.ScmFileSet)3 ScmRevision (org.apache.maven.scm.ScmRevision)3 ChangeLogScmResult (org.apache.maven.scm.command.changelog.ChangeLogScmResult)3 ChangeLogSet (org.apache.maven.scm.command.changelog.ChangeLogSet)3 AbstractAccuRevCommandTest (org.apache.maven.scm.provider.accurev.command.AbstractAccuRevCommandTest)3 ArrayList (java.util.ArrayList)2 ScmVersion (org.apache.maven.scm.ScmVersion)2 AccuRevVersion (org.apache.maven.scm.provider.accurev.AccuRevVersion)2 HashMap (java.util.HashMap)1 ScmBranch (org.apache.maven.scm.ScmBranch)1