You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2020/07/05 22:55:13 UTC

[maven-dependency-plugin] branch clean created (now ad4e03f)

This is an automated email from the ASF dual-hosted git repository.

elharo pushed a change to branch clean
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git.


      at ad4e03f  fix up test names

This branch includes the following new commits:

     new ad4e03f  fix up test names

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-dependency-plugin] 01/01: fix up test names

Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

elharo pushed a commit to branch clean
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git

commit ad4e03fc1f0090093a8ce419e5e7821d6fadf177
Author: Elliotte Rusty Harold <el...@ibiblio.org>
AuthorDate: Sun Jul 5 18:54:54 2020 -0400

    fix up test names
---
 .../java/org/apache/maven/plugins/dependency/ListClassesMojo.java | 4 ++--
 .../{TestGetClassesMojo.java => TestListClassesMojo.java}         | 8 +++-----
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/dependency/ListClassesMojo.java b/src/main/java/org/apache/maven/plugins/dependency/ListClassesMojo.java
index fa33031..8df0ea4 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/ListClassesMojo.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/ListClassesMojo.java
@@ -189,11 +189,11 @@ public class ListClassesMojo
         // open jar file in try-with-resources statement to guarantee the file closes after use regardless of errors
         try ( JarFile jarFile = new JarFile( result.getArtifact().getFile() ) )
         {
-            Enumeration entries = jarFile.entries();
+            Enumeration<JarEntry> entries = jarFile.entries();
 
             while ( entries.hasMoreElements() )
             {
-                JarEntry entry = (JarEntry) entries.nextElement();
+                JarEntry entry = entries.nextElement();
                 String entryName = entry.getName();
 
                 // filter out files that do not end in .class
diff --git a/src/test/java/org/apache/maven/plugins/dependency/TestGetClassesMojo.java b/src/test/java/org/apache/maven/plugins/dependency/TestListClassesMojo.java
similarity index 94%
rename from src/test/java/org/apache/maven/plugins/dependency/TestGetClassesMojo.java
rename to src/test/java/org/apache/maven/plugins/dependency/TestListClassesMojo.java
index 6139ed7..a46e55b 100644
--- a/src/test/java/org/apache/maven/plugins/dependency/TestGetClassesMojo.java
+++ b/src/test/java/org/apache/maven/plugins/dependency/TestListClassesMojo.java
@@ -24,13 +24,12 @@ import org.apache.maven.plugin.LegacySupport;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
 import org.apache.maven.settings.Server;
 import org.apache.maven.settings.Settings;
-import org.junit.Assert;
 import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager;
 import org.sonatype.aether.util.DefaultRepositorySystemSession;
 
 import java.io.File;
 
-public class TestGetClassesMojo
+public class TestListClassesMojo
         extends AbstractDependencyMojoTestCase
 {
     private ListClassesMojo mojo;
@@ -42,7 +41,6 @@ public class TestGetClassesMojo
         super.setUp( "markers", false );
 
         File testPom = new File( getBasedir(), "target/test-classes/unit/get-test/plugin-config.xml" );
-        assertTrue(testPom.exists());
         mojo = (ListClassesMojo) lookupMojo( "list-classes", testPom );
 
         assertNotNull( mojo );
@@ -63,7 +61,7 @@ public class TestGetClassesMojo
         setVariableValueToObject( mojo, "session", legacySupport.getSession() );
     }
 
-    public void testGetClassesNotTransitive()
+    public void testListClassesNotTransitive()
             throws Exception
     {
         setVariableValueToObject( mojo, "remoteRepositories", "central::default::https://repo.maven.apache.org/maven2,"
@@ -74,7 +72,7 @@ public class TestGetClassesMojo
         mojo.execute();
     }
 
-    public void testGetClassesTransitive()
+    public void testListClassesTransitive()
             throws Exception
     {
         setVariableValueToObject( mojo, "remoteRepositories", "central::default::https://repo.maven.apache.org/maven2,"