mirror of
https://github.com/wassname/ray.git
synced 2026-07-07 10:08:07 +08:00
[Java] Fix serializing issues of RaySerializer (#4887)
* Fix * Address comment.
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user