Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
fix Set Serialize data lost (#2)
* fix Set Vector Serialize data lost apache/dubbo#2069 apache/dubbo#146 * update .travis.yml * update * update test * update test * update test * change travis jdk version
- Loading branch information
1 parent
4c59eb6
commit 447d963c915340c2fdb0fa720de3ed6236263df0
Showing
8 changed files
with
84 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
Hessian Lite(Alibaba embed version) | ||
Hessian Lite(Alibaba embed version) | ||
|
||
[](https://travis-ci.org/dubbo/hessian-lite) | ||
[](https://codecov.io/gh/dubbo/hessian-lite) | ||
[](https://gitter.im/alibaba/dubbo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) | ||
 | ||
 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.alibaba.com.caucho.hessian.io; | ||
|
||
import com.alibaba.com.caucho.hessian.io.base.SerializeTestBase; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
import java.util.HashSet; | ||
import java.util.LinkedList; | ||
import java.util.List; | ||
import java.util.Set; | ||
import java.util.Vector; | ||
|
||
public class CollectionSerializerTest extends SerializeTestBase { | ||
@Test | ||
public void testSetSerializer() throws Exception { | ||
|
||
Set set = new HashSet(); | ||
set.add(1111); | ||
set.add(2222); | ||
|
||
Set deserialize = baseHessianSerialize(set); | ||
Assert.assertTrue(deserialize.equals(set)); | ||
} | ||
|
||
@Test | ||
public void testListSerializer() throws Exception { | ||
|
||
List<Integer> list = new LinkedList<>(); | ||
list.add(1111); | ||
list.add(2222); | ||
|
||
List deserialize = baseHessianSerialize(list); | ||
Assert.assertTrue(deserialize.equals(list)); | ||
} | ||
|
||
|
||
@Test | ||
public void testVectorSerializer() throws Exception { | ||
|
||
Vector vector = new Vector(); | ||
vector.add(1111); | ||
vector.add(2222); | ||
|
||
List deserialize = baseHessianSerialize(vector); | ||
Assert.assertTrue(deserialize.equals(vector)); | ||
} | ||
} |