Added test for failing TypedActor with method 'String hello(String s)'

This commit is contained in:
Jonas Bonér 2011-01-11 11:23:09 +01:00
parent 139a064110
commit ea5648e8e3
3 changed files with 10 additions and 0 deletions

View file

@ -6,6 +6,7 @@ import akka.dispatch.Future;
import akka.japi.Option;
public interface SimpleJavaPojo {
String hello(String name);
public Object getSender();
public Object getSenderFuture();
public Future<Integer> square(int value);

View file

@ -18,6 +18,10 @@ public class SimpleJavaPojoImpl extends TypedActor implements SimpleJavaPojo {
private String name;
public String hello(String name) {
return "Hello " + name;
}
public Future<Integer> square(int value) {
return future(value * value);
}

View file

@ -73,6 +73,11 @@ class TypedActorSpec extends
describe("TypedActor") {
it("should return POJO method return value when invoked") {
val result = simplePojo.hello("POJO")
result should equal ("Hello POJO")
}
it("should resolve Future return from method defined to return a Future") {
val future = simplePojo.square(10)
future.await