diff options
author | 2021-10-24 01:19:02 +0200 | |
---|---|---|
committer | 2021-10-31 19:26:11 +0100 | |
commit | aa205509820b526bf21dfedebfd798ded0d763e7 (patch) | |
tree | 6ec0178cc7bb245e2790e9807ad3184fc0033805 /language-web/src/main/java/tools | |
parent | feat(web): push precomputed service results (diff) | |
download | refinery-aa205509820b526bf21dfedebfd798ded0d763e7.tar.gz refinery-aa205509820b526bf21dfedebfd798ded0d763e7.tar.zst refinery-aa205509820b526bf21dfedebfd798ded0d763e7.zip |
test(web): websockets fixes and tests
Diffstat (limited to 'language-web/src/main/java/tools')
-rw-r--r-- | language-web/src/main/java/tools/refinery/language/web/ServerLauncher.java | 2 | ||||
-rw-r--r-- | language-web/src/main/java/tools/refinery/language/web/xtext/server/push/PushWebDocumentAccess.java | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/language-web/src/main/java/tools/refinery/language/web/ServerLauncher.java b/language-web/src/main/java/tools/refinery/language/web/ServerLauncher.java index a71d8e93..cde7278f 100644 --- a/language-web/src/main/java/tools/refinery/language/web/ServerLauncher.java +++ b/language-web/src/main/java/tools/refinery/language/web/ServerLauncher.java | |||
@@ -18,6 +18,7 @@ import org.eclipse.jetty.servlet.DefaultServlet; | |||
18 | import org.eclipse.jetty.servlet.ServletContextHandler; | 18 | import org.eclipse.jetty.servlet.ServletContextHandler; |
19 | import org.eclipse.jetty.servlet.ServletHolder; | 19 | import org.eclipse.jetty.servlet.ServletHolder; |
20 | import org.eclipse.jetty.util.resource.Resource; | 20 | import org.eclipse.jetty.util.resource.Resource; |
21 | import org.eclipse.jetty.websocket.server.config.JettyWebSocketServletContainerInitializer; | ||
21 | import org.slf4j.Logger; | 22 | import org.slf4j.Logger; |
22 | import org.slf4j.LoggerFactory; | 23 | import org.slf4j.LoggerFactory; |
23 | 24 | ||
@@ -73,6 +74,7 @@ public class ServerLauncher { | |||
73 | allowedOriginsString); | 74 | allowedOriginsString); |
74 | } | 75 | } |
75 | handler.addServlet(problemServletHolder, "/xtext-service/*"); | 76 | handler.addServlet(problemServletHolder, "/xtext-service/*"); |
77 | JettyWebSocketServletContainerInitializer.configure(handler, null); | ||
76 | } | 78 | } |
77 | 79 | ||
78 | private void addDefaultServlet(ServletContextHandler handler) { | 80 | private void addDefaultServlet(ServletContextHandler handler) { |
diff --git a/language-web/src/main/java/tools/refinery/language/web/xtext/server/push/PushWebDocumentAccess.java b/language-web/src/main/java/tools/refinery/language/web/xtext/server/push/PushWebDocumentAccess.java index ff4bb035..b3666a86 100644 --- a/language-web/src/main/java/tools/refinery/language/web/xtext/server/push/PushWebDocumentAccess.java +++ b/language-web/src/main/java/tools/refinery/language/web/xtext/server/push/PushWebDocumentAccess.java | |||
@@ -58,10 +58,10 @@ public class PushWebDocumentAccess extends XtextWebDocumentAccess { | |||
58 | 58 | ||
59 | protected String getPrecomputedServiceName(AbstractCachedService<? extends IServiceResult> service) { | 59 | protected String getPrecomputedServiceName(AbstractCachedService<? extends IServiceResult> service) { |
60 | if (service instanceof ValidationService) { | 60 | if (service instanceof ValidationService) { |
61 | return "validation"; | 61 | return "validate"; |
62 | } | 62 | } |
63 | if (service instanceof HighlightingService) { | 63 | if (service instanceof HighlightingService) { |
64 | return "highlighting"; | 64 | return "highlight"; |
65 | } | 65 | } |
66 | throw new IllegalArgumentException("Unknown precomputed service: " + service); | 66 | throw new IllegalArgumentException("Unknown precomputed service: " + service); |
67 | } | 67 | } |