mirror of
https://github.com/fafhrd91/actix-net
synced 2025-06-28 08:40:37 +02:00
update deps
This commit is contained in:
@ -33,8 +33,8 @@ ssl = ["openssl", "actix-server/ssl"]
|
||||
rust-tls = ["rustls", "tokio-rustls", "webpki", "webpki-roots"]
|
||||
|
||||
[dependencies]
|
||||
actix-rt = "0.1.0"
|
||||
#actix-server = "0.3.0"
|
||||
actix-rt = "0.2.0"
|
||||
# actix-server = "0.3.3"
|
||||
actix-server = { path="../actix-server" }
|
||||
|
||||
log = "0.4"
|
||||
@ -54,3 +54,6 @@ rustls = { version = "^0.15", optional = true }
|
||||
tokio-rustls = { version = "^0.9", optional = true }
|
||||
webpki = { version = "0.19", optional = true }
|
||||
webpki-roots = { version = "0.16", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
actix-service = "0.3.3"
|
||||
|
@ -13,27 +13,24 @@ use tokio_tcp::TcpStream;
|
||||
/// The `TestServer` type.
|
||||
///
|
||||
/// `TestServer` is very simple test server that simplify process of writing
|
||||
/// integration tests cases for actix applications.
|
||||
/// integration tests for actix-net applications.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// # extern crate actix_test_server;
|
||||
/// # use actix_web::*;
|
||||
/// #
|
||||
/// # fn my_handler(req: &HttpRequest) -> HttpResponse {
|
||||
/// # HttpResponse::Ok().into()
|
||||
/// # }
|
||||
/// #
|
||||
/// # fn main() {
|
||||
/// use actix_service::{fn_service, IntoNewService};
|
||||
/// use actix_test_server::TestServer;
|
||||
///
|
||||
/// let mut srv = TestServer::new(|app| app.handler(my_handler));
|
||||
/// fn main() {
|
||||
/// let srv = TestServer::with(|| fn_service(
|
||||
/// |sock| {
|
||||
/// println!("New connection: {:?}", sock);
|
||||
/// Ok::<_, ()>(())
|
||||
/// }
|
||||
/// ));
|
||||
///
|
||||
/// let req = srv.get().finish().unwrap();
|
||||
/// let response = srv.execute(req.send()).unwrap();
|
||||
/// assert!(response.status().is_success());
|
||||
/// # }
|
||||
/// println!("SOCKET: {:?}", srv.connect());
|
||||
/// }
|
||||
/// ```
|
||||
pub struct TestServer;
|
||||
|
||||
@ -57,13 +54,13 @@ impl TestServer {
|
||||
let local_addr = tcp.local_addr().unwrap();
|
||||
|
||||
Server::build()
|
||||
.listen("test", tcp, factory)
|
||||
.listen("test", tcp, factory)?
|
||||
.workers(1)
|
||||
.disable_signals()
|
||||
.start();
|
||||
|
||||
tx.send((System::current(), local_addr)).unwrap();
|
||||
sys.run();
|
||||
sys.run()
|
||||
});
|
||||
|
||||
let (system, addr) = rx.recv().unwrap();
|
||||
|
Reference in New Issue
Block a user