Permalink
Browse files

Add a test constructor for LDAPSearchResults.

  • Loading branch information...
qris committed Dec 19, 2011
1 parent 2d2b0c4 commit ad169182df323a387c4136f3a28f7335f4842170
Showing with 10 additions and 0 deletions.
  1. +10 −0 com/novell/ldap/LDAPSearchResults.java
@@ -126,6 +126,16 @@ public LDAPSearchResults() {
return;
}
+ /**
+ * Test constructor, that allows testing of code that uses
+ * {@link LDAPSearchResults} by creating mock objects based on it.
+ */
+ public LDAPSearchResults(LDAPEntry [] entries)
+ {
+ this.entries = new ArrayList(Arrays.asList(entries));
+ this.entryCount = entries.length;
+ }
+
/**
* Returns a count of the items in the search result.
*

0 comments on commit ad16918

Please sign in to comment.