summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Campo2008-01-18 09:49:34 (EST)
committerChristian Campo2008-01-18 09:49:34 (EST)
commit09e33a6aefd911b809bebed8ec7db7d24de1b534 (patch)
treebe17399873f11bea0ca5c80bc9f5f98bdba46258
parent17a09a11977314c9e0f11d09f4f43722d92b8875 (diff)
downloadorg.eclipse.riena-09e33a6aefd911b809bebed8ec7db7d24de1b534.zip
org.eclipse.riena-09e33a6aefd911b809bebed8ec7db7d24de1b534.tar.gz
org.eclipse.riena-09e33a6aefd911b809bebed8ec7db7d24de1b534.tar.bz2
*** empty log message ***
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/MyCallbackHandler.java51
1 files changed, 26 insertions, 25 deletions
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/MyCallbackHandler.java b/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/MyCallbackHandler.java
index 3aee19a..464dd5f 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/MyCallbackHandler.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/MyCallbackHandler.java
@@ -28,33 +28,34 @@ public class MyCallbackHandler implements CallbackHandler {
public void handle(Callback[] callbacks) {
for (int i = 0; i < callbacks.length; i++) {
- if (callbacks[i] instanceof TextOutputCallback) {
- TextOutputCallback toc = (TextOutputCallback) callbacks[i];
- String typeAsString;
- // detect textoutput message type and translate it to string
- switch (toc.getMessageType()) {
- case TextOutputCallback.INFORMATION:
- typeAsString = "information";
- break;
- case TextOutputCallback.ERROR:
- typeAsString = "error";
- break;
- case TextOutputCallback.WARNING:
- typeAsString = "warning";
- break;
- default:
- typeAsString = "unknown";
- break;
- }
- System.out.println(typeAsString + " " + toc.getMessage());
+ if (callbacks[i] instanceof NameCallback) {
+ NameCallback nc = (NameCallback) callbacks[i];
+ nc.setName(name);
} else {
- if (callbacks[i] instanceof NameCallback) {
- NameCallback nc = (NameCallback) callbacks[i];
- nc.setName(name);
+ if (callbacks[i] instanceof PasswordCallback) {
+ PasswordCallback pc = (PasswordCallback) callbacks[i];
+ pc.setPassword(password.toCharArray());
} else {
- if (callbacks[i] instanceof PasswordCallback) {
- PasswordCallback pc = (PasswordCallback) callbacks[i];
- pc.setPassword(password.toCharArray());
+ if (callbacks[i] instanceof TextOutputCallback) {
+ TextOutputCallback toc = (TextOutputCallback) callbacks[i];
+ String typeAsString;
+ // detect text output message type and translate it
+ // to string
+ switch (toc.getMessageType()) {
+ case TextOutputCallback.INFORMATION:
+ typeAsString = "information";
+ break;
+ case TextOutputCallback.ERROR:
+ typeAsString = "error";
+ break;
+ case TextOutputCallback.WARNING:
+ typeAsString = "warning";
+ break;
+ default:
+ typeAsString = "unknown";
+ break;
+ }
+ System.out.println(typeAsString + " " + toc.getMessage());
}
}
}