Search in sources :

Example 1 with LoggerManager

use of org.codehaus.plexus.logging.LoggerManager in project maven-scm by apache.

the class IntegrityCommandTest method setUp.

/**
 * Sets up all commands for unit test execution
 */
protected void setUp() throws Exception {
    super.setUp();
    // Set the Change Package ID to :bypass as we wont have a valid Change Pacakge ID for automated tests
    System.setProperty("maven.scm.integrity.cpid", ":bypass");
    // Initialize our scmManager
    scmManager = getScmManager();
    // Initialize our logger
    LoggerManager loggerManager = (LoggerManager) getContainer().lookup(LoggerManager.ROLE);
    logger = new PlexusLogger(loggerManager.getLoggerForComponent(ScmManager.ROLE));
    // Construct the SCM Repository and initialize our command execution variables
    ScmRepository repo = scmManager.makeScmRepository(testScmURL);
    iRepo = (IntegrityScmProviderRepository) repo.getProviderRepository();
    fileSet = new ScmFileSet(getTestFile("target/test-execution"));
    parameters = new CommandParameters();
    // Set the tag name for our tag and branch commands
    parameters.setString(CommandParameter.TAG_NAME, "Maven-${new java.text.SimpleDateFormat(\"yyyyMMddHHmmssSSS\").format(new Date())}");
    // Connect to the MKS Integrity Server
    IntegrityLoginCommand login = new IntegrityLoginCommand();
    login.setLogger(logger);
    assertResultIsSuccess(login.execute(iRepo, fileSet, parameters));
    // Then make sure we've got a sandbox to work with
    IntegrityCheckOutCommand checkout = new IntegrityCheckOutCommand();
    checkout.setLogger(logger);
    assertResultIsSuccess(checkout.execute(iRepo, fileSet, parameters));
}
Also used : ScmRepository(org.apache.maven.scm.repository.ScmRepository) ScmFileSet(org.apache.maven.scm.ScmFileSet) IntegrityCheckOutCommand(org.apache.maven.scm.provider.integrity.command.checkout.IntegrityCheckOutCommand) PlexusLogger(org.apache.maven.scm.manager.plexus.PlexusLogger) IntegrityLoginCommand(org.apache.maven.scm.provider.integrity.command.login.IntegrityLoginCommand) LoggerManager(org.codehaus.plexus.logging.LoggerManager) CommandParameters(org.apache.maven.scm.CommandParameters)

Example 2 with LoggerManager

use of org.codehaus.plexus.logging.LoggerManager 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)

Aggregations

PlexusLogger (org.apache.maven.scm.manager.plexus.PlexusLogger)2 LoggerManager (org.codehaus.plexus.logging.LoggerManager)2 CommandParameters (org.apache.maven.scm.CommandParameters)1 ScmFileSet (org.apache.maven.scm.ScmFileSet)1 ScmLogger (org.apache.maven.scm.log.ScmLogger)1 IntegrityCheckOutCommand (org.apache.maven.scm.provider.integrity.command.checkout.IntegrityCheckOutCommand)1 IntegrityLoginCommand (org.apache.maven.scm.provider.integrity.command.login.IntegrityLoginCommand)1 ScmRepository (org.apache.maven.scm.repository.ScmRepository)1 Logger (org.codehaus.plexus.logging.Logger)1