You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2012/12/19 18:24:42 UTC
svn commit: r1423968 [3/27] - in /directory/shared/branches/shared-refact:
dsml/engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/
dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/
dsml/parser/src/main/java/org/apache/directory...
Modified: directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/compareResponse/CompareResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/compareResponse/CompareResponseTest.java?rev=1423968&r1=1423967&r2=1423968&view=diff
==============================================================================
--- directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/compareResponse/CompareResponseTest.java (original)
+++ directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/compareResponse/CompareResponseTest.java Wed Dec 19 17:24:08 2012
@@ -31,16 +31,16 @@ import static org.junit.Assert.fail;
import java.util.Collection;
import java.util.Map;
+import org.apache.directory.api.ldap.model.exception.LdapURLEncodingException;
+import org.apache.directory.api.ldap.model.message.CompareResponse;
+import org.apache.directory.api.ldap.model.message.Control;
+import org.apache.directory.api.ldap.model.message.LdapResult;
+import org.apache.directory.api.ldap.model.message.ResultCodeEnum;
+import org.apache.directory.api.ldap.model.url.LdapUrl;
import org.apache.directory.api.util.Strings;
import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
import org.apache.directory.shared.dsmlv2.DsmlControl;
import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
-import org.apache.directory.shared.ldap.model.message.CompareResponse;
-import org.apache.directory.shared.ldap.model.message.Control;
-import org.apache.directory.shared.ldap.model.message.LdapResult;
-import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.model.url.LdapUrl;
import org.junit.Test;
import org.junit.runner.RunWith;
Modified: directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/delRequest/DelRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/delRequest/DelRequestTest.java?rev=1423968&r1=1423967&r2=1423968&view=diff
==============================================================================
--- directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/delRequest/DelRequestTest.java (original)
+++ directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/delRequest/DelRequestTest.java Wed Dec 19 17:24:08 2012
@@ -29,12 +29,12 @@ import static org.junit.Assert.fail;
import java.util.Map;
+import org.apache.directory.api.ldap.model.message.Control;
+import org.apache.directory.api.ldap.model.message.DeleteRequest;
import org.apache.directory.api.util.Strings;
import org.apache.directory.shared.dsmlv2.AbstractTest;
import org.apache.directory.shared.dsmlv2.DsmlControl;
import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
-import org.apache.directory.shared.ldap.model.message.Control;
-import org.apache.directory.shared.ldap.model.message.DeleteRequest;
import org.junit.Test;
import org.junit.runner.RunWith;
Modified: directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/delResponse/DelResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/delResponse/DelResponseTest.java?rev=1423968&r1=1423967&r2=1423968&view=diff
==============================================================================
--- directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/delResponse/DelResponseTest.java (original)
+++ directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/delResponse/DelResponseTest.java Wed Dec 19 17:24:08 2012
@@ -31,16 +31,16 @@ import static org.junit.Assert.fail;
import java.util.Collection;
import java.util.Map;
+import org.apache.directory.api.ldap.model.exception.LdapURLEncodingException;
+import org.apache.directory.api.ldap.model.message.Control;
+import org.apache.directory.api.ldap.model.message.DeleteResponse;
+import org.apache.directory.api.ldap.model.message.LdapResult;
+import org.apache.directory.api.ldap.model.message.ResultCodeEnum;
+import org.apache.directory.api.ldap.model.url.LdapUrl;
import org.apache.directory.api.util.Strings;
import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
import org.apache.directory.shared.dsmlv2.DsmlControl;
import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
-import org.apache.directory.shared.ldap.model.message.Control;
-import org.apache.directory.shared.ldap.model.message.DeleteResponse;
-import org.apache.directory.shared.ldap.model.message.LdapResult;
-import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.model.url.LdapUrl;
import org.junit.Test;
import org.junit.runner.RunWith;
Modified: directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedRequest/ExtendedRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedRequest/ExtendedRequestTest.java?rev=1423968&r1=1423967&r2=1423968&view=diff
==============================================================================
--- directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedRequest/ExtendedRequestTest.java (original)
+++ directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedRequest/ExtendedRequestTest.java Wed Dec 19 17:24:08 2012
@@ -29,12 +29,12 @@ import static org.junit.Assert.fail;
import java.util.Map;
+import org.apache.directory.api.ldap.model.message.Control;
import org.apache.directory.api.util.Strings;
import org.apache.directory.shared.dsmlv2.AbstractTest;
import org.apache.directory.shared.dsmlv2.DsmlControl;
import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
import org.apache.directory.shared.dsmlv2.request.ExtendedRequestDsml;
-import org.apache.directory.shared.ldap.model.message.Control;
import org.junit.Test;
import org.junit.runner.RunWith;
Modified: directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java?rev=1423968&r1=1423967&r2=1423968&view=diff
==============================================================================
--- directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java (original)
+++ directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java Wed Dec 19 17:24:08 2012
@@ -33,17 +33,17 @@ import java.util.Map;
import org.apache.directory.api.asn1.DecoderException;
import org.apache.directory.api.asn1.util.Oid;
+import org.apache.directory.api.ldap.model.exception.LdapURLEncodingException;
+import org.apache.directory.api.ldap.model.message.Control;
+import org.apache.directory.api.ldap.model.message.ExtendedResponse;
+import org.apache.directory.api.ldap.model.message.LdapResult;
+import org.apache.directory.api.ldap.model.message.ResultCodeEnum;
+import org.apache.directory.api.ldap.model.url.LdapUrl;
import org.apache.directory.api.util.Strings;
import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
import org.apache.directory.shared.dsmlv2.DsmlControl;
import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
import org.apache.directory.shared.dsmlv2.reponse.ExtendedResponseDsml;
-import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
-import org.apache.directory.shared.ldap.model.message.Control;
-import org.apache.directory.shared.ldap.model.message.ExtendedResponse;
-import org.apache.directory.shared.ldap.model.message.LdapResult;
-import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.model.url.LdapUrl;
import org.junit.Test;
import org.junit.runner.RunWith;
Modified: directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNRequest/ModifyDNRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNRequest/ModifyDNRequestTest.java?rev=1423968&r1=1423967&r2=1423968&view=diff
==============================================================================
--- directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNRequest/ModifyDNRequestTest.java (original)
+++ directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNRequest/ModifyDNRequestTest.java Wed Dec 19 17:24:08 2012
@@ -29,12 +29,12 @@ import static org.junit.Assert.fail;
import java.util.Map;
+import org.apache.directory.api.ldap.model.message.Control;
+import org.apache.directory.api.ldap.model.message.ModifyDnRequest;
import org.apache.directory.api.util.Strings;
import org.apache.directory.shared.dsmlv2.AbstractTest;
import org.apache.directory.shared.dsmlv2.DsmlControl;
import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
-import org.apache.directory.shared.ldap.model.message.Control;
-import org.apache.directory.shared.ldap.model.message.ModifyDnRequest;
import org.junit.Test;
import org.junit.runner.RunWith;
Modified: directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java?rev=1423968&r1=1423967&r2=1423968&view=diff
==============================================================================
--- directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java (original)
+++ directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java Wed Dec 19 17:24:08 2012
@@ -31,16 +31,16 @@ import static org.junit.Assert.fail;
import java.util.Collection;
import java.util.Map;
+import org.apache.directory.api.ldap.model.exception.LdapURLEncodingException;
+import org.apache.directory.api.ldap.model.message.Control;
+import org.apache.directory.api.ldap.model.message.LdapResult;
+import org.apache.directory.api.ldap.model.message.ModifyDnResponse;
+import org.apache.directory.api.ldap.model.message.ResultCodeEnum;
+import org.apache.directory.api.ldap.model.url.LdapUrl;
import org.apache.directory.api.util.Strings;
import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
import org.apache.directory.shared.dsmlv2.DsmlControl;
import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
-import org.apache.directory.shared.ldap.model.message.Control;
-import org.apache.directory.shared.ldap.model.message.LdapResult;
-import org.apache.directory.shared.ldap.model.message.ModifyDnResponse;
-import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.model.url.LdapUrl;
import org.junit.Test;
import org.junit.runner.RunWith;
Modified: directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyRequest/ModifyRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyRequest/ModifyRequestTest.java?rev=1423968&r1=1423967&r2=1423968&view=diff
==============================================================================
--- directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyRequest/ModifyRequestTest.java (original)
+++ directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyRequest/ModifyRequestTest.java Wed Dec 19 17:24:08 2012
@@ -32,16 +32,16 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
+import org.apache.directory.api.ldap.model.entry.Attribute;
+import org.apache.directory.api.ldap.model.entry.Modification;
+import org.apache.directory.api.ldap.model.entry.ModificationOperation;
+import org.apache.directory.api.ldap.model.exception.LdapException;
+import org.apache.directory.api.ldap.model.message.Control;
+import org.apache.directory.api.ldap.model.message.ModifyRequest;
import org.apache.directory.api.util.Strings;
import org.apache.directory.shared.dsmlv2.AbstractTest;
import org.apache.directory.shared.dsmlv2.DsmlControl;
import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
-import org.apache.directory.shared.ldap.model.entry.Attribute;
-import org.apache.directory.shared.ldap.model.entry.Modification;
-import org.apache.directory.shared.ldap.model.entry.ModificationOperation;
-import org.apache.directory.shared.ldap.model.exception.LdapException;
-import org.apache.directory.shared.ldap.model.message.Control;
-import org.apache.directory.shared.ldap.model.message.ModifyRequest;
import org.junit.Test;
import org.junit.runner.RunWith;
Modified: directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyResponse/ModifyResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyResponse/ModifyResponseTest.java?rev=1423968&r1=1423967&r2=1423968&view=diff
==============================================================================
--- directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyResponse/ModifyResponseTest.java (original)
+++ directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyResponse/ModifyResponseTest.java Wed Dec 19 17:24:08 2012
@@ -31,16 +31,16 @@ import static org.junit.Assert.fail;
import java.util.Collection;
import java.util.Map;
+import org.apache.directory.api.ldap.model.exception.LdapURLEncodingException;
+import org.apache.directory.api.ldap.model.message.Control;
+import org.apache.directory.api.ldap.model.message.LdapResult;
+import org.apache.directory.api.ldap.model.message.ModifyResponse;
+import org.apache.directory.api.ldap.model.message.ResultCodeEnum;
+import org.apache.directory.api.ldap.model.url.LdapUrl;
import org.apache.directory.api.util.Strings;
import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
import org.apache.directory.shared.dsmlv2.DsmlControl;
import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
-import org.apache.directory.shared.ldap.model.message.Control;
-import org.apache.directory.shared.ldap.model.message.LdapResult;
-import org.apache.directory.shared.ldap.model.message.ModifyResponse;
-import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.model.url.LdapUrl;
import org.junit.Test;
import org.junit.runner.RunWith;
Modified: directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/searchRequest/SearchRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/searchRequest/SearchRequestTest.java?rev=1423968&r1=1423967&r2=1423968&view=diff
==============================================================================
--- directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/searchRequest/SearchRequestTest.java (original)
+++ directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/searchRequest/SearchRequestTest.java Wed Dec 19 17:24:08 2012
@@ -34,27 +34,27 @@ import java.util.Map;
import com.mycila.junit.concurrent.Concurrency;
import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+import org.apache.directory.api.ldap.model.exception.LdapException;
+import org.apache.directory.api.ldap.model.filter.AndNode;
+import org.apache.directory.api.ldap.model.filter.ApproximateNode;
+import org.apache.directory.api.ldap.model.filter.EqualityNode;
+import org.apache.directory.api.ldap.model.filter.ExprNode;
+import org.apache.directory.api.ldap.model.filter.ExtensibleNode;
+import org.apache.directory.api.ldap.model.filter.GreaterEqNode;
+import org.apache.directory.api.ldap.model.filter.LessEqNode;
+import org.apache.directory.api.ldap.model.filter.NotNode;
+import org.apache.directory.api.ldap.model.filter.OrNode;
+import org.apache.directory.api.ldap.model.filter.PresenceNode;
+import org.apache.directory.api.ldap.model.filter.SubstringNode;
+import org.apache.directory.api.ldap.model.message.AliasDerefMode;
+import org.apache.directory.api.ldap.model.message.Control;
+import org.apache.directory.api.ldap.model.message.SearchRequest;
+import org.apache.directory.api.ldap.model.message.SearchScope;
import org.apache.directory.api.util.Strings;
import org.apache.directory.shared.dsmlv2.AbstractTest;
import org.apache.directory.shared.dsmlv2.DsmlControl;
import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
import org.apache.directory.shared.dsmlv2.request.SearchRequestDsml;
-import org.apache.directory.shared.ldap.model.exception.LdapException;
-import org.apache.directory.shared.ldap.model.filter.AndNode;
-import org.apache.directory.shared.ldap.model.filter.ApproximateNode;
-import org.apache.directory.shared.ldap.model.filter.EqualityNode;
-import org.apache.directory.shared.ldap.model.filter.ExprNode;
-import org.apache.directory.shared.ldap.model.filter.ExtensibleNode;
-import org.apache.directory.shared.ldap.model.filter.GreaterEqNode;
-import org.apache.directory.shared.ldap.model.filter.LessEqNode;
-import org.apache.directory.shared.ldap.model.filter.NotNode;
-import org.apache.directory.shared.ldap.model.filter.OrNode;
-import org.apache.directory.shared.ldap.model.filter.PresenceNode;
-import org.apache.directory.shared.ldap.model.filter.SubstringNode;
-import org.apache.directory.shared.ldap.model.message.AliasDerefMode;
-import org.apache.directory.shared.ldap.model.message.Control;
-import org.apache.directory.shared.ldap.model.message.SearchRequest;
-import org.apache.directory.shared.ldap.model.message.SearchScope;
import org.dom4j.tree.DefaultElement;
import org.junit.Test;
import org.junit.runner.RunWith;
Modified: directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java?rev=1423968&r1=1423967&r2=1423968&view=diff
==============================================================================
--- directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java (original)
+++ directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java Wed Dec 19 17:24:08 2012
@@ -31,17 +31,17 @@ import static org.junit.Assert.fail;
import java.util.Collection;
import java.util.Map;
+import org.apache.directory.api.ldap.model.exception.LdapURLEncodingException;
+import org.apache.directory.api.ldap.model.message.Control;
+import org.apache.directory.api.ldap.model.message.LdapResult;
+import org.apache.directory.api.ldap.model.message.ResultCodeEnum;
+import org.apache.directory.api.ldap.model.message.SearchResultDone;
+import org.apache.directory.api.ldap.model.url.LdapUrl;
import org.apache.directory.api.util.Strings;
import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
import org.apache.directory.shared.dsmlv2.DsmlControl;
import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
import org.apache.directory.shared.dsmlv2.reponse.SearchResponse;
-import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
-import org.apache.directory.shared.ldap.model.message.Control;
-import org.apache.directory.shared.ldap.model.message.LdapResult;
-import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.model.message.SearchResultDone;
-import org.apache.directory.shared.ldap.model.url.LdapUrl;
import org.junit.Test;
import org.junit.runner.RunWith;
Modified: directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultEntry/SearchResultEntryTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultEntry/SearchResultEntryTest.java?rev=1423968&r1=1423967&r2=1423968&view=diff
==============================================================================
--- directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultEntry/SearchResultEntryTest.java (original)
+++ directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultEntry/SearchResultEntryTest.java Wed Dec 19 17:24:08 2012
@@ -33,17 +33,17 @@ import java.util.Map;
import com.mycila.junit.concurrent.Concurrency;
import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+import org.apache.directory.api.ldap.model.entry.Attribute;
+import org.apache.directory.api.ldap.model.entry.Entry;
+import org.apache.directory.api.ldap.model.entry.Value;
+import org.apache.directory.api.ldap.model.message.Control;
+import org.apache.directory.api.ldap.model.message.SearchResultEntry;
import org.apache.directory.api.util.Strings;
import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
import org.apache.directory.shared.dsmlv2.DsmlControl;
import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
import org.apache.directory.shared.dsmlv2.reponse.SearchResponse;
import org.apache.directory.shared.dsmlv2.reponse.SearchResponseDsml;
-import org.apache.directory.shared.ldap.model.entry.Entry;
-import org.apache.directory.shared.ldap.model.entry.Attribute;
-import org.apache.directory.shared.ldap.model.entry.Value;
-import org.apache.directory.shared.ldap.model.message.Control;
-import org.apache.directory.shared.ldap.model.message.SearchResultEntry;
import org.junit.Test;
import org.junit.runner.RunWith;
Modified: directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.java?rev=1423968&r1=1423967&r2=1423968&view=diff
==============================================================================
--- directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.java (original)
+++ directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.java Wed Dec 19 17:24:08 2012
@@ -30,15 +30,15 @@ import static org.junit.Assert.fail;
import java.util.Collection;
import java.util.Map;
+import org.apache.directory.api.ldap.model.exception.LdapURLEncodingException;
+import org.apache.directory.api.ldap.model.message.Control;
+import org.apache.directory.api.ldap.model.message.SearchResultReference;
+import org.apache.directory.api.ldap.model.url.LdapUrl;
import org.apache.directory.api.util.Strings;
import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
import org.apache.directory.shared.dsmlv2.DsmlControl;
import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
import org.apache.directory.shared.dsmlv2.reponse.SearchResponse;
-import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
-import org.apache.directory.shared.ldap.model.message.Control;
-import org.apache.directory.shared.ldap.model.message.SearchResultReference;
-import org.apache.directory.shared.ldap.model.url.LdapUrl;
import org.junit.Test;
import org.junit.runner.RunWith;
Modified: directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/soap/SoapDsmlParsingTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/soap/SoapDsmlParsingTest.java?rev=1423968&r1=1423967&r2=1423968&view=diff
==============================================================================
--- directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/soap/SoapDsmlParsingTest.java (original)
+++ directory/shared/branches/shared-refact/dsml/parser/src/test/java/org/apache/directory/shared/dsmlv2/soap/SoapDsmlParsingTest.java Wed Dec 19 17:24:08 2012
@@ -26,9 +26,9 @@ import static org.junit.Assert.assertNul
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import org.apache.directory.api.ldap.model.message.SearchRequest;
import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
import org.apache.directory.shared.dsmlv2.request.BatchRequestDsml;
-import org.apache.directory.shared.ldap.model.message.SearchRequest;
import org.junit.Test;
Added: directory/shared/branches/shared-refact/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemChekerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-refact/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemChekerTest.java?rev=1423968&view=auto
==============================================================================
--- directory/shared/branches/shared-refact/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemChekerTest.java (added)
+++ directory/shared/branches/shared-refact/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemChekerTest.java Wed Dec 19 17:24:08 2012
@@ -0,0 +1,356 @@
+/*
+ * 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 org.apache.directory.api.ldap.aci;
+
+
+import static org.junit.Assert.fail;
+
+import java.text.ParseException;
+
+import org.apache.directory.api.ldap.model.schema.SchemaManager;
+import org.apache.directory.shared.ldap.aci.ACIItemChecker;
+import org.apache.directory.shared.ldap.schemaloader.JarLdifSchemaLoader;
+import org.apache.directory.shared.ldap.schemamanager.impl.DefaultSchemaManager;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+
+
+/**
+ * Unit tests class for ACIItem checker (wrapper).
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrency()
+public class ACIItemChekerTest
+{
+ /** the ACIItem checker wrapper */
+ static private ACIItemChecker checker;
+
+
+ /**
+ * Initialization
+ */
+ @BeforeClass
+ public static void init() throws Exception
+ {
+ JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
+ SchemaManager schemaManager = new DefaultSchemaManager( loader );
+ schemaManager.loadAllEnabled();
+
+ checker = new ACIItemChecker( schemaManager );
+ }
+
+
+ /**
+ * Tests the checker with an ACIItem of ItemFirst main component.
+ */
+ @Test
+ public void testItemFirst() throws Exception
+ {
+ String spec =
+ " { " +
+ " identificationTag \"id1\" , " +
+ " precedence 114 , " +
+ " authenticationLevel simple , " +
+ " itemOrUserFirst itemFirst :" +
+ " { " +
+ " protectedItems " +
+ " { " +
+ " entry , " +
+ " attributeType { 1.2.3 , ou } ," +
+ " attributeValue { ou=people , cn=Ersin } , " +
+ " rangeOfValues (cn=ErsinEr) , " +
+ " classes and : " +
+ " { " +
+ " item: xyz , " +
+ " or:{item:X,item:Y} " +
+ " }" +
+ " } , " +
+ " itemPermissions " +
+ " { " +
+ " { " +
+ " userClasses " +
+ " {" +
+ " allUsers , " +
+ " userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } ," +
+ " subtree { { base \"ou=people\" } } " +
+ " } , " +
+ " grantsAndDenials { denyCompare , grantModify } " +
+ " }," +
+ " { " +
+ " precedence 10, " +
+ " userClasses " +
+ " {" +
+ " allUsers , " +
+ " userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } ," +
+ " subtree { { base \"ou=people\" } } " +
+ " } , " +
+ " grantsAndDenials { denyCompare , grantModify } " +
+ " } " +
+ " } " +
+ " }" +
+ " }";
+
+ checker.parse( spec );
+ }
+
+
+ /**
+ * Tests the checker with an ACIItem of UserFirst main component.
+ */
+ @Test
+ public void testUserFirst() throws Exception
+ {
+ String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , "
+ + "itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, "
+ + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\","
+ + "minimum 1, maximum 2 } } } , "
+ + "userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue {cn=y,sn=n,dc=l} , "
+ + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } } } } ";
+
+ checker.parse( spec );
+ }
+
+
+ @Test
+ public void testAllowAddAllUsers() throws Exception
+ {
+ String spec = "{ identificationTag \"addAci\", " + "precedence 14, " + "authenticationLevel none, "
+ + "itemOrUserFirst userFirst: { " + "userClasses { allUsers }, "
+ + "userPermissions { { protectedItems {entry}, " + "grantsAndDenials { grantAdd } } } } }";
+
+ checker.parse( spec );
+ }
+
+
+ @Test
+ public void testCombo() throws Exception
+ {
+ String spec = "{ identificationTag \"addAci\", " + "precedence 14, " + "authenticationLevel none, "
+ + "itemOrUserFirst userFirst: { " + "userClasses { allUsers, name { \"ou=blah\" } }, "
+ + "userPermissions { { protectedItems {entry}, " + "grantsAndDenials { grantAdd } } } } }";
+
+ checker.parse( spec );
+ }
+
+
+ @Test
+ public void testOrderOfProtectedItemsDoesNotMatter() throws Exception
+ {
+ String spec = " { identificationTag \"id1\" , precedence 114 , authenticationLevel simple , "
+ + "itemOrUserFirst itemFirst :{ protectedItems { attributeType { 1.2.3 , ou }, entry , "
+ + " rangeOfValues (cn=ErsinEr) , attributeValue { ou=people , cn=Ersin },"
+ + "classes and : { item: xyz , or:{item:X,item:Y} }} , "
+ + "itemPermissions { { userClasses {allUsers , userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } "
+ + " , subtree { { base \"ou=people\" } } } , grantsAndDenials { denyCompare , grantModify } },"
+ + "{ precedence 10, userClasses {allUsers , userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } "
+ + " , subtree { { base \"ou=people\" } } } , grantsAndDenials { denyCompare , grantModify } } } }}";
+
+ checker.parse( spec );
+ }
+
+
+ @Test
+ public void testOrderOfUserClassesDoesNotMatter() throws Exception
+ {
+ String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , "
+ + "itemOrUserFirst userFirst: { userClasses { name { \"ou=people,cn=ersin\" }, allUsers, "
+ + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\","
+ + "minimum 1, maximum 2 } } } , "
+ + "userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue {dc=y,sn=n,dc=l} , "
+ + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } } } } ";
+
+ checker.parse( spec );
+ }
+
+
+ @Test
+ public void testItemPermissionComponentsOrderDoesNotMatter() throws Exception
+ {
+ String spec = " { identificationTag \"id1\" , precedence 114 , authenticationLevel simple , "
+ + "itemOrUserFirst itemFirst :{ protectedItems { attributeType { 1.2.3 , ou }, entry , "
+ + " rangeOfValues (cn=ErsinEr) , attributeValue { ou=people , cn=Ersin },"
+ + "classes and : { item: xyz , or:{item:X,item:Y} }} , "
+ + "itemPermissions { { grantsAndDenials { denyCompare , grantModify }, userClasses {allUsers , userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } "
+ + " , subtree { { base \"ou=people\" } } } },"
+ + "{ precedence 10, userClasses {allUsers , userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } "
+ + " , subtree { { base \"ou=people\" } } } , grantsAndDenials { denyCompare , grantModify } } } }}";
+
+ checker.parse( spec );
+ }
+
+
+ @Test
+ public void testUserPermissionComponentsOrderDoesNotMatter() throws Exception
+ {
+ String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , "
+ + "itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, "
+ + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\","
+ + "minimum 1, maximum 2 } } } , "
+ + "userPermissions { { grantsAndDenials { grantBrowse }, protectedItems{ entry , attributeType { cn , ou } , attributeValue {cn=y,sn=n,dc=l} , "
+ + "rangeOfValues (cn=ErsinEr) } } } } } ";
+
+ checker.parse( spec );
+ }
+
+
+ @Test
+ public void testOrderOfMainACIComponentsDoesNotMatter() throws Exception
+ {
+ String spec = "{ itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, "
+ + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\","
+ + "minimum 1, maximum 2 } } } , "
+ + "userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue {cn=y,sn=n,dc=l} , "
+ + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } } }, "
+ + " identificationTag \"id2\" , authenticationLevel none, precedence 14 } ";
+
+ checker.parse( spec );
+ }
+
+
+ @Test
+ public void testRestrictedValueComponentsOrderDoesNotMatter() throws Exception
+ {
+ String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , "
+ + "itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, "
+ + "subtree {{ base \"ou=system\"}, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , "
+ + "userPermissions { { protectedItems{ entry , "
+ + "maxValueCount { { type 10.11.12, maxCount 10 }, { maxCount 20, type 11.12.13 } } "
+ + " } , grantsAndDenials { grantBrowse } } } } } ";
+
+ checker.parse( spec );
+ }
+
+
+ @Test
+ public void testMaxValueCountComponentsOrderDoesNotMatter() throws Exception
+ {
+ String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , "
+ + "itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, "
+ + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , "
+ + "userPermissions { { protectedItems{ entry , "
+ + "restrictedBy { { type 10.11.12, valuesIn ou }, { valuesIn cn, type 11.12.13 } } "
+ + " } , grantsAndDenials { grantBrowse } } } } } ";
+
+ checker.parse( spec );
+ }
+
+
+ /**
+ * Test case for DIRSERVER-891
+ */
+ @Test
+ public void testInvalidAttributeValue()
+ {
+ String spec;
+
+ // no name-value-pair
+ spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , "
+ + "itemOrUserFirst userFirst: { userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue { must_be_a_name_value_pair } , "
+ + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } }, userClasses { allUsers , name { \"ou=people,cn=ersin\" }, "
+ + "subtree {{ minimum 7, maximum 9, base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\","
+ + " maximum 2, minimum 1 } } } } } ";
+ try
+ {
+ checker.parse( spec );
+ fail( "Expected ParseException, invalid protected item 'attributeValue { must_be_a_name_value_pair }'" );
+ }
+ catch ( ParseException e )
+ {
+ // Expected
+ }
+
+ // no name-value-pair
+ spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , "
+ + "itemOrUserFirst userFirst: { userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue { x=y,m=n,k=l,x } , "
+ + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } }, userClasses { allUsers , name { \"ou=people,cn=ersin\" }, "
+ + "subtree {{ minimum 7, maximum 9, base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\","
+ + " maximum 2, minimum 1 } } } } } ";
+ try
+ {
+ checker.parse( spec );
+ fail( "Expected ParseException, invalid protected item 'attributeValue { must_be_a_name_value_pair }'" );
+ }
+ catch ( ParseException e )
+ {
+ // Expected
+ }
+ }
+
+
+ /**
+ * Test case for DIRSERVER-891
+ */
+ @Test
+ public void testIncomplete()
+ {
+ String spec;
+
+ spec = "{ }";
+ try
+ {
+ checker.parse( spec );
+ fail( "Expected ParseException, ACIItem is incomplete'" );
+ }
+ catch ( ParseException e )
+ {
+ // Expected
+ }
+
+ spec = "{ identificationTag \"id2\" }";
+ try
+ {
+ checker.parse( spec );
+ fail( "Expected ParseException, ACIItem is incomplete'" );
+ }
+ catch ( ParseException e )
+ {
+ // Expected
+ }
+
+ spec = "{ identificationTag \"id2\", precedence 14 } ";
+ try
+ {
+ checker.parse( spec );
+ fail( "Expected ParseException, ACIItem is incomplete'" );
+ }
+ catch ( ParseException e )
+ {
+ // Expected
+ }
+
+ spec = "{ identificationTag \"id2\", precedence 14, authenticationLevel none } ";
+ try
+ {
+ checker.parse( spec );
+ fail( "Expected ParseException, ACIItem is incomplete'" );
+ }
+ catch ( ParseException e )
+ {
+ // Expected
+ }
+ }
+}
Propchange: directory/shared/branches/shared-refact/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemChekerTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: directory/shared/branches/shared-refact/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-refact/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemParserTest.java?rev=1423968&view=auto
==============================================================================
--- directory/shared/branches/shared-refact/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemParserTest.java (added)
+++ directory/shared/branches/shared-refact/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemParserTest.java Wed Dec 19 17:24:08 2012
@@ -0,0 +1,871 @@
+/*
+ * 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 org.apache.directory.api.ldap.aci;
+
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.text.ParseException;
+
+import org.apache.directory.api.ldap.model.schema.SchemaManager;
+import org.apache.directory.shared.ldap.aci.ACIItem;
+import org.apache.directory.shared.ldap.aci.ACIItemParser;
+import org.apache.directory.shared.ldap.aci.UserFirstACIItem;
+import org.apache.directory.shared.ldap.aci.UserPermission;
+import org.apache.directory.shared.ldap.schemaloader.JarLdifSchemaLoader;
+import org.apache.directory.shared.ldap.schemamanager.impl.DefaultSchemaManager;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+
+
+/**
+ * Unit tests class for ACIItem parser (wrapper).
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrency()
+public class ACIItemParserTest
+{
+
+ /** the ACIItem parser wrapper */
+ private static ACIItemParser parser;
+
+
+ /**
+ * Initialization
+ */
+ @BeforeClass
+ public static void init() throws Exception
+ {
+ JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
+ SchemaManager schemaManager = new DefaultSchemaManager( loader );
+ schemaManager.loadAllEnabled();
+
+ parser = new ACIItemParser( schemaManager );
+ }
+
+
+ private void checkItemToString( String spec, ACIItem item ) throws Exception
+ {
+ // try to parse the result of item.toString() again
+ parser.parse( item.toString() );
+ }
+
+
+ /**
+ * Tests the parser with a rangeOfValues with a nested filter.
+ */
+ @Test
+ public void testRangeOfValues() throws Exception
+ {
+ String spec = " { identificationTag \"id1\" , precedence 114 , authenticationLevel simple , "
+ + "itemOrUserFirst itemFirst :{ protectedItems "
+ + "{ rangeOfValues (&(&(|(|(cn=ccc)(!(cn=ddd))(&(cn=aaa)(cn=bbb)))))) " + "} , itemPermissions { } } }";
+
+ ACIItem item = parser.parse( spec );
+ checkItemToString( spec, item );
+
+ spec = " { identificationTag \"id8\", precedence 0, authenticationLevel simple "
+ + ", itemOrUserFirst userFirst: { userClasses { allUsers }, userPermissions { "
+ + " { protectedItems { rangeOfValues (&(cn=test)(sn=test)) }, grantsAndDenials { grantAdd } }, "
+ + "{ protectedItems { rangeOfValues (|(!(cn=aaa))(sn=bbb)) }, grantsAndDenials { grantAdd } } "
+ + " } } }";
+
+ item = parser.parse( spec );
+ checkItemToString( spec, item );
+ }
+
+
+ /**
+ * Tests the parser with an ACIItem of ItemFirst main component.
+ */
+ @Test
+ public void testItemFirst() throws Exception
+ {
+ String spec =
+ "{ " +
+ " identificationTag \"id1\" , " +
+ " precedence 114 , " +
+ " authenticationLevel simple , " +
+ " itemOrUserFirst itemFirst :" +
+ " { " +
+ " protectedItems { entry , attributeType { 2.5.4.3 , ou } , " +
+ " attributeValue { ou=people , cn=Ersin } , " +
+ " rangeOfValues (cn=ErsinEr) , " +
+ " classes and : { item: xyz , or:{item:X,item:Y} }" +
+ " } , " +
+ " itemPermissions " +
+ " { " +
+ " { " +
+ " userClasses " +
+ " {" +
+ " allUsers , " +
+ " userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } , " +
+ " subtree { { base \"ou=people\" } } " +
+ " } , " +
+ " grantsAndDenials { denyCompare , grantModify } " +
+ " }," +
+ " { " +
+ " precedence 10, " +
+ " userClasses " +
+ " {" +
+ " allUsers , " +
+ " userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } ," +
+ " subtree { { base \"ou=people\" } } " +
+ " } , " +
+ " grantsAndDenials { denyCompare , grantModify } } " +
+ " } " +
+ " }" +
+ "}";
+
+ ACIItem item = parser.parse( spec );
+ checkItemToString( spec, item );
+ }
+
+
+ /**
+ * Tests the parser with an ACIItem of UserFirst main component.
+ */
+ @Test
+ public void testUserFirst() throws Exception
+ {
+ String spec =
+ "{ " +
+ " identificationTag \"id2\" , " +
+ " precedence 14, " +
+ " authenticationLevel none , " +
+ " itemOrUserFirst userFirst: " +
+ " { " +
+ " userClasses " +
+ " { " +
+ " allUsers , " +
+ " name { \"ou=people,cn=ersin\" }, " +
+ " subtree " +
+ " {" +
+ " { base \"ou=system\" }, " +
+ " { " +
+ " base \"ou=ORGANIZATIONUNIT\"," +
+ " minimum 1, " +
+ " maximum 2 " +
+ " } " +
+ " } " +
+ " } , " +
+ " userPermissions " +
+ " { " +
+ " { " +
+ " protectedItems" +
+ " { " +
+ " entry , " +
+ " attributeType { cn , ou } , " +
+ " attributeValue {cn=y,sn=n,dc=l} , " +
+ " rangeOfValues (cn=ErsinEr) " +
+ " } , " +
+ " grantsAndDenials { grantBrowse } " +
+ " } " +
+ " } " +
+ " } " +
+ "} ";
+
+ ACIItem item = parser.parse( spec );
+ checkItemToString( spec, item );
+ }
+
+
+ @Test
+ public void testAllowAddAllUsers() throws Exception
+ {
+ String spec = "{ identificationTag \"addAci\", " + "precedence 14, " + "authenticationLevel none, "
+ + "itemOrUserFirst userFirst: { " + "userClasses { allUsers }, "
+ + "userPermissions { { protectedItems {entry}, " + "grantsAndDenials { grantAdd } } } } }";
+
+ ACIItem item = parser.parse( spec );
+ checkItemToString( spec, item );
+ }
+
+
+ @Test
+ public void testCombo() throws Exception
+ {
+ String spec = "{ identificationTag \"addAci\", " + "precedence 14, " + "authenticationLevel none, "
+ + "itemOrUserFirst userFirst: { " + "userClasses { allUsers, name { \"ou=blah\" } }, "
+ + "userPermissions { { protectedItems {entry}, " + "grantsAndDenials { grantAdd } } } } }";
+
+ ACIItem item = parser.parse( spec );
+ checkItemToString( spec, item );
+ }
+
+
+ @Test
+ public void testOrderOfProtectedItemsDoesNotMatter() throws Exception
+ {
+ String spec =
+ " { " +
+ " identificationTag \"id1\" , " +
+ " precedence 114 , " +
+ " authenticationLevel simple , " +
+ " itemOrUserFirst itemFirst :" +
+ " { " +
+ " protectedItems " +
+ " { " +
+ " attributeType { 2.5.4.3 , ou }, " +
+ " entry , " +
+ " rangeOfValues (cn=ErsinEr) , " +
+ " attributeValue { ou=people , cn=Ersin }," +
+ " classes and : " +
+ " { item: xyz , or:{item:X,item:Y} }" +
+ " } , " +
+ " itemPermissions " +
+ " { " +
+ " { " +
+ " userClasses " +
+ " {" +
+ " allUsers , " +
+ " userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,sn=d\" } " +
+ " , " +
+ " subtree " +
+ " { " +
+ " { base \"ou=people\" } " +
+ " } " +
+ " } , " +
+ " grantsAndDenials " +
+ " { " +
+ " denyCompare , " +
+ " grantModify " +
+ " } " +
+ " }," +
+ " { " +
+ " precedence 10, " +
+ " userClasses " +
+ " {" +
+ " allUsers , " +
+ " userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } " +
+ " , subtree { { base \"ou=people\" } } " +
+ " } , " +
+ " grantsAndDenials { denyCompare , grantModify } " +
+ " } " +
+ " } " +
+ " }" +
+ " }";
+
+ ACIItem item = parser.parse( spec );
+ checkItemToString( spec, item );
+ }
+
+
+ @Test
+ public void testOrderOfUserClassesDoesNotMatter() throws Exception
+ {
+ String spec =
+ "{ " +
+ " identificationTag \"id2\" , " +
+ " precedence 14, " +
+ " authenticationLevel none , " +
+ " itemOrUserFirst userFirst: " +
+ " { " +
+ " userClasses " +
+ " { " +
+ " name { \"ou=people,cn=ersin\" }, " +
+ " allUsers, " +
+ " subtree " +
+ " {" +
+ " { base \"ou=system\" }, " +
+ " { " +
+ " base \"ou=ORGANIZATIONUNIT\"," +
+ " minimum 1, " +
+ " maximum 2 " +
+ " } " +
+ " } " +
+ " } , " +
+ " userPermissions " +
+ " { " +
+ " { " +
+ " protectedItems" +
+ " { " +
+ " entry , " +
+ " attributeType { cn , ou } , " +
+ " attributeValue {cn=y,sn=n,dc=l} , " +
+ " rangeOfValues (cn=ErsinEr) " +
+ " } , " +
+ " grantsAndDenials { grantBrowse } " +
+ " } " +
+ " } " +
+ " } " +
+ "}";
+
+ ACIItem item = parser.parse( spec );
+ checkItemToString( spec, item );
+ }
+
+
+ @Test
+ public void testOrderOfProtectedItemsDoesNotMatterButDuplicatesMatter() throws Exception
+ {
+ String spec = " { identificationTag \"id1\" , precedence 114 , authenticationLevel simple , "
+ + "itemOrUserFirst itemFirst :{ protectedItems { attributeType { 1.2.3 , ou }, entry, entry , "
+ + " rangeOfValues (cn=ErsinEr) , attributeValue { ou=people , cn=Ersin },"
+ + "classes and : { item: xyz , or:{item:X,item:Y} }} , "
+ + "itemPermissions { { userClasses {allUsers , userGroup { \"1.2=y,z=t\" , \"a=b,c=d\" } "
+ + " , subtree { { base \"ou=people\" } } } , grantsAndDenials { denyCompare , grantModify } },"
+ + "{ precedence 10, userClasses {allUsers , userGroup { \"1.2=y,z=t\" , \"a=b,c=d\" } "
+ + " , subtree { { base \"ou=people\" } } } , grantsAndDenials { denyCompare , grantModify } } } }}";
+
+ try
+ {
+ parser.parse( spec );
+ fail( "testItemFirstOrderOfProtectedItemsDoesNotMatterButDuplicatesMatter() should not have run this line." );
+ }
+ catch ( ParseException e )
+ {
+ assertNotNull( e );
+ }
+ }
+
+
+ @Test
+ public void testOrderOfUserClassesDoesNotMatterButDuplicatesMatter() throws Exception
+ {
+ String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , "
+ + "itemOrUserFirst userFirst: { userClasses { name { \"ou=people,cn=ersin\" }, allUsers, allUsers, "
+ + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\","
+ + "minimum 1, maximum 2 } } } , "
+ + "userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue {x=y,m=n,k=l} , "
+ + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } } } } ";
+
+ try
+ {
+ parser.parse( spec );
+ fail( "testUserFirstOrderOfUserClassesDoesNotMatterButDuplicatesMatter() should not have run this line." );
+ }
+ catch ( ParseException e )
+ {
+ assertNotNull( e );
+ }
+ }
+
+
+ @Test
+ public void testItemPermissionComponentsOrderDoesNotMatter() throws Exception
+ {
+ String spec =
+ " { " +
+ " identificationTag \"id1\" , " +
+ " precedence 114 , " +
+ " authenticationLevel simple , " +
+ " itemOrUserFirst itemFirst :" +
+ " { " +
+ " protectedItems " +
+ " { " +
+ " attributeType { 2.5.4.3 , ou }, " +
+ " entry , " +
+ " rangeOfValues (cn=ErsinEr) , " +
+ " attributeValue { ou=people , cn=Ersin }," +
+ " classes and : { item: xyz , or:{item:X,item:Y} }" +
+ " } , " +
+ " itemPermissions " +
+ " { " +
+ " { " +
+ " grantsAndDenials " +
+ " { " +
+ " denyCompare , grantModify " +
+ " }, " +
+ " userClasses " +
+ " {" +
+ " allUsers , " +
+ " userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } " +
+ " , subtree { { base \"ou=people\" } } " +
+ " } " +
+ " }," +
+ " { " +
+ " precedence 10, " +
+ " userClasses " +
+ " {" +
+ " allUsers , " +
+ " userGroup { \"2.5.4.3=y,dc=t\" , \"cn=b,dc=d\" } " +
+ " , subtree { { base \"ou=people\" } } " +
+ " } , " +
+ " grantsAndDenials { denyCompare , grantModify } " +
+ " } " +
+ " } " +
+ " }" +
+ " }";
+
+ ACIItem item = parser.parse( spec );
+ checkItemToString( spec, item );
+ }
+
+
+ @Test
+ public void testItemPermissionComponentsOrderDoesNotMatterButDuplicatesMatter() throws Exception
+ {
+ String spec = " { identificationTag \"id1\" , precedence 114 , authenticationLevel simple , "
+ + "itemOrUserFirst itemFirst :{ protectedItems { attributeType { 1.2.3 , ou }, entry , "
+ + " rangeOfValues (cn=ErsinEr) , attributeValue { ou=people , cn=Ersin },"
+ + "classes and : { item: xyz , or:{item:X,item:Y} }} , "
+ + "itemPermissions { { userClasses {allUsers , userGroup { \"1.2=y,z=t\" , \"a=b,c=d\" } "
+ + " , subtree { { base \"ou=people\" } } }, grantsAndDenials { denyCompare , grantModify }, userClasses {allUsers , userGroup { \"1.2=y,z=t\" , \"a=b,c=d\" } "
+ + " , subtree { { base \"ou=people\" } } } },"
+ + "{ precedence 10, userClasses {allUsers , userGroup { \"1.2=y,z=t\" , \"a=b,c=d\" } "
+ + " , subtree { { base \"ou=people\" } } } , grantsAndDenials { denyCompare , grantModify } } } }}";
+
+ try
+ {
+ parser.parse( spec );
+ fail( "testItemPermissionComponentsOrderDoesNotMatterButDuplicatesMatter() should not have run this line." );
+ }
+ catch ( ParseException e )
+ {
+ assertNotNull( e );
+ }
+ }
+
+
+ @Test
+ public void testUserPermissionComponentsOrderDoesNotMatter() throws Exception
+ {
+ String spec =
+ "{ " +
+ " identificationTag \"id2\" , " +
+ " precedence 14, " +
+ " authenticationLevel none , " +
+ " itemOrUserFirst userFirst: " +
+ " { " +
+ " userClasses " +
+ " { " +
+ " allUsers , " +
+ " name { \"ou=people,cn=ersin\" }, " +
+ " subtree " +
+ " {" +
+ " { base \"ou=system\" }, " +
+ " { " +
+ " base \"ou=ORGANIZATIONUNIT\"," +
+ " minimum 1, " +
+ " maximum 2 " +
+ " } " +
+ " } " +
+ " } , " +
+ " userPermissions " +
+ " { " +
+ " { " +
+ " grantsAndDenials { grantBrowse }, " +
+ " protectedItems" +
+ " { " +
+ " entry , " +
+ " attributeType { cn , ou } , " +
+ " attributeValue {cn=y,sn=n,dc=l} , " +
+ " rangeOfValues (cn=ErsinEr) " +
+ " } " +
+ " } " +
+ " } " +
+ " } " +
+ "} ";
+
+ ACIItem item = parser.parse( spec );
+ checkItemToString( spec, item );
+ }
+
+
+ @Test
+ public void testUserPermissionComponentsOrderDoesNotMatterButDuplicatesMatter() throws Exception
+ {
+ String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , "
+ + "itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, "
+ + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\","
+ + "minimum 1, maximum 2 } } } , "
+ + "userPermissions { { grantsAndDenials { grantBrowse }, grantsAndDenials { grantBrowse }, protectedItems{ entry , attributeType { cn , ou } , attributeValue {x=y,m=n,k=l} , "
+ + "rangeOfValues (cn=ErsinEr) } } } } } ";
+
+ try
+ {
+ parser.parse( spec );
+ fail( "testUserPermissionComponentsOrderDoesNotMatterButDuplicatesMatter() should not have run this line." );
+ }
+ catch ( ParseException e )
+ {
+ assertNotNull( e );
+ }
+ }
+
+
+ @Test
+ public void testOrderOfMainACIComponentsDoesNotMatter() throws Exception
+ {
+ String spec =
+ "{ " +
+ " itemOrUserFirst userFirst: " +
+ " { " +
+ " userClasses " +
+ " { " +
+ " allUsers , " +
+ " name { \"ou=people,cn=ersin\" }, " +
+ " subtree " +
+ " {" +
+ " { base \"ou=system\" }, " +
+ " { " +
+ " base \"ou=ORGANIZATIONUNIT\"," +
+ " minimum 1, " +
+ " maximum 2 " +
+ " } " +
+ " } " +
+ " } , " +
+ " userPermissions " +
+ " { " +
+ " { " +
+ " protectedItems" +
+ " { " +
+ " entry , " +
+ " attributeType { cn , ou } , " +
+ " attributeValue {cn=y,sn=n,dc=l} , " +
+ " rangeOfValues (cn=ErsinEr) " +
+ " } , " +
+ " grantsAndDenials { grantBrowse } " +
+ " } " +
+ " } " +
+ " }, " +
+ " identificationTag \"id2\" , " +
+ " authenticationLevel none, " +
+ " precedence 14 " +
+ "} ";
+
+ ACIItem item = parser.parse( spec );
+ checkItemToString( spec, item );
+ }
+
+
+ @Test
+ public void testOrderOfMainACIComponentsDoesNotMatterButDuplicatesMatter() throws Exception
+ {
+ String spec = "{ itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, "
+ + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\","
+ + "minimum 1, maximum 2 } } } , "
+ + "userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue {x=y,m=n,k=l} , "
+ + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } } }, "
+ + " identificationTag \"id2\" , authenticationLevel none, authenticationLevel simple, precedence 14 } ";
+
+ try
+ {
+ parser.parse( spec );
+ fail( "testOrderOfMainACIComponentsDoesNotMatterButDuplicatesMatter() should not have run this line." );
+ }
+ catch ( ParseException e )
+ {
+ assertNotNull( e );
+ }
+ }
+
+
+ @Test
+ public void testOrderOfMainACIComponentsDoesNotMatterButMissingsMatter() throws Exception
+ {
+ String spec = "{ itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, "
+ + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\","
+ + "minimum 1, maximum 2 } } } , "
+ + "userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue {x=y,m=n,k=l} , "
+ + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } } }, "
+ + " identificationTag \"id2\" , precedence 14 } ";
+
+ try
+ {
+ parser.parse( spec );
+ fail( "testOrderOfMainACIComponentsDoesNotMatterButMissingsMatter() should not have run this line." );
+ }
+ catch ( ParseException e )
+ {
+ assertNotNull( e );
+ }
+ }
+
+
+ @Test
+ public void testGrantAndDenialBitsOrderDoesNotMatterButDuplicatesMatter() throws Exception
+ {
+ String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , "
+ + "itemOrUserFirst userFirst: { userClasses { allUsers } , "
+ + "userPermissions { { protectedItems{ entry } , grantsAndDenials { grantBrowse, grantInvoke, denyAdd, grantBrowse } } } } }";
+
+ try
+ {
+ parser.parse( spec );
+ fail( "testGrantAndDenialBitsOrderDoesNotMatterButDuplicatesMatter() should not have run this line." );
+ }
+ catch ( ParseException e )
+ {
+ assertNotNull( e );
+ }
+ }
+
+
+ @Test
+ public void testMaxValueCountComponentsOrderDoesNotMatter() throws Exception
+ {
+ String spec =
+ "{ " +
+ " identificationTag \"id2\" , " +
+ " precedence 14, " +
+ " authenticationLevel none , " +
+ " itemOrUserFirst userFirst: " +
+ " { " +
+ " userClasses " +
+ " { " +
+ " allUsers , " +
+ " name { \"ou=people,cn=ersin\" }, " +
+ " subtree " +
+ " {" +
+ " { base \"ou=system\"}, " +
+ " { base \"ou=ORGANIZATIONUNIT\", minimum 1, maximum 2 } " +
+ " } " +
+ " } , " +
+ " userPermissions " +
+ " { " +
+ " { " +
+ " protectedItems" +
+ " { " +
+ " entry , " +
+ " maxValueCount " +
+ " { " +
+ " { type 2.5.4.3, maxCount 10 }, " +
+ " { maxCount 20, type 2.5.4.3 } " +
+ " } " +
+ " } , " +
+ " grantsAndDenials { grantBrowse } " +
+ " } " +
+ " } " +
+ " } " +
+ "} ";
+
+ ACIItem item = parser.parse( spec );
+ checkItemToString( spec, item );
+ }
+
+
+ @Test
+ public void testRestrictedValueComponentsOrderDoesNotMatter() throws Exception
+ {
+ String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , "
+ + "itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, "
+ + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , "
+ + "userPermissions { { protectedItems{ entry , "
+ + "restrictedBy { { type 2.5.4.3, valuesIn ou }, { valuesIn cn, type 2.5.4.3 } } "
+ + " } , grantsAndDenials { grantBrowse } } } } } ";
+
+ ACIItem item = parser.parse( spec );
+ checkItemToString( spec, item );
+ }
+
+
+ @Test
+ public void testMaxImmSubComponentsOrderDoesNotMatter() throws Exception
+ {
+ String spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , "
+ + "itemOrUserFirst userFirst: { userClasses { allUsers , name { \"ou=people,cn=ersin\" }, "
+ + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\"," + "minimum 1, maximum 2 } } } , "
+ + "userPermissions { { protectedItems{ entry , maxImmSub 5 "
+ + " } , grantsAndDenials { grantBrowse } } } } } ";
+
+ ACIItem item = parser.parse( spec );
+ checkItemToString( spec, item );
+ }
+
+
+ /**
+ * Test case for DIRSERVER-891
+ */
+ @Test
+ public void testInvalidAttributeValue()
+ {
+ String spec;
+
+ // no name-value-pair
+ spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , "
+ + "itemOrUserFirst userFirst: { userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue { must_be_a_name_value_pair } , "
+ + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } }, userClasses { allUsers , name { \"ou=people,cn=ersin\" }, "
+ + "subtree {{ minimum 7, maximum 9, base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\","
+ + " maximum 2, minimum 1 } } } } } ";
+ try
+ {
+ parser.parse( spec );
+ fail( "Expected ParseException, invalid protected item 'attributeValue { must_be_a_name_value_pair }'" );
+ }
+ catch ( ParseException e )
+ {
+ // Expected
+ }
+
+ // no name-value-pair
+ spec = "{ identificationTag \"id2\" , precedence 14, authenticationLevel none , "
+ + "itemOrUserFirst userFirst: { userPermissions { { protectedItems{ entry , attributeType { cn , ou } , attributeValue { x=y,m=n,k=l,x } , "
+ + "rangeOfValues (cn=ErsinEr) } , grantsAndDenials { grantBrowse } } }, userClasses { allUsers , name { \"ou=people,cn=ersin\" }, "
+ + "subtree {{ minimum 7, maximum 9, base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\","
+ + " maximum 2, minimum 1 } } } } } ";
+ try
+ {
+ parser.parse( spec );
+ fail( "Expected ParseException, invalid protected item 'attributeValue { x=y,m=n,k=l,x }'" );
+ }
+ catch ( ParseException e )
+ {
+ // Expected
+ }
+ }
+
+
+ @Test
+ public void testUserClassParentOfEntry() throws Exception
+ {
+ String spec =
+ "{ " +
+ " identificationTag \"id\" , " +
+ " precedence 10, " +
+ " authenticationLevel none , " +
+ " itemOrUserFirst userFirst: " +
+ " { " +
+ " userClasses " +
+ " { " +
+ " parentOfEntry , " +
+ " name { \"cn=ersin,ou=people\" }, " +
+ " subtree " +
+ " {" +
+ " { base \"ou=system\" }, " +
+ " { " +
+ " base \"ou=ORGANIZATIONUNIT\"," +
+ " minimum 1, " +
+ " maximum 2 " +
+ " } " +
+ " } " +
+ " } , " +
+ " userPermissions " +
+ " { " +
+ " { " +
+ " protectedItems" +
+ " { " +
+ " entry , " +
+ " attributeType { cn , ou } , " +
+ " attributeValue {cn=y,sn=n,dc=l} , " +
+ " rangeOfValues (cn=ErsinEr) " +
+ " } , " +
+ " grantsAndDenials { grantBrowse } " +
+ " } " +
+ " } " +
+ " } " +
+ "} ";
+
+ ACIItem item = parser.parse( spec );
+ checkItemToString( spec, item );
+ }
+
+
+ /**
+ * Test case for DIRSTUDIO-440
+ */
+ @Test
+ public void testPrecedenceOfUserFirst() throws Exception
+ {
+ String spec = "{ identificationTag \"test\", precedence 14, authenticationLevel simple, "
+ + "itemOrUserFirst userFirst: { userClasses { allUsers }, userPermissions { { "
+ + "precedence 1, protectedItems { attributeType { userPassword } }, grantsAndDenials "
+ + "{ denyRead, denyReturnDN, denyBrowse } }, { precedence 2, protectedItems "
+ + "{ entry, allUserAttributeTypesAndValues }, grantsAndDenials "
+ + "{ grantReturnDN, grantRead, grantBrowse } } } } }";
+
+ ACIItem item = parser.parse( spec );
+ checkItemToString( spec, item );
+
+ UserFirstACIItem userFirstItem = ( UserFirstACIItem ) item;
+ int aciPrecedence = userFirstItem.getPrecedence();
+ assertEquals( 14, aciPrecedence );
+ for ( UserPermission permission : userFirstItem.getUserPermission() )
+ {
+ int precedence = permission.getPrecedence();
+ if ( precedence == 1 )
+ {
+ assertEquals( 1, precedence );
+ }
+ else if ( precedence == 2 )
+ {
+ assertEquals( 2, precedence );
+ }
+ else
+ {
+ fail( "Got precedence " + precedence + ", expected precedence 1 or 2." );
+ }
+ }
+ }
+
+
+ /**
+ * Test case for DIRSERVER-891
+ */
+ @Test
+ public void testIncomplete()
+ {
+ String spec;
+
+ spec = "{ }";
+ try
+ {
+ parser.parse( spec );
+ fail( "Expected ParseException, ACIItem is incomplete'" );
+ }
+ catch ( ParseException e )
+ {
+ // Expected
+ }
+
+ spec = "{ identificationTag \"id2\" }";
+ try
+ {
+ parser.parse( spec );
+ fail( "Expected ParseException, ACIItem is incomplete'" );
+ }
+ catch ( ParseException e )
+ {
+ // Expected
+ }
+
+ spec = "{ identificationTag \"id2\", precedence 14 } ";
+ try
+ {
+ parser.parse( spec );
+ fail( "Expected ParseException, ACIItem is incomplete'" );
+ }
+ catch ( ParseException e )
+ {
+ // Expected
+ }
+
+ spec = "{ identificationTag \"id2\", precedence 14, authenticationLevel none } ";
+ try
+ {
+ parser.parse( spec );
+ fail( "Expected ParseException, ACIItem is incomplete'" );
+ }
+ catch ( ParseException e )
+ {
+ // Expected
+ }
+ }
+}
Propchange: directory/shared/branches/shared-refact/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemParserTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: directory/shared/branches/shared-refact/integ/src/test/java/org/apache/directory/api/ldap/codec/api/DefaultLdapCodecServiceTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-refact/integ/src/test/java/org/apache/directory/api/ldap/codec/api/DefaultLdapCodecServiceTest.java?rev=1423968&view=auto
==============================================================================
--- directory/shared/branches/shared-refact/integ/src/test/java/org/apache/directory/api/ldap/codec/api/DefaultLdapCodecServiceTest.java (added)
+++ directory/shared/branches/shared-refact/integ/src/test/java/org/apache/directory/api/ldap/codec/api/DefaultLdapCodecServiceTest.java Wed Dec 19 17:24:08 2012
@@ -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 org.apache.directory.api.ldap.codec.api;
+
+
+import org.junit.Test;
+
+
+/**
+ * Tests for StandaloneLdapCodecService.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class DefaultLdapCodecServiceTest
+{
+ /**
+ * In situ OSGi test run.
+ */
+ @Test
+ public void testLoadingExtras()
+ {
+ }
+}
Propchange: directory/shared/branches/shared-refact/integ/src/test/java/org/apache/directory/api/ldap/codec/api/DefaultLdapCodecServiceTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: directory/shared/branches/shared-refact/integ/src/test/java/org/apache/directory/api/ldap/codec/api/StandaloneLdapCodecServiceTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-refact/integ/src/test/java/org/apache/directory/api/ldap/codec/api/StandaloneLdapCodecServiceTest.java?rev=1423968&view=auto
==============================================================================
--- directory/shared/branches/shared-refact/integ/src/test/java/org/apache/directory/api/ldap/codec/api/StandaloneLdapCodecServiceTest.java (added)
+++ directory/shared/branches/shared-refact/integ/src/test/java/org/apache/directory/api/ldap/codec/api/StandaloneLdapCodecServiceTest.java Wed Dec 19 17:24:08 2012
@@ -0,0 +1,111 @@
+/*
+ * 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 org.apache.directory.api.ldap.codec.api;
+
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.directory.api.ldap.model.message.Control;
+import org.apache.directory.api.util.Strings;
+import org.apache.directory.shared.ldap.codec.api.CodecControl;
+import org.apache.directory.shared.ldap.codec.api.LdapApiService;
+import org.apache.directory.shared.ldap.codec.api.LdapApiServiceFactory;
+import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapApiService;
+import org.apache.directory.shared.ldap.extras.controls.ppolicy.PasswordPolicy;
+import org.apache.directory.shared.ldap.extras.extended.StoredProcedureRequest;
+import org.apache.directory.shared.ldap.extras.extended.StoredProcedureRequestImpl;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+/**
+ * Tests for StandaloneLdapCodecService.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StandaloneLdapCodecServiceTest
+{
+ @BeforeClass
+ public static void setupLdapApiService() throws Exception
+ {
+ // Load the extension points
+ System.setProperty( StandaloneLdapApiService.DEFAULT_CONTROLS_LIST,
+ "org.apache.directory.shared.ldap.codec.controls.cascade.CascadeFactory," +
+ "org.apache.directory.shared.ldap.codec.controls.manageDsaIT.ManageDsaITFactory," +
+ "org.apache.directory.shared.ldap.codec.controls.search.entryChange.EntryChangeFactory," +
+ "org.apache.directory.shared.ldap.codec.controls.search.pagedSearch.PagedResultsFactory," +
+ "org.apache.directory.shared.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory," +
+ "org.apache.directory.shared.ldap.codec.controls.search.subentries.SubentriesFactory" );
+
+ System.setProperty( StandaloneLdapApiService.EXTRA_CONTROLS_LIST,
+ "org.apache.directory.shared.ldap.extras.controls.ppolicy_impl.PasswordPolicyFactory," +
+ "org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncDoneValueFactory," +
+ "org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncInfoValueFactory," +
+ "org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory," +
+ "org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory" );
+
+ System.setProperty( StandaloneLdapApiService.DEFAULT_EXTENDED_OPERATION_REQUESTS_LIST,
+ "org.apache.directory.shared.ldap.extras.extended.ads_impl.cancel.CancelFactory," +
+ "org.apache.directory.shared.ldap.extras.extended.ads_impl.certGeneration.CertGenerationFactory," +
+ "org.apache.directory.shared.ldap.extras.extended.ads_impl.gracefulShutdown.GracefulShutdownFactory," +
+ "org.apache.directory.shared.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory" );
+
+ System.setProperty( StandaloneLdapApiService.DEFAULT_EXTENDED_OPERATION_RESPONSES_LIST,
+ "org.apache.directory.shared.ldap.extras.extended.ads_impl.gracefulDisconnect.GracefulDisconnectFactory" );
+
+ System.setProperty( StandaloneLdapApiService.EXTRA_EXTENDED_OPERATION_LIST, "" );
+ }
+
+
+ /**
+ * Test method for {@link org.apache.directory.api.ldap.codec.standalone.StandaloneLdapCodecService#StandaloneLdapCodecService()}.
+ */
+ @Test
+ public void testLoadingExtras() throws Exception
+ {
+ LdapApiService codec = LdapApiServiceFactory.getSingleton();
+
+ assertTrue( codec.isControlRegistered( PasswordPolicy.OID ) );
+
+ CodecControl<? extends Control> control = codec.newControl( PasswordPolicy.OID );
+ assertNotNull( control );
+ assertNotNull( codec );
+ }
+
+
+ /**
+ * Test an extended operation.
+ */
+ @Test
+ public void testLoadingExtendedOperation() throws Exception
+ {
+ LdapApiService codec = LdapApiServiceFactory.getSingleton();
+ StoredProcedureRequest req = new StoredProcedureRequestImpl();
+ req.setLanguage( "Java" );
+ req.setProcedure( Strings.getBytesUtf8( "bogusProc" ) );
+
+ assertNotNull( req );
+ assertNotNull( codec );
+
+ StoredProcedureRequest decorator = ( StoredProcedureRequest ) codec.decorate( req );
+ assertNotNull( decorator );
+ }
+}
Propchange: directory/shared/branches/shared-refact/integ/src/test/java/org/apache/directory/api/ldap/codec/api/StandaloneLdapCodecServiceTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain