harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r451816 [1/2] - in /incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java: common/javax/security/auth/ common/javax/security/auth/x500/ common/javax/security/sasl/ common/org/apache/harmony/auth/internal/ common/org/apache/ha...
Date Sun, 01 Oct 2006 21:42:05 GMT
Author: ndbeyer
Date: Sun Oct  1 14:42:03 2006
New Revision: 451816

URL: http://svn.apache.org/viewvc?view=rev&rev=451816
Log:
Clean up compiler warnings in auth tests; pull classes into their own files.

Added:
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/cbHand.java   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/cbHandN.java   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myClientFactory01.java   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myClientFactory02.java   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslClientFactory.java   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslClientFactoryExt.java   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslServerFactory.java   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslServerFactoryExt.java   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myServerFactory01.java   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myServerFactory02.java   (with props)
Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/SubjectTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrincipalTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrivateCredentialTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/RealmCallbackTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl1Test.java
    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
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/SaslExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/internal/SecurityTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/login/DefaultConfigParserTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/login/DefaultConfigurationTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/login/LoginContextTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/support/SpiEngUtils.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/linux/org/apache/harmony/auth/module/UnixLoginModuleTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/windows/org/apache/harmony/auth/module/NTLoginModuleTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/SubjectTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/SubjectTest.java?view=diff&rev=451816&r1=451815&r2=451816
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/SubjectTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/SubjectTest.java Sun Oct  1 14:42:03 2006
@@ -43,7 +43,7 @@
 
 
 /**
- * Tests Subject and its innner classes implementation. 
+ * Tests Subject and its inner classes implementation. 
  */
 
 public class SubjectTest extends SecurityTest {
@@ -94,11 +94,7 @@
 
     private final HashSet<Object> h2 = new HashSet<Object>(); // public credentials
 
-    private final HashSet<Object> h3 = new HashSet<Object>(); // private credentials
-
-    public static void main(String[] args) throws Exception {
-        junit.textui.TestRunner.run(javax.security.auth.SubjectTest.suite());
-    }
+    private final HashSet<Object> h3 = new HashSet<Object>(); // private credentials gd
 
     public static Test suite() throws Exception {
 
@@ -600,7 +596,7 @@
             subject1.equals(subject2);
             fail("No expected AccessControlException");
         } catch (AccessControlException e) {
-            assertEquals(e, PrivateCredentialPermission.class);
+            assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
         }
     }
 
@@ -625,7 +621,7 @@
             subThis.getPrivateCredentials().iterator().next();
             fail("No expected AccessControlException");
         } catch (AccessControlException e) {
-            assertEquals(e, PrivateCredentialPermission.class);
+            assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
         }
         subThat.getPrivateCredentials().iterator().next();
 
@@ -634,7 +630,7 @@
             subThis.equals(subThat);
             fail("No expected AccessControlException");
         } catch (AccessControlException e) {
-            assertEquals(e, PrivateCredentialPermission.class);
+            assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
         }
 
         // provided subject doesn't have permission
@@ -642,7 +638,7 @@
             subThat.equals(subThis);
             fail("No expected AccessControlException");
         } catch (AccessControlException e) {
-            assertEquals(e, PrivateCredentialPermission.class);
+            assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
         }
     }
 
@@ -808,7 +804,7 @@
                 fail("No expected AccessControlException");
             }
         } catch (AccessControlException e) {
-            assertEquals(e, PrivateCredentialPermission.class);
+            assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
         }
     }
 
@@ -1455,21 +1451,21 @@
                 fail("No expected AccessControlException");
             } catch (AccessControlException e) {
                 // PrivateCredentialPermission check goes first
-                assertEquals(e, PrivateCredentialPermission.class);
+                assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
             }
 
             try {
                 set.contains(privCr1);
                 fail("No expected AccessControlException");
             } catch (AccessControlException e) {
-                assertEquals(e, PrivateCredentialPermission.class);
+                assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
             }
 
             try {
                 set.contains(new Object());
                 fail("No expected AccessControlException");
             } catch (AccessControlException e) {
-                assertEquals(e, PrivateCredentialPermission.class);
+                assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
             }
 
             assertTrue(set.equals(set));
@@ -1479,7 +1475,7 @@
                 set.equals(hash);
                 fail("No expected AccessControlException");
             } catch (AccessControlException e) {
-                assertEquals(e, PrivateCredentialPermission.class);
+                assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
             }
 
             set.isEmpty();
@@ -1488,7 +1484,7 @@
                 set.hashCode();
                 fail("No expected AccessControlException");
             } catch (AccessControlException e) {
-                assertEquals(e, PrivateCredentialPermission.class);
+                assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
             }
 
             try {
@@ -1496,7 +1492,7 @@
                 fail("No expected AccessControlException");
             } catch (AccessControlException e) {
                 // PrivateCredentialPermission check goes first
-                assertEquals(e, PrivateCredentialPermission.class);
+                assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
             }
 
             try {
@@ -1504,7 +1500,7 @@
                 fail("No expected AccessControlException");
             } catch (AccessControlException e) {
                 // PrivateCredentialPermission check goes first
-                assertEquals(e, PrivateCredentialPermission.class);
+                assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
             }
 
             try {
@@ -1512,21 +1508,21 @@
                 fail("No expected AccessControlException");
             } catch (AccessControlException e) {
                 // PrivateCredentialPermission check goes first
-                assertEquals(e, PrivateCredentialPermission.class);
+                assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
             }
 
             try {
                 set.toArray();
                 fail("No expected AccessControlException");
             } catch (AccessControlException e) {
-                assertEquals(e, PrivateCredentialPermission.class);
+                assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
             }
 
             try {
                 set.toArray(new Object[5]);
                 fail("No expected AccessControlException");
             } catch (AccessControlException e) {
-                assertEquals(e, PrivateCredentialPermission.class);
+                assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
             }
         }
 
@@ -1572,7 +1568,7 @@
                 try {
                     hash.add(it.next());
                 } catch (AccessControlException e) {
-                    assertEquals(e, PrivateCredentialPermission.class);
+                    assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
                 }
             }
 
@@ -1647,7 +1643,7 @@
                 it.next();
                 fail("No expected AccessControlException");
             } catch (AccessControlException e) {
-                assertEquals(e, PrivateCredentialPermission.class);
+                assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
             }
 
             subject.getPrincipals().add(p2);
@@ -1669,7 +1665,7 @@
                 sOut.writeObject(subject.getPrivateCredentials());
                 fail("No expected AccessControlException");
             } catch (AccessControlException e) {
-                assertEquals(e, PrivateCredentialPermission.class);
+                assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
             } finally {
                 sOut.close();
             }
@@ -1691,14 +1687,14 @@
                 subject.getPrivateCredentials(MyClass1.class);
                 fail("No expected AccessControlException");
             } catch (AccessControlException e) {
-                assertEquals(e, PrivateCredentialPermission.class);
+                assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
             }
 
             try {
                 subject.getPrivateCredentials(MyClass2.class);
                 fail("No expected AccessControlException");
             } catch (AccessControlException e) {
-                assertEquals(e, PrivateCredentialPermission.class);
+                assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
             }
 
             // subject hash partial permissions (only for MyClass1 class)
@@ -1710,14 +1706,14 @@
                 subject.getPrivateCredentials(MyClass1.class);
                 fail("No expected AccessControlException");
             } catch (AccessControlException e) {
-                assertEquals(e, PrivateCredentialPermission.class);
+                assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
             }
 
             try {
                 subject.getPrivateCredentials(MyClass2.class);
                 fail("No expected AccessControlException");
             } catch (AccessControlException e) {
-                assertEquals(e, PrivateCredentialPermission.class);
+                assertEquals(PrivateCredentialPermission.class, e.getPermission().getClass());
             }
 
             // now subject has all permissions 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrincipalTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrincipalTest.java?view=diff&rev=451816&r1=451815&r2=451816
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrincipalTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrincipalTest.java Sun Oct  1 14:42:03 2006
@@ -30,9 +30,7 @@
 import java.util.Arrays;
 import java.util.Locale;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 /**
  * Tests X500Principal class
@@ -1941,14 +1939,6 @@
         assertEquals("cn=a\nb", s);
     }
 
-    public static Test suite() {
-        return new TestSuite(X500PrincipalTest.class);
-    }
-
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(suite());
-    }
-
     public static final String[] RFC2253_SPECIAL = new String[] { ",", "=",
             "+", "<", ">", "#", ";" };
 
@@ -2243,14 +2233,14 @@
         list.add("CN=\\  A  ", "CN=\\  A", "CN=\"  A\"", "cn=a", null,
                 (byte) 0x01); // escaped leading space
         list.add("CN=  A \\ ", "CN=A \\ ", "CN=\"A  \"", "cn=a", null,
-                (byte) 0x01); // escaped traling space
+                (byte) 0x01); // escaped trailing space
 
-        list.add("CN=  \"A\"  ", "CN=A", "CN=A", "cn=a"); // leading & traling spaces
+        list.add("CN=  \"A\"  ", "CN=A", "CN=A", "cn=a"); // leading & trailing spaces
 
         StringBuffer errorMsg = new StringBuffer();
         for (int i = 0; i < list.size(); i++) {
 
-            Object[] obj = (Object[]) list.get(i);
+            Object[] obj = list.get(i);
 
             String dn = (String) obj[0];
             String rfc2253 = (String) obj[1];
@@ -2680,7 +2670,7 @@
         StringBuffer errorMsg = new StringBuffer();
         for (int i = 0; i < list.size(); i++) {
 
-            Object[] values = (Object[]) list.get(i);
+            Object[] values = list.get(i);
             byte[] encoded = (byte[]) values[0];
             String rfc2253 = (String) values[1];
             String rfc1179 = (String) values[2];
@@ -2735,7 +2725,8 @@
         }
     }
 
-    public static class TestList extends ArrayList {
+    @SuppressWarnings("serial")
+    public static class TestList extends ArrayList<Object[]> {
         //
         // TODO comment me
         //

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrivateCredentialTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrivateCredentialTest.java?view=diff&rev=451816&r1=451815&r2=451816
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrivateCredentialTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrivateCredentialTest.java Sun Oct  1 14:42:03 2006
@@ -33,13 +33,14 @@
 import java.security.cert.CertificateEncodingException;
 import java.security.cert.CertificateException;
 import java.security.cert.X509Certificate;
-import junit.framework.Test;
+import java.util.Date;
+import java.util.Set;
+
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import java.util.*;
 /**
  * Tests implementation of X500PrivateCredential class
  */
+@SuppressWarnings("serial")
 public class X500PrivateCredentialTest extends TestCase {
 
 	X509Certificate cert= new X509Certificate() {
@@ -125,13 +126,13 @@
         public PublicKey getPublicKey() {
 			return null;
 		}
-		public Set getCriticalExtensionOIDs() {
+		public Set<String> getCriticalExtensionOIDs() {
 			return null;
 		}
 		public byte[] getExtensionValue(String oid) {
 			return null;
 		}
-		public Set getNonCriticalExtensionOIDs() {
+		public Set<String> getNonCriticalExtensionOIDs() {
 			return null;
 		}
 		public boolean hasUnsupportedCriticalExtension() {
@@ -213,13 +214,4 @@
 			//ignore
 		}
 	}
-
-	public static Test suite() {
-		return new TestSuite(X500PrivateCredentialTest.class);
-	}
-
-	public static void main(String[] args) {
-		junit.textui.TestRunner.run(suite());
-	}
-
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/RealmCallbackTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/RealmCallbackTest.java?view=diff&rev=451816&r1=451815&r2=451816
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/RealmCallbackTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/RealmCallbackTest.java Sun Oct  1 14:42:03 2006
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
 package javax.security.sasl;
 
 import junit.framework.TestCase;
@@ -28,16 +23,7 @@
  * Tests for constructors and methods of RealmCallback class
  * 
  */
-
 public class RealmCallbackTest extends TestCase {
-
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(RealmCallbackTest.class);
-    }
-
-    public RealmCallbackTest(String arg0) {
-        super(arg0);
-    }
     
     private static final String[] prompts = {
             "Prompts",

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl1Test.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl1Test.java?view=diff&rev=451816&r1=451815&r2=451816
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl1Test.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl1Test.java Sun Oct  1 14:42:03 2006
@@ -15,14 +15,8 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
 package javax.security.sasl;
 
-
 import java.security.Provider;
 import java.security.Security;
 import java.util.Enumeration;
@@ -33,23 +27,9 @@
  * Test for Sasl class
  * 
  */
-
 public class Sasl1Test extends TestCase {
-
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(Sasl1Test.class);
-    }
-
     private Provider [] provs;
     private boolean initProvs = false;
-    /**
-     * Constructor for Sasl2Test.
-     * 
-     * @param arg0
-     */
-    public Sasl1Test(String arg0) {
-        super(arg0);
-    }
 
     @Override
     protected void setUp() throws Exception {
@@ -84,7 +64,7 @@
      * All providers are previously removed.
      */
     public void testGetClient() {    
-        Enumeration en = Sasl.getSaslClientFactories();
+        Enumeration<?> en = Sasl.getSaslClientFactories();
         assertNotNull("List of SaslClientFactories should not be null", en);
         assertFalse("List of SaslClientFactories should not haves elements", en
                 .hasMoreElements());
@@ -99,7 +79,7 @@
      * All providers are previously removed.
      */
     public void testGetSertver() {
-        Enumeration en = Sasl.getSaslServerFactories();
+        Enumeration<?> en = Sasl.getSaslServerFactories();
         assertNotNull("List of SaslServerFactories should not be null", en);
         assertFalse("List of SaslServerFactories should not have elements", en
                 .hasMoreElements());

Modified: 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/javax/security/sasl/Sasl2Test.java?view=diff&rev=451816&r1=451815&r2=451816
==============================================================================
--- 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/javax/security/sasl/Sasl2Test.java Sun Oct  1 14:42:03 2006
@@ -15,47 +15,38 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
 package javax.security.sasl;
 
-
 import java.security.Provider;
 import java.security.Security;
-import javax.security.auth.callback.CallbackHandler;
-
-import org.apache.harmony.auth.tests.support.SpiEngUtils;
+import java.util.Enumeration;
 
 import junit.framework.TestCase;
 
-import java.util.Enumeration;
-import java.util.Map;
+import org.apache.harmony.auth.tests.support.SpiEngUtils;
 
 /**
  * Test for Sasl class
  * 
  */
-
 public class Sasl2Test extends TestCase {
 
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(Sasl2Test.class);
-    }
+    private static final String[] mech = { "mechanism", "NEW-MECHANISM", "AA",
+            "LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG" };
 
-    Provider[] mProv;
+    private static final String CLNTSRV = "SaslClientFactory.";
+
+    private static final String SRVSSRV = "SaslServerFactory.";
 
     private static final String fClientClass01 = "javax.security.sasl.myClientFactory01";
 
     private static final String fServerClass01 = "javax.security.sasl.myServerFactory01";
 
     private static final String fServerClass02 = "javax.security.sasl.myServerFactory02";
+    
+    Provider[] mProv;
 
-    /*
-     * @see TestCase#tearDown()
-     */
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
         if (mProv != null) {
@@ -65,28 +56,12 @@
         }
     }
 
-    /**
-     * Constructor for Sasl2Test.
-     * 
-     * @param arg0
-     */
-    public Sasl2Test(String arg0) {
-        super(arg0);
-    }
-
     private void addProviders() {
         for (Provider element : mProv) {
             Security.insertProviderAt(element, 2);
         }
     }
 
-    private static final String[] mech = { "mechanism", "NEW-MECHANISM", "AA",
-            "LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG" };
-
-    private static final String CLNTSRV = "SaslClientFactory.";
-
-    private static final String SRVSSRV = "SaslServerFactory.";
-
     /**
      * Test for <code>getSaslClientFactories()</code> method 
      * 
@@ -114,7 +89,7 @@
 
         addProviders();
 
-        Enumeration en = Sasl.getSaslClientFactories();
+        Enumeration<?> en = Sasl.getSaslClientFactories();
         assertNotNull("List of SaslClientFactories should not be null", en);
         assertTrue("List of SaslClientFactories should have elements", en
                 .hasMoreElements());
@@ -164,7 +139,7 @@
                                 .concat(mech[3]), fClientClass01) };
         addProviders();
 
-        Enumeration en = Sasl.getSaslClientFactories();
+        Enumeration<?> en = Sasl.getSaslClientFactories();
         assertNotNull("List of SaslClientFactories should not be null", en);
         assertTrue("List of SaslClientFactories should have elements", en
                 .hasMoreElements());
@@ -207,7 +182,7 @@
                         "Testing provider SaslClientFactory - 2", CLNTSRV
                                 .concat(mech[1]), fClientClass01) };
         addProviders();
-        Enumeration en = Sasl.getSaslClientFactories();
+        Enumeration<?> en = Sasl.getSaslClientFactories();
         assertNotNull("List of SaslClientFactories should not be null", en);
         assertTrue("List of SaslClientFactories should have elements", en
                 .hasMoreElements());
@@ -267,7 +242,7 @@
         mProv[0].put(CLNTSRV.concat(mech[3]), fClientClass01);
 
         addProviders();
-        Enumeration en = Sasl.getSaslClientFactories();
+        Enumeration<?> en = Sasl.getSaslClientFactories();
         assertNotNull("List of SaslClientFactories should not be null", en);
         assertTrue("List of SaslClientFactories should have elements", en
                 .hasMoreElements());
@@ -326,7 +301,7 @@
                     fServerClass01);
         }
         addProviders();
-        Enumeration en = Sasl.getSaslServerFactories();
+        Enumeration<?> en = Sasl.getSaslServerFactories();
         assertNotNull("List of SaslServerFactories should not be null", en);
         assertTrue("List of SaslServerFactories should have elements", en
                 .hasMoreElements());
@@ -386,7 +361,7 @@
                                 .concat(mech[3]), fServerClass01) };
         addProviders();
 
-        Enumeration en = Sasl.getSaslServerFactories();
+        Enumeration<?> en = Sasl.getSaslServerFactories();
         assertNotNull("List of SaslServerFactories should not be null", en);
         assertTrue("List of SaslServerFactories should have elements", en
                 .hasMoreElements());
@@ -429,7 +404,7 @@
                         "Testing provider SaslServerFactory - 2", SRVSSRV
                                 .concat(mech[1]), fServerClass01) };
         addProviders();
-        Enumeration en = Sasl.getSaslServerFactories();
+        Enumeration<?> en = Sasl.getSaslServerFactories();
         assertNotNull("List of SaslServerFactories should not be null", en);
         assertTrue("List of SaslServerFactories should have elements", en
                 .hasMoreElements());
@@ -489,7 +464,7 @@
         mProv[0].put(SRVSSRV.concat(mech[3]), fServerClass02);
 
         addProviders();
-        Enumeration en = Sasl.getSaslServerFactories();
+        Enumeration<?> en = Sasl.getSaslServerFactories();
         assertNotNull("List of SaslServerFactories should not be null", en);
         assertTrue("List of SaslServerFactories should have elements", en
                 .hasMoreElements());
@@ -512,68 +487,4 @@
                 mProv.length);
     }
 
-}
-
-class myServerFactory01 implements SaslServerFactory {
-    public myServerFactory01() {
-        super();
-    }
-
-    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;
-    }
-}
-
-class myServerFactory02 implements SaslServerFactory {
-    public myServerFactory02() {
-        super();
-    }
-
-    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");
-        }
-        return null;
-    }
-}
-
-class myClientFactory01 implements SaslClientFactory {
-    public myClientFactory01() {
-        super();
-    }
-
-    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;
-    }
-}
-
-class myClientFactory02 implements SaslClientFactory {
-    public myClientFactory02() {
-        super();
-    }
-
-    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;
-    }
 }

Modified: 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/javax/security/sasl/Sasl3Test.java?view=diff&rev=451816&r1=451815&r2=451816
==============================================================================
--- 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/javax/security/sasl/Sasl3Test.java Sun Oct  1 14:42:03 2006
@@ -15,35 +15,21 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
 package javax.security.sasl;
 
-
-import java.io.IOException;
 import java.security.Provider;
 import java.security.Security;
-import java.util.Map;
 
-import javax.security.auth.callback.Callback;
 import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.TextOutputCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-
-import org.apache.harmony.auth.tests.support.SpiEngUtils;
 
 import junit.framework.TestCase;
 
+import org.apache.harmony.auth.tests.support.SpiEngUtils;
+
 /**
  * Test for Sasl class
  * 
  */
-
 public class Sasl3Test extends TestCase {
     private static final String CLNTSRV = "SaslClientFactory.";
 
@@ -197,7 +183,7 @@
         assertNotNull("Null result", saslC);
         try {
             saslC.unwrap(null, 1, 1);
-            fail("SaslException sould be thrown");
+            fail("SaslException should be thrown");
         } catch (SaslException e) {
         }
         assertFalse("Incorrect isComplete() result", saslC.isComplete());
@@ -205,7 +191,7 @@
         try {
             saslC = Sasl.createSaslClient(new String[] { "NAME-1" }, null,
                     "protocol", null, null, cbH);
-            fail("SaslException sould be thrown");
+            fail("SaslException should be thrown");
         } catch (SaslException e) {
         }
     }
@@ -236,7 +222,7 @@
         try {
             saslC = Sasl.createSaslClient(new String[] { "NAME-1" }, null,
                     "protocol", null, null, cbH);
-            fail("SaslException sould be thrown");
+            fail("SaslException should be thrown");
         } catch (SaslException e) {
         }
     }
@@ -280,7 +266,7 @@
         assertNotNull("Null result for NAME-2", saslC);
         try {
             saslC.unwrap(null, 1, 1);
-            fail("SaslException sould be thrown");
+            fail("SaslException should be thrown");
         } catch (SaslException e) {
         }
         assertFalse("Incorrect isComplete() result", saslC.isComplete());
@@ -289,7 +275,7 @@
         try {
             Sasl.createSaslClient(new String[] { "NAME-1" }, null, "protocol",
                     null, null, cbH);
-            fail("SaslException sould be thrown");
+            fail("SaslException should be thrown");
         } catch (SaslException e) {
         }
         // NAME-6 and NAME-5 were defined in one provider but they are
@@ -298,143 +284,5 @@
         saslC = Sasl.createSaslClient(new String[] { "NAME-6", "NAME-5" },
                 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();
-    }
-
-    public class mySaslClient implements SaslClient {
-        public mySaslClient() {
-            super();
-        }
-
-        public Object getNegotiatedProperty(String s) {
-            return "";
-        }
-
-        public String getMechanismName() {
-            return "Proba";
-        }
-
-        public boolean isComplete() {
-            return false;
-        }
-
-        public boolean hasInitialResponse() {
-            return false;
-        }
-
-        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 {
-    @Override
-    public String[] getMechanismNames(Map prop) {
-        return new String[] { "NAME-5", "NAME-6" };
-    }
-
-    @Override
-    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();
-    }
-}
-
-class cbHand implements CallbackHandler {
-    public cbHand() {
-    }
-
-    public void handle(Callback[] callbacks) throws IOException,
-            UnsupportedCallbackException {
-        for (Callback element : callbacks) {
-            if (element instanceof NameCallback) {
-                NameCallback nc = (NameCallback) element;
-                nc.setName("Ok");
-            } else if (element instanceof PasswordCallback) {
-                PasswordCallback pc = (PasswordCallback) element;
-                System.err.print(pc.getPrompt());
-                System.err.flush();
-                pc.setPassword(new char[] { 'O', 'k' });
-            } else {
-                throw new UnsupportedCallbackException(element,
-                        "Callback should be NamCallback or PasswordCallback");
-            }
-        }
-    }
-}
-
-class cbHandN implements CallbackHandler {
-    public cbHandN() {
-    }
-
-    public void handle(Callback[] callbacks) throws IOException,
-            UnsupportedCallbackException {
-        for (Callback element : callbacks) {
-            if (element instanceof TextOutputCallback) {
-                TextOutputCallback toc = (TextOutputCallback) element;
-                if (toc.getMessageType() != TextOutputCallback.INFORMATION) {
-                    throw new IOException("Unsupported message type: "
-                            + toc.getMessageType());
-                }
-            } else {
-                throw new UnsupportedCallbackException(element,
-                        "Callback should be TextOutputCallback");
-            }
-        }
     }
 }

Modified: 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/javax/security/sasl/Sasl4Test.java?view=diff&rev=451816&r1=451815&r2=451816
==============================================================================
--- 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/javax/security/sasl/Sasl4Test.java Sun Oct  1 14:42:03 2006
@@ -15,32 +15,21 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
 package javax.security.sasl;
 
-
-import java.io.IOException;
 import java.security.Provider;
 import java.security.Security;
-import java.util.Map;
 
 import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.TextOutputCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-
-import org.apache.harmony.auth.tests.support.SpiEngUtils;
 
 import junit.framework.TestCase;
 
+import org.apache.harmony.auth.tests.support.SpiEngUtils;
+
 /**
  * Test for Sasl class
  * 
  */
-
 public class Sasl4Test extends TestCase {
     private static final String SRVSSRV = "SaslServerFactory.";
 
@@ -49,20 +38,6 @@
     private Provider [] provs;
     private boolean initProvs = false;
 
-    
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(Sasl4Test.class);
-    }
-
-    /**
-     * Constructor for Sasl4Test.
-     * 
-     * @param arg0
-     */
-    public Sasl4Test(String arg0) {
-        super(arg0);
-    }
-
     @Override
     protected void setUp() throws Exception {
         super.setUp();
@@ -297,97 +272,5 @@
         assertNotNull("Null result for MECH-6", saslS);
         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() {
-            super();
-        }
-
-        public void dispose() throws SaslException {
-        }
-
-        public byte[] evaluateResponse(byte[] challenge) throws SaslException {
-            return new byte[0];
-        }
-
-        public String getMechanismName() {
-            return "Server Proba";
-        }
-
-        public Object getNegotiatedProperty(String s) {
-            return "";
-        }
-
-        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 {
-    @Override
-    public String[] getMechanismNames(Map prop) {
-        return new String[] { "MECH-5", "MECH-6" };
-    }
-
-    @Override
-    public SaslServer createSaslServer(String mech, String protocol,
-            String srvName, Map prop, CallbackHandler hnd) throws SaslException {
-        if (mech == null) {
-            throw new SaslException();
-        }
-        return new mySaslServer();
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/SaslExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/SaslExceptionTest.java?view=diff&rev=451816&r1=451815&r2=451816
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/SaslExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/SaslExceptionTest.java Sun Oct  1 14:42:03 2006
@@ -15,14 +15,8 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
 package javax.security.sasl;
 
-
 import junit.framework.TestCase;
 
 /**
@@ -30,19 +24,6 @@
  * 
  */
 public class SaslExceptionTest extends TestCase {
-
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(SaslExceptionTest.class);
-    }
-
-    /**
-     * Constructor for SaslExceptionTests.
-     * 
-     * @param arg0
-     */
-    public SaslExceptionTest(String arg0) {
-        super(arg0);
-    }
 
     static String[] msgs = {
             "",

Added: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/cbHand.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/cbHand.java?view=auto&rev=451816
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/cbHand.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/cbHand.java Sun Oct  1 14:42:03 2006
@@ -0,0 +1,49 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package javax.security.sasl;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+class cbHand implements CallbackHandler {
+    public cbHand() {
+    }
+
+    public void handle(Callback[] callbacks) throws IOException,
+            UnsupportedCallbackException {
+        for (Callback element : callbacks) {
+            if (element instanceof NameCallback) {
+                NameCallback nc = (NameCallback) element;
+                nc.setName("Ok");
+            } else if (element instanceof PasswordCallback) {
+                PasswordCallback pc = (PasswordCallback) element;
+                System.err.print(pc.getPrompt());
+                System.err.flush();
+                pc.setPassword(new char[] { 'O', 'k' });
+            } else {
+                throw new UnsupportedCallbackException(element,
+                        "Callback should be NamCallback or PasswordCallback");
+            }
+        }
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/cbHand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/cbHandN.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/cbHandN.java?view=auto&rev=451816
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/cbHandN.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/cbHandN.java Sun Oct  1 14:42:03 2006
@@ -0,0 +1,46 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package javax.security.sasl;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.TextOutputCallback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+class cbHandN implements CallbackHandler {
+    public cbHandN() {
+    }
+
+    public void handle(Callback[] callbacks) throws IOException,
+            UnsupportedCallbackException {
+        for (Callback element : callbacks) {
+            if (element instanceof TextOutputCallback) {
+                TextOutputCallback toc = (TextOutputCallback) element;
+                if (toc.getMessageType() != TextOutputCallback.INFORMATION) {
+                    throw new IOException("Unsupported message type: "
+                            + toc.getMessageType());
+                }
+            } else {
+                throw new UnsupportedCallbackException(element,
+                        "Callback should be TextOutputCallback");
+            }
+        }
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/cbHandN.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myClientFactory01.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myClientFactory01.java?view=auto&rev=451816
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myClientFactory01.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myClientFactory01.java Sun Oct  1 14:42:03 2006
@@ -0,0 +1,21 @@
+
+package javax.security.sasl;
+
+import java.util.Map;
+
+import javax.security.auth.callback.CallbackHandler;
+
+class myClientFactory01 implements SaslClientFactory {
+    public myClientFactory01() {
+        super();
+    }
+
+    public String[] getMechanismNames(Map<String, ?> map) {
+        return new String[] { "a1", "a2", "a3", "a4", "a5" };
+    }
+
+    public SaslClient createSaslClient(String[] mech, String prot, String auth,
+            String srvName, Map<String, ?> prop, CallbackHandler ch) throws SaslException {
+        return null;
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myClientFactory01.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myClientFactory02.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myClientFactory02.java?view=auto&rev=451816
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myClientFactory02.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myClientFactory02.java Sun Oct  1 14:42:03 2006
@@ -0,0 +1,37 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package javax.security.sasl;
+
+import java.util.Map;
+
+import javax.security.auth.callback.CallbackHandler;
+
+class myClientFactory02 implements SaslClientFactory {
+    public myClientFactory02() {
+        super();
+    }
+
+    public String[] getMechanismNames(Map<String, ?> map) {
+        return new String[] { "a11", "a22", "a33", "a44", "a55", "" };
+    }
+
+    public SaslClient createSaslClient(String[] mech, String prot, String auth,
+            String srvName, Map<String, ?> prop, CallbackHandler ch) throws SaslException {
+        return null;
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myClientFactory02.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslClientFactory.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslClientFactory.java?view=auto&rev=451816
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslClientFactory.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslClientFactory.java Sun Oct  1 14:42:03 2006
@@ -0,0 +1,98 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package javax.security.sasl;
+
+import java.io.IOException;
+import java.util.Map;
+
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.TextOutputCallback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+class mySaslClientFactory implements SaslClientFactory {
+    public mySaslClientFactory() {
+        super();
+    }
+
+    public String[] getMechanismNames(Map<String, ?> prop) {
+        return new String[] { "NAME-1", "NAME-2", "NAME-3", "NAME-4" };
+    }
+
+    public SaslClient createSaslClient(String[] mech, String id,
+            String protocol, String srvName, Map<String, ?> 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 class mySaslClient implements SaslClient {
+        public mySaslClient() {
+            super();
+        }
+
+        public Object getNegotiatedProperty(String s) {
+            return "";
+        }
+
+        public String getMechanismName() {
+            return "Proba";
+        }
+
+        public boolean isComplete() {
+            return false;
+        }
+
+        public boolean hasInitialResponse() {
+            return false;
+        }
+
+        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];
+        }
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslClientFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslClientFactoryExt.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslClientFactoryExt.java?view=auto&rev=451816
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslClientFactoryExt.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslClientFactoryExt.java Sun Oct  1 14:42:03 2006
@@ -0,0 +1,38 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package javax.security.sasl;
+
+import java.util.Map;
+
+import javax.security.auth.callback.CallbackHandler;
+
+class mySaslClientFactoryExt extends mySaslClientFactory {
+    @Override
+    public String[] getMechanismNames(Map<String, ?> prop) {
+        return new String[] { "NAME-5", "NAME-6" };
+    }
+
+    @Override
+    public SaslClient createSaslClient(String[] mech, String id, String protocol,
+            String srvName, Map<String, ?> prop, CallbackHandler hnd) throws SaslException {
+        if (mech == null) {
+            throw new SaslException();
+        }
+        return new mySaslClient();
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslClientFactoryExt.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslServerFactory.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslServerFactory.java?view=auto&rev=451816
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslServerFactory.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslServerFactory.java Sun Oct  1 14:42:03 2006
@@ -0,0 +1,95 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package javax.security.sasl;
+
+import java.io.IOException;
+import java.util.Map;
+
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.TextOutputCallback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+class mySaslServerFactory implements SaslServerFactory {
+    public mySaslServerFactory() {
+        super();
+    }
+
+    public String[] getMechanismNames(Map<String, ?> prop) {
+        return new String[] { "MECH-1", "MECH-2", "MECH-3", "MECH-4" };
+    }
+
+    public SaslServer createSaslServer(String mech, String protocol, String srvName,
+            Map<String, ?> 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() {
+            super();
+        }
+
+        public void dispose() throws SaslException {
+        }
+
+        public byte[] evaluateResponse(byte[] challenge) throws SaslException {
+            return new byte[0];
+        }
+
+        public String getMechanismName() {
+            return "Server Proba";
+        }
+
+        public Object getNegotiatedProperty(String s) {
+            return "";
+        }
+
+        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];
+        }
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslServerFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslServerFactoryExt.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslServerFactoryExt.java?view=auto&rev=451816
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslServerFactoryExt.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslServerFactoryExt.java Sun Oct  1 14:42:03 2006
@@ -0,0 +1,38 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package javax.security.sasl;
+
+import java.util.Map;
+
+import javax.security.auth.callback.CallbackHandler;
+
+class mySaslServerFactoryExt extends mySaslServerFactory {
+    @Override
+    public String[] getMechanismNames(Map<String, ?> prop) {
+        return new String[] { "MECH-5", "MECH-6" };
+    }
+
+    @Override
+    public SaslServer createSaslServer(String mech, String protocol, String srvName,
+            Map<String, ?> prop, CallbackHandler hnd) throws SaslException {
+        if (mech == null) {
+            throw new SaslException();
+        }
+        return new mySaslServer();
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/mySaslServerFactoryExt.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myServerFactory01.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myServerFactory01.java?view=auto&rev=451816
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myServerFactory01.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myServerFactory01.java Sun Oct  1 14:42:03 2006
@@ -0,0 +1,40 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package javax.security.sasl;
+
+import java.util.Map;
+
+import javax.security.auth.callback.CallbackHandler;
+
+class myServerFactory01 implements SaslServerFactory {
+    public myServerFactory01() {
+        super();
+    }
+
+    public String[] getMechanismNames(Map<String, ?> map) {
+        return new String[] { "aaaa", "dddddddddddd",
+                "llllllllll sssssssss aaaaaaaaaaa c" };
+    }
+
+    public SaslServer createSaslServer(String mech, String prot,
+            String srvName, Map<String, ?> prop, CallbackHandler ch) throws SaslException {
+        return null;
+    }
+}
+
+

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myServerFactory01.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myServerFactory02.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myServerFactory02.java?view=auto&rev=451816
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myServerFactory02.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myServerFactory02.java Sun Oct  1 14:42:03 2006
@@ -0,0 +1,40 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package javax.security.sasl;
+
+import java.util.Map;
+
+import javax.security.auth.callback.CallbackHandler;
+
+class myServerFactory02 implements SaslServerFactory {
+    public myServerFactory02() {
+        super();
+    }
+
+    public String[] getMechanismNames(Map<String, ?> map) {
+        return null;
+    }
+
+    public SaslServer createSaslServer(String mech, String prot,
+            String srvName, Map<String, ?> prop, CallbackHandler ch) throws SaslException {
+        if (prot == null) {
+            throw new SaslException("Protocol is null");
+        }
+        return null;
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/myServerFactory02.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message