You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by ja...@apache.org on 2018/03/02 12:32:15 UTC

ant-ivy git commit: IVY-1576 make the test a bit more robust to make sure the artifact content is the right one for the dependency

Repository: ant-ivy
Updated Branches:
  refs/heads/master 9e8810563 -> 075134d7d


IVY-1576 make the test a bit more robust to make sure the artifact content is the right one for the dependency


Project: http://git-wip-us.apache.org/repos/asf/ant-ivy/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-ivy/commit/075134d7
Tree: http://git-wip-us.apache.org/repos/asf/ant-ivy/tree/075134d7
Diff: http://git-wip-us.apache.org/repos/asf/ant-ivy/diff/075134d7

Branch: refs/heads/master
Commit: 075134d7d07d79ece8ec947402e8d2c3a2b4c4ac
Parents: 9e88105
Author: Jaikiran Pai <ja...@apache.org>
Authored: Fri Mar 2 18:01:49 2018 +0530
Committer: Jaikiran Pai <ja...@apache.org>
Committed: Fri Mar 2 18:01:49 2018 +0530

----------------------------------------------------------------------
 .../org/apache/ivy/core/resolve/ResolveTest.java     |  12 ++++++++++++
 .../test-classified/1.0/test-classified-1.0-asl.jar  | Bin 3 -> 454 bytes
 .../1.0/test-classified-1.0-other.jar                | Bin 2 -> 460 bytes
 .../test-classified/1.0/test-classified-1.0-unix.jar | Bin 2 -> 457 bytes
 4 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/075134d7/test/java/org/apache/ivy/core/resolve/ResolveTest.java
----------------------------------------------------------------------
diff --git a/test/java/org/apache/ivy/core/resolve/ResolveTest.java b/test/java/org/apache/ivy/core/resolve/ResolveTest.java
index f3bf74f..dce0ecd 100644
--- a/test/java/org/apache/ivy/core/resolve/ResolveTest.java
+++ b/test/java/org/apache/ivy/core/resolve/ResolveTest.java
@@ -62,6 +62,7 @@ import org.xml.sax.helpers.DefaultHandler;
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
 import java.io.File;
+import java.io.IOException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -73,6 +74,8 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
 
 import static org.apache.ivy.util.StringUtils.joinArray;
 import static org.junit.Assert.assertEquals;
@@ -6315,7 +6318,16 @@ public class ResolveTest {
             final String classifier = artifact.getExtraAttribute("m:classifier");
             assertNotNull("No classifier extra attribute on artifact for dependency " + dependencyId, classifier);
             assertTrue("Unexpected classifier " + classifier + " on artifact " + artifact, classifiers.remove(classifier));
+            // just make sure it's the correct jar file
+            assertJarContains(adr.getLocalFile(), classifier + ".txt");
         }
         assertTrue("Missing artifact(s) with classifiers " + classifiers, classifiers.isEmpty());
     }
+
+    private void assertJarContains(final File jar, final String jarEntryPath) throws IOException {
+        try (final JarFile jarFile = new JarFile(jar)) {
+            final JarEntry entry = jarFile.getJarEntry(jarEntryPath);
+            assertNotNull(jarEntryPath + " is missing from jar file " + jar, entry);
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/075134d7/test/repositories/m2/org/apache/test-classified/1.0/test-classified-1.0-asl.jar
----------------------------------------------------------------------
diff --git a/test/repositories/m2/org/apache/test-classified/1.0/test-classified-1.0-asl.jar b/test/repositories/m2/org/apache/test-classified/1.0/test-classified-1.0-asl.jar
index 56f3b36..d7088ae 100644
Binary files a/test/repositories/m2/org/apache/test-classified/1.0/test-classified-1.0-asl.jar and b/test/repositories/m2/org/apache/test-classified/1.0/test-classified-1.0-asl.jar differ

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/075134d7/test/repositories/m2/org/apache/test-classified/1.0/test-classified-1.0-other.jar
----------------------------------------------------------------------
diff --git a/test/repositories/m2/org/apache/test-classified/1.0/test-classified-1.0-other.jar b/test/repositories/m2/org/apache/test-classified/1.0/test-classified-1.0-other.jar
index 8d1c8b6..36f87e4 100644
Binary files a/test/repositories/m2/org/apache/test-classified/1.0/test-classified-1.0-other.jar and b/test/repositories/m2/org/apache/test-classified/1.0/test-classified-1.0-other.jar differ

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/075134d7/test/repositories/m2/org/apache/test-classified/1.0/test-classified-1.0-unix.jar
----------------------------------------------------------------------
diff --git a/test/repositories/m2/org/apache/test-classified/1.0/test-classified-1.0-unix.jar b/test/repositories/m2/org/apache/test-classified/1.0/test-classified-1.0-unix.jar
index 8d1c8b6..ba256c4 100644
Binary files a/test/repositories/m2/org/apache/test-classified/1.0/test-classified-1.0-unix.jar and b/test/repositories/m2/org/apache/test-classified/1.0/test-classified-1.0-unix.jar differ