[Java] Fix instanceof RayPyActor (#6377)

This commit is contained in:
Kai Yang
2019-12-07 16:28:29 +08:00
committed by Hao Chen
parent 7e9fddf3ed
commit eb912b68b1
7 changed files with 102 additions and 49 deletions
@@ -7,6 +7,7 @@ import java.util.concurrent.TimeUnit;
import org.ray.api.Ray;
import org.ray.api.RayActor;
import org.ray.api.RayObject;
import org.ray.api.RayPyActor;
import org.ray.api.TestUtils;
import org.ray.api.TestUtils.LargeObject;
import org.ray.api.annotation.RayRemote;
@@ -50,6 +51,8 @@ public class ActorTest extends BaseTest {
// Test creating an actor from a constructor
RayActor<Counter> actor = Ray.createActor(Counter::new, 1);
Assert.assertNotEquals(actor.getId(), UniqueId.NIL);
// A java actor is not a python actor
Assert.assertFalse(actor instanceof RayPyActor);
// Test calling an actor
Assert.assertEquals(Integer.valueOf(1), Ray.call(Counter::getValue, actor).get());
Ray.call(Counter::increase, actor, 1);