Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into servletcontextlistene…
Browse files Browse the repository at this point in the history
…r-tests
  • Loading branch information
lachlan-roberts committed May 14, 2024
2 parents 9912567 + cb3c8b3 commit fbdf751
Show file tree
Hide file tree
Showing 127 changed files with 271 additions and 227 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Source code for all public APIs for com.google.appengine.api.* packages.
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>2.0.26</version><!-- or later-->
<version>2.0.27</version><!-- or later-->
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
Expand All @@ -89,7 +89,7 @@ Source code for all public APIs for com.google.appengine.api.* packages.
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>2.0.26</version><!-- or later-->
<version>2.0.27</version><!-- or later-->
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
Expand Down Expand Up @@ -188,7 +188,7 @@ Source code for remote APIs for App Engine.
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-remote-api</artifactId>
<version>2.0.26</version><!-- Or later-->
<version>2.0.27</version><!-- Or later-->
</dependency>
```

Expand All @@ -211,7 +211,7 @@ We moved `com.google.appengine.api.memcache.stdimpl` and its old dependency
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-legacy.jar/artifactId>
<version>2.0.26</version><!-- Or later-->
<version>2.0.27</version><!-- Or later-->
</dependency>
```

Expand All @@ -226,19 +226,19 @@ We moved `com.google.appengine.api.memcache.stdimpl` and its old dependency
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-testing</artifactId>
<version>2.0.26</version><!-- Or later-->
<version>2.0.27</version><!-- Or later-->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-stubs</artifactId>
<version>2.0.26</version><!-- Or later-->
<version>2.0.27</version><!-- Or later-->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-tools-sdk</artifactId>
<version>2.0.26</version><!-- Or later-->
<version>2.0.27</version><!-- Or later-->
<scope>test</scope>
</dependency>
```
Expand Down
4 changes: 2 additions & 2 deletions TRYLATESTBITSINPROD.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ top of your web application and change the entrypoint to boot with these jars in
mvn clean install
```

Let's assume the current built version is `2.0.27-SNAPSHOT`.
Let's assume the current built version is `2.0.28-SNAPSHOT`.
Add the dependency for the GAE runtime jars in your application pom.xml file:

```
<properties>
<appengine.runtime.version>2.0.27-SNAPSHOT</appengine.runtime.version>
<appengine.runtime.version>2.0.28-SNAPSHOT</appengine.runtime.version>
<appengine.runtime.location>target/${project.artifactId}-${project.version}</appengine.runtime.location>
<properties>
...
Expand Down
3 changes: 1 addition & 2 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.google.appengine</groupId>
<artifactId>parent</artifactId>
<version>2.0.27-SNAPSHOT</version>
<version>2.0.28-SNAPSHOT</version>
</parent>
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
Expand Down Expand Up @@ -148,7 +148,6 @@
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>6.0.0</version>
</dependency>
</dependencies>
<build>
Expand Down
3 changes: 1 addition & 2 deletions api_dev/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>com.google.appengine</groupId>
<artifactId>parent</artifactId>
<version>2.0.27-SNAPSHOT</version>
<version>2.0.28-SNAPSHOT</version>
</parent>

<packaging>jar</packaging>
Expand Down Expand Up @@ -196,7 +196,6 @@
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>6.0.0</version>
<type>jar</type>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.google.common.base.Preconditions;
import com.google.common.html.HtmlEscapers;
import com.google.common.net.HttpHeaders;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
Expand Down Expand Up @@ -728,7 +729,7 @@ public void sendError(int sc, String msg) throws IOException {
checkNotCommitted();
// This has to be re-implemented to avoid committing the response.
setStatus(sc, msg);
setErrorBody(sc + " " + HtmlEscapers.htmlEscaper().escape(msg));
setErrorBody(sc + " " + (msg == null ? "" : HtmlEscapers.htmlEscaper().escape(msg)));
}

/** Sets the response body to an HTML page with an error message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import jakarta.servlet.http.HttpServletRequestWrapper;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponseWrapper;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
Expand Down Expand Up @@ -728,8 +729,8 @@ public void sendError(int sc) throws IOException {
public void sendError(int sc, String msg) throws IOException {
checkNotCommitted();
// This has to be re-implemented to avoid committing the response.
super.sendError(sc, msg);
setErrorBody(sc + " " + HtmlEscapers.htmlEscaper().escape(msg));
setStatus(sc);
setErrorBody(sc + " " + (msg == null ? "" : HtmlEscapers.htmlEscaper().escape(msg)));
}

/** Sets the response body to an HTML page with an error message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.google.appengine.tools.info;

import com.google.common.base.Joiner;

import java.io.File;
import java.io.FileFilter;
import java.net.URL;
Expand Down Expand Up @@ -191,6 +192,24 @@ public List<URL> getSharedJspLibs() {
return Collections.unmodifiableList(toURLs(getSharedJspLibFiles()));
}

private File getJetty12Jar(String fileNamePattern) {
File path = new File(sdkRoot, JETTY12_HOME_LIB_PATH + File.separator);

if (!path.exists()) {
throw new IllegalArgumentException("Unable to find " + path.getAbsolutePath());
}
for (File f : listFiles(path)) {
if (f.getName().endsWith(".jar")) {
// All but CDI jar. All the tests are still passing without CDI that should not be exposed
// in our runtime (private Jetty dependency we do not want to expose to the customer).
if (f.getName().contains(fileNamePattern)) {
return f;
}
}
}
throw new IllegalArgumentException("Unable to find " + fileNamePattern + " at " + path.getAbsolutePath());
}

private List<File> getJetty12Jars(String subDir) {
File path = new File(sdkRoot, JETTY12_HOME_LIB_PATH + File.separator + subDir);

Expand Down Expand Up @@ -219,10 +238,12 @@ List<File> getJetty12JspJars() {
if (Boolean.getBoolean("appengine.use.EE10")) {
List<File> lf = getJetty12Jars("ee10-apache-jsp");
lf.addAll(getJetty12Jars("ee10-glassfish-jstl"));
lf.add(getJetty12Jar("ee10-servlet-"));
return lf;
}
List<File> lf = getJetty12Jars("ee8-apache-jsp");
lf.addAll(getJetty12Jars("ee8-glassfish-jstl"));
lf.add(getJetty12Jar("ee8-servlet-"));
return lf;
}

Expand Down
2 changes: 1 addition & 1 deletion api_legacy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>com.google.appengine</groupId>
<artifactId>parent</artifactId>
<version>2.0.27-SNAPSHOT</version>
<version>2.0.28-SNAPSHOT</version>
</parent>

<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion appengine-api-1.0-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.google.appengine</groupId>
<artifactId>parent</artifactId>
<version>2.0.27-SNAPSHOT</version>
<version>2.0.28-SNAPSHOT</version>
</parent>
<packaging>jar</packaging>
<name>AppEngine :: appengine-api-1.0-sdk</name>
Expand Down
2 changes: 1 addition & 1 deletion appengine-api-stubs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>com.google.appengine</groupId>
<artifactId>parent</artifactId>
<version>2.0.27-SNAPSHOT</version>
<version>2.0.28-SNAPSHOT</version>
</parent>

<packaging>jar</packaging>
Expand Down
1 change: 1 addition & 0 deletions appengine_init/appengine-web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<property name="foo" value="bar"/>
<property name="appengine.use.EE10" value="true"/>
<property name="appengine.use.httpconnector" value="true"/>
<property name="appengine.use.allheaders" value="true"/>
</system-properties>
</appengine-web-app>

Expand Down
2 changes: 1 addition & 1 deletion appengine_init/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>com.google.appengine</groupId>
<artifactId>parent</artifactId>
<version>2.0.27-SNAPSHOT</version>
<version>2.0.28-SNAPSHOT</version>
</parent>

<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ private void setAppEngineUseProperties(final XMLEventReader reader) throws XMLSt
System.setProperty(prop, value);
} else if (prop.equalsIgnoreCase("appengine.use.HttpConnector")) {
System.setProperty("appengine.use.HttpConnector", value);
}
} else if (prop.equalsIgnoreCase("appengine.use.allheaders")) {
System.setProperty("appengine.use.allheaders", value);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ public void testParse() {
new AppEngineWebXmlInitialParse(file).handleRuntimeProperties();
assertTrue(Boolean.getBoolean("appengine.use.EE10"));
assertTrue(Boolean.getBoolean("appengine.use.HttpConnector"));
assertTrue(Boolean.getBoolean("appengine.use.allheaders"));
}
}
2 changes: 1 addition & 1 deletion appengine_jsr107/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>com.google.appengine</groupId>
<artifactId>parent</artifactId>
<version>2.0.27-SNAPSHOT</version>
<version>2.0.28-SNAPSHOT</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion appengine_resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.google.appengine</groupId>
<artifactId>parent</artifactId>
<version>2.0.27-SNAPSHOT</version>
<version>2.0.28-SNAPSHOT</version>
</parent>
<packaging>jar</packaging>
<name>AppEngine :: appengine-resources</name>
Expand Down
2 changes: 1 addition & 1 deletion appengine_setup/apiserver_local/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.google.appengine</groupId>
<artifactId>appengine_setup</artifactId>
<version>2.0.27-SNAPSHOT</version>
<version>2.0.28-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion appengine_setup/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>com.google.appengine</groupId>
<artifactId>parent</artifactId>
<version>2.0.27-SNAPSHOT</version>
<version>2.0.28-SNAPSHOT</version>
</parent>
<modules>
<module>apiserver_local</module>
Expand Down
2 changes: 1 addition & 1 deletion appengine_setup/test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.google.appengine</groupId>
<artifactId>appengine_setup</artifactId>
<version>2.0.27-SNAPSHOT</version>
<version>2.0.28-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.appengine</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected String appName() {

@Override
protected String relativePathForUserApplicationJar() {
return "../testapps/jetty12_testapp/target/"
+ "jetty12_testapp-2.0.27-SNAPSHOT-jar-with-dependencies.jar";
return "../testapps/jetty12_testapp/target/"
+ "jetty12_testapp-2.0.28-SNAPSHOT-jar-with-dependencies.jar";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ protected String appName() {

@Override
protected String relativePathForUserApplicationJar() {
return "../testapps/springboot_testapp/target/"
+ "springboot_testapp-2.0.27-SNAPSHOT.jar";
return "../testapps/springboot_testapp/target/" + "springboot_testapp-2.0.28-SNAPSHOT.jar";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public static HttpClient initializeHttpClient(int timeoutMillis) {

@SneakyThrows
public static Process initializeHttpApiServer() {
String apiServerRelativeJarPath = "../apiserver_local/target/"
+ "apiserver_local-2.0.27-SNAPSHOT-jar-with-dependencies.jar";
String apiServerRelativeJarPath =
"../apiserver_local/target/" + "apiserver_local-2.0.28-SNAPSHOT-jar-with-dependencies.jar";
File currentDirectory = new File("").getAbsoluteFile();
File apiServerJar = new File(currentDirectory, apiServerRelativeJarPath);
ImmutableList<String> processArgs = ImmutableList.<String>builder()
Expand Down
15 changes: 8 additions & 7 deletions appengine_setup/testapps/jetty12_testapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,20 @@
<parent>
<artifactId>testapps</artifactId>
<groupId>com.google.appengine</groupId>
<version>2.0.27-SNAPSHOT</version>
<version>2.0.28-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.appengine.setup.testapps</groupId>
<artifactId>jetty12_testapp</artifactId>
<properties>
<jetty.version>12.0.8</jetty.version>
<jetty.version>12.0.9</jetty.version>
<aspectj.version>1.9.22.1</aspectj.version>
</properties>
<dependencies>
<dependency>
<groupId>com.google.appengine.setup.testapps</groupId>
<artifactId>testapps_common</artifactId>
<version>2.0.27-SNAPSHOT</version>
<version>2.0.28-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
Expand Down Expand Up @@ -65,7 +66,7 @@
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.9.22</version>
<version>${aspectj.version}</version>
<scope>runtime</scope>
</dependency>

Expand Down Expand Up @@ -105,7 +106,7 @@
<projectId>srirammahavadi-dev</projectId>
<version>GCLOUD_CONFIG</version>
<automaticRestart>true</automaticRestart>
<artifact>${project.build.directory}/jetty11_testapp-2.0.27-SNAPSHOT-jar-with-dependencies.jar</artifact>
<artifact>${project.build.directory}/jetty11_testapp-2.0.28-SNAPSHOT-jar-with-dependencies.jar</artifact>
</configuration>
</plugin>

Expand All @@ -124,12 +125,12 @@
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>1.9.22</version>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.9.22</version>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
Expand Down
2 changes: 1 addition & 1 deletion appengine_setup/testapps/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.google.appengine</groupId>
<artifactId>appengine_setup</artifactId>
<version>2.0.27-SNAPSHOT</version>
<version>2.0.28-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.appengine</groupId>
Expand Down

0 comments on commit fbdf751

Please sign in to comment.