-
Notifications
You must be signed in to change notification settings - Fork 253
SUBMARINE-551. Add a test of user identity verification #337
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Eroschang Please add SUBMAINR-ID. xxx
to PR title head.
|
||
try { | ||
ctx = new InitialDirContext(HashEnv); | ||
System.out.println("Pass"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change System.out.println("Pass");
to LOG.info(...)
;
} | ||
catch (AuthenticationException e) { | ||
System.out.println("fail"); | ||
e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change
e.printStackTrace();
to
LOG.error(e.getMessage(), e);
} | ||
catch (javax.naming.CommunicationException e) { | ||
System.out.println("Connection fail"); | ||
e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change
e.printStackTrace();
to
LOG.error(e.getMessage(), e);
System.out.println("Unknown identity verification fail"); | ||
e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change
e.printStackTrace();
to
LOG.error(e.getMessage(), e);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Eroschang Please modify your code follow this guide: https://google.github.io/styleguide/javaguide.html#s4.1.2-blocks-k-r-style
@@ -133,6 +136,39 @@ public void testList() throws Exception { | |||
context.close(); | |||
} | |||
|
|||
@Test | |||
public void testauth() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public void testauth() throws Exception { | |
public void testAuth() throws Exception { |
LOG.info("Pass"); | ||
} | ||
catch (AuthenticationException e) { | ||
LOG.info("fail"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please delete LOG.info(fail)
Because there is already have LOG.error(e.getMessage(), e);
LOG.error(e.getMessage(), e); | ||
} | ||
catch (javax.naming.CommunicationException e) { | ||
LOG.info("Connection fail"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please delete LOG.info("Connection fail");
Because there is already have LOG.error(e.getMessage(), e);
LOG.error(e.getMessage(), e); | ||
} | ||
catch (Exception e) { | ||
LOG.info("Unknown identity verification fail"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please delete LOG.info("Unknown identity verification fail");
Because there is already have LOG.error(e.getMessage(), e);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT
Will merge if no more comments.
What is this PR for?
To test the LDAP for user verification.
The user in this open LDAP server can be verified successfully.
What type of PR is it?
Improvement
Todos
What is the Jira issue?
https://issues.apache.org/jira/browse/SUBMARINE-551
How should this be tested?
https://travis-ci.org/github/Eroschang/submarine/builds/703852786
Screenshots (if appropriate)
Questions: