You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/06/25 08:14:54 UTC

[GitHub] [hadoop] bensonlin321 commented on a diff in pull request #3959: YARN-11072. Can not display hadoop-st.png when using reverse proxy and applying APPLICATION_WEB_PROXY_BASE

bensonlin321 commented on code in PR #3959:
URL: https://github.com/apache/hadoop/pull/3959#discussion_r906652716


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/webapp/view/TestHeaderBlock.java:
##########
@@ -0,0 +1,88 @@
+/**
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.apache.hadoop.yarn.webapp.view;
+
+import com.google.inject.Injector;
+
+import java.io.PrintWriter;
+import java.lang.reflect.Field;
+import java.util.Collections;
+import java.util.Map;
+
+import org.apache.hadoop.yarn.webapp.test.WebAppTests;
+
+import org.junit.Test;
+import static org.mockito.Mockito.*;
+
+public class TestHeaderBlock {
+  @SuppressWarnings("unchecked")
+  public void setEnv(Map<String, String> newenv) throws Exception {
+    try {
+      Class<?> processEnvironmentClass = Class.forName("java.lang.ProcessEnvironment");
+      String fieldname = "theEnvironment";
+      Field theEnvironmentField = processEnvironmentClass.getDeclaredField(fieldname);
+      // reset environment accessibility

Review Comment:
   No problem. Thank you for letting me know!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org