2011-05-06 07:38:49 +02:00
.. _developer_guidelines:
2011-05-02 18:50:56 +02:00
Developer Guidelines
2011-04-09 19:55:46 -06:00
====================
2012-10-16 10:59:11 +03:00
.. note ::
2012-10-15 20:00:12 +02:00
2014-10-02 08:23:38 +02:00
First read `The Akka Contributor Guidelines`_ .
2012-10-15 12:02:08 +02:00
2011-04-09 19:55:46 -06:00
Code Style
2011-04-10 13:07:57 -06:00
----------
2011-04-09 19:55:46 -06:00
2013-07-02 12:25:06 +02:00
The Akka code style follows the `Scala Style Guide <http://docs.scala-lang.org/style/> `_ . The only exception is the
style of block comments:
.. code-block :: scala
/**
* Style mandated by "Scala Style Guide"
*/
/**
* Style adopted in the Akka codebase
*/
2011-04-09 19:55:46 -06:00
2011-06-16 11:25:48 +02:00
Akka is using `` Scalariform `` to format the source code as part of the build. So just hack away and then run `` sbt compile `` and it will reformat the code according to Akka standards.
2011-04-09 19:55:46 -06:00
2011-06-16 11:25:48 +02:00
Process
-------
2014-10-02 08:23:38 +02:00
The full process is described in `The Akka Contributor Guidelines`_ . In summary:
2016-02-23 12:58:39 +01:00
* Make sure you have signed the Akka CLA, if not, `sign it online <http://www.lightbend.com/contribute/cla> `_ .
2011-06-16 11:25:48 +02:00
* Pick a ticket, if there is no ticket for your work then create one first.
2014-10-02 08:23:38 +02:00
* Fork `akka/akka <https://github.com/akka/akka> `_ . Start working in a feature branch.
* When you are done, create a GitHub Pull-Request towards the targeted branch.
2012-03-16 15:29:41 +01:00
* When there's consensus on the review, someone from the Akka Core Team will merge it.
2011-04-09 19:55:46 -06:00
2011-08-10 07:51:52 +02:00
Commit messages
---------------
2014-10-02 08:23:38 +02:00
Please follow the conventions described in `The Akka Contributor Guidelines`_ when creating public commits and writing commit messages.
2011-08-10 07:51:52 +02:00
2011-04-09 19:55:46 -06:00
Testing
2011-04-10 13:07:57 -06:00
-------
2011-04-09 19:55:46 -06:00
2011-05-02 18:38:21 +02:00
All code that is checked in **should** have tests. All testing is done with `` ScalaTest `` and `` ScalaCheck `` .
2011-04-10 13:07:57 -06:00
2011-05-02 19:28:00 +02:00
* 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.
2011-04-10 13:07:57 -06:00
2011-04-09 19:55:46 -06:00
Actor TestKit
2011-04-10 13:07:57 -06:00
^^^^^^^^^^^^^
2011-04-09 19:55:46 -06:00
2012-10-22 11:14:22 +02:00
There is a useful test kit for testing actors: `akka.util.TestKit <@github@/akka-testkit/src/main/scala/akka/testkit/TestKit.scala> `_ . It enables assertions concerning replies received and their timing, there is more documentation in the :ref: `akka-testkit` module.
2011-04-09 19:55:46 -06:00
2011-06-16 11:25:48 +02:00
Multi-JVM Testing
^^^^^^^^^^^^^^^^^
2011-04-09 19:55:46 -06:00
2011-06-16 11:25:48 +02:00
Included in the example is an sbt trait for multi-JVM testing which will fork
JVMs for multi-node testing. There is support for running applications (objects
with main methods) and running ScalaTest tests.
2011-04-09 19:55:46 -06:00
2011-06-16 11:25:48 +02:00
NetworkFailureTest
^^^^^^^^^^^^^^^^^^
2011-04-09 19:55:46 -06:00
2012-10-01 20:35:19 +02:00
You can use the 'NetworkFailureTest' trait to test network failure.
2014-10-02 08:23:38 +02:00
.. _The Akka Contributor Guidelines: https://github.com/akka/akka/blob/master/CONTRIBUTING.md