Projects
openEuler:24.03:SP1:Everything
maven-scm
_service:tar_scm:0001-Port-maven-scm-to-latest-...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:0001-Port-maven-scm-to-latest-version-of-plexus-default.patch of Package maven-scm
From a1d0fbb59675906e2a3d84bc6207f536e54dc2c4 Mon Sep 17 00:00:00 2001 From: Mat Booth <mbooth@apache.org> Date: Sun, 25 Aug 2013 14:08:40 +0100 Subject: [PATCH 1/3] Port maven-scm to latest version of plexus default --- .../org/apache/maven/scm/client/cli/MavenScmCli.java | 10 ++++------ .../provider/accurev/cli/AccuRevCommandLineTest.java | 7 +++---- .../scm/provider/accurev/cli/AccuRevJUnitUtil.java | 6 +++--- .../provider/accurev/cli/WorkSpaceConsumerTest.java | 6 +++--- .../accurev/command/AbstractAccuRevCommandTest.java | 8 ++++---- .../command/blame/AccuRevBlameCommandTckTest.java | 8 +++----- .../changelog/AccuRevChangeLogCommandTckTest.java | 8 +++----- .../command/checkin/AccuRevCheckInCommandTckTest.java | 7 +++---- .../checkout/AccuRevCheckoutCommandTckTest.java | 7 +++---- .../command/status/AccuRevStatusCommandTckTest.java | 7 +++---- .../accurev/command/tag/AccuRevTagCommandTckTest.java | 7 +++---- .../command/update/AccuRevUpdateCommandTckTest.java | 7 +++---- .../vss/commands/status/VssStatusConsumerTest.java | 3 ++- .../command/changelog/SvnChangeLogConsumerTest.java | 3 ++- 14 files changed, 42 insertions(+), 52 deletions(-) diff --git a/maven-scm-client/src/main/java/org/apache/maven/scm/client/cli/MavenScmCli.java b/maven-scm-client/src/main/java/org/apache/maven/scm/client/cli/MavenScmCli.java index 5bff170..c89127b 100644 --- a/maven-scm-client/src/main/java/org/apache/maven/scm/client/cli/MavenScmCli.java +++ b/maven-scm-client/src/main/java/org/apache/maven/scm/client/cli/MavenScmCli.java @@ -37,7 +37,7 @@ import org.apache.maven.scm.manager.NoSuchScmProviderException; import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.repository.ScmRepository; import org.apache.maven.scm.repository.ScmRepositoryException; -import org.codehaus.plexus.embed.Embedder; +import org.codehaus.plexus.DefaultPlexusContainer; import org.codehaus.plexus.util.StringUtils; /** @@ -47,7 +47,7 @@ import org.codehaus.plexus.util.StringUtils; */ public class MavenScmCli { - private Embedder plexus; + private DefaultPlexusContainer plexus; private ScmManager scmManager; @@ -58,9 +58,7 @@ public class MavenScmCli public MavenScmCli() throws Exception { - plexus = new Embedder(); - - plexus.start(); + plexus = new DefaultPlexusContainer(); scmManager = (ScmManager) plexus.lookup( ScmManager.ROLE ); } @@ -69,7 +67,7 @@ public class MavenScmCli { try { - plexus.stop(); + plexus.dispose(); } catch ( Exception ex ) { diff --git a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/AccuRevCommandLineTest.java b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/AccuRevCommandLineTest.java index 0cd220f..c9d5987 100644 --- a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/AccuRevCommandLineTest.java +++ b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/AccuRevCommandLineTest.java @@ -39,6 +39,7 @@ import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.accurev.AccuRev; import org.apache.maven.scm.provider.accurev.AccuRevStat; +import org.codehaus.plexus.ContainerConfiguration; import org.codehaus.plexus.util.Os; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.Commandline; @@ -152,11 +153,9 @@ public class AccuRevCommandLineTest } @Override - protected InputStream getCustomConfiguration() - throws Exception + protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) { - - return AccuRevJUnitUtil.getPlexusConfiguration(); + containerConfiguration.setContainerConfigurationURL( AccuRevJUnitUtil.getPlexusConfiguration() ); } @Test diff --git a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/AccuRevJUnitUtil.java b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/AccuRevJUnitUtil.java index ff85158..7f5d6d5 100644 --- a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/AccuRevJUnitUtil.java +++ b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/AccuRevJUnitUtil.java @@ -21,8 +21,8 @@ package org.apache.maven.scm.provider.accurev.cli; import java.io.BufferedReader; import java.io.IOException; -import java.io.InputStream; import java.io.InputStreamReader; +import java.net.URL; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.manager.ScmManager; @@ -63,9 +63,9 @@ public class AccuRevJUnitUtil return new PlexusLogger( logger ); } - public static InputStream getPlexusConfiguration() + public static URL getPlexusConfiguration() { - return AccuRevJUnitUtil.class.getResourceAsStream( "/PlexusTestContainerConfig.xml" ); + return AccuRevJUnitUtil.class.getResource( "/PlexusTestContainerConfig.xml" ); } } diff --git a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/WorkSpaceConsumerTest.java b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/WorkSpaceConsumerTest.java index dc950ba..49e060d 100644 --- a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/WorkSpaceConsumerTest.java +++ b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/cli/WorkSpaceConsumerTest.java @@ -31,6 +31,7 @@ import java.util.Map; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.accurev.WorkSpace; +import org.codehaus.plexus.ContainerConfiguration; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -44,10 +45,9 @@ public class WorkSpaceConsumerTest private ScmLogger logger; @Override - protected InputStream getCustomConfiguration() - throws Exception + protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) { - return AccuRevJUnitUtil.getPlexusConfiguration(); + containerConfiguration.setContainerConfigurationURL( AccuRevJUnitUtil.getPlexusConfiguration() ); } @Before diff --git a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/AbstractAccuRevCommandTest.java b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/AbstractAccuRevCommandTest.java index 9d7b707..d223928 100644 --- a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/AbstractAccuRevCommandTest.java +++ b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/AbstractAccuRevCommandTest.java @@ -33,6 +33,7 @@ import org.apache.maven.scm.provider.accurev.AccuRevInfo; import org.apache.maven.scm.provider.accurev.AccuRevScmProviderRepository; import org.apache.maven.scm.provider.accurev.Stream; import org.apache.maven.scm.provider.accurev.cli.AccuRevJUnitUtil; +import org.codehaus.plexus.ContainerConfiguration; import org.junit.Before; import org.junit.runner.RunWith; import org.mockito.InOrder; @@ -45,10 +46,9 @@ public abstract class AbstractAccuRevCommandTest { @Override - protected InputStream getCustomConfiguration() - throws Exception + protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) { - return AccuRevJUnitUtil.getPlexusConfiguration(); + containerConfiguration.setContainerConfigurationURL( AccuRevJUnitUtil.getPlexusConfiguration() ); } @Mock @@ -98,4 +98,4 @@ public abstract class AbstractAccuRevCommandTest return logger; } -} \ No newline at end of file +} diff --git a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/blame/AccuRevBlameCommandTckTest.java b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/blame/AccuRevBlameCommandTckTest.java index b28d613..a05ca56 100644 --- a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/blame/AccuRevBlameCommandTckTest.java +++ b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/blame/AccuRevBlameCommandTckTest.java @@ -31,6 +31,7 @@ import org.apache.maven.scm.command.blame.BlameScmResult; import org.apache.maven.scm.provider.accurev.cli.AccuRevJUnitUtil; import org.apache.maven.scm.provider.accurev.command.AccuRevTckUtil; import org.apache.maven.scm.tck.command.blame.BlameCommandTckTest; +import org.codehaus.plexus.ContainerConfiguration; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -45,12 +46,9 @@ public class AccuRevBlameCommandTckTest private AccuRevTckUtil accurevTckTestUtil = new AccuRevTckUtil(); @Override - protected InputStream getCustomConfiguration() - throws Exception - + protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) { - - return AccuRevJUnitUtil.getPlexusConfiguration(); + containerConfiguration.setContainerConfigurationURL( AccuRevJUnitUtil.getPlexusConfiguration() ); } @Override diff --git a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/changelog/AccuRevChangeLogCommandTckTest.java b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/changelog/AccuRevChangeLogCommandTckTest.java index d87e277..82b6f2d 100644 --- a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/changelog/AccuRevChangeLogCommandTckTest.java +++ b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/changelog/AccuRevChangeLogCommandTckTest.java @@ -42,6 +42,7 @@ import org.apache.maven.scm.provider.accurev.command.AccuRevTckUtil; import org.apache.maven.scm.repository.ScmRepository; import org.apache.maven.scm.tck.command.changelog.ChangeLogCommandTckTest; import org.hamcrest.Matchers; +import org.codehaus.plexus.ContainerConfiguration; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -223,11 +224,8 @@ public class AccuRevChangeLogCommandTckTest } @Override - protected InputStream getCustomConfiguration() - throws Exception - + protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) { - return AccuRevJUnitUtil.getPlexusConfiguration(); + containerConfiguration.setContainerConfigurationURL( AccuRevJUnitUtil.getPlexusConfiguration() ); } - } diff --git a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/checkin/AccuRevCheckInCommandTckTest.java b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/checkin/AccuRevCheckInCommandTckTest.java index 9432d35..188b84a 100644 --- a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/checkin/AccuRevCheckInCommandTckTest.java +++ b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/checkin/AccuRevCheckInCommandTckTest.java @@ -25,6 +25,7 @@ import java.io.InputStream; import org.apache.maven.scm.provider.accurev.cli.AccuRevJUnitUtil; import org.apache.maven.scm.provider.accurev.command.AccuRevTckUtil; import org.apache.maven.scm.tck.command.checkin.CheckInCommandTckTest; +import org.codehaus.plexus.ContainerConfiguration; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -39,11 +40,9 @@ public class AccuRevCheckInCommandTckTest private AccuRevTckUtil accurevTckTestUtil = new AccuRevTckUtil(); @Override - protected InputStream getCustomConfiguration() - throws Exception - + protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) { - return AccuRevJUnitUtil.getPlexusConfiguration(); + containerConfiguration.setContainerConfigurationURL( AccuRevJUnitUtil.getPlexusConfiguration() ); } @Override diff --git a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/checkout/AccuRevCheckoutCommandTckTest.java b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/checkout/AccuRevCheckoutCommandTckTest.java index 06932e7..6fe9fd2 100644 --- a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/checkout/AccuRevCheckoutCommandTckTest.java +++ b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/checkout/AccuRevCheckoutCommandTckTest.java @@ -25,6 +25,7 @@ import java.io.InputStream; import org.apache.maven.scm.provider.accurev.cli.AccuRevJUnitUtil; import org.apache.maven.scm.provider.accurev.command.AccuRevTckUtil; import org.apache.maven.scm.tck.command.checkout.CheckOutCommandTckTest; +import org.codehaus.plexus.ContainerConfiguration; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -44,11 +45,9 @@ public class AccuRevCheckoutCommandTckTest protected AccuRevTckUtil testUtil = new AccuRevTckUtil(); @Override - protected InputStream getCustomConfiguration() - throws Exception - + protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) { - return AccuRevJUnitUtil.getPlexusConfiguration(); + containerConfiguration.setContainerConfigurationURL( AccuRevJUnitUtil.getPlexusConfiguration() ); } @Override diff --git a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/status/AccuRevStatusCommandTckTest.java b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/status/AccuRevStatusCommandTckTest.java index 8655aa8..5cb4414 100644 --- a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/status/AccuRevStatusCommandTckTest.java +++ b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/status/AccuRevStatusCommandTckTest.java @@ -25,6 +25,7 @@ import java.io.InputStream; import org.apache.maven.scm.provider.accurev.cli.AccuRevJUnitUtil; import org.apache.maven.scm.provider.accurev.command.AccuRevTckUtil; import org.apache.maven.scm.tck.command.status.StatusCommandTckTest; +import org.codehaus.plexus.ContainerConfiguration; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -87,11 +88,9 @@ public class AccuRevStatusCommandTckTest } @Override - protected InputStream getCustomConfiguration() - throws Exception - + protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) { - return AccuRevJUnitUtil.getPlexusConfiguration(); + containerConfiguration.setContainerConfigurationURL( AccuRevJUnitUtil.getPlexusConfiguration() ); } @Override diff --git a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/tag/AccuRevTagCommandTckTest.java b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/tag/AccuRevTagCommandTckTest.java index b4e14d6..8d5b691 100644 --- a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/tag/AccuRevTagCommandTckTest.java +++ b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/tag/AccuRevTagCommandTckTest.java @@ -31,6 +31,7 @@ import org.apache.maven.scm.provider.accurev.cli.AccuRevJUnitUtil; import org.apache.maven.scm.provider.accurev.command.AccuRevTckUtil; import org.apache.maven.scm.repository.ScmRepository; import org.apache.maven.scm.tck.command.tag.TagCommandTckTest; +import org.codehaus.plexus.ContainerConfiguration; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -45,11 +46,9 @@ public class AccuRevTagCommandTckTest private AccuRevTckUtil accurevTckTestUtil = new AccuRevTckUtil(); @Override - protected InputStream getCustomConfiguration() - throws Exception - + protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) { - return AccuRevJUnitUtil.getPlexusConfiguration(); + containerConfiguration.setContainerConfigurationURL( AccuRevJUnitUtil.getPlexusConfiguration() ); } @Override diff --git a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/update/AccuRevUpdateCommandTckTest.java b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/update/AccuRevUpdateCommandTckTest.java index 1f8397f..2e7cc51 100644 --- a/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/update/AccuRevUpdateCommandTckTest.java +++ b/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/update/AccuRevUpdateCommandTckTest.java @@ -25,6 +25,7 @@ import java.io.InputStream; import org.apache.maven.scm.provider.accurev.cli.AccuRevJUnitUtil; import org.apache.maven.scm.provider.accurev.command.AccuRevTckUtil; import org.apache.maven.scm.tck.command.update.UpdateCommandTckTest; +import org.codehaus.plexus.ContainerConfiguration; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -39,11 +40,9 @@ public class AccuRevUpdateCommandTckTest private AccuRevTckUtil accurevTckTestUtil = new AccuRevTckUtil(); @Override - protected InputStream getCustomConfiguration() - throws Exception - + protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) { - return AccuRevJUnitUtil.getPlexusConfiguration(); + containerConfiguration.setContainerConfigurationURL( AccuRevJUnitUtil.getPlexusConfiguration() ); } @Override diff --git a/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/vss/commands/status/VssStatusConsumerTest.java b/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/vss/commands/status/VssStatusConsumerTest.java index 70febdd..b22897f 100644 --- a/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/vss/commands/status/VssStatusConsumerTest.java +++ b/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/vss/commands/status/VssStatusConsumerTest.java @@ -31,6 +31,7 @@ import org.apache.maven.scm.manager.plexus.PlexusLogger; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.apache.maven.scm.repository.ScmRepositoryException; +import org.codehaus.plexus.DefaultPlexusContainer; import org.codehaus.plexus.util.IOUtil; /** @@ -50,7 +51,7 @@ public class VssStatusConsumerTest { super.setUp(); scmManager = getScmManager(); - logger = getContainer().getLogger(); + logger = ( (DefaultPlexusContainer) getContainer() ).getLogger(); } public void testConsumeLine() diff --git a/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/changelog/SvnChangeLogConsumerTest.java b/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/changelog/SvnChangeLogConsumerTest.java index 0c9c455..69b072e 100644 --- a/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/changelog/SvnChangeLogConsumerTest.java +++ b/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/changelog/SvnChangeLogConsumerTest.java @@ -24,6 +24,7 @@ import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.DefaultLog; import org.codehaus.plexus.PlexusTestCase; +import org.codehaus.plexus.DefaultPlexusContainer; import org.codehaus.plexus.logging.Logger; import org.junit.Assert; @@ -57,7 +58,7 @@ public class SvnChangeLogConsumerTest { super.setUp(); - logger = getContainer().getLogger(); + logger = ( (DefaultPlexusContainer) getContainer() ).getLogger(); consumer = new SvnChangeLogConsumer( new DefaultLog(), null ); } -- 2.17.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2