harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject 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
Date Thu, 01 Mar 2007 16:17:13 GMT
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());



Mime
View raw message