You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ml...@apache.org on 2007/03/01 17:17:13 UTC

svn commit: r513394 - in /harmony/enhanced/classlib/trunk/modules/jndi/src: main/java/javax/naming/ldap/SortKey.java test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/SortKeyTest.java

Author: mloenko
Date: Thu Mar  1 08:17:13 2007
New Revision: 513394

URL: http://svn.apache.org/viewvc?view=rev&rev=513394
Log:
adjust test to pass on RI. Adjust the code to pass adjusted test

Modified:
    harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/SortKey.java
    harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/SortKeyTest.java

Modified: harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/SortKey.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/SortKey.java?view=diff&rev=513394&r1=513393&r2=513394
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/SortKey.java (original)
+++ harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/SortKey.java Thu Mar  1 08:17:13 2007
@@ -17,7 +17,6 @@
 
 package javax.naming.ldap;
 
-import org.apache.harmony.jndi.internal.nls.Messages;
 
 /**
  * 
@@ -38,9 +37,6 @@
      * @ar.org.fitc.spec_ref
      */
     public SortKey(String attrID) {
-        if (attrID == null) {
-            throw new NullPointerException("attrID "+Messages.getString("ldap.00"));
-        }
         this.attrID = attrID;
         this.ascendingOrder = true;
     }
@@ -49,9 +45,6 @@
      * @ar.org.fitc.spec_ref
      */
     public SortKey(String attrID, boolean ascendingOrder, String matchingRuleID) {
-        if (attrID == null) {
-            throw new NullPointerException("attrID "+Messages.getString("ldap.00"));
-        }
         this.attrID = attrID;
         this.ascendingOrder = ascendingOrder;
         this.matchingRuleID = matchingRuleID;

Modified: harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/SortKeyTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/SortKeyTest.java?view=diff&rev=513394&r1=513393&r2=513394
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/SortKeyTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/SortKeyTest.java Thu Mar  1 08:17:13 2007
@@ -23,31 +23,19 @@
 public class SortKeyTest extends TestCase {
 
     public void testAll() {
+        new SortKey(null);
+        new SortKey(null, true, null);
+
         SortKey sk = new SortKey("attributeId");
         assertEquals("attributeId", sk.getAttributeID());
         assertTrue(sk.isAscending());
         assertNull(sk.getMatchingRuleID());
-        
-        try {
-            new SortKey(null);
-            fail("Should throw NullPointerException.");
-        } catch (NullPointerException e) {
-            //expected
-        }
-        
-        
-        
+
         sk = new SortKey("attributeId", false, "matchingRuleId");
         assertEquals("attributeId", sk.getAttributeID());
         assertFalse(sk.isAscending());
         assertEquals("matchingRuleId", sk.getMatchingRuleID());
         
-        try {
-            new SortKey(null, true, null);
-            fail("Should throw NullPointerException.");
-        } catch (NullPointerException e) {
-            //expected
-        }
         
         sk = new SortKey("attributeId", true, null);
         assertEquals("attributeId", sk.getAttributeID());