Skip to content

Commit 4789c07

Browse files
authored
Merge pull request #4 from codeurjc-students/call_rebase
OpenViduCall rebase
2 parents d167797 + 2f42b92 commit 4789c07

File tree

225 files changed

+29715
-26169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

225 files changed

+29715
-26169
lines changed

.gitignore

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,61 @@
1+
# backend
12
backend/src/main/resources/static/*
23
backend/bin/src/main/resources/keystore.jks
34
backend/bin/src/main/resources/static/*
5+
backend/bin/
46
backend/src/main/resources/static/*
57
*.class
8+
9+
#docker
610
docker/composed/.env
11+
docker/videos/
712

8-
backend/bin/
913

10-
docker/videos/
14+
# compiled output
15+
**/dist
16+
**/tmp
17+
*/out-tsc
18+
**/openvidu-webcomponent
19+
**/public
20+
21+
# dependencies
22+
**/node_modules
23+
24+
**/projects/openvidu-angular/src/lib/environments
25+
**/projects/openvidu-angular/src/lib/shared
26+
**/projects/openvidu-angular/src/lib/video-room
27+
**/projects/openvidu-angular/src/lib/app-routing.module.ts
28+
29+
# IDEs and editors
30+
**/.idea
31+
**.project
32+
**.classpath
33+
**.c9/
34+
**.launch
35+
**.settings/
36+
**.sublime-workspace
37+
38+
# IDE - VSCode
39+
**.vscode
40+
**.vscode/*
41+
**!.vscode/settings.json
42+
**!.vscode/tasks.json
43+
**!.vscode/launch.json
44+
**!.vscode/extensions.json
45+
46+
# misc
47+
**/.sass-cache
48+
**/connect.lock
49+
**/coverage
50+
**/libpeerconnection.log
51+
**npm-debug.log
52+
**yarn-error.log
53+
**testem.log
54+
**/typings
55+
**/*.key
56+
**/*.crt
57+
58+
# System Files
59+
**.DS_Store
60+
**Thumbs.db
61+
frontend/debug.log

.travis.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
1-
language: java
2-
jdk: openjdk8
1+
matrix:
2+
include:
3+
- language: java
4+
jdk: openjdk8
35

4-
before_script:
5-
- cd ./backend/
6-
script:
7-
- mvn test -B
6+
before_script:
7+
- cd ./backend/
8+
script:
9+
- mvn test -B
10+
11+
- language: node_js
12+
node_js:
13+
- '12'
14+
15+
addons:
16+
chrome: stable
17+
18+
before_install:
19+
- cd ./frontend/
20+
21+
cache:
22+
directories:
23+
- ./node_modules
24+
25+
install:
26+
- npm install
27+
28+
script:
29+
- npm run test -- --watch=false --no-progress --browsers=ChromeHeadless

backend/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</parent>
1212
<groupId>urjc.openvidu</groupId>
1313
<artifactId>OpenViduTeaching</artifactId>
14-
<version>0.3.3</version>
14+
<version>1.0.0</version>
1515
<name>OpenViduTeaching</name>
1616
<description>Project for online teaching using OpenVidu</description>
1717

backend/src/main/java/urjc/ovteaching/openvidu/OpenViduController.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,8 @@ public ResponseEntity<String> createSession(@PathVariable String roomName) {
7474
*
7575
* @return The token
7676
*/
77-
@SuppressWarnings("unchecked")
7877
@GetMapping("/room/{roomName}/token")
79-
public ResponseEntity<JSONObject> generateToken(@PathVariable String roomName) {
78+
public ResponseEntity<String> generateToken(@PathVariable String roomName) {
8079
Room room = roomServ.findByName(roomName);
8180
User user = userServ.findByName(this.userComponent.getLoggedUser().getName());
8281
if (room == null) { // No room with that name
@@ -96,12 +95,10 @@ public ResponseEntity<JSONObject> generateToken(@PathVariable String roomName) {
9695
}
9796
}
9897

99-
JSONObject json = new JSONObject();
10098
try {
10199
String token = this.openViduComponent.generateToken(room, user);
102100
this.openViduComponent.addUserWithTokenToRoom(room, user, token);
103-
json.put("token", token);
104-
return new ResponseEntity<>(json, HttpStatus.OK);
101+
return new ResponseEntity<>("\"" + token + "\"", HttpStatus.OK);
105102
} catch (IOException e1) {
106103
// Internal error
107104
return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
@@ -111,8 +108,7 @@ public ResponseEntity<JSONObject> generateToken(@PathVariable String roomName) {
111108
// anymore. Must clean invalid session and create a new one
112109
try {
113110
String token = this.openViduComponent.replaceSession(room, user);
114-
json.put("token", token);
115-
return new ResponseEntity<>(json, HttpStatus.OK);
111+
return new ResponseEntity<>("\"" + token + "\"", HttpStatus.OK);
116112
} catch (IOException e3) {
117113
return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
118114
}

backend/src/test/java/urjc/ovteaching/OpenViduTests.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
package urjc.ovteaching;
22

3-
import static org.hamcrest.Matchers.is;
43
import static org.mockito.ArgumentMatchers.any;
54
import static org.mockito.BDDMockito.given;
65
import static org.mockito.Mockito.never;
76
import static org.mockito.Mockito.times;
87
import static org.mockito.Mockito.verify;
9-
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
8+
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
109
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
1110

1211
import java.io.IOException;
@@ -151,7 +150,7 @@ public void getToken() throws Exception {
151150
mvc.perform(MockMvcRequestBuilders.get("/ovTeachingApi/room/testRoom/token")
152151
.contentType(MediaType.APPLICATION_JSON))
153152
.andExpect(status().isOk())
154-
.andExpect(jsonPath("$.token", is(token)));
153+
.andExpect(content().string("\"" + token + "\""));
155154

156155
verify(openviduComponent, never()).createSession(any());
157156
verify(openviduComponent).generateToken(room, user);
@@ -193,7 +192,7 @@ public void getTokenAndCreateSession() throws Exception {
193192
mvc.perform(MockMvcRequestBuilders.get("/ovTeachingApi/room/testRoom/token")
194193
.contentType(MediaType.APPLICATION_JSON))
195194
.andExpect(status().isOk())
196-
.andExpect(jsonPath("$.token", is(token)));
195+
.andExpect(content().string("\"" + token + "\""));
197196

198197
verify(openviduComponent).createSession(room);
199198
verify(openviduComponent).generateToken(room, user);
@@ -257,7 +256,7 @@ public void getTokenUserLeftUnexpectedly() throws Exception {
257256
mvc.perform(MockMvcRequestBuilders.get("/ovTeachingApi/room/testRoom/token")
258257
.contentType(MediaType.APPLICATION_JSON))
259258
.andExpect(status().isOk())
260-
.andExpect(jsonPath("$.token", is(token)));
259+
.andExpect(content().string("\"" + token + "\""));
261260

262261
verify(openviduComponent).generateToken(room, user);
263262
verify(openviduComponent).replaceSession(room, user);

docker/build/OpenViduTeaching.jar

4.91 MB
Binary file not shown.

docker/dockerOVServer.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ docker run -p 4443:4443 --name openvidu-server-kms --rm \
66
-e OPENVIDU_RECORDING_PATH=/home/diegomzmn/Escritorio/OpenViduTeaching/2019-OpenViduTeaching/docker/videos \
77
-e OPENVIDU_RECORDING_NOTIFICATION=moderator \
88
-e OPENVIDU_SECRET=MY_SECRET \
9-
openvidu/openvidu-server-kms:2.13.0
9+
openvidu/openvidu-server-kms:2.14.0

documentation/api.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This document will explain how is used the Licensoft-Web API.
3030
* [Stop recording](#stop-recording)
3131
* [Get recording status](#get-recording-status)
3232
* [Get recording enabled](#get-recording-enabled)
33-
* [Get recordings' info](#get-recordings'-info)
33+
* [Get recordings info](#get-recordings-info)
3434
* [Get video](#get-video)
3535

3636

@@ -464,9 +464,7 @@ Gets the OpenVidu Token for the current user according to it's role (moderator=m
464464
Password: pass
465465
- **Response**:
466466
~~~~ json
467-
{
468-
"token": "wss://localhost:4443?sessionId=roomA&token=l5lcdqshsjb0tsym&role=MODERATOR&version=2.11.0"
469-
}
467+
"wss://localhost:4443?sessionId=roomA&token=l5lcdqshsjb0tsym&role=MODERATOR&version=2.11.0"
470468
~~~~
471469

472470
### Disconnect current user ###
@@ -603,7 +601,7 @@ Check whether recording was enabled in the server. It it disabled by default and
603601
true
604602
~~~~
605603

606-
### Get recordings' info ###
604+
### Get recordings info ###
607605
Get the info of the recordings of a room.
608606
- **URL**
609607
`/ovTeachingApi/room/{roomName}/recordings`

frontend/.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Editor configuration, see http://editorconfig.org
22
root = true
3-
3+
quote_type = single
44
[*]
55
charset = utf-8
6-
indent_style = space
6+
indent_style = tabs
77
indent_size = 2
88
insert_final_newline = true
99
trim_trailing_whitespace = true

frontend/.gitignore

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)