Search in sources :

Example 21 with PerforceScmProviderRepository

use of org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository in project maven-scm by apache.

the class PerforceChangeLogCommandTest method testCommandLine.

// ----------------------------------------------------------------------
// 
// ----------------------------------------------------------------------
private void testCommandLine(String scmUrl, String commandLine) throws Exception {
    ScmRepository repository = getScmManager().makeScmRepository(scmUrl);
    PerforceScmProviderRepository repo = (PerforceScmProviderRepository) repository.getProviderRepository();
    Commandline cl = PerforceChangeLogCommand.createCommandLine(repo, workingDirectory, System.getProperty(PerforceScmProvider.DEFAULT_CLIENTSPEC_PROPERTY), null, null, null, null, null);
    assertCommandLine(commandLine, null, cl);
}
Also used : ScmRepository(org.apache.maven.scm.repository.ScmRepository) Commandline(org.codehaus.plexus.util.cli.Commandline) PerforceScmProviderRepository(org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository)

Example 22 with PerforceScmProviderRepository

use of org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository in project maven-scm by apache.

the class PerforceInfoCommandTest method testPerforceInfo.

public void testPerforceInfo() throws Exception {
    ScmRepository repo = makeScmRepository("scm:perforce://depot/projects/pathname");
    PerforceScmProviderRepository p4Repo = (PerforceScmProviderRepository) repo.getProviderRepository();
    PerforceScmProvider prov = new PerforceScmProvider();
    PerforceTagCommand cmd = new PerforceTagCommand();
    cmd.setLogger(prov.getLogger());
    if (PerforceScmProvider.isLive()) {
        assertNotNull(PerforceInfoCommand.getInfo(prov.getLogger(), p4Repo).getEntry("User name"));
        assertNotNull(PerforceInfoCommand.getInfo(prov.getLogger(), p4Repo).getEntry("Client root"));
        assertNotNull(PerforceInfoCommand.getInfo(prov.getLogger(), p4Repo).getEntry("Client name"));
        assertNotNull(PerforceInfoCommand.getInfo(prov.getLogger(), p4Repo).getEntry("Client host"));
        assertNull(PerforceInfoCommand.getInfo(prov.getLogger(), p4Repo).getEntry("foobar"));
    }
}
Also used : ScmRepository(org.apache.maven.scm.repository.ScmRepository) PerforceTagCommand(org.apache.maven.scm.provider.perforce.command.tag.PerforceTagCommand) PerforceScmProvider(org.apache.maven.scm.provider.perforce.PerforceScmProvider) PerforceScmProviderRepository(org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository)

Example 23 with PerforceScmProviderRepository

use of org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository in project maven-scm by apache.

the class PerforceCheckOutCommandTest method testCommandLine.

// ----------------------------------------------------------------------
// 
// ----------------------------------------------------------------------
private void testCommandLine(String scmUrl, String commandLine) throws Exception {
    workingDirectory.mkdirs();
    ScmRepository repository = getScmManager().makeScmRepository(scmUrl);
    PerforceScmProviderRepository svnRepository = (PerforceScmProviderRepository) repository.getProviderRepository();
    Commandline cl = PerforceCheckOutCommand.createCommandLine(svnRepository, workingDirectory, new ScmRevision("somelabel"), "test-test-maven");
    assertCommandLine(commandLine, null, cl);
}
Also used : ScmRepository(org.apache.maven.scm.repository.ScmRepository) Commandline(org.codehaus.plexus.util.cli.Commandline) ScmRevision(org.apache.maven.scm.ScmRevision) PerforceScmProviderRepository(org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository)

Example 24 with PerforceScmProviderRepository

use of org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository in project maven-scm by apache.

the class PerforceLoginCommandTest method disabledTestLoginWithoutPassword.

/**
 * This test requires P4 installed
 *
 * @throws Exception
 */
public void disabledTestLoginWithoutPassword() throws Exception {
    ScmRepository repository = getScmManager().makeScmRepository("scm:perforce://depot/projects/pathname");
    PerforceScmProviderRepository scmRepository = (PerforceScmProviderRepository) repository.getProviderRepository();
    ScmFileSet fileSet = new ScmFileSet(new File("."));
    PerforceLoginCommand command = new PerforceLoginCommand();
    ScmLogger logger = new DefaultLog();
    command.setLogger(logger);
    command.executeLoginCommand(scmRepository, fileSet, null);
}
Also used : ScmRepository(org.apache.maven.scm.repository.ScmRepository) ScmFileSet(org.apache.maven.scm.ScmFileSet) ScmLogger(org.apache.maven.scm.log.ScmLogger) DefaultLog(org.apache.maven.scm.log.DefaultLog) PerforceScmProviderRepository(org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository) File(java.io.File)

Example 25 with PerforceScmProviderRepository

use of org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository in project maven-scm by apache.

the class PerforceRemoveCommandTest method testCommandLine.

// ----------------------------------------------------------------------
// 
// ----------------------------------------------------------------------
private void testCommandLine(String scmUrl, String commandLine) throws Exception {
    ScmRepository repository = getScmManager().makeScmRepository(scmUrl);
    PerforceScmProviderRepository svnRepository = (PerforceScmProviderRepository) repository.getProviderRepository();
    ScmFileSet files = new ScmFileSet(new File("."), Arrays.asList(new File[] { new File("foo.xml"), new File("bar.xml") }));
    Commandline cl = PerforceRemoveCommand.createCommandLine(svnRepository, workingDirectory, files);
    assertCommandLine(commandLine, null, cl);
}
Also used : ScmRepository(org.apache.maven.scm.repository.ScmRepository) ScmFileSet(org.apache.maven.scm.ScmFileSet) Commandline(org.codehaus.plexus.util.cli.Commandline) PerforceScmProviderRepository(org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository) File(java.io.File)

Aggregations

PerforceScmProviderRepository (org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository)31 ScmRepository (org.apache.maven.scm.repository.ScmRepository)23 Commandline (org.codehaus.plexus.util.cli.Commandline)19 File (java.io.File)6 ScmFileSet (org.apache.maven.scm.ScmFileSet)5 CommandLineException (org.codehaus.plexus.util.cli.CommandLineException)5 CommandLineUtils (org.codehaus.plexus.util.cli.CommandLineUtils)5 ByteArrayInputStream (java.io.ByteArrayInputStream)2 CheckOutScmResult (org.apache.maven.scm.command.checkout.CheckOutScmResult)2 BufferedReader (java.io.BufferedReader)1 IOException (java.io.IOException)1 InputStreamReader (java.io.InputStreamReader)1 HashSet (java.util.HashSet)1 CommandParameters (org.apache.maven.scm.CommandParameters)1 ScmException (org.apache.maven.scm.ScmException)1 ScmFile (org.apache.maven.scm.ScmFile)1 ScmRevision (org.apache.maven.scm.ScmRevision)1 BlameLine (org.apache.maven.scm.command.blame.BlameLine)1 BlameScmResult (org.apache.maven.scm.command.blame.BlameScmResult)1 ChangeLogScmResult (org.apache.maven.scm.command.changelog.ChangeLogScmResult)1