Skip to content

Commit

Permalink
chore: add a test that reads the flat record node using all possible …
Browse files Browse the repository at this point in the history
…types (#706)
  • Loading branch information
eduardoramirez authored Oct 25, 2024
1 parent a4568a7 commit 6e7ee46
Show file tree
Hide file tree
Showing 11 changed files with 518 additions and 28 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
import com.netflix.hollow.core.write.objectmapper.flatrecords.FlatRecord;
import com.netflix.hollow.core.write.objectmapper.flatrecords.FlatRecordWriter;
import com.netflix.hollow.core.write.objectmapper.flatrecords.HollowSchemaIdentifierMapper;
import com.netflix.hollow.test.dto.Award;
import com.netflix.hollow.test.dto.CastMember;
import com.netflix.hollow.test.dto.CastRole;
import com.netflix.hollow.test.dto.Country;
import com.netflix.hollow.test.dto.MaturityRating;
import com.netflix.hollow.test.dto.Movie;
import com.netflix.hollow.test.dto.Tag;
import com.netflix.hollow.test.dto.TagValue;
import com.netflix.hollow.test.dto.movie.Award;
import com.netflix.hollow.test.dto.movie.CastMember;
import com.netflix.hollow.test.dto.movie.CastRole;
import com.netflix.hollow.test.dto.movie.Country;
import com.netflix.hollow.test.dto.movie.MaturityRating;
import com.netflix.hollow.test.dto.movie.Movie;
import com.netflix.hollow.test.dto.movie.Tag;
import com.netflix.hollow.test.dto.movie.TagValue;
import org.assertj.core.api.Assertions;
import org.junit.Before;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
package com.netflix.hollow.test.dto.kitchensink;


import com.netflix.hollow.core.write.objectmapper.HollowHashKey;
import com.netflix.hollow.core.write.objectmapper.HollowInline;
import com.netflix.hollow.core.write.objectmapper.HollowPrimaryKey;
import com.netflix.hollow.core.write.objectmapper.HollowTypeName;

import java.util.List;
import java.util.Map;
import java.util.Set;

@HollowPrimaryKey(fields = {"intVal"})
public class KitchenSink {
public int intVal;
public long longVal;
public float floatVal;
public double doubleVal;
public boolean booleanVal;
public byte byteVal;
public short shortVal;
public char charVal;

public Integer boxedIntVal;
public Long boxedLongVal;
public Float boxedFloatVal;
public Double boxedDoubleVal;
public Boolean boxedBooleanVal;
public Byte boxedByteVal;
public Short boxedShortVal;
public Character boxedCharVal;
public String stringVal;

@HollowInline
public Integer inlineIntVal;
@HollowInline
public Long inlineLongVal;
@HollowInline
public Float inlineFloatVal;
@HollowInline
public Double inlineDoubleVal;
@HollowInline
public Boolean inlineBooleanVal;
@HollowInline
public Byte inlineByteVal;
@HollowInline
public Short inlineShortVal;
@HollowInline
public Character inlineCharVal;
@HollowInline
public String inlineStringVal;

public byte[] bytesVal;

@HollowTypeName(name = "CustomType")
public String customTypeVal;

public SubType subType;

public List<SubType> subTypeList;
public Set<SubType> subTypeSet;

public Map<MapKey, SubType> subTypeMap;
public Map<ComplexMapKey, SubType> complexMapKeyMap;


@HollowHashKey(fields = {"value1"})
public Set<HashableKey> hashableSet;
@HollowHashKey(fields = {"value1"})
public Map<HashableKey, SubType> hashableMap;

public static class SubType {
public int intVal;
public long longVal;
public float floatVal;
}

public static class MapKey {
public int value;
}

public static class ComplexMapKey {
public int value1;
public int value2;
}

public static class HashableKey {
public int value1;
public int value2;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.netflix.hollow.test.dto;
package com.netflix.hollow.test.dto.movie;

import com.netflix.hollow.core.write.objectmapper.HollowTypeName;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.netflix.hollow.test.dto;
package com.netflix.hollow.test.dto.movie;

import com.netflix.hollow.core.write.objectmapper.HollowInline;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.netflix.hollow.test.dto;
package com.netflix.hollow.test.dto.movie;

public enum CastRole {
DIRECTOR,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.netflix.hollow.test.dto;
package com.netflix.hollow.test.dto.movie;


import com.netflix.hollow.core.write.objectmapper.HollowInline;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.netflix.hollow.test.dto;
package com.netflix.hollow.test.dto.movie;

import com.netflix.hollow.core.write.objectmapper.HollowTypeName;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.netflix.hollow.test.dto;
package com.netflix.hollow.test.dto.movie;


import com.netflix.hollow.core.write.objectmapper.HollowHashKey;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.netflix.hollow.test.dto;
package com.netflix.hollow.test.dto.movie;

import com.netflix.hollow.core.write.objectmapper.HollowInline;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.netflix.hollow.test.dto;
package com.netflix.hollow.test.dto.movie;

import com.netflix.hollow.core.write.objectmapper.HollowInline;

Expand Down

0 comments on commit 6e7ee46

Please sign in to comment.