=doc shuffle test files around to proper packages
This commit is contained in:
parent
b2c38444b3
commit
d50c0e3426
9 changed files with 12 additions and 12 deletions
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
|
||||
package docs.http.javadsl;
|
||||
package docs.http.javadsl.server;
|
||||
|
||||
//#high-level-server-example
|
||||
import akka.actor.ActorSystem;
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
|
||||
package docs.http.javadsl;
|
||||
package docs.http.javadsl.server;
|
||||
|
||||
import akka.actor.ActorSystem;
|
||||
import akka.http.impl.util.Util;
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
|
||||
package docs.http.javadsl;
|
||||
package docs.http.javadsl.server;
|
||||
|
||||
import akka.http.javadsl.model.HttpRequest;
|
||||
import akka.http.javadsl.model.StatusCodes;
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
|
||||
package docs.http.javadsl.testkit;
|
||||
package docs.http.javadsl.server.testkit;
|
||||
|
||||
//#simple-app
|
||||
import akka.http.javadsl.server.*;
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
|
||||
package docs.http.javadsl.testkit;
|
||||
package docs.http.javadsl.server.testkit;
|
||||
|
||||
//#simple-app-testing
|
||||
import akka.http.javadsl.model.HttpRequest;
|
||||
|
|
@ -91,5 +91,5 @@ Predefined path matchers allow extraction of various types of values:
|
|||
|
||||
Here's a collection of path matching examples:
|
||||
|
||||
.. includecode:: ../../../code/docs/http/javadsl/PathDirectiveExampleTest.java
|
||||
.. includecode:: ../../../code/docs/http/javadsl/server/PathDirectiveExampleTest.java
|
||||
:include: path-examples
|
||||
|
|
@ -7,7 +7,7 @@ The Akka HTTP :ref:`http-low-level-server-side-api-java` provides a ``Flow``- or
|
|||
an application to respond to incoming HTTP requests by simply mapping requests to responses
|
||||
(excerpt from :ref:`Low-level server side example <http-low-level-server-side-example-java>`):
|
||||
|
||||
.. includecode:: ../../code/docs/http/javadsl/HttpServerExampleDocTest.java
|
||||
.. includecode:: ../../code/docs/http/javadsl/server/HttpServerExampleDocTest.java
|
||||
:include: request-handler
|
||||
|
||||
While it'd be perfectly possible to define a complete REST API service purely by inspecting the incoming
|
||||
|
|
@ -21,7 +21,7 @@ async handler function) that can be directly supplied to a ``bind`` call.
|
|||
|
||||
Here's the complete example rewritten using the composable high-level API:
|
||||
|
||||
.. includecode:: ../../code/docs/http/javadsl/HighLevelServerExample.java
|
||||
.. includecode:: ../../code/docs/http/javadsl/server/HighLevelServerExample.java
|
||||
:include: high-level-server-example
|
||||
|
||||
Heart of the high-level architecture is the route tree. It is a big expression of type ``Route``
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ Example
|
|||
|
||||
To see the testkit in action consider the following simple calculator app service:
|
||||
|
||||
.. includecode:: ../../code/docs/http/javadsl/testkit/MyAppService.java
|
||||
.. includecode:: ../../code/docs/http/javadsl/server/testkit/MyAppService.java
|
||||
:include: simple-app
|
||||
|
||||
The app extends from ``HttpApp`` which brings all of the directives into scope. Method ``createRoute``
|
||||
|
|
@ -29,7 +29,7 @@ needs to be implemented to return the complete route of the app.
|
|||
|
||||
Here's how you would test that service:
|
||||
|
||||
.. includecode:: ../../code/docs/http/javadsl/testkit/TestkitExampleTest.java
|
||||
.. includecode:: ../../code/docs/http/javadsl/server/testkit/TestkitExampleTest.java
|
||||
:include: simple-app-testing
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ Starting and Stopping
|
|||
On the most basic level an Akka HTTP server is bound by invoking the ``bind`` method of the `akka.http.javadsl.Http`_
|
||||
extension:
|
||||
|
||||
.. includecode:: ../../code/docs/http/javadsl/HttpServerExampleDocTest.java
|
||||
.. includecode:: ../../code/docs/http/javadsl/server/HttpServerExampleDocTest.java
|
||||
:include: binding-example
|
||||
|
||||
Arguments to the ``Http().bind`` method specify the interface and port to bind to and register interest in handling
|
||||
|
|
@ -99,7 +99,7 @@ Requests are handled by calling one of the ``handleWithXXX`` methods with a hand
|
|||
|
||||
Here is a complete example:
|
||||
|
||||
.. includecode:: ../../code/docs/http/javadsl/HttpServerExampleDocTest.java
|
||||
.. includecode:: ../../code/docs/http/javadsl/server/HttpServerExampleDocTest.java
|
||||
:include: full-server-example
|
||||
|
||||
In this example, a request is handled by transforming the request stream with a function ``Function<HttpRequest, HttpResponse>``
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue