You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2011/04/14 13:36:28 UTC
svn commit: r1092142 -
/commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestUtils.java
Author: mturk
Date: Thu Apr 14 11:36:27 2011
New Revision: 1092142
URL: http://svn.apache.org/viewvc?rev=1092142&view=rev
Log:
Test hex conversion
Modified:
commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestUtils.java
Modified: commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestUtils.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestUtils.java?rev=1092142&r1=1092141&r2=1092142&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestUtils.java (original)
+++ commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestUtils.java Thu Apr 14 11:36:27 2011
@@ -41,4 +41,24 @@ public class TestUtils
Assert.assertTrue(Utils.deleteDirectory(tmp));
}
+ @Test(groups = { "core" })
+ public void hexEncodingInt()
+ throws IOException
+ {
+ int i = -1;
+ Assert.assertEquals("ffffffff", Utils.hex(i));
+ i = 0xcafebabe;
+ Assert.assertEquals("cafebabe", Utils.hex(i));
+ }
+
+ @Test(groups = { "core" })
+ public void hexEncodingLong()
+ throws IOException
+ {
+ long l = -1;
+ Assert.assertEquals("ffffffffffffffff", Utils.hex(l));
+ l = 0xcafebabedeadbeefL;
+ Assert.assertEquals("cafebabedeadbeef", Utils.hex(l));
+ }
+
}