Search in sources :

Example 1 with ScmLogger

use of org.apache.maven.scm.log.ScmLogger in project maven-scm by apache.

the class StatConsumerTest method consume.

private String consume(String resource) throws IOException {
    ScmLogger logger = new DefaultLog();
    StatConsumer consumer = new StatConsumer(logger);
    AccuRevJUnitUtil.consume(resource, consumer);
    return consumer.getStatus();
}
Also used : ScmLogger(org.apache.maven.scm.log.ScmLogger) DefaultLog(org.apache.maven.scm.log.DefaultLog)

Example 2 with ScmLogger

use of org.apache.maven.scm.log.ScmLogger in project maven-scm by apache.

the class SvnExeScmProviderTest method testGetRepositoryURL_Windows.

// SCM-435
@Test
public void testGetRepositoryURL_Windows() throws Exception {
    Assume.assumeTrue(Os.isFamily(Os.FAMILY_WINDOWS));
    // prepare
    ScmLogger logger = mock(ScmLogger.class);
    when(logger.isInfoEnabled()).thenReturn(Boolean.TRUE);
    scmProvider.addListener(logger);
    File workingDirectory = new File(".");
    // test
    // Since SCM-project has moved from svn to GIT, we can't verify the URL of this project
    String url;
    try {
        url = scmProvider.getRepositoryURL(workingDirectory);
        // verify
        assertFalse(url.startsWith("file://"));
    } catch (ScmException e) {
    }
    // verify
    verify(logger).info("Executing: cmd.exe /X /C \"svn --non-interactive info .\"");
    verify(logger).info("Working directory: " + workingDirectory.getCanonicalPath());
}
Also used : ScmException(org.apache.maven.scm.ScmException) ScmLogger(org.apache.maven.scm.log.ScmLogger) File(java.io.File) Test(org.junit.Test)

Example 3 with ScmLogger

use of org.apache.maven.scm.log.ScmLogger in project maven-scm by apache.

the class AccuRevJUnitUtil method getLogger.

public static ScmLogger getLogger(PlexusContainer plexusContainer) throws ComponentLookupException {
    LoggerManager loggerManager = (LoggerManager) plexusContainer.lookup(LoggerManager.ROLE);
    Logger logger = loggerManager.getLoggerForComponent(ScmManager.ROLE);
    return new PlexusLogger(logger);
}
Also used : PlexusLogger(org.apache.maven.scm.manager.plexus.PlexusLogger) LoggerManager(org.codehaus.plexus.logging.LoggerManager) PlexusLogger(org.apache.maven.scm.manager.plexus.PlexusLogger) ScmLogger(org.apache.maven.scm.log.ScmLogger) Logger(org.codehaus.plexus.logging.Logger)

Example 4 with ScmLogger

use of org.apache.maven.scm.log.ScmLogger 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)

Aggregations

ScmLogger (org.apache.maven.scm.log.ScmLogger)4 File (java.io.File)2 DefaultLog (org.apache.maven.scm.log.DefaultLog)2 ScmException (org.apache.maven.scm.ScmException)1 ScmFileSet (org.apache.maven.scm.ScmFileSet)1 PlexusLogger (org.apache.maven.scm.manager.plexus.PlexusLogger)1 PerforceScmProviderRepository (org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository)1 ScmRepository (org.apache.maven.scm.repository.ScmRepository)1 Logger (org.codehaus.plexus.logging.Logger)1 LoggerManager (org.codehaus.plexus.logging.LoggerManager)1 Test (org.junit.Test)1