Skip to content

Commit

Permalink
Fix hessian-lite spelling mistake (apache#1779)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrick-zhu authored and ralf0131 committed May 11, 2018
1 parent 45f07f9 commit 35e7431
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void serialize_string_short_map_then_deserialize() throws Exception {
stringShortMap.put("last", (short)60);
stringShort.stringShortMap = stringShortMap;

Hessian2StringShortType deserialize = baseHessionSerialize(stringShort);
Hessian2StringShortType deserialize = baseHessianSerialize(stringShort);
assertTrue(deserialize.stringShortMap != null);
assertTrue(deserialize.stringShortMap.size() == 2);
assertTrue(deserialize.stringShortMap.get("last") instanceof Short);
Expand All @@ -61,7 +61,7 @@ public void serialize_string_byte_map_then_deserialize() throws Exception {
stringByteMap.put("last", (byte)60);
stringShort.stringByteMap = stringByteMap;

Hessian2StringShortType deserialize = baseHessionSerialize(stringShort);
Hessian2StringShortType deserialize = baseHessianSerialize(stringShort);
assertTrue(deserialize.stringByteMap != null);
assertTrue(deserialize.stringByteMap.size() == 2);
assertTrue(deserialize.stringByteMap.get("last") instanceof Byte);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,23 @@ public class Hessian2EnumSetTest extends SerializeTestBase {
@Test
public void singleton() throws Exception {
EnumSet h = EnumSet.of(Type.High);
EnumSet set = baseHession2Serialize(h);
EnumSet set = baseHessian2Serialize(h);
assertTrue(Arrays.asList(set.toArray()).contains(Type.High));
assertFalse(Arrays.asList(set.toArray()).contains(Type.Lower));
}

@Test
public void set() throws Exception {
EnumSet<Type> types = EnumSet.of(Type.High, Type.Lower);
EnumSet set = baseHession2Serialize(types);
EnumSet set = baseHessian2Serialize(types);
assertTrue(set.contains(Type.High));
assertFalse(set.contains(Type.Normal));
}

@Test
public void none() throws Exception {
EnumSet<Type> types = EnumSet.noneOf(Type.class);
EnumSet set = baseHession2Serialize(types);
EnumSet set = baseHessian2Serialize(types);
TestCase.assertEquals(set, EnumSet.noneOf(Type.class));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void serialize_string_short_map_then_deserialize() throws Exception {
stringShortMap.put("last", (short)60);
stringShort.stringShortMap = stringShortMap;

Hessian2StringShortType deserialize = baseHession2Serialize(stringShort);
Hessian2StringShortType deserialize = baseHessian2Serialize(stringShort);
assertTrue(deserialize.stringShortMap != null);
assertTrue(deserialize.stringShortMap.size() == 2);
assertTrue(deserialize.stringShortMap.get("last") instanceof Short);
Expand All @@ -61,7 +61,7 @@ public void serialize_string_byte_map_then_deserialize() throws Exception {
stringByteMap.put("last", (byte)60);
stringShort.stringByteMap = stringByteMap;

Hessian2StringShortType deserialize = baseHession2Serialize(stringShort);
Hessian2StringShortType deserialize = baseHessian2Serialize(stringShort);
assertTrue(deserialize.stringByteMap != null);
assertTrue(deserialize.stringByteMap.size() == 2);
assertTrue(deserialize.stringByteMap.get("last") instanceof Byte);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.junit.Test;

/**
* fix hession serialize bug:
* fix hessian serialize bug:
* the filed of parent class will cover the filed of sub class
*
*/
Expand All @@ -38,7 +38,7 @@ public void testGetBaseUserName() throws Exception {
baseUser.setUserId(1);
baseUser.setUserName("tom");

BaseUser serializedUser = baseHessionSerialize(baseUser);
BaseUser serializedUser = baseHessianSerialize(baseUser);
Assert.assertEquals("tom", serializedUser.getUserName());
}

Expand All @@ -49,7 +49,7 @@ public void testGetSubUserName() throws Exception {
subUser.setUserId(1);
subUser.setUserName("tom");

SubUser serializedUser = baseHessionSerialize(subUser);
SubUser serializedUser = baseHessianSerialize(subUser);
Assert.assertEquals("tom", serializedUser.getUserName());

}
Expand All @@ -60,7 +60,7 @@ public void testGetGrandsonUserName() throws Exception {
grandsonUser.setUserId(1);
grandsonUser.setUserName("tom");

GrandsonUser serializedUser = baseHessionSerialize(grandsonUser);
GrandsonUser serializedUser = baseHessianSerialize(grandsonUser);
Assert.assertEquals("tom", serializedUser.getUserName());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void locale() throws IOException {
}

private void assertLocale(Locale locale) throws IOException {
TestCase.assertEquals(locale, baseHession2Serialize(locale));
TestCase.assertEquals(locale, baseHessionSerialize(locale));
TestCase.assertEquals(locale, baseHessian2Serialize(locale));
TestCase.assertEquals(locale, baseHessianSerialize(locale));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@
import java.io.IOException;

/**
* hession base serialize utils
* hessian base serialize utils
*
*/
public class SerializeTestBase {
/**
* hession serialize util
* hessian serialize util
*
* @param data
* @param <T>
* @return
* @throws IOException
*/
protected <T> T baseHessionSerialize(T data) throws IOException {
protected <T> T baseHessianSerialize(T data) throws IOException {
ByteArrayOutputStream bout = new ByteArrayOutputStream();
HessianOutput out = new HessianOutput(bout);

Expand All @@ -51,14 +51,14 @@ protected <T> T baseHessionSerialize(T data) throws IOException {
}

/**
* hession2 serialize util
* hessian2 serialize util
*
* @param data
* @param <T>
* @return
* @throws IOException
*/
protected <T> T baseHession2Serialize(T data) throws IOException {
protected <T> T baseHessian2Serialize(T data) throws IOException {
ByteArrayOutputStream bout = new ByteArrayOutputStream();
Hessian2Output out = new Hessian2Output(bout);

Expand Down

0 comments on commit 35e7431

Please sign in to comment.