aboutsummaryrefslogtreecommitdiff
path: root/org.jacoco.core.test/src/org
diff options
context:
space:
mode:
authorMirko Friedenhagen <mfriedenhagen@gmail.com>2014-03-15 21:57:56 +0100
committerMirko Friedenhagen <mfriedenhagen@gmail.com>2014-03-16 10:54:45 +0100
commit0bc4a63f608bb2b6405bdbd7f216e8b1a87f6c5c (patch)
tree71daa16f9eab1057464160caea19a3349a940a2e /org.jacoco.core.test/src/org
parentfa48e77d201142b63ad616d925696305300d75e1 (diff)
downloadjacoco-0bc4a63f608bb2b6405bdbd7f216e8b1a87f6c5c.tar.gz
Do not rely on the String representation of the Manifest for comparison.
At least on Mac OS X with JDK8 the order of the entries is different from the one with JDK7 so rely on java.util.jar.Manifest.equals(Object) instead.
Diffstat (limited to 'org.jacoco.core.test/src/org')
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/instr/SignatureRemoverTest.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/SignatureRemoverTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/SignatureRemoverTest.java
index 31119958..f179a1e3 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/SignatureRemoverTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/SignatureRemoverTest.java
@@ -19,6 +19,7 @@ import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.util.jar.Manifest;
import org.junit.Before;
import org.junit.Test;
@@ -110,7 +111,14 @@ public class SignatureRemoverTest {
+ "Name: org/jacoco/example/B.class\r\n" //
+ "OtherInfo: keep this\r\n" //
+ "\r\n";
- assertEquals(expected, out.toString("ISO-8859-1"));
+ assertEquals(
+ createManifest(expected.getBytes("ISO-8859-1")),
+ createManifest(out.toByteArray()));
}
+ private static Manifest createManifest(final byte[] bytes)
+ throws IOException {
+ return new Manifest(
+ new ByteArrayInputStream(bytes));
+ }
}