@Test public void testSecurityModeText() { conf.set(DFSConfigKeys.HADOOP_SECURITY_AUTHENTICATION, "kerberos"); UserGroupInformation.setConfiguration(conf); String securityOnOff = NamenodeJspHelper.getSecurityModeText(); Assert.assertTrue("security mode doesn't match. Should be ON", securityOnOff.contains("ON")); conf.set(DFSConfigKeys.HADOOP_SECURITY_AUTHENTICATION, "simple"); UserGroupInformation.setConfiguration(conf); securityOnOff = NamenodeJspHelper.getSecurityModeText(); Assert.assertTrue("security mode doesn't match. Should be OFF", securityOnOff.contains("OFF")); }
static String getSecurityModeText() { if(UserGroupInformation.isSecurityEnabled()) { return "<div class=\"security\">Security is <em>ON</em></div>"; } else { return "<div class=\"security\">Security is <em>OFF</em></div>"; } }
NamenodeJspHelper { static String getSecurityModeText() { if(UserGroupInformation.isSecurityEnabled()) { return "<div class=\"security\">Security is <em>ON</em></div>"; } else { return "<div class=\"security\">Security is <em>OFF</em></div>"; } } }
NamenodeJspHelper { static String getSecurityModeText() { if(UserGroupInformation.isSecurityEnabled()) { return "<div class=\"security\">Security is <em>ON</em></div>"; } else { return "<div class=\"security\">Security is <em>OFF</em></div>"; } }  }
NamenodeJspHelper { static String getSecurityModeText() { if(UserGroupInformation.isSecurityEnabled()) { return "<div class=\"security\">Security is <em>ON</em></div>"; } else { return "<div class=\"security\">Security is <em>OFF</em></div>"; } }   }
NamenodeJspHelper { static String getSecurityModeText() { if(UserGroupInformation.isSecurityEnabled()) { return "<div class=\"security\">Security is <em>ON</em></div>"; } else { return "<div class=\"security\">Security is <em>OFF</em></div>"; } }    }