-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement the ydoc js bundle test (#10160)
close #9929 Changelog: - update: customize Ydoc main hostname and port with environment variables - add: Ydoc initialization test
- Loading branch information
Showing
13 changed files
with
242 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
lib/java/ydoc-server/src/test/java/org/enso/ydoc/jsonrpc/JsonRpcRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.enso.ydoc.jsonrpc; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
|
||
public record JsonRpcRequest(String jsonrpc, String id, String method, JsonNode params) {} |
16 changes: 16 additions & 0 deletions
16
lib/java/ydoc-server/src/test/java/org/enso/ydoc/jsonrpc/JsonRpcResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.enso.ydoc.jsonrpc; | ||
|
||
import org.enso.ydoc.jsonrpc.model.result.Result; | ||
|
||
public record JsonRpcResponse(String jsonrpc, String id, Result result) { | ||
|
||
private static final String JSONRPC_VERSION_2_0 = "2.0"; | ||
|
||
public JsonRpcResponse(String id, Result result) { | ||
this(JSONRPC_VERSION_2_0, id, result); | ||
} | ||
|
||
public static JsonRpcResponse ok(String id) { | ||
return new JsonRpcResponse(id, null); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
lib/java/ydoc-server/src/test/java/org/enso/ydoc/jsonrpc/model/ContentRoot.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.enso.ydoc.jsonrpc.model; | ||
|
||
import java.util.UUID; | ||
|
||
public record ContentRoot(String type, UUID id, String path) { | ||
|
||
public ContentRoot(String type, UUID id) { | ||
this(type, id, null); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
lib/java/ydoc-server/src/test/java/org/enso/ydoc/jsonrpc/model/FilePath.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.enso.ydoc.jsonrpc.model; | ||
|
||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
public record FilePath(UUID rootId, List<String> segments) {} |
8 changes: 8 additions & 0 deletions
8
lib/java/ydoc-server/src/test/java/org/enso/ydoc/jsonrpc/model/FileSystemObject.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.enso.ydoc.jsonrpc.model; | ||
|
||
public record FileSystemObject(String type, String name, FilePath path) { | ||
|
||
public static FileSystemObject file(String name, FilePath path) { | ||
return new FileSystemObject("File", name, path); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
lib/java/ydoc-server/src/test/java/org/enso/ydoc/jsonrpc/model/WriteCapability.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.enso.ydoc.jsonrpc.model; | ||
|
||
public record WriteCapability(String method, Options registerOptions) { | ||
|
||
public record Options(FilePath path) {} | ||
} |
6 changes: 6 additions & 0 deletions
6
lib/java/ydoc-server/src/test/java/org/enso/ydoc/jsonrpc/model/result/FileListResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.enso.ydoc.jsonrpc.model.result; | ||
|
||
import java.util.List; | ||
import org.enso.ydoc.jsonrpc.model.FileSystemObject; | ||
|
||
public record FileListResult(List<FileSystemObject> paths) implements Result {} |
7 changes: 7 additions & 0 deletions
7
...server/src/test/java/org/enso/ydoc/jsonrpc/model/result/InitProtocolConnectionResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.enso.ydoc.jsonrpc.model.result; | ||
|
||
import java.util.List; | ||
import org.enso.ydoc.jsonrpc.model.ContentRoot; | ||
|
||
public record InitProtocolConnectionResult( | ||
String ensoVersion, String currentEdition, List<ContentRoot> contentRoots) implements Result {} |
3 changes: 3 additions & 0 deletions
3
lib/java/ydoc-server/src/test/java/org/enso/ydoc/jsonrpc/model/result/Result.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package org.enso.ydoc.jsonrpc.model.result; | ||
|
||
public interface Result {} |
6 changes: 6 additions & 0 deletions
6
...java/ydoc-server/src/test/java/org/enso/ydoc/jsonrpc/model/result/TextOpenFileResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.enso.ydoc.jsonrpc.model.result; | ||
|
||
import org.enso.ydoc.jsonrpc.model.WriteCapability; | ||
|
||
public record TextOpenFileResult( | ||
WriteCapability writeCapability, String content, String currentVersion) implements Result {} |