Search in sources :

Example 6 with RemoteInfoScmResult

use of org.apache.maven.scm.command.remoteinfo.RemoteInfoScmResult in project maven-scm by apache.

the class GitRemoteInfoConsumerTest method testConsumerRemoteInfo.

public void testConsumerRemoteInfo() {
    GitRemoteInfoConsumer consumer = new GitRemoteInfoConsumer(new DefaultLog(), null);
    consumer.consumeLine("344581899752998038a74989142221ae08c381bc	HEAD");
    consumer.consumeLine("344581899752998038a74989142221ae08c381bc	refs/heads/master");
    consumer.consumeLine("9006c3dbaa9749aa435694f261638583c9088419	refs/tags/staging");
    RemoteInfoScmResult remoteInfoScmResult = consumer.getRemoteInfoScmResult();
    assertEquals(1, remoteInfoScmResult.getBranches().size());
    assertEquals("344581899752998038a74989142221ae08c381bc", remoteInfoScmResult.getBranches().get("master"));
    assertEquals(1, remoteInfoScmResult.getTags().size());
    assertEquals("9006c3dbaa9749aa435694f261638583c9088419", remoteInfoScmResult.getTags().get("staging"));
}
Also used : DefaultLog(org.apache.maven.scm.log.DefaultLog) RemoteInfoScmResult(org.apache.maven.scm.command.remoteinfo.RemoteInfoScmResult)

Aggregations

RemoteInfoScmResult (org.apache.maven.scm.command.remoteinfo.RemoteInfoScmResult)6 ScmException (org.apache.maven.scm.ScmException)4 GitScmProviderRepository (org.apache.maven.scm.provider.git.repository.GitScmProviderRepository)3 File (java.io.File)2 CheckOutScmResult (org.apache.maven.scm.command.checkout.CheckOutScmResult)2 CommandLineUtils (org.codehaus.plexus.util.cli.CommandLineUtils)2 Commandline (org.codehaus.plexus.util.cli.Commandline)2 Git (org.eclipse.jgit.api.Git)2 CredentialsProvider (org.eclipse.jgit.transport.CredentialsProvider)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 ScmFile (org.apache.maven.scm.ScmFile)1 ScmFileSet (org.apache.maven.scm.ScmFileSet)1 ScmTag (org.apache.maven.scm.ScmTag)1 DefaultLog (org.apache.maven.scm.log.DefaultLog)1 ScmProvider (org.apache.maven.scm.provider.ScmProvider)1 GitCommandLineUtils (org.apache.maven.scm.provider.git.gitexe.command.GitCommandLineUtils)1 GitListConsumer (org.apache.maven.scm.provider.git.gitexe.command.list.GitListConsumer)1 GitRemoteInfoCommand (org.apache.maven.scm.provider.git.gitexe.command.remoteinfo.GitRemoteInfoCommand)1 JGitRemoteInfoCommand (org.apache.maven.scm.provider.git.jgit.command.remoteinfo.JGitRemoteInfoCommand)1