Matthew Dempsky has submitted this change and it was merged.
Change subject: Remove dependency from GWT-JUnit on deRPC
......................................................................
Remove dependency from GWT-JUnit on deRPC
GWT-JUnit never actually used deRPC, which additionally is being phased out
and its use now discouraged.
Change-Id: I74c9d2e339187c2a47ccea4b0082c3a59ffe5ae4
---
M user/src/com/google/gwt/junit/server/JUnitHostImpl.java
1 file changed, 31 insertions(+), 2 deletions(-)
Approvals:
Matthew Dempsky: Looks good to me, approved
Leeroy Jenkins: Verified
diff --git a/user/src/com/google/gwt/junit/server/JUnitHostImpl.java
b/user/src/com/google/gwt/junit/server/JUnitHostImpl.java
index e7e0f9b..0577cbb 100644
--- a/user/src/com/google/gwt/junit/server/JUnitHostImpl.java
+++ b/user/src/com/google/gwt/junit/server/JUnitHostImpl.java
@@ -15,6 +15,8 @@
*/
package com.google.gwt.junit.server;
+import static
com.google.gwt.user.client.rpc.RpcRequestBuilder.MODULE_BASE_HEADER;
+
import com.google.gwt.core.server.impl.StackTraceDeobfuscator;
import com.google.gwt.junit.JUnitFatalLaunchException;
import com.google.gwt.junit.JUnitMessageQueue;
@@ -25,10 +27,12 @@
import com.google.gwt.junit.client.impl.JUnitResult;
import com.google.gwt.junit.linker.JUnitSymbolMapsLinker;
import com.google.gwt.user.client.rpc.InvocationException;
-import com.google.gwt.user.server.rpc.HybridServiceServlet;
import com.google.gwt.user.server.rpc.RPCServletUtils;
+import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
import java.util.HashMap;
import java.util.concurrent.atomic.AtomicInteger;
@@ -41,7 +45,7 @@
* communication between the unit test code running in a browser and the
real
* test process.
*/
-public class JUnitHostImpl extends HybridServiceServlet implements
JUnitHost {
+public class JUnitHostImpl extends RemoteServiceServlet implements
JUnitHost {
/**
* A hook into GWTUnitTestShell, the underlying unit test process.
@@ -154,6 +158,31 @@
return machine + " / " + agent;
}
+ /**
+ * Extract the module's base path from the current request.
+ *
+ * @return the module's base path, modulo protocol and host, as reported
by
+ * {@link com.google.gwt.core.client.GWT#getModuleBaseURL()} or
+ * <code>null</code> if the request did not contain the
+ * {@value
com.google.gwt.user.client.rpc.RpcRequestBuilder#MODULE_BASE_HEADER} header
+ */
+ private String getRequestModuleBasePath() {
+ try {
+ String header =
getThreadLocalRequest().getHeader(MODULE_BASE_HEADER);
+ if (header == null) {
+ return null;
+ }
+ String path = new URL(header).getPath();
+ String contextPath = getThreadLocalRequest().getContextPath();
+ if (!path.startsWith(contextPath)) {
+ return null;
+ }
+ return path.substring(contextPath.length());
+ } catch (MalformedURLException e) {
+ return null;
+ }
+ }
+
private void initResult(HttpServletRequest request, JUnitResult result) {
result.setAgent(request.getHeader("User-Agent"));
result.setHost(request.getRemoteHost());
--
To view, visit https://gwt-review.googlesource.com/1290
To unsubscribe, visit https://gwt-review.googlesource.com/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I74c9d2e339187c2a47ccea4b0082c3a59ffe5ae4
Gerrit-PatchSet: 2
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Thomas Broyer <[email protected]>
Gerrit-Reviewer: Leeroy Jenkins <[email protected]>
Gerrit-Reviewer: Matthew Dempsky <[email protected]>
Gerrit-Reviewer: Thomas Broyer <[email protected]>
--
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
---
You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.