3030
3131public class BinaryToTextEncodingTest {
3232 @ Test
33- public void encodeHex () throws Exception {
33+ public void encodeHex () {
3434 assertEquals ("010203" , new BinaryToTextEncoding .Hex (false ).encode (new byte []{1 , 2 , 3 }, ByteOrder .BIG_ENDIAN ));
3535 assertEquals ("030201" , new BinaryToTextEncoding .Hex (false ).encode (new byte []{1 , 2 , 3 }, ByteOrder .LITTLE_ENDIAN ));
3636 assertNotEquals (new BinaryToTextEncoding .Hex (false ).encode (new byte []{1 , 2 , 3 }, ByteOrder .LITTLE_ENDIAN ), new BinaryToTextEncoding .Hex (false ).encode (new byte []{1 , 2 , 3 }, ByteOrder .BIG_ENDIAN ));
3737 }
3838
3939 @ Test (expected = IllegalArgumentException .class )
40- public void decodeHexShouldFail () throws Exception {
40+ public void decodeHexShouldFail () {
4141 new BinaryToTextEncoding .Hex (false ).decode ("AAI=" );
4242 }
4343
4444 @ Test
45- public void encodeBaseRadix () throws Exception {
45+ public void encodeBaseRadix () {
4646 assertEquals ("100211" , new BinaryToTextEncoding .BaseRadix (16 ).encode (new byte []{16 , 2 , 17 }, ByteOrder .BIG_ENDIAN ));
4747 assertEquals ("110210" , new BinaryToTextEncoding .BaseRadix (16 ).encode (new byte []{16 , 2 , 17 }, ByteOrder .LITTLE_ENDIAN ));
4848 assertNotEquals (new BinaryToTextEncoding .BaseRadix (2 ).encode (new byte []{1 , 2 , 3 }, ByteOrder .LITTLE_ENDIAN ), new BinaryToTextEncoding .BaseRadix (2 ).encode (new byte []{1 , 2 , 3 }, ByteOrder .BIG_ENDIAN ));
4949 }
5050
5151 @ Test
52- public void encodeDecodeRadix () throws Exception {
52+ public void encodeDecodeRadix () {
5353 for (int i = 0 ; i < 32 ; i ++) {
5454 Bytes rnd = Bytes .random (i );
5555 System .out .println ("\n \n NEW TEST: " + i + " bytes\n " );
@@ -67,7 +67,7 @@ public void encodeDecodeRadix() throws Exception {
6767
6868 @ Test
6969 @ Ignore ("should fix" )
70- public void encodeDecodeRadixZeros () throws Exception {
70+ public void encodeDecodeRadixZeros () {
7171 Bytes bytes = Bytes .wrap (new byte []{0 , 0 , 0 , 0 });
7272 BinaryToTextEncoding .EncoderDecoder encoding = new BinaryToTextEncoding .BaseRadix (36 );
7373 String encodedBigEndian = encoding .encode (bytes .array (), ByteOrder .BIG_ENDIAN );
@@ -80,7 +80,7 @@ public void encodeDecodeRadixZeros() throws Exception {
8080 }
8181
8282 @ Test
83- public void encodeDecodeBase64 () throws Exception {
83+ public void encodeDecodeBase64 () {
8484 for (int i = 4 ; i < 32 ; i += 4 ) {
8585 Bytes rnd = Bytes .random (i );
8686 BinaryToTextEncoding .EncoderDecoder encoding = new BinaryToTextEncoding .Base64Encoding ();
@@ -91,7 +91,7 @@ public void encodeDecodeBase64() throws Exception {
9191 }
9292
9393 @ Test
94- public void encodeDecodeHex () throws Exception {
94+ public void encodeDecodeHex () {
9595 for (int i = 4 ; i < 32 ; i += 4 ) {
9696 Bytes rnd = Bytes .random (i );
9797 BinaryToTextEncoding .EncoderDecoder encoding = new BinaryToTextEncoding .Hex ();
@@ -102,30 +102,30 @@ public void encodeDecodeHex() throws Exception {
102102 }
103103
104104 @ Test (expected = IllegalArgumentException .class )
105- public void decodeInvalidRadix16 () throws Exception {
105+ public void decodeInvalidRadix16 () {
106106 new BinaryToTextEncoding .BaseRadix (16 ).decode ("AAI=" );
107107 }
108108
109109 @ Test (expected = IllegalArgumentException .class )
110- public void decodeInvalidRadix36 () throws Exception {
110+ public void decodeInvalidRadix36 () {
111111 new BinaryToTextEncoding .BaseRadix (36 ).decode ("AAI=" );
112112 }
113113
114114 @ Test
115- public void encodeBase64 () throws Exception {
115+ public void encodeBase64 () {
116116 assertEquals ("EAIR" , new BinaryToTextEncoding .Base64Encoding ().encode (new byte []{16 , 2 , 17 }, ByteOrder .BIG_ENDIAN ));
117117 assertEquals ("EQIQ" , new BinaryToTextEncoding .Base64Encoding ().encode (new byte []{17 , 2 , 16 }, ByteOrder .BIG_ENDIAN ));
118118 assertEquals ("EQIQ" , new BinaryToTextEncoding .Base64Encoding ().encode (new byte []{16 , 2 , 17 }, ByteOrder .LITTLE_ENDIAN ));
119119 assertNotEquals (new BinaryToTextEncoding .Base64Encoding ().encode (new byte []{1 , 2 , 3 }, ByteOrder .LITTLE_ENDIAN ), new BinaryToTextEncoding .Base64Encoding ().encode (new byte []{1 , 2 , 3 }, ByteOrder .BIG_ENDIAN ));
120120 }
121121
122122 @ Test (expected = IllegalArgumentException .class )
123- public void decodeInvalidBase64 () throws Exception {
123+ public void decodeInvalidBase64 () {
124124 new BinaryToTextEncoding .Base64Encoding ().decode ("(&´´" );
125125 }
126126
127127 @ Test (expected = IllegalArgumentException .class )
128- public void decodeHalfInvalidBase64 () throws Exception {
128+ public void decodeHalfInvalidBase64 () {
129129 new BinaryToTextEncoding .Base64Encoding ().decode ("EAI`" );
130130 }
131- }
131+ }
0 commit comments