diff --git a/Cargo.toml b/Cargo.toml index 44262e849..40f8c7c4a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -107,7 +107,7 @@ openssl = { version="0.10", optional = true } [dev-dependencies] actix-http = { path = "actix-http", features=["ssl"] } -actix-http-test = { path = "actix-http/test-server", features=["ssl"] } +actix-http-test = { path = "test-server", features=["ssl"] } rand = "0.6" env_logger = "0.6" serde_derive = "1.0" diff --git a/actix-files/Cargo.toml b/actix-files/Cargo.toml index 65faa5e8c..ba8fbb6c2 100644 --- a/actix-files/Cargo.toml +++ b/actix-files/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "actix-files" -version = "0.1.0" +version = "0.1.0-alpha.1" authors = ["Nikolay Kim "] description = "Static files support for Actix web." readme = "README.md" keywords = ["actix", "http", "async", "futures"] homepage = "https://actix.rs" repository = "https://github.com/actix/actix-web.git" -documentation = "https://actix.rs/api/actix-web/stable/actix_web/" +documentation = "https://docs.rs/actix-files/" categories = ["asynchronous", "web-programming::http-server"] license = "MIT/Apache-2.0" edition = "2018" @@ -19,7 +19,7 @@ path = "src/lib.rs" [dependencies] actix-web = { path=".." } -actix-http = { git = "https://github.com/actix/actix-http.git" } +actix-http = { path="../actix-http" } actix-service = "0.3.3" bitflags = "1" diff --git a/actix-http/Cargo.toml b/actix-http/Cargo.toml index 798508a94..3b403ac2a 100644 --- a/actix-http/Cargo.toml +++ b/actix-http/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-http" -version = "0.1.0" +version = "0.1.0-alpha.1" authors = ["Nikolay Kim "] description = "Actix http" readme = "README.md" @@ -20,9 +20,8 @@ workspace = ".." features = ["ssl", "fail", "cookie"] [badges] -travis-ci = { repository = "actix/actix-http", branch = "master" } -# appveyor = { repository = "fafhrd91/actix-http-b1qsn" } -codecov = { repository = "actix/actix-http", branch = "master", service = "github" } +travis-ci = { repository = "actix/actix-web", branch = "master" } +codecov = { repository = "actix/actix-web", branch = "master", service = "github" } [lib] name = "actix_http" @@ -87,7 +86,7 @@ openssl = { version="0.10", optional = true } actix-rt = "0.2.1" actix-server = { version = "0.4.0", features=["ssl"] } actix-connect = { version = "0.1.0", features=["ssl"] } -actix-http-test = { path="test-server", features=["ssl"] } +actix-http-test = { path="../test-server", features=["ssl"] } env_logger = "0.6" serde_derive = "1.0" diff --git a/actix-session/Cargo.toml b/actix-session/Cargo.toml index 554f3d7fc..3adcc8f53 100644 --- a/actix-session/Cargo.toml +++ b/actix-session/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "actix-session" -version = "0.1.0" +version = "0.1.0-alpha.1" authors = ["Nikolay Kim "] description = "Session for actix web framework." readme = "README.md" keywords = ["http", "web", "framework", "async", "futures"] homepage = "https://actix.rs" repository = "https://github.com/actix/actix-web.git" -documentation = "https://docs.rs/actix-web/" +documentation = "https://docs.rs/actix-session/" license = "MIT/Apache-2.0" exclude = [".gitignore", ".travis.yml", ".cargo/config", "appveyor.yml"] workspace = ".." diff --git a/actix-web-actors/Cargo.toml b/actix-web-actors/Cargo.toml index db42a1a23..95b726619 100644 --- a/actix-web-actors/Cargo.toml +++ b/actix-web-actors/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-web-actors" -version = "0.1.0" +version = "0.1.0-alpha.1" authors = ["Nikolay Kim "] description = "Actix actors support for actix web framework." readme = "README.md" @@ -20,12 +20,12 @@ path = "src/lib.rs" [dependencies] actix-web = { path=".." } actix = { git = "https://github.com/actix/actix.git" } -actix-http = { git = "https://github.com/actix/actix-http.git" } +actix-http = { path = "../actix-http/" } actix-codec = "0.1.1" bytes = "0.4" futures = "0.1" [dev-dependencies] env_logger = "0.6" -actix-http = { git = "https://github.com/actix/actix-http.git", features=["ssl"] } -actix-http-test = { git = "https://github.com/actix/actix-http.git", features=["ssl"] } +actix-http = { path = "../actix-http/", features=["ssl"] } +actix-http-test = { path = "../test-server/", features=["ssl"] } diff --git a/actix-web-codegen/Cargo.toml b/actix-web-codegen/Cargo.toml index d87b71ba9..3785acb32 100644 --- a/actix-web-codegen/Cargo.toml +++ b/actix-web-codegen/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "actix-web-codegen" description = "Actix web codegen macros" -version = "0.1.0" +version = "0.1.0-alpha.1" authors = ["Nikolay Kim "] license = "MIT/Apache-2.0" edition = "2018" @@ -16,5 +16,5 @@ syn = { version = "0.15", features = ["full", "parsing"] } [dev-dependencies] actix-web = { path = ".." } -actix-http = { git = "https://github.com/actix/actix-http.git", features=["ssl"] } -actix-http-test = { git = "https://github.com/actix/actix-http.git", features=["ssl"] } +actix-http = { path = "../actix-http/", features=["ssl"] } +actix-http-test = { path = "../test-server/", features=["ssl"] } diff --git a/actix-web-codegen/tests/test_macro.rs b/actix-web-codegen/tests/test_macro.rs index 62b5d618f..8bf2c88be 100644 --- a/actix-web-codegen/tests/test_macro.rs +++ b/actix-web-codegen/tests/test_macro.rs @@ -1,6 +1,6 @@ use actix_http::HttpService; use actix_http_test::TestServer; -use actix_web::{get, App, HttpResponse, Responder}; +use actix_web::{get, http, App, HttpResponse, Responder}; #[get("/test")] fn test() -> impl Responder { @@ -11,7 +11,7 @@ fn test() -> impl Responder { fn test_body() { let mut srv = TestServer::new(|| HttpService::new(App::new().service(test))); - let request = srv.get().uri(srv.url("/test")).finish().unwrap(); - let response = srv.send_request(request).unwrap(); + let request = srv.request(http::Method::GET, srv.url("/test")); + let response = srv.block_on(request.send()).unwrap(); assert!(response.status().is_success()); } diff --git a/awc/Cargo.toml b/awc/Cargo.toml index 233fe59db..023bd088b 100644 --- a/awc/Cargo.toml +++ b/awc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "awc" -version = "0.1.0" +version = "0.1.0-alpha.1" authors = ["Nikolay Kim "] description = "Actix web client." readme = "README.md" @@ -45,4 +45,4 @@ env_logger = "0.6" mime = "0.3" actix-rt = "0.2.1" actix-http = { path = "../actix-http/", features=["ssl"] } -actix-http-test = { path = "../actix-http/test-server/", features=["ssl"] } +actix-http-test = { path = "../test-server/", features=["ssl"] } diff --git a/actix-http/test-server/Cargo.toml b/test-server/Cargo.toml similarity index 84% rename from actix-http/test-server/Cargo.toml rename to test-server/Cargo.toml index 316f3e36d..6959adbe5 100644 --- a/actix-http/test-server/Cargo.toml +++ b/test-server/Cargo.toml @@ -1,19 +1,20 @@ [package] name = "actix-http-test" -version = "0.1.0" +version = "0.1.0-alpha.1" authors = ["Nikolay Kim "] -description = "Actix http" +description = "Actix http test server" readme = "README.md" keywords = ["http", "web", "framework", "async", "futures"] homepage = "https://actix.rs" repository = "https://github.com/actix/actix-web.git" -documentation = "https://actix.rs/api/actix-web/stable/actix_web/" +documentation = "https://docs.rs/actix-http-test/" categories = ["network-programming", "asynchronous", "web-programming::http-server", "web-programming::websocket"] license = "MIT/Apache-2.0" exclude = [".gitignore", ".travis.yml", ".cargo/config", "appveyor.yml"] edition = "2018" +workspace = ".." [package.metadata.docs.rs] features = ["session"] @@ -34,11 +35,11 @@ ssl = ["openssl", "actix-http/ssl", "actix-server/ssl", "awc/ssl"] [dependencies] actix-codec = "0.1.1" actix-rt = "0.2.1" -actix-http = { path=".." } +actix-http = { path="../actix-http" } actix-service = "0.3.4" actix-server = "0.4.0" actix-utils = "0.3.4" -awc = { path = "../../awc" } +awc = { path = "../awc" } base64 = "0.10" bytes = "0.4" @@ -58,3 +59,6 @@ tokio-tcp = "0.1" tokio-timer = "0.2" openssl = { version="0.10", optional = true } + +[dev-dependencies] +actix-web = { path=".." } diff --git a/actix-http/test-server/src/lib.rs b/test-server/src/lib.rs similarity index 91% rename from actix-http/test-server/src/lib.rs rename to test-server/src/lib.rs index 77329e700..7cd94d4d2 100644 --- a/actix-http/test-server/src/lib.rs +++ b/test-server/src/lib.rs @@ -21,22 +21,26 @@ use net2::TcpBuilder; /// # Examples /// /// ```rust -/// # extern crate actix_web; -/// # use actix_web::*; +/// use actix_http::HttpService; +/// use actix_http_test::TestServer; +/// use actix_web::{web, App, HttpResponse}; /// # -/// # fn my_handler(req: &HttpRequest) -> HttpResponse { -/// # HttpResponse::Ok().into() -/// # } -/// # -/// # fn main() { -/// use actix_web::test::TestServer; +/// fn my_handler() -> HttpResponse { +/// HttpResponse::Ok().into() +/// } /// -/// let mut srv = TestServer::new(|app| app.handler(my_handler)); +/// fn main() { +/// let mut srv = TestServer::new( +/// || HttpService::new( +/// App::new().service( +/// web::resource("/").to(my_handler)) +/// ) +/// ); /// -/// let req = srv.get().finish().unwrap(); -/// let response = srv.execute(req.send()).unwrap(); -/// assert!(response.status().is_success()); -/// # } +/// let req = srv.get(); +/// let response = srv.block_on(req.send()).unwrap(); +/// assert!(response.status().is_success()); +/// } /// ``` pub struct TestServer;