[Java] Fix serializing issues of RaySerializer (#4887)

* Fix

* Address comment.
This commit is contained in:
Qing Wang
2019-06-08 22:56:00 +08:00
committed by GitHub
parent ec8aaf011b
commit 671c0f769e
4 changed files with 28 additions and 3 deletions
@@ -0,0 +1,23 @@
package org.ray.api.test;
import org.ray.api.RayPyActor;
import org.ray.api.id.UniqueId;
import org.ray.runtime.RayPyActorImpl;
import org.ray.runtime.util.Serializer;
import org.testng.Assert;
import org.testng.annotations.Test;
public class RaySerializerTest {
@Test
public void testSerializePyActor() {
final UniqueId pyActorId = UniqueId.randomId();
RayPyActor pyActor = new RayPyActorImpl(pyActorId, "test", "RaySerializerTest");
byte[] bytes = Serializer.encode(pyActor);
RayPyActor result = Serializer.decode(bytes);
Assert.assertEquals(result.getId(), pyActorId);
Assert.assertEquals(result.getModuleName(), "test");
Assert.assertEquals(result.getClassName(), "RaySerializerTest");
}
}