Skip to content

Commit

Permalink
Fix typo in method name of convertBytesToHexString.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoerenhout committed Nov 22, 2020
1 parent b5b8f05 commit 977a4dd
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public void test_split_8_bit_iso_latin_1_characters() throws Exception {
Assert.assertEquals(63, segments[1].length);
Assert.assertEquals(
"050003d202014c6f72656d20697073756d20646f6c6f722073697420616d657420656e696d2e20457469616d20756c6c616d636f727065722e2053757370656e646973736520612070656c6c656e746573717565206475692c206e6f6e2066656c69732e204d616563656e6173206d616c65737561646120656c6974206c65637475732066656c69732c206d616c65737561646120756c747269636965732e",
HexUtil.conventBytesToHexString(segments[0]));
HexUtil.convertBytesToHexString(segments[0]));
Assert.assertEquals("050003d20202437572616269747572206574206c6967756c612e205574206d6f6c657374696520612c20756c7472696369657320706f7274612075726e612e",
HexUtil.conventBytesToHexString(segments[1]));
HexUtil.convertBytesToHexString(segments[1]));
Assert.assertEquals(
"Lorem ipsum dolor sit amet enim. Etiam ullamcorper. Suspendisse a pellentesque dui, non felis. Maecenas malesuada elit lectus felis, malesuada ultricies.",
new String(subarray(segments[0], 6), ISO_LATIN_1));
Expand All @@ -71,9 +71,9 @@ public void test_split_16_bit_iso_latin_1_characters() throws Exception {
Assert.assertEquals(65, segments[1].length);
Assert.assertEquals(
"060804d20201004c6f72656d20697073756d20646f6c6f722073697420616d657420656e696d2e20457469616d20756c6c616d636f727065722e2053757370656e646973736520612070656c6c656e746573717565206475692c206e6f6e2066656c69732e204d616563656e6173206d616c65737561646120656c6974206c65637475732066656c69732c206d616c65737561646120756c74726963696573",
HexUtil.conventBytesToHexString(segments[0]));
HexUtil.convertBytesToHexString(segments[0]));
Assert.assertEquals("060804d20202002e437572616269747572206574206c6967756c612e205574206d6f6c657374696520612c20756c7472696369657320706f7274612075726e612e",
HexUtil.conventBytesToHexString(segments[1]));
HexUtil.convertBytesToHexString(segments[1]));
Assert.assertEquals(
"Lorem ipsum dolor sit amet enim. Etiam ullamcorper. Suspendisse a pellentesque dui, non felis. Maecenas malesuada elit lectus felis, malesuada ultricies",
new String(subarray(segments[0], 7), ISO_LATIN_1));
Expand All @@ -92,15 +92,15 @@ public void test_split_8_bit_ucs2_characters() throws Exception {
Assert.assertEquals(24, segments[3].length);
Assert.assertEquals(
"050003d20401004c006f00720065006d00200069007000730075006d00200064006f006c006f0072002000730069007400200061006d0065007400200065006e0069006d002e00200045007400690061006d00200075006c006c0061006d0063006f0072007000650072002e002000530075007300700065006e006400690073007300650020006100200070",
HexUtil.conventBytesToHexString(segments[0]));
HexUtil.convertBytesToHexString(segments[0]));
Assert.assertEquals(
"050003d204020065006c006c0065006e0074006500730071007500650020006400750069002c0020006e006f006e002000660065006c00690073002e0020004d0061006500630065006e006100730020006d0061006c00650073007500610064006100200065006c006900740020006c00650063007400750073002000660065006c00690073002c0020006d",
HexUtil.conventBytesToHexString(segments[1]));
HexUtil.convertBytesToHexString(segments[1]));
Assert.assertEquals(
"050003d204030061006c00650073007500610064006100200075006c0074007200690063006900650073002e0043007500720061006200690074007500720020006500740020006c006900670075006c0061002e0020005500740020006d006f006c0065007300740069006500200061002c00200075006c007400720069006300690065007300200070006f",
HexUtil.conventBytesToHexString(segments[2]));
HexUtil.convertBytesToHexString(segments[2]));
Assert.assertEquals("050003d20404007200740061002000750072006e0061002e",
HexUtil.conventBytesToHexString(segments[3]));
HexUtil.convertBytesToHexString(segments[3]));
Assert.assertEquals(
"Lorem ipsum dolor sit amet enim. Etiam ullamcorper. Suspendisse a p",
new String(subarray(segments[0], 6), USC_2));
Expand All @@ -123,15 +123,15 @@ public void test_split_16_bit_ucs2_characters() throws Exception {
Assert.assertEquals(31, segments[3].length);
Assert.assertEquals(
"060804d2040100004c006f00720065006d00200069007000730075006d00200064006f006c006f0072002000730069007400200061006d0065007400200065006e0069006d002e00200045007400690061006d00200075006c006c0061006d0063006f0072007000650072002e002000530075007300700065006e00640069007300730065002000610020",
HexUtil.conventBytesToHexString(segments[0]));
HexUtil.convertBytesToHexString(segments[0]));
Assert.assertEquals(
"060804d204020000700065006c006c0065006e0074006500730071007500650020006400750069002c0020006e006f006e002000660065006c00690073002e0020004d0061006500630065006e006100730020006d0061006c00650073007500610064006100200065006c006900740020006c00650063007400750073002000660065006c00690073002c",
HexUtil.conventBytesToHexString(segments[1]));
HexUtil.convertBytesToHexString(segments[1]));
Assert.assertEquals(
"060804d20403000020006d0061006c00650073007500610064006100200075006c0074007200690063006900650073002e0043007500720061006200690074007500720020006500740020006c006900670075006c0061002e0020005500740020006d006f006c0065007300740069006500200061002c00200075006c0074007200690063006900650073",
HexUtil.conventBytesToHexString(segments[2]));
HexUtil.convertBytesToHexString(segments[2]));
Assert.assertEquals("060804d204040000200070006f007200740061002000750072006e0061002e",
HexUtil.conventBytesToHexString(segments[3]));
HexUtil.convertBytesToHexString(segments[3]));
Assert.assertEquals(
"Lorem ipsum dolor sit amet enim. Etiam ullamcorper. Suspendisse a ",
new String(subarray(segments[0], 7), USC_2));
Expand All @@ -152,10 +152,10 @@ public void test_split_gsm_0338_basic_characters_with_extension_char_on_split_in
assertEquals(2, segments.length);
assertEquals(
"050003d20201546869732069732061206d657373616765207768696368206669747320696e2031353420736570746574732062757420746865206c61737420636861726163746572206973203220736570746574732e205468697320776f756c642066697420696e746f206f6e65207061636b6564206d657373616765206f66203135332073657074657473206f7220313334206f63746574732e2e2e2e",
HexUtil.conventBytesToHexString(segments[0]));
HexUtil.convertBytesToHexString(segments[0]));
assertEquals(
"050003d202023f",
HexUtil.conventBytesToHexString(segments[1]));
HexUtil.convertBytesToHexString(segments[1]));
assertEquals(158, segments[0].length);
assertEquals(7, segments[1].length);

Expand Down
6 changes: 3 additions & 3 deletions jsmpp/src/main/java/org/jsmpp/bean/OptionalParameter.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ protected byte[] serializeValue() {
@Override
public String toString()
{
return HexUtil.conventBytesToHexString(OctetUtil.shortToBytes(value));
return HexUtil.convertBytesToHexString(OctetUtil.shortToBytes(value));
}
}

Expand Down Expand Up @@ -160,7 +160,7 @@ protected byte[] serializeValue() {
@Override
public String toString()
{
return HexUtil.conventBytesToHexString(OctetUtil.intToBytes(value));
return HexUtil.convertBytesToHexString(OctetUtil.intToBytes(value));
}
}

Expand Down Expand Up @@ -198,7 +198,7 @@ protected byte[] serializeValue() {
@Override
public String toString()
{
return HexUtil.conventBytesToHexString(new byte[] {getValue()});
return HexUtil.convertBytesToHexString(new byte[] {getValue()});
}
}

Expand Down
4 changes: 2 additions & 2 deletions jsmpp/src/main/java/org/jsmpp/util/HexUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private HexUtil() {
* @return the hex string representation of string.
*/
public static String convertStringToHexString(String data) {
return conventBytesToHexString(data.getBytes());
return convertBytesToHexString(data.getBytes());
}

/**
Expand All @@ -62,7 +62,7 @@ public static String convertByteToHexString(byte data) {
* @param data is the bytes.
* @return the hex string representation of bytes.
*/
public static String conventBytesToHexString(byte[] data) {
public static String convertBytesToHexString(byte[] data) {
return convertBytesToHexString(data, 0, data.length);
}

Expand Down
2 changes: 1 addition & 1 deletion jsmpp/src/main/java/org/jsmpp/util/IntUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ public static String toNDigitString(final int value, final int digitLength) {
}

public static final String toHexString(int value) {
return HexUtil.conventBytesToHexString(OctetUtil.intToBytes(value));
return HexUtil.convertBytesToHexString(OctetUtil.intToBytes(value));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ public class RandomSessionIDGenerator implements SessionIDGenerator<String> {
public String newSessionId() {
byte[] b = new byte[32];
random.nextBytes(b);
return HexUtil.conventBytesToHexString(b);
return HexUtil.convertBytesToHexString(b);
}
}

0 comments on commit 977a4dd

Please sign in to comment.