Skip to content

Commit

Permalink
revert change to JavaRuntimeViaHttpBase and use full path in ServletC…
Browse files Browse the repository at this point in the history
…ontextListenerTest

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
  • Loading branch information
lachlan-roberts committed May 14, 2024
1 parent 8ae03b2 commit 650c92a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,12 @@ void awaitOutputLineMatching(String pattern, long timeoutSeconds) throws Interru
static void copyAppToDir(String appName, Path dir) throws IOException {
Class<?> myClass = JavaRuntimeViaHttpBase.class;
ClassLoader myClassLoader = myClass.getClassLoader();
String appPrefix = Reflection.getPackageName(myClass).replace('.', '/') + "/" + appName + "/";
String appPrefix;
if (appName.contains("/")) {
appPrefix = appName + "/";
} else {
appPrefix = Reflection.getPackageName(myClass).replace('.', '/') + "/" + appName + "/";
}
String appEngineWebXmlResource = appPrefix + "WEB-INF/appengine-web.xml";
URL appEngineWebXmlUrl = myClassLoader.getResource(appEngineWebXmlResource);
assertWithMessage("Resource %s not found", appEngineWebXmlResource)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private RuntimeContext<?> runtimeContext() throws Exception {

@Before
public void before() throws Exception {
String app = "servletcontextlistenerapp/" + environment;
String app = "com/google/apphosting/runtime/jetty9/servletcontextlistenerapp/" + environment;
copyAppToDir(app, temp.getRoot().toPath());
httpClient.start();
runtime = runtimeContext();
Expand Down

0 comments on commit 650c92a

Please sign in to comment.