Skip to content

Commit 0697307

Browse files
committed
Bump the Jetty version from 7 to 9
Also, handle repacking the jar ourselves. In order for eclipse users to be able to build within the IDE, they need to repack the jetty jar using `go repack-jetty`. IJ users need to do this too.
1 parent 219e898 commit 0697307

File tree

77 files changed

+724
-291
lines changed

Some content is hidden

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

77 files changed

+724
-291
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ py/selenium/webdriver/firefox/webdriver_prefs.json
4848
py/selenium/webdriver/firefox/x86/
4949
py/docs/build/
5050
selenium.egg-info/
51+
third_party/java/jetty/jetty-repacked.jar
5152
*.user
5253
*.cache
5354
obj/

.idea/libraries/jetty.xml

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libraries/servlet_api.xml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libraries/xml_apis.xml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Rakefile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,49 @@ task :test_webdriverjs => [
472472
desc "Generate a single file with WebDriverJS' public API"
473473
task :webdriverjs => [ "//javascript/webdriver:webdriver" ]
474474

475+
desc "Repack jetty"
476+
task "repack-jetty" => "build/third_party/java/jetty/jetty-repacked.jar"
477+
478+
# Expose the repack task to CrazyFun.
479+
task "//third_party/java/jetty:repacked" => "build/third_party/java/jetty/jetty-repacked.jar"
480+
481+
file "build/third_party/java/jetty/jetty-repacked.jar" => [
482+
"third_party/java/jetty/jetty-continuation-9.2.13.v20150730.jar",
483+
"third_party/java/jetty/jetty-http-9.2.13.v20150730.jar",
484+
"third_party/java/jetty/jetty-io-9.2.13.v20150730.jar",
485+
"third_party/java/jetty/jetty-jmx-9.2.13.v20150730.jar",
486+
"third_party/java/jetty/jetty-security-9.2.13.v20150730.jar",
487+
"third_party/java/jetty/jetty-server-9.2.13.v20150730.jar",
488+
"third_party/java/jetty/jetty-servlet-9.2.13.v20150730.jar",
489+
"third_party/java/jetty/jetty-servlets-9.2.13.v20150730.jar",
490+
"third_party/java/jetty/jetty-util-9.2.13.v20150730.jar"
491+
] do |t|
492+
print "Repacking jetty\n"
493+
root = File.join("build", "third_party", "java", "jetty")
494+
jarjar = File.join("third_party", "java", "jarjar", "jarjar-1.4.jar")
495+
rules = File.join("third_party", "java", "jetty", "jetty-repack-rules")
496+
temp = File.join(root, "temp")
497+
498+
# First, process the files
499+
mkdir_p root
500+
mkdir_p temp
501+
502+
t.prerequisites.each do |pre|
503+
filename = File.basename(pre, ".jar")
504+
out = File.join(root, "#{filename}-repacked.jar")
505+
`java -jar #{jarjar} process #{rules} #{pre} #{out}`
506+
`cd #{temp} && jar xf #{File.join("..", File.basename(out))}`
507+
end
508+
509+
# Now, merge them
510+
`cd #{temp} && jar cvf #{File.join("..", "jetty-repacked.jar")} *`
511+
512+
# And copy the artifact to third_party so that eclipse users can be made happy
513+
cp "build/third_party/java/jetty/jetty-repacked.jar", "third_party/java/jetty/jetty-repacked.jar"
514+
end
515+
516+
task
517+
475518
task :release => [
476519
:clean,
477520
:build,

java/client/.classpath

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
<classpathentry kind="lib" path="/third-party/java/jna/jna-4.1.0.jar" sourcepath="/third-party/java/jna/jna-4.1.0-src.jar"/>
1414
<classpathentry kind="lib" path="/third-party/java/jna/jna-platform-4.1.0.jar" sourcepath="/third-party/java/jna/jna-platform-4.1.0-src.jar"/>
1515
<classpathentry kind="lib" path="/third-party/java/commons-exec/commons-exec-1.3.jar" sourcepath="/third-party/java/commons-exec/commons-exec-1.3-sources.jar"/>
16-
<classpathentry kind="lib" path="/third-party/java/jetty/jetty-repacked-7.6.1.jar" sourcepath="/third-party/java/jetty/jetty-repacked-7.6.1-sources.jar"/>
16+
<classpathentry kind="lib" path="/third-party/java/jetty/jetty-repacked.jar"/>
1717
<classpathentry kind="lib" path="/third-party/java/cglib/cglib-nodep-2.1_3.jar"/>
18-
<classpathentry kind="lib" path="/third-party/java/servlet/servlet-api-2.5-6.1.9.jar" sourcepath="/third-party/java/servlet/servlet-api-2.5-6.1.9-sources.jar"/>
18+
<classpathentry kind="lib" path="/third-party/java/servlet/javax.servlet-api-3.1.0.jar" sourcepath="/third-party/java/servlet/javax.servlet-api-3.1.0-sources.jar"/>
1919
<classpathentry kind="lib" path="/third-party/java/phantomjs-driver/phantomjsdriver-1.2.1.jar" sourcepath="/third-party/java/phantomjs-driver/phantomjsdriver-1.2.1-sources.jar"/>
2020
<classpathentry kind="lib" path="/third-party/java/httpcomponents/httpclient-4.5.jar" sourcepath="/third-party/java/httpcomponents/httpclient-4.5-sources.jar"/>
2121
<classpathentry kind="lib" path="/third-party/java/httpcomponents/httpcore-4.4.1.jar" sourcepath="/third-party/java/httpcomponents/httpcore-4.4.1-sources.jar"/>
@@ -40,10 +40,10 @@
4040
<classpathentry kind="lib" path="/third-party/java/slf4j/slf4j-api-1.6.6.jar"/>
4141
<classpathentry kind="lib" path="/third-party/java/slf4j/slf4j-jdk14-1.6.6.jar"/>
4242
<classpathentry kind="lib" path="/third-party/java/gson/gson-2.3.1.jar"/>
43-
<classpathentry kind="lib" path="/third-party/java/jetty-websocket/websocket-api-9.2.12.v20150709.jar"/>
44-
<classpathentry kind="lib" path="/third-party/java/jetty-websocket/websocket-client-9.2.12.v20150709.jar"/>
45-
<classpathentry kind="lib" path="/third-party/java/jetty-websocket/websocket-common-9.2.12.v20150709.jar"/>
46-
<classpathentry kind="lib" path="/third-party/java/jetty-websocket/jetty-io-9.2.12.v20150709.jar"/>
47-
<classpathentry kind="lib" path="/third-party/java/jetty-websocket/jetty-util-9.2.12.v20150709.jar"/>
43+
<classpathentry kind="lib" path="/third-party/java/websocket/websocket-api-9.2.13.v20150730.jar"/>
44+
<classpathentry kind="lib" path="/third-party/java/websocket/websocket-client-9.2.13.v20150730.jar"/>
45+
<classpathentry kind="lib" path="/third-party/java/websocket/websocket-common-9.2.13.v20150730.jar"/>
46+
<classpathentry kind="lib" path="/third-party/java/jetty/jetty-io-9.2.13.v20150730.jar"/>
47+
<classpathentry kind="lib" path="/third-party/java/jetty/jetty-util-9.2.13.v20150730.jar"/>
4848
<classpathentry kind="output" path="build/production"/>
4949
</classpath>

java/client/client.iml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<orderEntry type="library" name="sac" level="project" />
4242
<orderEntry type="library" scope="TEST" name="dnsjava" level="project" />
4343
<orderEntry type="library" scope="TEST" name="dnssec4j" level="project" />
44-
<orderEntry type="library" scope="TEST" name="jetty" level="project" />
44+
<orderEntry type="library" name="jetty" level="project" />
4545
<orderEntry type="library" scope="TEST" name="little_proxy" level="project" />
4646
<orderEntry type="library" scope="TEST" name="slf4j" level="project" />
4747
<orderEntry type="library" name="mockito-core-1.9.5-srcs" level="project" />

java/client/test/com/thoughtworks/selenium/testing/CachedContentServlet.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
package com.thoughtworks.selenium.testing;
1919

20-
import org.seleniumhq.jetty7.http.HttpFields;
21-
2220
import java.io.IOException;
2321
import java.util.Calendar;
2422

@@ -48,8 +46,8 @@ private void setAlwaysCacheHeaders(HttpServletResponse resp) {
4846
resp.setHeader("Cache-Control", "max-age=29723626");
4947
Calendar calendar = Calendar.getInstance();
5048
calendar.add(Calendar.YEAR, 1);
51-
resp.setHeader("Expires", HttpFields.formatDate(calendar.getTimeInMillis()));
52-
resp.setHeader("Last-Modified", HttpFields.__01Jan1970);
49+
resp.setDateHeader("Expires", calendar.getTimeInMillis());
50+
resp.setDateHeader("Last-Modified", 0);
5351
resp.setHeader("Pragma", "");
5452
resp.setHeader("ETag", "foo");
5553
}

java/client/test/com/thoughtworks/selenium/testing/SeleniumAppServer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717

1818
package com.thoughtworks.selenium.testing;
1919

20-
import java.io.File;
21-
2220
import org.openqa.selenium.environment.webserver.JettyAppServer;
2321
import org.openqa.selenium.testing.InProject;
24-
import org.seleniumhq.jetty7.servlet.ServletContextHandler;
22+
import org.seleniumhq.jetty9.servlet.ServletContextHandler;
23+
24+
import java.io.File;
2525

2626
public class SeleniumAppServer extends JettyAppServer {
2727

java/client/test/org/openqa/selenium/BUCK

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ java_test(name = 'small-tests',
1111
],
1212
)
1313

14-
java_test(name = 'large-tests',
14+
java_library(name = 'large-tests',
1515
srcs = [
1616
'StandardSeleniumTests.java',
1717
],

0 commit comments

Comments
 (0)