karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KARAF-5173) Some tests could benefit from a common CallbackHandler
Date Fri, 02 Jun 2017 11:05:05 GMT

    [ https://issues.apache.org/jira/browse/KARAF-5173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16034503#comment-16034503
] 

ASF subversion and git services commented on KARAF-5173:
--------------------------------------------------------

Commit 02f382f45555a70bf6f159cb1ba18af62754c6cf in karaf's branch refs/heads/master from [~skitt]
[ https://git-wip-us.apache.org/repos/asf?p=karaf.git;h=02f382f ]

[KARAF-5173] Provide an impl of CallbackHandler

A number of tests use an anonymous class implementing CallbackHandler
with the same pattern, username and password. This patch introduces
NamePasswordCallbackHandler and uses it where appropriate.

Signed-off-by: Stephen Kitt <skitt@redhat.com>


> Some tests could benefit from a common CallbackHandler
> ------------------------------------------------------
>
>                 Key: KARAF-5173
>                 URL: https://issues.apache.org/jira/browse/KARAF-5173
>             Project: Karaf
>          Issue Type: Improvement
>          Components: karaf-core
>    Affects Versions: 4.2.0
>            Reporter: Stephen Kitt
>            Assignee: Jean-Baptiste Onofré
>            Priority: Trivial
>             Fix For: 4.2.0
>
>
> I’ve noticed that a number of tests contain code like
> {code}
>         CallbackHandler cb = new CallbackHandler() {
>             public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
{
>                 for (Callback cb : callbacks) {
>                     if (cb instanceof NameCallback) {
>                         ((NameCallback) cb).setName("hnelson");
>                     } else if (cb instanceof PasswordCallback) {
>                         ((PasswordCallback) cb).setPassword("secret".toCharArray());
>                     }
>                 }
>             }
>         };
> {code}
> It might make sense to introduce a concrete implementation of CallbackHandler to provide
this.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message