Formatting java codes with sbt-java-formatter.
This commit is contained in:
parent
27500001ea
commit
998c5a9285
401 changed files with 19750 additions and 17450 deletions
|
|
@ -30,8 +30,8 @@ import static org.junit.Assert.*;
|
|||
public class JavaAPI extends JUnitSuite {
|
||||
|
||||
@ClassRule
|
||||
public static AkkaJUnitActorSystemResource actorSystemResource = new AkkaJUnitActorSystemResource("JavaAPI",
|
||||
AkkaSpec.testConf());
|
||||
public static AkkaJUnitActorSystemResource actorSystemResource =
|
||||
new AkkaJUnitActorSystemResource("JavaAPI", AkkaSpec.testConf());
|
||||
|
||||
private final ActorSystem system = actorSystemResource.getSystem();
|
||||
|
||||
|
|
@ -62,11 +62,13 @@ public class JavaAPI extends JUnitSuite {
|
|||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static Props mkErasedProps() {
|
||||
return Props.create(JavaAPITestActor.class, new Creator() {
|
||||
public Object create() {
|
||||
return new JavaAPITestActor();
|
||||
}
|
||||
});
|
||||
return Props.create(
|
||||
JavaAPITestActor.class,
|
||||
new Creator() {
|
||||
public Object create() {
|
||||
return new JavaAPITestActor();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static Props mkPropsWithLambda() {
|
||||
|
|
@ -87,7 +89,9 @@ public class JavaAPI extends JUnitSuite {
|
|||
|
||||
@Test
|
||||
public void mustBeAbleToCreateActorWIthConstructorParams() {
|
||||
ActorRef ref = system.actorOf(Props.create(ActorWithConstructorParams.class, "a", "b", new Integer(17), 18));
|
||||
ActorRef ref =
|
||||
system.actorOf(
|
||||
Props.create(ActorWithConstructorParams.class, "a", "b", new Integer(17), 18));
|
||||
final TestProbe probe = new TestProbe(system);
|
||||
probe.send(ref, "get");
|
||||
probe.expectMsg("a-b-17-18");
|
||||
|
|
@ -95,7 +99,9 @@ public class JavaAPI extends JUnitSuite {
|
|||
|
||||
@Test
|
||||
public void mustBeAbleToCreateActorWIthBoxedAndUnBoxedConstructorParams() {
|
||||
ActorRef ref = system.actorOf(Props.create(ActorWithConstructorParams.class, "a", "b", 17, new Integer(18)));
|
||||
ActorRef ref =
|
||||
system.actorOf(
|
||||
Props.create(ActorWithConstructorParams.class, "a", "b", 17, new Integer(18)));
|
||||
final TestProbe probe = new TestProbe(system);
|
||||
probe.send(ref, "get");
|
||||
probe.expectMsg("a-b-17-18");
|
||||
|
|
@ -103,7 +109,8 @@ public class JavaAPI extends JUnitSuite {
|
|||
|
||||
@Test
|
||||
public void mustBeAbleToCreateActorWIthNullConstructorParams() {
|
||||
ActorRef ref = system.actorOf(Props.create(ActorWithConstructorParams.class, "a", null, null, 18));
|
||||
ActorRef ref =
|
||||
system.actorOf(Props.create(ActorWithConstructorParams.class, "a", null, null, 18));
|
||||
final TestProbe probe = new TestProbe(system);
|
||||
probe.send(ref, "get");
|
||||
probe.expectMsg("a-null-null-18");
|
||||
|
|
@ -112,7 +119,8 @@ public class JavaAPI extends JUnitSuite {
|
|||
@Test
|
||||
public void mustBeAbleToCreateActorWIthNullConstructorParams2() {
|
||||
// without this Object array wrapper it will not compile: "reference to create is ambiguous"
|
||||
ActorRef ref = system.actorOf(Props.create(ActorWithConstructorParams.class, new Object[] { null }));
|
||||
ActorRef ref =
|
||||
system.actorOf(Props.create(ActorWithConstructorParams.class, new Object[] {null}));
|
||||
final TestProbe probe = new TestProbe(system);
|
||||
probe.send(ref, "get");
|
||||
probe.expectMsg("null-undefined-0-0");
|
||||
|
|
@ -186,9 +194,15 @@ public class JavaAPI extends JUnitSuite {
|
|||
}
|
||||
|
||||
public void onReceive(Object msg) {
|
||||
String reply = String.valueOf(a) + "-" + String.valueOf(b) + "-" + String.valueOf(c) + "-" + String.valueOf(d);
|
||||
String reply =
|
||||
String.valueOf(a)
|
||||
+ "-"
|
||||
+ String.valueOf(b)
|
||||
+ "-"
|
||||
+ String.valueOf(c)
|
||||
+ "-"
|
||||
+ String.valueOf(d);
|
||||
getSender().tell(reply, getSelf());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue