Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-5173

Some tests could benefit from a common CallbackHandler

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 4.2.0.M1
    • Fix Version/s: 4.2.0.M1
    • Component/s: karaf
    • Labels:
      None

      Description

      I’ve noticed that a number of tests contain code like

              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());
                          }
                      }
                  }
              };
      

      It might make sense to introduce a concrete implementation of CallbackHandler to provide this.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jbonofre Jean-Baptiste Onofré
                Reporter:
                skitt Stephen Kitt
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: