fix EventStreamSpec by adding Logging extension
- used only to keep the uniquifying logger counter per-ActorSystem - add convenience-class for writing an extension with only two lines overhead (Java: three)!
This commit is contained in:
parent
afda539324
commit
073c3c012b
3 changed files with 59 additions and 3 deletions
|
|
@ -31,6 +31,15 @@ public class JavaExtension {
|
|||
system = i;
|
||||
}
|
||||
}
|
||||
|
||||
static class OtherExtension implements Extension {
|
||||
static final ExtensionKey<OtherExtension> key = new ExtensionKey<OtherExtension>(OtherExtension.class) {};
|
||||
|
||||
public final ActorSystemImpl system;
|
||||
public OtherExtension(ActorSystemImpl i) {
|
||||
system = i;
|
||||
}
|
||||
}
|
||||
|
||||
private Config c = ConfigFactory.parseString("akka.extensions = [ \"akka.actor.JavaExtension$Provider\" ]",
|
||||
ConfigParseOptions.defaults());
|
||||
|
|
@ -42,5 +51,10 @@ public class JavaExtension {
|
|||
assertSame(system.extension(defaultInstance).system, system);
|
||||
assertSame(defaultInstance.apply(system).system, system);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mustBeAdHoc() {
|
||||
assertSame(OtherExtension.key.apply(system).system, system);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue