aboutsummaryrefslogtreecommitdiff
path: root/java/org/brotli/dec/DictionaryTest.java
diff options
context:
space:
mode:
authorEugene Kliuchnikov <eustas@google.com>2017-02-28 16:59:52 +0100
committerGitHub <noreply@github.com>2017-02-28 16:59:52 +0100
commitc931e576d2a7ae3dba9a7fc369895e3d31bb3f8b (patch)
treeaa06e917be17ea9d8c9d705009c18b100aa1de0c /java/org/brotli/dec/DictionaryTest.java
parentaaac88a1e0165676c27ec11cc675dc49a93dfa35 (diff)
downloadbrotli-c931e576d2a7ae3dba9a7fc369895e3d31bb3f8b.zip
brotli-c931e576d2a7ae3dba9a7fc369895e3d31bb3f8b.tar.gz
brotli-c931e576d2a7ae3dba9a7fc369895e3d31bb3f8b.tar.bz2
Move `java/` to `java/org/brotli/` to fix `sources.jar` structure (#517)
Also added man pages to `docs/`
Diffstat (limited to 'java/org/brotli/dec/DictionaryTest.java')
-rwxr-xr-xjava/org/brotli/dec/DictionaryTest.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/java/org/brotli/dec/DictionaryTest.java b/java/org/brotli/dec/DictionaryTest.java
new file mode 100755
index 0000000..eb0b46e
--- /dev/null
+++ b/java/org/brotli/dec/DictionaryTest.java
@@ -0,0 +1,31 @@
+/* Copyright 2015 Google Inc. All Rights Reserved.
+
+ Distributed under MIT license.
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+
+package org.brotli.dec;
+
+import static org.junit.Assert.assertEquals;
+
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+/**
+ * Tests for {@link Dictionary}.
+ */
+@RunWith(JUnit4.class)
+public class DictionaryTest {
+
+ @Test
+ public void testGetData() throws NoSuchAlgorithmException {
+ MessageDigest md = MessageDigest.getInstance("SHA-256");
+ md.update(Dictionary.getData());
+ byte[] digest = md.digest();
+ String sha256 = String.format("%064x", new java.math.BigInteger(1, digest));
+ assertEquals("20e42eb1b511c21806d4d227d07e5dd06877d8ce7b3a817f378f313653f35c70", sha256);
+ }
+}