mirror of https://github.com/apache/maven.git
fixed warnings
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1402780 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
390122c170
commit
9a2b77d8be
|
@ -88,8 +88,9 @@ public class MavenLifecycleParticipantTest
|
|||
{
|
||||
PlexusContainer container = getContainer();
|
||||
|
||||
ComponentDescriptor cd =
|
||||
new ComponentDescriptor( InjectDependencyLifecycleListener.class, container.getContainerRealm() );
|
||||
ComponentDescriptor<? extends AbstractMavenLifecycleParticipant> cd =
|
||||
new ComponentDescriptor<InjectDependencyLifecycleListener>( InjectDependencyLifecycleListener.class,
|
||||
container.getContainerRealm() );
|
||||
cd.setRoleClass( AbstractMavenLifecycleParticipant.class );
|
||||
container.addComponentDescriptor( cd );
|
||||
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
package org.apache.maven;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.apache.maven.exception.ExceptionHandler;
|
||||
import org.apache.maven.exception.ExceptionSummary;
|
||||
import org.apache.maven.execution.MavenExecutionRequest;
|
||||
import org.apache.maven.execution.MavenExecutionResult;
|
||||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
|
||||
public class MavenTest
|
||||
|
|
|
@ -8,7 +8,6 @@ import java.util.Set;
|
|||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.execution.MavenSession;
|
||||
import org.apache.maven.model.Exclusion;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
|
||||
|
@ -92,6 +91,7 @@ public class ProjectDependenciesResolverTest
|
|||
List<String> elements = project.getCompileClasspathElements();
|
||||
assertEquals( 2, elements.size() );
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
List<Artifact> artifacts = project.getCompileArtifacts();
|
||||
assertEquals( 1, artifacts.size() );
|
||||
assertTrue( artifacts.get( 0 ).getFile().getName().endsWith( "tools.jar" ) );
|
||||
|
|
|
@ -32,8 +32,6 @@ public class MojoExecutionXPathContainer
|
|||
{
|
||||
private JXPathContext context;
|
||||
|
||||
private MojoExecution mojoExecution;
|
||||
|
||||
static
|
||||
{
|
||||
JXPathContextReferenceImpl.addNodePointerFactory( new Xpp3DomPointerFactory() );
|
||||
|
@ -42,7 +40,6 @@ public class MojoExecutionXPathContainer
|
|||
public MojoExecutionXPathContainer( MojoExecution mojoExecution )
|
||||
throws IOException
|
||||
{
|
||||
this.mojoExecution = mojoExecution;
|
||||
context = JXPathContext.newContext( mojoExecution );
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ import java.util.Iterator;
|
|||
public class ConcurrentBuildLoggerTest
|
||||
extends TestCase
|
||||
{
|
||||
@SuppressWarnings( "unused" )
|
||||
public void testToGraph()
|
||||
throws Exception
|
||||
{
|
||||
|
|
|
@ -58,6 +58,7 @@ public class LifecycleWeaveBuilderTest
|
|||
}
|
||||
*/
|
||||
|
||||
@SuppressWarnings( "unused" )
|
||||
public void testBuildProjectThreaded()
|
||||
throws Exception
|
||||
{
|
||||
|
@ -67,6 +68,7 @@ public class LifecycleWeaveBuilderTest
|
|||
executor.shutdown();
|
||||
}
|
||||
|
||||
@SuppressWarnings( "unused" )
|
||||
public void testBuildProjectThreadedAggressive()
|
||||
throws Exception
|
||||
{
|
||||
|
|
|
@ -49,6 +49,7 @@ public class DefaultLifecyclesStub
|
|||
List<String> stubSiteCycle =
|
||||
Arrays.asList( PRE_SITE.getPhase(), SITE.getPhase(), POST_SITE.getPhase(), SITE_DEPLOY.getPhase() );
|
||||
|
||||
@SuppressWarnings( "unchecked" )
|
||||
Iterator<List<String>> lcs = Arrays.asList( stubDefaultCycle, stubCleanCycle, stubSiteCycle ).iterator();
|
||||
|
||||
Map<String, Lifecycle> lifeCycles = new HashMap<String, Lifecycle>();
|
||||
|
|
|
@ -29,7 +29,6 @@ import java.util.Properties;
|
|||
import org.apache.maven.AbstractCoreMavenComponentTestCase;
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.artifact.ArtifactUtils;
|
||||
import org.apache.maven.artifact.factory.ArtifactFactory;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.execution.DefaultMavenExecutionRequest;
|
||||
import org.apache.maven.execution.DefaultMavenExecutionResult;
|
||||
|
@ -315,6 +314,7 @@ public class PluginParameterExpressionEvaluatorTest
|
|||
assertEquals( "value", value );
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
private static MavenSession createSession( PlexusContainer container, ArtifactRepository repo, Properties properties )
|
||||
throws CycleDetectedException, DuplicateProjectException
|
||||
{
|
||||
|
|
|
@ -396,7 +396,7 @@ public class PomConstructionTest
|
|||
public void testConsecutiveEmptyElements()
|
||||
throws Exception
|
||||
{
|
||||
PomTestWrapper pom = buildPom( "consecutive_empty_elements" );
|
||||
buildPom( "consecutive_empty_elements" );
|
||||
}
|
||||
|
||||
public void testOrderOfGoalsFromPluginExecutionWithoutPluginManagement()
|
||||
|
@ -1490,14 +1490,14 @@ public class PomConstructionTest
|
|||
public void testDependencyScope()
|
||||
throws Exception
|
||||
{
|
||||
PomTestWrapper pom = buildPom( "dependency-scope/sub" );
|
||||
buildPom( "dependency-scope/sub" );
|
||||
}
|
||||
|
||||
//This will fail on a validation error if incorrect
|
||||
public void testDependencyManagementWithInterpolation()
|
||||
throws Exception
|
||||
{
|
||||
PomTestWrapper pom = buildPom( "dependency-management-with-interpolation/sub" );
|
||||
buildPom( "dependency-management-with-interpolation/sub" );
|
||||
}
|
||||
|
||||
public void testInterpolationWithSystemProperty()
|
||||
|
@ -1514,6 +1514,7 @@ public class PomConstructionTest
|
|||
throws Exception
|
||||
{
|
||||
PomTestWrapper pom = buildPom( "plugin-exec-inheritance/wo-merge" );
|
||||
@SuppressWarnings( "unchecked" )
|
||||
List<PluginExecution> executions =
|
||||
(List<PluginExecution>) pom.getValue( "build/pluginsAsMap[@name='org.apache.maven.its.plugins:maven-it-plugin-log-file']/executions" );
|
||||
assertEquals( 1, executions.size() );
|
||||
|
@ -1524,6 +1525,7 @@ public class PomConstructionTest
|
|||
throws Exception
|
||||
{
|
||||
PomTestWrapper pom = buildPom( "plugin-exec-inheritance/w-merge" );
|
||||
@SuppressWarnings( "unchecked" )
|
||||
List<PluginExecution> executions =
|
||||
(List<PluginExecution>) pom.getValue( "build/pluginsAsMap[@name='org.apache.maven.its.plugins:maven-it-plugin-log-file']/executions" );
|
||||
assertEquals( 1, executions.size() );
|
||||
|
@ -1684,6 +1686,7 @@ public class PomConstructionTest
|
|||
throws Exception
|
||||
{
|
||||
PomTestWrapper pom = buildPom( "plugin-exec-order-and-default-exec" );
|
||||
@SuppressWarnings( "unchecked" )
|
||||
List<PluginExecution> executions =
|
||||
(List<PluginExecution>) pom.getValue( "build/plugins[@artifactId='maven-resources-plugin']/executions" );
|
||||
assertNotNull( executions );
|
||||
|
@ -1698,6 +1701,7 @@ public class PomConstructionTest
|
|||
throws Exception
|
||||
{
|
||||
PomTestWrapper pom = buildPom( "plugin-exec-order-with-lifecycle" );
|
||||
@SuppressWarnings( "unchecked" )
|
||||
List<Plugin> plugins = (List<Plugin>) pom.getValue( "build/plugins" );
|
||||
int resourcesPlugin = -1;
|
||||
int customPlugin = -1;
|
||||
|
@ -1735,7 +1739,9 @@ public class PomConstructionTest
|
|||
expected.add( "maven-it-plugin-touch" );
|
||||
|
||||
List<String> actual = new ArrayList<String>();
|
||||
for ( Plugin plugin : (List<Plugin>) pom.getValue( "build/plugins" ) )
|
||||
@SuppressWarnings( "unchecked" )
|
||||
List<Plugin> plugins = (List<Plugin>) pom.getValue( "build/plugins" );
|
||||
for ( Plugin plugin : plugins )
|
||||
{
|
||||
actual.add( plugin.getArtifactId() );
|
||||
}
|
||||
|
@ -1762,7 +1768,9 @@ public class PomConstructionTest
|
|||
expected.add( "maven-it-plugin-touch" );
|
||||
|
||||
List<String> actual = new ArrayList<String>();
|
||||
for ( Plugin plugin : (List<Plugin>) pom.getValue( "build/plugins" ) )
|
||||
@SuppressWarnings( "unchecked" )
|
||||
List<Plugin> plugins = (List<Plugin>) pom.getValue( "build/plugins" );
|
||||
for ( Plugin plugin : plugins )
|
||||
{
|
||||
actual.add( plugin.getArtifactId() );
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ package org.apache.maven.project;
|
|||
*/
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.maven.AbstractCoreMavenComponentTestCase;
|
||||
|
@ -48,6 +47,6 @@ public class ProjectBuilderTest
|
|||
// Here we will actually not have any artifacts because the ProjectDependenciesResolver is not involved here. So
|
||||
// right now it's not valid to ask for artifacts unless plugins require the artifacts.
|
||||
|
||||
List<String> elements = project.getCompileClasspathElements();
|
||||
project.getCompileClasspathElements();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.apache.maven.artifact.repository.ArtifactRepository;
|
|||
import org.apache.maven.project.artifact.MavenMetadataSource;
|
||||
import org.codehaus.plexus.component.annotations.Component;
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Component( role = ArtifactMetadataSource.class, hint = "classpath" )
|
||||
public class TestMetadataSource
|
||||
extends MavenMetadataSource
|
||||
|
|
|
@ -57,11 +57,13 @@ public class DefaultMavenMetadataCacheTest
|
|||
throws Exception
|
||||
{
|
||||
Artifact a1 = repositorySystem.createArtifact( "testGroup", "testArtifact", "1.2.3", "jar" );
|
||||
@SuppressWarnings( "deprecation" )
|
||||
ArtifactRepository lr1 = new DelegatingLocalArtifactRepository( repositorySystem.createDefaultLocalRepository() );
|
||||
ArtifactRepository rr1 = repositorySystem.createDefaultRemoteRepository();
|
||||
a1.setDependencyFilter( new ExcludesArtifactFilter( Arrays.asList( "foo" ) ) );
|
||||
|
||||
Artifact a2 = repositorySystem.createArtifact( "testGroup", "testArtifact", "1.2.3", "jar" );
|
||||
@SuppressWarnings( "deprecation" )
|
||||
ArtifactRepository lr2 = new DelegatingLocalArtifactRepository( repositorySystem.createDefaultLocalRepository() );
|
||||
ArtifactRepository rr2 = repositorySystem.createDefaultRemoteRepository();
|
||||
a2.setDependencyFilter( new ExcludesArtifactFilter( Arrays.asList( "foo" ) ) );
|
||||
|
|
Loading…
Reference in New Issue