harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r463559 - in /incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common: javax/security/sasl/ org/apache/harmony/auth/tests/javax/security/sasl/
Date Fri, 13 Oct 2006 04:39:22 GMT
Author: smishura
Date: Thu Oct 12 21:39:19 2006
New Revision: 463559

URL: http://svn.apache.org/viewvc?view=rev&rev=463559
Log:
Fix tests and do rename javax.security.sasl -> o.a.h.auth.tests.javax.security.sasl

Added:
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/sasl/Sasl2Test.java
      - copied, changed from r463294, incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl2Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/sasl/Sasl3Test.java
      - copied, changed from r463294, incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl3Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/sasl/Sasl4Test.java
      - copied, changed from r463294, incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl4Test.java
Removed:
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl2Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl3Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl4Test.java

Copied: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/sasl/Sasl2Test.java
(from r463294, incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl2Test.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/sasl/Sasl2Test.java?view=diff&rev=463559&p1=incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl2Test.java&r1=463294&p2=incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/sasl/Sasl2Test.java&r2=463559
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl2Test.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/sasl/Sasl2Test.java
Thu Oct 12 21:39:19 2006
@@ -20,7 +20,7 @@
 * @version $Revision$
 */
 
-package javax.security.sasl;
+package org.apache.harmony.auth.tests.javax.security.sasl;
 
 import java.security.Provider;
 import java.security.Security;
@@ -50,11 +50,14 @@
 
     Provider[] mProv;
 
-    private static final String fClientClass01 = "javax.security.sasl.myClientFactory01";
+    private static final String fClientClass01 = myClientFactory01.class
+            .getName();
 
-    private static final String fServerClass01 = "javax.security.sasl.myServerFactory01";
+    private static final String fServerClass01 = myServerFactory01.class
+            .getName();
 
-    private static final String fServerClass02 = "javax.security.sasl.myServerFactory02";
+    private static final String fServerClass02 = myServerFactory02.class
+            .getName();
 
     /*
      * @see TestCase#tearDown()
@@ -515,68 +518,70 @@
                 mProv.length);
     }
 
-}
-
-class myServerFactory01 implements SaslServerFactory {
-    public myServerFactory01() {
-        super();
-    }
+    /*
+     * Support classes 
+     */
+    public static class myServerFactory01 implements SaslServerFactory {
+        public myServerFactory01() {
+            super();
+        }
 
-    public String[] getMechanismNames(Map map) {
-        return new String[] { "aaaa", "dddddddddddd",
-                "llllllllll sssssssss aaaaaaaaaaa c" };
-    }
+        public String[] getMechanismNames(Map map) {
+            return new String[] { "aaaa", "dddddddddddd",
+                    "llllllllll sssssssss aaaaaaaaaaa c" };
+        }
 
-    public SaslServer createSaslServer(String mech, String prot,
-            String srvName, Map prop, CallbackHandler ch) throws SaslException {
-        return null;
+        public SaslServer createSaslServer(String mech, String prot,
+                String srvName, Map prop, CallbackHandler ch) throws SaslException {
+            return null;
+        }
     }
-}
 
-class myServerFactory02 implements SaslServerFactory {
-    public myServerFactory02() {
-        super();
-    }
+    public static class myServerFactory02 implements SaslServerFactory {
+        public myServerFactory02() {
+            super();
+        }
 
-    public String[] getMechanismNames(Map map) {
-        return null;
-    }
+        public String[] getMechanismNames(Map map) {
+            return null;
+        }
 
-    public SaslServer createSaslServer(String mech, String prot,
-            String srvName, Map prop, CallbackHandler ch) throws SaslException {
-        if (prot == null) {
-            throw new SaslException("Protocol is null");
+        public SaslServer createSaslServer(String mech, String prot,
+                String srvName, Map prop, CallbackHandler ch) throws SaslException {
+            if (prot == null) {
+                throw new SaslException("Protocol is null");
+            }
+            return null;
         }
-        return null;
     }
-}
 
-class myClientFactory01 implements SaslClientFactory {
-    public myClientFactory01() {
-        super();
-    }
+    public static class myClientFactory01 implements SaslClientFactory {
+        public myClientFactory01() {
+            super();
+        }
 
-    public String[] getMechanismNames(Map map) {
-        return new String[] { "a1", "a2", "a3", "a4", "a5" };
-    }
+        public String[] getMechanismNames(Map map) {
+            return new String[] { "a1", "a2", "a3", "a4", "a5" };
+        }
 
-    public SaslClient createSaslClient(String[] mech, String prot, String auth,
-            String srvName, Map prop, CallbackHandler ch) throws SaslException {
-        return null;
+        public SaslClient createSaslClient(String[] mech, String prot, String auth,
+                String srvName, Map prop, CallbackHandler ch) throws SaslException {
+            return null;
+        }
     }
-}
 
-class myClientFactory02 implements SaslClientFactory {
-    public myClientFactory02() {
-        super();
-    }
+    public static class myClientFactory02 implements SaslClientFactory {
+        public myClientFactory02() {
+            super();
+        }
 
-    public String[] getMechanismNames(Map map) {
-        return new String[] { "a11", "a22", "a33", "a44", "a55", "" };
-    }
+        public String[] getMechanismNames(Map map) {
+            return new String[] { "a11", "a22", "a33", "a44", "a55", "" };
+        }
 
-    public SaslClient createSaslClient(String[] mech, String prot, String auth,
-            String srvName, Map prop, CallbackHandler ch) throws SaslException {
-        return null;
+        public SaslClient createSaslClient(String[] mech, String prot, String auth,
+                String srvName, Map prop, CallbackHandler ch) throws SaslException {
+            return null;
+        }
     }
 }

Copied: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/sasl/Sasl3Test.java
(from r463294, incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl3Test.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/sasl/Sasl3Test.java?view=diff&rev=463559&p1=incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl3Test.java&r1=463294&p2=incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/sasl/Sasl3Test.java&r2=463559
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl3Test.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/sasl/Sasl3Test.java
Thu Oct 12 21:39:19 2006
@@ -20,7 +20,7 @@
 * @version $Revision$
 */
 
-package javax.security.sasl;
+package org.apache.harmony.auth.tests.javax.security.sasl;
 
 import java.io.IOException;
 import java.security.Provider;
@@ -48,7 +48,7 @@
 public class Sasl3Test extends TestCase {
     private static final String CLNTSRV = "SaslClientFactory.";
 
-    private static final String fClientClass = "javax.security.sasl.mySaslClientFactory";
+    private static final String fClientClass = mySaslClientFactory.class.getName();;
 
     private Provider [] provs;
     private boolean initProvs = false;
@@ -298,139 +298,139 @@
                 null, "protocol", null, null, cbH);
         assertNotNull("Null result for NAME-6 and NAME-5", saslC);
     }
-}
-
-/*
- * Additional classes for creating SaslClient and SaslServer objects
- */
-
-class mySaslClientFactory implements SaslClientFactory {
-    public mySaslClientFactory() {
-        super();
-    }
-
-    public String[] getMechanismNames(Map prop) {
-        return new String[] { "NAME-1", "NAME-2", "NAME-3", "NAME-4" };
-    }
-
-    public SaslClient createSaslClient(String[] mech, String id,
-            String protocol, String srvName, Map prop, CallbackHandler hnd)
-            throws SaslException {
-        if (mech == null) {
-            throw new SaslException();
-        }
-        if ("NAME-1".equals(mech[0])) {
-            throw new SaslException("Incorrect mechanisms");
-        }
-        if (protocol == null) {
-            throw new SaslException("Protocol is null");
-        }
-        TextOutputCallback[] cb = { new TextOutputCallback(
-                TextOutputCallback.INFORMATION, "Information") };
-        try {
-            hnd.handle(cb);
-        } catch (UnsupportedCallbackException e) {
-            throw new SaslException("Incorrect callback handlere", e);
-        } catch (IOException e) {
-            throw new SaslException("Incorrect callback handlere", e);
-        }
-        return new mySaslClient();
-    }
+    
+    /*
+     * Additional classes for creating SaslClient and SaslServer objects
+     */
 
-    public class mySaslClient implements SaslClient {
-        public mySaslClient() {
+    public static class mySaslClientFactory implements SaslClientFactory {
+        public mySaslClientFactory() {
             super();
         }
 
-        public Object getNegotiatedProperty(String s) {
-            return "";
+        public String[] getMechanismNames(Map prop) {
+            return new String[] { "NAME-1", "NAME-2", "NAME-3", "NAME-4" };
         }
 
-        public String getMechanismName() {
-            return "Proba";
+        public SaslClient createSaslClient(String[] mech, String id,
+                String protocol, String srvName, Map prop, CallbackHandler hnd)
+                throws SaslException {
+            if (mech == null) {
+                throw new SaslException();
+            }
+            if ("NAME-1".equals(mech[0])) {
+                throw new SaslException("Incorrect mechanisms");
+            }
+            if (protocol == null) {
+                throw new SaslException("Protocol is null");
+            }
+            TextOutputCallback[] cb = { new TextOutputCallback(
+                    TextOutputCallback.INFORMATION, "Information") };
+            try {
+                hnd.handle(cb);
+            } catch (UnsupportedCallbackException e) {
+                throw new SaslException("Incorrect callback handlere", e);
+            } catch (IOException e) {
+                throw new SaslException("Incorrect callback handlere", e);
+            }
+            return new mySaslClient();
         }
 
-        public boolean isComplete() {
-            return false;
-        }
+        public class mySaslClient implements SaslClient {
+            public mySaslClient() {
+                super();
+            }
 
-        public boolean hasInitialResponse() {
-            return false;
-        }
+            public Object getNegotiatedProperty(String s) {
+                return "";
+            }
 
-        public void dispose() throws SaslException {
-        }
+            public String getMechanismName() {
+                return "Proba";
+            }
 
-        public byte[] evaluateChallenge(byte[] challenge) throws SaslException {
-            return new byte[0];
-        }
+            public boolean isComplete() {
+                return false;
+            }
 
-        public byte[] unwrap(byte[] incoming, int offset, int len)
-                throws SaslException {
-            throw new SaslException();
-        }
+            public boolean hasInitialResponse() {
+                return false;
+            }
 
-        public byte[] wrap(byte[] outgoing, int offset, int len)
-                throws SaslException {
-            return new byte[0];
+            public void dispose() throws SaslException {
+            }
+
+            public byte[] evaluateChallenge(byte[] challenge) throws SaslException {
+                return new byte[0];
+            }
+
+            public byte[] unwrap(byte[] incoming, int offset, int len)
+                    throws SaslException {
+                throw new SaslException();
+            }
+
+            public byte[] wrap(byte[] outgoing, int offset, int len)
+                    throws SaslException {
+                return new byte[0];
+            }
         }
     }
-}
 
-class mySaslClientFactoryExt extends mySaslClientFactory {
-    public String[] getMechanismNames(Map prop) {
-        return new String[] { "NAME-5", "NAME-6" };
-    }
+    public static class mySaslClientFactoryExt extends mySaslClientFactory {
+        public String[] getMechanismNames(Map prop) {
+            return new String[] { "NAME-5", "NAME-6" };
+        }
 
-    public SaslClient createSaslClient(String[] mech, String id,
-            String protocol, String srvName, Map prop, CallbackHandler hnd)
-            throws SaslException {
-        if (mech == null) {
-            throw new SaslException();
+        public SaslClient createSaslClient(String[] mech, String id,
+                String protocol, String srvName, Map prop, CallbackHandler hnd)
+                throws SaslException {
+            if (mech == null) {
+                throw new SaslException();
+            }
+            return new mySaslClient();
         }
-        return new mySaslClient();
     }
-}
 
-class cbHand implements CallbackHandler {
-    public cbHand() {
-    }
+    public static class cbHand implements CallbackHandler {
+        public cbHand() {
+        }
 
-    public void handle(Callback[] callbacks) throws IOException,
-            UnsupportedCallbackException {
-        for (int i = 0; i < callbacks.length; i++) {
-            if (callbacks[i] instanceof NameCallback) {
-                NameCallback nc = (NameCallback) callbacks[i];
-                nc.setName("Ok");
-            } else if (callbacks[i] instanceof PasswordCallback) {
-                PasswordCallback pc = (PasswordCallback) callbacks[i];
-                System.err.print(pc.getPrompt());
-                System.err.flush();
-                pc.setPassword(new char[] { 'O', 'k' });
-            } else {
-                throw new UnsupportedCallbackException(callbacks[i],
-                        "Callback should be NamCallback or PasswordCallback");
+        public void handle(Callback[] callbacks) throws IOException,
+                UnsupportedCallbackException {
+            for (int i = 0; i < callbacks.length; i++) {
+                if (callbacks[i] instanceof NameCallback) {
+                    NameCallback nc = (NameCallback) callbacks[i];
+                    nc.setName("Ok");
+                } else if (callbacks[i] instanceof PasswordCallback) {
+                    PasswordCallback pc = (PasswordCallback) callbacks[i];
+                    System.err.print(pc.getPrompt());
+                    System.err.flush();
+                    pc.setPassword(new char[] { 'O', 'k' });
+                } else {
+                    throw new UnsupportedCallbackException(callbacks[i],
+                            "Callback should be NamCallback or PasswordCallback");
+                }
             }
         }
     }
-}
 
-class cbHandN implements CallbackHandler {
-    public cbHandN() {
-    }
+    public static class cbHandN implements CallbackHandler {
+        public cbHandN() {
+        }
 
-    public void handle(Callback[] callbacks) throws IOException,
-            UnsupportedCallbackException {
-        for (int i = 0; i < callbacks.length; i++) {
-            if (callbacks[i] instanceof TextOutputCallback) {
-                TextOutputCallback toc = (TextOutputCallback) callbacks[i];
-                if (toc.getMessageType() != TextOutputCallback.INFORMATION) {
-                    throw new IOException("Unsupported message type: "
-                            + toc.getMessageType());
+        public void handle(Callback[] callbacks) throws IOException,
+                UnsupportedCallbackException {
+            for (int i = 0; i < callbacks.length; i++) {
+                if (callbacks[i] instanceof TextOutputCallback) {
+                    TextOutputCallback toc = (TextOutputCallback) callbacks[i];
+                    if (toc.getMessageType() != TextOutputCallback.INFORMATION) {
+                        throw new IOException("Unsupported message type: "
+                                + toc.getMessageType());
+                    }
+                } else {
+                    throw new UnsupportedCallbackException(callbacks[i],
+                            "Callback should be TextOutputCallback");
                 }
-            } else {
-                throw new UnsupportedCallbackException(callbacks[i],
-                        "Callback should be TextOutputCallback");
             }
         }
     }

Copied: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/sasl/Sasl4Test.java
(from r463294, incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl4Test.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/sasl/Sasl4Test.java?view=diff&rev=463559&p1=incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl4Test.java&r1=463294&p2=incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/sasl/Sasl4Test.java&r2=463559
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl4Test.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/sasl/Sasl4Test.java
Thu Oct 12 21:39:19 2006
@@ -20,7 +20,7 @@
 * @version $Revision$
 */
 
-package javax.security.sasl;
+package org.apache.harmony.auth.tests.javax.security.sasl;
 
 import java.io.IOException;
 import java.security.Provider;
@@ -45,7 +45,7 @@
 public class Sasl4Test extends TestCase {
     private static final String SRVSSRV = "SaslServerFactory.";
 
-    private static final String fServerClass = "javax.security.sasl.mySaslServerFactory";
+    private static final String fServerClass = mySaslServerFactory.class.getName();
 
     private Provider [] provs;
     private boolean initProvs = false;
@@ -123,7 +123,7 @@
                                 .concat("MECH-2"), fServerClass) };
         addProviders();
 
-        CallbackHandler cbH = new cbHand();
+        CallbackHandler cbH = new Sasl3Test.cbHand();
         try {
             Sasl.createSaslServer(null, null, null, null, cbH);
             fail("NullPointerException should be thrown when mechanisms is null");
@@ -134,7 +134,7 @@
             fail("SaslException should be thrown when CallbackHandler is wrong");
         } catch (SaslException e) {
         }
-        cbH = new cbHandN();
+        cbH = new Sasl3Test.cbHandN();
         try {
             Sasl.createSaslServer("MECH-1", "protocol", null, null, cbH);
             fail("SaslException should be thrown when mechamisms is wrong");
@@ -188,7 +188,7 @@
                                 .concat("MECH-2"), fServerClass) };
         addProviders();
 
-        CallbackHandler cbH = new cbHandN();
+        CallbackHandler cbH = new Sasl3Test.cbHandN();
         SaslServer saslS = Sasl.createSaslServer("MECH-2", "protocol", null,
                 null, cbH);
         assertNotNull("Null result", saslS);
@@ -226,7 +226,7 @@
                         .concat("MECH-1"), fServerClass) };
         mProv[0].put(SRVSSRV.concat("MECH-2"), fServerClass);
         addProviders();
-        CallbackHandler cbH = new cbHandN();
+        CallbackHandler cbH = new Sasl3Test.cbHandN();
         SaslServer saslS = Sasl.createSaslServer("MECH-2", "protocol", null,
                 null, cbH);
         assertNotNull("Null result for MECH-2", saslS);
@@ -266,7 +266,7 @@
         mProv[2].put(SRVSSRV.concat("MECH-5"), fServerClass);
         addProviders();
 
-        CallbackHandler cbH = new cbHandN();
+        CallbackHandler cbH = new Sasl3Test.cbHandN();
 
         SaslServer saslS;
         // try to create SaslServer for wrong mechanism
@@ -297,94 +297,93 @@
         saslS = Sasl.createSaslServer("MECH-5", "protocol", null, null, cbH);
         assertNotNull("Null result for MECH-5", saslS);
     }
-}
 
-/*
- * Additional class for creating SaslServer object
- */
-
-class mySaslServerFactory implements SaslServerFactory {
-    public mySaslServerFactory() {
-        super();
-    }
-
-    public String[] getMechanismNames(Map prop) {
-        return new String[] { "MECH-1", "MECH-2", "MECH-3", "MECH-4" };
-    }
-
-    public SaslServer createSaslServer(String mech, String protocol,
-            String srvName, Map prop, CallbackHandler hnd) throws SaslException {
-        if (mech == null) {
-            throw new SaslException();
-        }
-        if ("MECH-1".equals(mech)) {
-            throw new SaslException("Incorrect mechanisms");
-        }
-        if (protocol == null) {
-            throw new SaslException("Protocol is null");
-        }
-        TextOutputCallback[] cb = { new TextOutputCallback(
-                TextOutputCallback.INFORMATION, "Information") };
-        try {
-            hnd.handle(cb);
-        } catch (UnsupportedCallbackException e) {
-            throw new SaslException("Incorrect callback handlere", e);
-        } catch (IOException e) {
-            throw new SaslException("Incorrect callback handlere", e);
-        }
-        return new mySaslServer();
-    }
-
-    public class mySaslServer implements SaslServer {
-        public mySaslServer() {
+    /*
+     * Additional class for creating SaslServer object
+     */
+    public static class mySaslServerFactory implements SaslServerFactory {
+        public mySaslServerFactory() {
             super();
         }
 
-        public void dispose() throws SaslException {
+        public String[] getMechanismNames(Map prop) {
+            return new String[] { "MECH-1", "MECH-2", "MECH-3", "MECH-4" };
         }
 
-        public byte[] evaluateResponse(byte[] challenge) throws SaslException {
-            return new byte[0];
+        public SaslServer createSaslServer(String mech, String protocol,
+                String srvName, Map prop, CallbackHandler hnd) throws SaslException {
+            if (mech == null) {
+                throw new SaslException();
+            }
+            if ("MECH-1".equals(mech)) {
+                throw new SaslException("Incorrect mechanisms");
+            }
+            if (protocol == null) {
+                throw new SaslException("Protocol is null");
+            }
+            TextOutputCallback[] cb = { new TextOutputCallback(
+                    TextOutputCallback.INFORMATION, "Information") };
+            try {
+                hnd.handle(cb);
+            } catch (UnsupportedCallbackException e) {
+                throw new SaslException("Incorrect callback handlere", e);
+            } catch (IOException e) {
+                throw new SaslException("Incorrect callback handlere", e);
+            }
+            return new mySaslServer();
         }
 
-        public String getMechanismName() {
-            return "Server Proba";
-        }
+        public class mySaslServer implements SaslServer {
+            public mySaslServer() {
+                super();
+            }
 
-        public Object getNegotiatedProperty(String s) {
-            return "";
-        }
+            public void dispose() throws SaslException {
+            }
 
-        public String getAuthorizationID() {
-            return "";
-        }
+            public byte[] evaluateResponse(byte[] challenge) throws SaslException {
+                return new byte[0];
+            }
 
-        public boolean isComplete() {
-            return false;
-        }
+            public String getMechanismName() {
+                return "Server Proba";
+            }
 
-        public byte[] unwrap(byte[] incoming, int offset, int len)
-                throws SaslException {
-            throw new SaslException();
-        }
+            public Object getNegotiatedProperty(String s) {
+                return "";
+            }
 
-        public byte[] wrap(byte[] outgoing, int offset, int len)
-                throws SaslException {
-            return new byte[0];
+            public String getAuthorizationID() {
+                return "";
+            }
+
+            public boolean isComplete() {
+                return false;
+            }
+
+            public byte[] unwrap(byte[] incoming, int offset, int len)
+                    throws SaslException {
+                throw new SaslException();
+            }
+
+            public byte[] wrap(byte[] outgoing, int offset, int len)
+                    throws SaslException {
+                return new byte[0];
+            }
         }
     }
-}
 
-class mySaslServerFactoryExt extends mySaslServerFactory {
-    public String[] getMechanismNames(Map prop) {
-        return new String[] { "MECH-5", "MECH-6" };
-    }
+    public static class mySaslServerFactoryExt extends mySaslServerFactory {
+        public String[] getMechanismNames(Map prop) {
+            return new String[] { "MECH-5", "MECH-6" };
+        }
 
-    public SaslServer createSaslServer(String mech, String protocol,
-            String srvName, Map prop, CallbackHandler hnd) throws SaslException {
-        if (mech == null) {
-            throw new SaslException();
+        public SaslServer createSaslServer(String mech, String protocol,
+                String srvName, Map prop, CallbackHandler hnd) throws SaslException {
+            if (mech == null) {
+                throw new SaslException();
+            }
+            return new mySaslServer();
         }
-        return new mySaslServer();
     }
 }



Mime
View raw message