Skip to content

Commit 4c3f964

Browse files
ludochgae-java-bot
authored andcommitted
Internal change
PiperOrigin-RevId: 479623167 Change-Id: I85e05cc9385d111d66ed89f68cf5df4b0941bae3
1 parent 726c08b commit 4c3f964

2 files changed

Lines changed: 6 additions & 92 deletions

File tree

runtime/impl/src/test/java/com/google/apphosting/runtime/ClassPathUtilsTest.java

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ public final class ClassPathUtilsTest {
3434

3535
@Before
3636
public void setUp() throws Exception {
37-
System.clearProperty("use.java11");
3837
System.clearProperty("classpath.runtime-impl");
39-
System.clearProperty("use.mavenjars");
4038
System.clearProperty("classpath.appengine-api-legacy");
4139
System.clearProperty("classpath.connector-j");
4240
runtimeLocation = temporaryFolder.getRoot().getAbsolutePath();
@@ -49,34 +47,6 @@ private void createJava8Environment() throws Exception {
4947
temporaryFolder.newFile("java_runtime_launcher");
5048
}
5149

52-
@Test
53-
public void verifyDefaultPropertiesAreConfigured() throws Exception {
54-
createJava8Environment();
55-
ClassPathUtils cpu = new ClassPathUtils();
56-
assertThat(cpu.getConnectorJUrls()).hasLength(1);
57-
assertThat(System.getProperty("classpath.runtime-impl"))
58-
.isEqualTo(
59-
runtimeLocation
60-
+ "/runtime-impl.jar"
61-
+ PATH_SEPARATOR
62-
+ runtimeLocation
63-
+ "/frozen_debugger.jar"
64-
+ PATH_SEPARATOR
65-
+ runtimeLocation
66-
+ "/runtime-impl-third-party.jar"
67-
+ PATH_SEPARATOR
68-
+ runtimeLocation
69-
+ "/runtime-appengine-api.jar");
70-
71-
assertThat(System.getProperty("classpath.runtime-shared"))
72-
.isEqualTo(runtimeLocation + "/runtime-shared.jar");
73-
assertThat(System.getProperty("classpath.connector-j"))
74-
.isEqualTo(runtimeLocation + "/jdbc-mysql-connector.jar");
75-
76-
assertThat(cpu.getFrozenApiJar().getAbsolutePath())
77-
.isEqualTo(runtimeLocation + "/appengine-api.jar");
78-
}
79-
8050
@Test
8151
public void verifyJava11PropertiesAreConfigured() throws Exception {
8252
// we do not call createJava8Environment() so expect java11+
@@ -93,39 +63,9 @@ public void verifyJava11PropertiesAreConfigured() throws Exception {
9363
.isEqualTo(runtimeLocation + "/appengine-api-1.0-sdk.jar");
9464
}
9565

96-
@Test
97-
public void verifyJetty94PropertiesAreConfigured() throws Exception {
98-
99-
createJava8Environment();
100-
ClassPathUtils cpu = new ClassPathUtils();
101-
assertThat(cpu.getConnectorJUrls()).hasLength(1);
102-
assertThat(System.getProperty("classpath.runtime-impl"))
103-
.isEqualTo(
104-
runtimeLocation
105-
+ "/runtime-impl.jar"
106-
+ PATH_SEPARATOR
107-
+ runtimeLocation
108-
+ "/frozen_debugger.jar"
109-
+ PATH_SEPARATOR
110-
+ runtimeLocation
111-
+ "/runtime-impl-third-party.jar"
112-
+ PATH_SEPARATOR
113-
+ runtimeLocation
114-
+ "/runtime-appengine-api.jar");
115-
116-
assertThat(System.getProperty("classpath.runtime-shared"))
117-
.isEqualTo(runtimeLocation + "/runtime-shared.jar");
118-
assertThat(System.getProperty("classpath.connector-j"))
119-
.isEqualTo(runtimeLocation + "/jdbc-mysql-connector.jar");
120-
121-
assertThat(cpu.getFrozenApiJar().getAbsolutePath())
122-
.isEqualTo(runtimeLocation + "/appengine-api.jar");
123-
}
124-
12566
@Test
12667
public void verifyMavenJarsPropertiesAreConfigured() throws Exception {
12768
createJava8Environment();
128-
System.setProperty("use.mavenjars", "true");
12969

13070
ClassPathUtils cpu = new ClassPathUtils(new File("/my_app_root"));
13171
assertThat(cpu.getConnectorJUrls()).hasLength(1);

runtime/util/src/main/java/com/google/apphosting/runtime/ClassPathUtils.java

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public class ClassPathUtils {
3838
private static final Logger logger = Logger.getLogger(ClassPathUtils.class.getName());
3939

4040
private static final String RUNTIME_BASE_PROPERTY = "classpath.runtimebase";
41-
private static final String USE_MAVENJARS = "use.mavenjars";
4241
private static final String RUNTIME_IMPL_PROPERTY = "classpath.runtime-impl";
4342
private static final String RUNTIME_SHARED_PROPERTY = "classpath.runtime-shared";
4443
private static final String PREBUNDLED_PROPERTY = "classpath.prebundled";
@@ -69,30 +68,14 @@ public ClassPathUtils(File root) {
6968
return;
7069
}
7170

72-
boolean useMavenJars = Boolean.getBoolean(USE_MAVENJARS);
73-
String runtimeImplJar = null;
74-
String cloudDebuggerJar = null;
71+
String cloudDebuggerJar = "frozen_debugger.jar";
7572
String profilerJar = null;
7673
if (System.getenv("GAE_PROFILER_MODE") != null) {
7774
profilerJar = "profiler.jar"; // Close source, not in Maven.;
7875
logger.log(Level.INFO, "AppEngine profiler enabled.");
7976
}
80-
// This is only for Java11 or later runtime:
81-
if (Boolean.getBoolean("use.java11")) {
82-
runtimeImplJar = "runtime-impl.jar";
83-
// Java11: No need for Cloud Debugger special treatement, we rely on pure open source agent.
84-
} else {
85-
runtimeImplJar = "runtime-impl.jar";
86-
cloudDebuggerJar = "frozen_debugger.jar";
87-
}
8877
List<String> runtimeClasspathEntries =
89-
useMavenJars
90-
? Arrays.asList("jars/runtime-impl.jar", cloudDebuggerJar, profilerJar)
91-
: Arrays.asList(
92-
runtimeImplJar,
93-
cloudDebuggerJar,
94-
"runtime-impl-third-party.jar",
95-
"runtime-appengine-api.jar");
78+
Arrays.asList("jars/runtime-impl.jar", cloudDebuggerJar, profilerJar);
9679

9780
String runtimeClasspath =
9881
runtimeClasspathEntries.stream()
@@ -105,10 +88,6 @@ public ClassPathUtils(File root) {
10588
runtimeClasspath =
10689
System.getProperty(RUNTIME_IMPL_PROPERTY) + PATH_SEPARATOR + runtimeClasspath;
10790
}
108-
// Only for Java8g, TODO(b/122040046)
109-
if (new File(runtimeBase, "runtime-rpc-plugins.jar").exists()) {
110-
runtimeClasspath += ":" + runtimeBase + "/runtime-rpc-plugins.jar";
111-
}
11291
// Keep old properties for absolute compatibility if ever some public apps depend on them:
11392
System.setProperty(RUNTIME_IMPL_PROPERTY, runtimeClasspath);
11493
logger.log(Level.INFO, "Using runtime classpath: " + runtimeClasspath);
@@ -117,15 +96,10 @@ public ClassPathUtils(File root) {
11796
// that when deploying with api_version: 1.0 in generated app.yaml
11897
// we need to add our own legacy jar.
11998
frozenApiJarFile = new File(new File(root, runtimeBase), "/appengine-api.jar");
120-
if (useMavenJars) {
121-
System.setProperty(RUNTIME_SHARED_PROPERTY, runtimeBase + "/jars/runtime-shared.jar");
122-
System.setProperty(API_PROPERTY, "1.0=" + runtimeBase + "/jars/appengine-api-1.0-sdk.jar");
123-
System.setProperty(
124-
APPENGINE_API_LEGACY_PROPERTY, runtimeBase + "/jars/appengine-api-legacy.jar");
125-
} else {
126-
System.setProperty(RUNTIME_SHARED_PROPERTY, runtimeBase + "/runtime-shared.jar");
127-
System.setProperty(API_PROPERTY, "1.0=" + runtimeBase + "/appengine-api.jar");
128-
}
99+
System.setProperty(RUNTIME_SHARED_PROPERTY, runtimeBase + "/jars/runtime-shared.jar");
100+
System.setProperty(API_PROPERTY, "1.0=" + runtimeBase + "/jars/appengine-api-1.0-sdk.jar");
101+
System.setProperty(
102+
APPENGINE_API_LEGACY_PROPERTY, runtimeBase + "/jars/appengine-api-legacy.jar");
129103
System.setProperty(CONNECTOR_J_PROPERTY, runtimeBase + "/jdbc-mysql-connector.jar");
130104
System.setProperty(PREBUNDLED_PROPERTY, runtimeBase + "/conscrypt.jar");
131105
System.setProperty(LEGACY_PROPERTY, runtimeBase + "/legacy.jar");

0 commit comments

Comments
 (0)