summaryrefslogtreecommitdiffstats
path: root/src/junit/com/jogamp/common/util/TestVersionInfo.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/junit/com/jogamp/common/util/TestVersionInfo.java')
-rw-r--r--src/junit/com/jogamp/common/util/TestVersionInfo.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/junit/com/jogamp/common/util/TestVersionInfo.java b/src/junit/com/jogamp/common/util/TestVersionInfo.java
index 2a9dfa1..de0d8d6 100644
--- a/src/junit/com/jogamp/common/util/TestVersionInfo.java
+++ b/src/junit/com/jogamp/common/util/TestVersionInfo.java
@@ -29,19 +29,24 @@
package com.jogamp.common.util;
import java.io.IOException;
+import java.net.URISyntaxException;
+import java.security.NoSuchAlgorithmException;
import org.junit.Test;
import com.jogamp.common.GlueGenVersion;
import com.jogamp.junit.util.SingletonJunitCase;
+import org.junit.Assert;
import org.junit.FixMethodOrder;
import org.junit.runners.MethodSorters;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestVersionInfo extends SingletonJunitCase {
+ static boolean VERBOSE = false;
@Test
- public void testInfo01() {
+ public void test01Info() {
+ System.err.println(VersionUtil.getPlatformInfo());
System.err.println("Version Info:");
System.err.println(GlueGenVersion.getInstance());
System.err.println("");
@@ -49,8 +54,23 @@ public class TestVersionInfo extends SingletonJunitCase {
System.err.println(GlueGenVersion.getInstance().getFullManifestInfo(null));
}
+ @Test
+ public void test02ValidateSHA256()
+ throws IllegalArgumentException, IOException, URISyntaxException, SecurityException, NoSuchAlgorithmException
+ {
+ final GlueGenVersion info = GlueGenVersion.getInstance();
+ final String sha256ClassesThis = info.getImplementationSHA256ClassesThis();
+ System.err.println("SHA256 CLASSES.this (build-time): "+sha256ClassesThis);
+
+ final GlueGenVersion.GluGenRTJarSHASum shaSum = new GlueGenVersion.GluGenRTJarSHASum();
+ final byte[] shasum = shaSum.compute(VERBOSE);
+ final String sha256Classes = SHASum.toHexString(shasum, null).toString();
+ System.err.println("SHA256 CLASSES.this (now): "+sha256Classes);
+ Assert.assertEquals("SHA256 not equal", sha256ClassesThis, sha256Classes);
+ }
public static void main(final String args[]) throws IOException {
+ // VERBOSE = true;
final String tstname = TestVersionInfo.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}