Developer Guidelines
Code Style
The Akka code style follows this document .
Here is a code style settings file for IntelliJ IDEA: Download
Please follow the code style. Look at the code around you and mimic.
Testing
All code that is checked in should have tests. All testing is done with ScalaTest and ScalaCheck.
- Name tests as Test.scala if they do not depend on any external stuff. That keeps surefire happy.
- Name tests as Spec.scala if they have external dependencies.
There is a testing standard that should be followed: Ticket001Spec
Actor TestKit
There is a useful test kit for testing actors: akka.util.TestKit. It enables assertions concerning replies received and their timing, there is more documentation in the Testing Actor Systems module.
NetworkFailureTest
You can use the ‘NetworkFailureTest’ trait to test network failure. See the ‘RemoteErrorHandlingNetworkTest’ test. Your tests needs to end with ‘NetworkTest’. They are disabled by default. To run them you need to enable a flag.
Example:
project akka-remote
set akka.test.network true
test-only akka.actor.remote.RemoteErrorHandlingNetworkTest
It uses ‘ipfw’ for network management. Mac OSX comes with it installed but if you are on another platform you might need to install it yourself. Here is a port:
Contents