测试 handler 未使用参数改为匿名参数,通过发布 MANDATORY 规范检查(G.FUN.02)
This commit is contained in:
+12
-12
@@ -64,12 +64,12 @@ class TestWsHandler <: IWebsocketHandler {
|
||||
conn.send("echo: ${msg.text.getOrThrow()}")
|
||||
}
|
||||
|
||||
public override func onClose(conn: WebSocketConnection, code: Int64, reason: String): Unit {
|
||||
public override func onClose(_: WebSocketConnection, code: Int64, reason: String): Unit {
|
||||
harness.connCloseCode = code
|
||||
harness.connCloseReason = reason
|
||||
}
|
||||
|
||||
public override func onError(conn: WebSocketConnection, e: Exception): Unit {
|
||||
public override func onError(_: WebSocketConnection, e: Exception): Unit {
|
||||
if (let we: WebSocketException <- e) {
|
||||
harness.connErrorCode = we.code
|
||||
}
|
||||
@@ -84,19 +84,19 @@ class EchoHandler <: IWebsocketHandler {
|
||||
this.harness = harness
|
||||
}
|
||||
|
||||
public override func onConnect(conn: WebSocketConnection): Unit {
|
||||
public override func onConnect(_: WebSocketConnection): Unit {
|
||||
()
|
||||
}
|
||||
|
||||
public override func onMessage(conn: WebSocketConnection, msg: WebSocketMessage): Unit {
|
||||
public override func onMessage(_: WebSocketConnection, msg: WebSocketMessage): Unit {
|
||||
harness.connMessage = msg.text.getOrThrow()
|
||||
}
|
||||
|
||||
public override func onClose(conn: WebSocketConnection, code: Int64, reason: String): Unit {
|
||||
public override func onClose(_: WebSocketConnection, _: Int64, _: String): Unit {
|
||||
()
|
||||
}
|
||||
|
||||
public override func onError(conn: WebSocketConnection, e: Exception): Unit {
|
||||
public override func onError(_: WebSocketConnection, _: Exception): Unit {
|
||||
()
|
||||
}
|
||||
}
|
||||
@@ -109,15 +109,15 @@ class CloseOnConnectHandler <: IWebsocketHandler {
|
||||
conn.close(code: 4000, reason: "svr")
|
||||
}
|
||||
|
||||
public override func onMessage(conn: WebSocketConnection, msg: WebSocketMessage): Unit {
|
||||
public override func onMessage(_: WebSocketConnection, _: WebSocketMessage): Unit {
|
||||
()
|
||||
}
|
||||
|
||||
public override func onClose(conn: WebSocketConnection, code: Int64, reason: String): Unit {
|
||||
public override func onClose(_: WebSocketConnection, _: Int64, _: String): Unit {
|
||||
()
|
||||
}
|
||||
|
||||
public override func onError(conn: WebSocketConnection, e: Exception): Unit {
|
||||
public override func onError(_: WebSocketConnection, _: Exception): Unit {
|
||||
()
|
||||
}
|
||||
}
|
||||
@@ -128,15 +128,15 @@ class GroupJoinHandler <: IWebsocketHandler {
|
||||
conn.joinGroup("room")
|
||||
}
|
||||
|
||||
public override func onMessage(conn: WebSocketConnection, msg: WebSocketMessage): Unit {
|
||||
public override func onMessage(_: WebSocketConnection, _: WebSocketMessage): Unit {
|
||||
()
|
||||
}
|
||||
|
||||
public override func onClose(conn: WebSocketConnection, code: Int64, reason: String): Unit {
|
||||
public override func onClose(_: WebSocketConnection, _: Int64, _: String): Unit {
|
||||
()
|
||||
}
|
||||
|
||||
public override func onError(conn: WebSocketConnection, e: Exception): Unit {
|
||||
public override func onError(_: WebSocketConnection, _: Exception): Unit {
|
||||
()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user