Skip to content

Commit

Permalink
fxi jdk tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chaokunyang committed Jul 15, 2023
1 parent 567673f commit 9a020e3
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedSet;
import com.google.common.reflect.TypeToken;
import io.fury.Fury;
import io.fury.FuryTestBase;
import io.fury.Language;
import io.fury.memory.MemoryBuffer;
import io.fury.memory.MemoryUtils;
import io.fury.serializer.CollectionSerializers.JDKCompatibleCollectionSerializer;
import io.fury.type.GenericType;
import java.io.Serializable;
import java.util.AbstractCollection;
Expand Down Expand Up @@ -388,17 +390,16 @@ public void testDefaultCollectionSerializer() {
@SuppressWarnings("unchecked")
@Test
public void testJavaSerialization() {
ImmutableSet<Integer> set = ImmutableSet.of(1, 2, 3);
Class<? extends ImmutableSet> setClass = set.getClass();
ImmutableSortedSet<Integer> set = ImmutableSortedSet.of(1, 2, 3);
Class<? extends ImmutableSortedSet> setClass = set.getClass();
Fury fury =
Fury.builder()
.withLanguage(Language.JAVA)
.withRefTracking(false)
.disableSecureMode()
.build();
MemoryBuffer buffer = MemoryUtils.buffer(32);
CollectionSerializers.JDKCompatibleCollectionSerializer javaSerializer =
new CollectionSerializers.JDKCompatibleCollectionSerializer(fury, setClass);
JDKCompatibleCollectionSerializer javaSerializer = new JDKCompatibleCollectionSerializer(fury, setClass);
javaSerializer.write(buffer, set);
Object read = javaSerializer.read(buffer);
assertEquals(set, read);
Expand Down

0 comments on commit 9a020e3

Please sign in to comment.