Skip to content

Commit 51d6055

Browse files
committed
WebSocket API: Add unit test support + clean up
1 parent 4a1995b commit 51d6055

File tree

28 files changed

+559
-24
lines changed

28 files changed

+559
-24
lines changed

TODO

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
* Session set null context to Value API
1+
* Make Session.toMap() read-only
22
* review toString on Value API (removal of QueryStringValue?)
33
* tests and coverage
44
* server options from application.conf MUST override hardcoded settings
55
* make reset headers on error configurable
66
* netty reports a leak in MVC body
7-
8-
* websockets

examples/src/main/java/examples/WebSocketApp.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Jooby https://jooby.io
3+
* Apache License Version 2.0 https://jooby.io/LICENSE.txt
4+
* Copyright 2014 Edgar Espina
5+
*/
16
package examples;
27

38
import io.jooby.ExecutionMode;

jooby/src/main/java/io/jooby/Context.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,12 @@ public interface Context extends Registry {
666666
*/
667667
@Nonnull Context detach(@Nonnull Route.Handler next) throws Exception;
668668

669+
/**
670+
* Perform a websocket handsake and upgrade a HTTP GET into a websocket protocol.
671+
*
672+
* @param handler Web socket initializer.
673+
* @return This context.
674+
*/
669675
@Nonnull Context upgrade(@Nonnull WebSocket.Initializer handler);
670676

671677
/*

jooby/src/main/java/io/jooby/Multipart.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@
2020
*/
2121
public interface Multipart extends Formdata {
2222

23-
void put(String name, FileUpload file);
23+
/**
24+
* Put/Add a file into this multipart request.
25+
*
26+
* @param name HTTP name.
27+
* @param file File upload.
28+
*/
29+
void put(@Nonnull String name, @Nonnull FileUpload file);
2430

2531
/**
2632
* All file uploads. Only for <code>multipart/form-data</code> request.

jooby/src/main/java/io/jooby/Session.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ public interface Session {
130130
*/
131131
@Nonnull ValueNode remove(@Nonnull String name);
132132

133+
/**
134+
* Read-only copy of session attributes.
135+
*
136+
* @return Read-only attributes.
137+
*/
133138
@Nonnull Map<String, String> toMap();
134139

135140
/**

jooby/src/main/java/io/jooby/Value.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Jooby https://jooby.io
3+
* Apache License Version 2.0 https://jooby.io/LICENSE.txt
4+
* Copyright 2014 Edgar Espina
5+
*/
16
package io.jooby;
27

38
import io.jooby.internal.ArrayValue;

jooby/src/main/java/io/jooby/WebSocket.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Jooby https://jooby.io
3+
* Apache License Version 2.0 https://jooby.io/LICENSE.txt
4+
* Copyright 2014 Edgar Espina
5+
*/
16
package io.jooby;
27

38
import javax.annotation.Nonnull;

jooby/src/main/java/io/jooby/WebSocketCloseStatus.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Jooby https://jooby.io
3+
* Apache License Version 2.0 https://jooby.io/LICENSE.txt
4+
* Copyright 2014 Edgar Espina
5+
*/
16
package io.jooby;
27

38
import javax.annotation.Nullable;

jooby/src/main/java/io/jooby/WebSocketConfigurer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Jooby https://jooby.io
3+
* Apache License Version 2.0 https://jooby.io/LICENSE.txt
4+
* Copyright 2014 Edgar Espina
5+
*/
16
package io.jooby;
27

38
import javax.annotation.Nonnull;

jooby/src/main/java/io/jooby/WebSocketMessage.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Jooby https://jooby.io
3+
* Apache License Version 2.0 https://jooby.io/LICENSE.txt
4+
* Copyright 2014 Edgar Espina
5+
*/
16
package io.jooby;
27

38
import io.jooby.internal.WebSocketMessageImpl;

0 commit comments

Comments
 (0)