You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by se...@apache.org on 2015/07/05 20:48:08 UTC
svn commit: r1689275 [1/2] - in
/directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap:
aci/ codec/api/ entry/ model/name/ subtree/
Author: seelmann
Date: Sun Jul 5 18:48:07 2015
New Revision: 1689275
URL: http://svn.apache.org/r1689275
Log:
Fix checkstyle violations
Modified:
directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemChekerTest.java
directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemParserTest.java
directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/codec/api/StandaloneLdapCodecServiceTest.java
directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareAttributeTest.java
directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareEntryTest.java
directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareModificationSerializationTest.java
directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareValueSerializationTest.java
directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/TestEntryUtils.java
directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/model/name/AvaTest.java
directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/model/name/MultiThreadedTest.java
directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/model/name/RdnTest.java
directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/model/name/SchemaAwareDnSerializationTest.java
directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/subtree/SubtreeSpecificationParserTest.java
Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemChekerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemChekerTest.java?rev=1689275&r1=1689274&r2=1689275&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemChekerTest.java (original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemChekerTest.java Sun Jul 5 18:48:07 2015
@@ -25,7 +25,6 @@ import static org.junit.Assert.fail;
import java.text.ParseException;
-import org.apache.directory.api.ldap.aci.ACIItemChecker;
import org.apache.directory.api.ldap.model.schema.SchemaManager;
import org.apache.directory.api.ldap.schema.loader.JarLdifSchemaLoader;
import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager;
@@ -47,7 +46,7 @@ import com.mycila.junit.concurrent.Concu
public class ACIItemChekerTest
{
/** the ACIItem checker wrapper */
- static private ACIItemChecker checker;
+ private static ACIItemChecker checker;
/**
@@ -71,48 +70,48 @@ public class ACIItemChekerTest
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 } " +
- " } " +
- " } " +
- " }" +
- " }";
+ " { "
+ + " 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 );
}
Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemParserTest.java?rev=1689275&r1=1689274&r2=1689275&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemParserTest.java (original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/aci/ACIItemParserTest.java Sun Jul 5 18:48:07 2015
@@ -27,10 +27,6 @@ import static org.junit.Assert.fail;
import java.text.ParseException;
-import org.apache.directory.api.ldap.aci.ACIItem;
-import org.apache.directory.api.ldap.aci.ACIItemParser;
-import org.apache.directory.api.ldap.aci.UserFirstACIItem;
-import org.apache.directory.api.ldap.aci.UserPermission;
import org.apache.directory.api.ldap.model.schema.SchemaManager;
import org.apache.directory.api.ldap.schema.loader.JarLdifSchemaLoader;
import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager;
@@ -108,40 +104,40 @@ public class ACIItemParserTest
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 } } " +
- " } " +
- " }" +
- "}";
+ "{ "
+ + " 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 );
@@ -155,41 +151,41 @@ public class ACIItemParserTest
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 } " +
- " } " +
- " } " +
- " } " +
- "} ";
+ "{ "
+ + " 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 );
@@ -224,53 +220,53 @@ public class ACIItemParserTest
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 } " +
- " } " +
- " } " +
- " }" +
- " }";
+ " { "
+ + " 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 );
@@ -281,41 +277,41 @@ public class ACIItemParserTest
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 } " +
- " } " +
- " } " +
- " } " +
- "}";
+ "{ "
+ + " 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 );
@@ -372,47 +368,47 @@ public class ACIItemParserTest
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 } " +
- " } " +
- " } " +
- " }" +
- " }";
+ " { "
+ + " 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 );
@@ -448,41 +444,41 @@ public class ACIItemParserTest
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) " +
- " } " +
- " } " +
- " } " +
- " } " +
- "} ";
+ "{ "
+ + " 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 );
@@ -515,41 +511,41 @@ public class ACIItemParserTest
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 " +
- "} ";
+ "{ "
+ + " 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 );
@@ -623,39 +619,39 @@ public class ACIItemParserTest
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 } " +
- " } " +
- " } " +
- " } " +
- "} ";
+ "{ "
+ + " 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 );
@@ -737,41 +733,41 @@ public class ACIItemParserTest
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 } " +
- " } " +
- " } " +
- " } " +
- "} ";
+ "{ "
+ + " 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 );
Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/codec/api/StandaloneLdapCodecServiceTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/codec/api/StandaloneLdapCodecServiceTest.java?rev=1689275&r1=1689274&r2=1689275&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/codec/api/StandaloneLdapCodecServiceTest.java (original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/codec/api/StandaloneLdapCodecServiceTest.java Sun Jul 5 18:48:07 2015
@@ -45,32 +45,33 @@ public class StandaloneLdapCodecServiceT
{
// Load the extension points
System.setProperty( StandaloneLdapApiService.CONTROLS_LIST,
- "org.apache.directory.api.ldap.codec.controls.cascade.CascadeFactory," +
- "org.apache.directory.api.ldap.codec.controls.manageDsaIT.ManageDsaITFactory," +
- "org.apache.directory.api.ldap.codec.controls.proxiedauthz.ProxiedAuthzFactory," +
- "org.apache.directory.api.ldap.codec.controls.search.entryChange.EntryChangeFactory," +
- "org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsFactory," +
- "org.apache.directory.api.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory," +
- "org.apache.directory.api.ldap.codec.controls.search.subentries.SubentriesFactory," +
- "org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyFactory," +
- "org.apache.directory.api.ldap.extras.controls.vlv_impl.VirtualListViewRequestFactory," +
- "org.apache.directory.api.ldap.extras.controls.vlv_impl.VirtualListViewResponseFactory," +
- "org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncDoneValueFactory," +
- "org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncInfoValueFactory," +
- "org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory," +
- "org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory," +
- "org.apache.directory.api.ldap.extras.controls.ad_impl.AdDirSyncFactory" );
+ "org.apache.directory.api.ldap.codec.controls.cascade.CascadeFactory,"
+ + "org.apache.directory.api.ldap.codec.controls.manageDsaIT.ManageDsaITFactory,"
+ + "org.apache.directory.api.ldap.codec.controls.proxiedauthz.ProxiedAuthzFactory,"
+ + "org.apache.directory.api.ldap.codec.controls.search.entryChange.EntryChangeFactory,"
+ + "org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsFactory,"
+ + "org.apache.directory.api.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory,"
+ + "org.apache.directory.api.ldap.codec.controls.search.subentries.SubentriesFactory,"
+ + "org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyFactory,"
+ + "org.apache.directory.api.ldap.extras.controls.vlv_impl.VirtualListViewRequestFactory,"
+ + "org.apache.directory.api.ldap.extras.controls.vlv_impl.VirtualListViewResponseFactory,"
+ + "org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncDoneValueFactory,"
+ + "org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncInfoValueFactory,"
+ + "org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory,"
+ + "org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory,"
+ + "org.apache.directory.api.ldap.extras.controls.ad_impl.AdDirSyncFactory" );
- System.setProperty( StandaloneLdapApiService.EXTENDED_OPERATIONS_LIST,
- "org.apache.directory.api.ldap.extras.extended.ads_impl.cancel.CancelFactory," +
- "org.apache.directory.api.ldap.extras.extended.ads_impl.certGeneration.CertGenerationFactory," +
- "org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulShutdown.GracefulShutdownFactory," +
- "org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory," +
- "org.apache.directory.api.ldap.extras.extended.ads_impl.pwdModify.PasswordModifyFactory," +
- "org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulDisconnect.GracefulDisconnectFactory," +
- "org.apache.directory.api.ldap.extras.extended.ads_impl.whoAmI.WhoAmIFactory," +
- "org.apache.directory.api.ldap.extras.extended.ads_impl.startTls.StartTlsFactory"
- );
+ System
+ .setProperty(
+ StandaloneLdapApiService.EXTENDED_OPERATIONS_LIST,
+ "org.apache.directory.api.ldap.extras.extended.ads_impl.cancel.CancelFactory,"
+ + "org.apache.directory.api.ldap.extras.extended.ads_impl.certGeneration.CertGenerationFactory,"
+ + "org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulShutdown.GracefulShutdownFactory,"
+ + "org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory,"
+ + "org.apache.directory.api.ldap.extras.extended.ads_impl.pwdModify.PasswordModifyFactory,"
+ + "org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulDisconnect.GracefulDisconnectFactory,"
+ + "org.apache.directory.api.ldap.extras.extended.ads_impl.whoAmI.WhoAmIFactory,"
+ + "org.apache.directory.api.ldap.extras.extended.ads_impl.startTls.StartTlsFactory" );
}
Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareAttributeTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareAttributeTest.java?rev=1689275&r1=1689274&r2=1689275&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareAttributeTest.java (original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareAttributeTest.java Sun Jul 5 18:48:07 2015
@@ -82,26 +82,26 @@ public class SchemaAwareAttributeTest
// A String attribute which allows null value
private AttributeType atEMail;
- private final Value<String> NULL_STRING_VALUE = new StringValue( ( String ) null );
- private final Value<byte[]> NULL_BINARY_VALUE = new BinaryValue( ( byte[] ) null );
- private final byte[] BYTES1 = new byte[]
+ private final Value<String> nullStringValue = new StringValue( ( String ) null );
+ private final Value<byte[]> nullBinaryValue = new BinaryValue( ( byte[] ) null );
+ private static final byte[] BYTES1 = new byte[]
{ 'a', 'b' };
- private final byte[] BYTES2 = new byte[]
+ private static final byte[] BYTES2 = new byte[]
{ 'b' };
- private final byte[] BYTES3 = new byte[]
+ private static final byte[] BYTES3 = new byte[]
{ 'c' };
- private final byte[] BYTES4 = new byte[]
+ private static final byte[] BYTES4 = new byte[]
{ 'd' };
- private final StringValue STR_VALUE1 = new StringValue( "a" );
- private final StringValue STR_VALUE2 = new StringValue( "b" );
- private final StringValue STR_VALUE3 = new StringValue( "c" );
- private final StringValue STR_VALUE4 = new StringValue( "d" );
-
- private final BinaryValue BIN_VALUE1 = new BinaryValue( BYTES1 );
- private final BinaryValue BIN_VALUE2 = new BinaryValue( BYTES2 );
- private final BinaryValue BIN_VALUE3 = new BinaryValue( BYTES3 );
- private final BinaryValue BIN_VALUE4 = new BinaryValue( BYTES4 );
+ private final StringValue stringValue1 = new StringValue( "a" );
+ private final StringValue stringValue2 = new StringValue( "b" );
+ private final StringValue stringValue3 = new StringValue( "c" );
+ private final StringValue stringValue4 = new StringValue( "d" );
+
+ private final BinaryValue binaryValue1 = new BinaryValue( BYTES1 );
+ private final BinaryValue binaryValue2 = new BinaryValue( BYTES2 );
+ private final BinaryValue binaryValue3 = new BinaryValue( BYTES3 );
+ private final BinaryValue binaryValue4 = new BinaryValue( BYTES4 );
private static SchemaManager schemaManager;
@@ -624,14 +624,14 @@ public class SchemaAwareAttributeTest
int nbAdded = attr1.add( ( String ) null );
assertEquals( 1, nbAdded );
assertTrue( attr1.isHumanReadable() );
- assertEquals( NULL_STRING_VALUE, attr1.get() );
+ assertEquals( nullStringValue, attr1.get() );
Attribute attr2 = new DefaultAttribute( atPwd );
nbAdded = attr2.add( new BinaryValue( atPwd, null ) );
assertEquals( 1, nbAdded );
assertFalse( attr2.isHumanReadable() );
- assertEquals( NULL_BINARY_VALUE, attr2.get() );
+ assertEquals( nullBinaryValue, attr2.get() );
Attribute attr3 = new DefaultAttribute( atCN );
@@ -670,7 +670,7 @@ public class SchemaAwareAttributeTest
nbAdded = attr7.add( new BinaryValue( atPwd, null ), new StringValue( atCN, "c" ) );
assertEquals( 1, nbAdded );
assertFalse( attr7.isHumanReadable() );
- assertTrue( attr7.contains( NULL_BINARY_VALUE ) );
+ assertTrue( attr7.contains( nullBinaryValue ) );
assertFalse( attr7.contains( BYTES3 ) );
Attribute attr8 = new DefaultAttribute( atDC );
@@ -678,7 +678,7 @@ public class SchemaAwareAttributeTest
nbAdded = attr8.add( new StringValue( atDC, null ), new BinaryValue( atPwd, BYTES1 ) );
assertEquals( 1, nbAdded );
assertTrue( attr8.isHumanReadable() );
- assertTrue( attr8.contains( NULL_STRING_VALUE ) );
+ assertTrue( attr8.contains( nullStringValue ) );
assertFalse( attr8.contains( "ab" ) );
Attribute attr9 = new DefaultAttribute( atDC );
@@ -686,7 +686,7 @@ public class SchemaAwareAttributeTest
nbAdded = attr9.add( new StringValue( ( String ) null ), new StringValue( "ab" ) );
assertEquals( 2, nbAdded );
assertTrue( attr9.isHumanReadable() );
- assertTrue( attr9.contains( NULL_STRING_VALUE ) );
+ assertTrue( attr9.contains( nullStringValue ) );
assertTrue( attr9.contains( "ab" ) );
Attribute attr10 = new DefaultAttribute( atPwd );
@@ -694,7 +694,7 @@ public class SchemaAwareAttributeTest
nbAdded = attr10.add( new BinaryValue( ( byte[] ) null ), new BinaryValue( BYTES1 ) );
assertEquals( 2, nbAdded );
assertFalse( attr10.isHumanReadable() );
- assertTrue( attr10.contains( NULL_BINARY_VALUE ) );
+ assertTrue( attr10.contains( nullBinaryValue ) );
assertTrue( attr10.contains( BYTES1 ) );
}
@@ -710,7 +710,7 @@ public class SchemaAwareAttributeTest
int nbAdded = attr1.add( ( String ) null );
assertEquals( 1, nbAdded );
assertTrue( attr1.isHumanReadable() );
- assertEquals( NULL_STRING_VALUE, attr1.get() );
+ assertEquals( nullStringValue, attr1.get() );
Attribute attr2 = new DefaultAttribute( atDC );
@@ -765,7 +765,7 @@ public class SchemaAwareAttributeTest
assertTrue( attr5.isHumanReadable() );
assertTrue( attr5.contains( "a" ) );
assertTrue( attr5.contains( "b" ) );
- assertTrue( attr5.contains( NULL_STRING_VALUE ) );
+ assertTrue( attr5.contains( nullStringValue ) );
assertTrue( attr5.contains( "d" ) );
Attribute attr6 = new DefaultAttribute( atPwd );
@@ -787,7 +787,7 @@ public class SchemaAwareAttributeTest
int nbAdded = attr1.add( ( byte[] ) null );
assertEquals( 1, nbAdded );
assertFalse( attr1.isHumanReadable() );
- assertTrue( Arrays.equals( NULL_BINARY_VALUE.getBytes(), attr1.getBytes() ) );
+ assertTrue( Arrays.equals( nullBinaryValue.getBytes(), attr1.getBytes() ) );
Attribute attr2 = new DefaultAttribute( atPwd );
@@ -860,45 +860,45 @@ public class SchemaAwareAttributeTest
Attribute attr1 = new DefaultAttribute( atEMail );
assertEquals( 0, attr1.size() );
- assertFalse( attr1.contains( STR_VALUE1 ) );
- assertFalse( attr1.contains( NULL_STRING_VALUE ) );
+ assertFalse( attr1.contains( stringValue1 ) );
+ assertFalse( attr1.contains( nullStringValue ) );
attr1.add( ( String ) null );
assertEquals( 1, attr1.size() );
- assertTrue( attr1.contains( NULL_STRING_VALUE ) );
+ assertTrue( attr1.contains( nullStringValue ) );
attr1.remove( ( String ) null );
- assertFalse( attr1.contains( NULL_STRING_VALUE ) );
+ assertFalse( attr1.contains( nullStringValue ) );
assertEquals( 0, attr1.size() );
attr1.add( "a", "b", "c" );
assertEquals( 3, attr1.size() );
- assertTrue( attr1.contains( STR_VALUE1 ) );
- assertTrue( attr1.contains( STR_VALUE2 ) );
- assertTrue( attr1.contains( STR_VALUE3 ) );
- assertTrue( attr1.contains( STR_VALUE1, STR_VALUE3 ) );
- assertFalse( attr1.contains( STR_VALUE4 ) );
- assertFalse( attr1.contains( NULL_STRING_VALUE ) );
+ assertTrue( attr1.contains( stringValue1 ) );
+ assertTrue( attr1.contains( stringValue2 ) );
+ assertTrue( attr1.contains( stringValue3 ) );
+ assertTrue( attr1.contains( stringValue1, stringValue3 ) );
+ assertFalse( attr1.contains( stringValue4 ) );
+ assertFalse( attr1.contains( nullStringValue ) );
Attribute attr2 = new DefaultAttribute( atPwd );
assertEquals( 0, attr2.size() );
assertFalse( attr2.contains( BYTES1 ) );
- assertFalse( attr2.contains( NULL_BINARY_VALUE ) );
+ assertFalse( attr2.contains( nullBinaryValue ) );
attr2.add( ( byte[] ) null );
assertEquals( 1, attr2.size() );
- assertTrue( attr2.contains( NULL_BINARY_VALUE ) );
+ assertTrue( attr2.contains( nullBinaryValue ) );
attr2.remove( ( byte[] ) null );
- assertFalse( attr2.contains( NULL_BINARY_VALUE ) );
+ assertFalse( attr2.contains( nullBinaryValue ) );
assertEquals( 0, attr2.size() );
attr2.add( BYTES1, BYTES2, BYTES3 );
assertEquals( 3, attr2.size() );
- assertTrue( attr2.contains( BIN_VALUE1 ) );
- assertTrue( attr2.contains( BIN_VALUE2 ) );
- assertTrue( attr2.contains( BIN_VALUE3 ) );
- assertFalse( attr2.contains( NULL_BINARY_VALUE ) );
+ assertTrue( attr2.contains( binaryValue1 ) );
+ assertTrue( attr2.contains( binaryValue2 ) );
+ assertTrue( attr2.contains( binaryValue3 ) );
+ assertFalse( attr2.contains( nullBinaryValue ) );
}
@@ -994,16 +994,16 @@ public class SchemaAwareAttributeTest
Attribute attr3 = new DefaultAttribute( atPwd );
Attribute attr4 = new DefaultAttribute( atPwd );
- attr3.add( NULL_BINARY_VALUE );
- attr4.add( NULL_BINARY_VALUE );
+ attr3.add( nullBinaryValue );
+ attr4.add( nullBinaryValue );
assertTrue( attr3.equals( attr4 ) );
Attribute attr5 = new DefaultAttribute( atPwd );
Attribute attr6 = new DefaultAttribute( atDC );
assertFalse( attr5.equals( attr6 ) );
- attr5.add( NULL_BINARY_VALUE );
- attr6.add( NULL_STRING_VALUE );
+ attr5.add( nullBinaryValue );
+ attr6.add( nullStringValue );
assertFalse( attr5.equals( attr6 ) );
Attribute attr7 = new DefaultAttribute( atCN );
@@ -1048,7 +1048,7 @@ public class SchemaAwareAttributeTest
Attribute attr1 = new DefaultAttribute( "dc", atDC );
attr1.add( ( String ) null );
- assertEquals( NULL_STRING_VALUE, attr1.get() );
+ assertEquals( nullStringValue, attr1.get() );
Attribute attr2 = new DefaultAttribute( "email", atEMail );
@@ -1091,12 +1091,12 @@ public class SchemaAwareAttributeTest
Iterator<Value<?>> iterator = attr.iterator();
assertFalse( iterator.hasNext() );
- attr.add( NULL_STRING_VALUE );
+ attr.add( nullStringValue );
iterator = attr.iterator();
assertTrue( iterator.hasNext() );
Value<?> value = iterator.next();
- assertEquals( NULL_STRING_VALUE, value );
+ assertEquals( nullStringValue, value );
attr.clear();
iterator = attr.iterator();
@@ -1155,7 +1155,7 @@ public class SchemaAwareAttributeTest
int nbAdded = attr1.add( ( byte[] ) null );
assertEquals( 1, nbAdded );
assertFalse( attr1.isHumanReadable() );
- assertTrue( Arrays.equals( NULL_BINARY_VALUE.getBytes(), attr1.getBytes() ) );
+ assertTrue( Arrays.equals( nullBinaryValue.getBytes(), attr1.getBytes() ) );
Attribute attr2 = new DefaultAttribute( atPwd );
@@ -1217,7 +1217,7 @@ public class SchemaAwareAttributeTest
int nbAdded = attr1.add( ( String ) null );
assertEquals( 1, nbAdded );
assertTrue( attr1.isHumanReadable() );
- assertEquals( NULL_STRING_VALUE, attr1.get() );
+ assertEquals( nullStringValue, attr1.get() );
Attribute attr2 = new DefaultAttribute( atDC );
@@ -1267,7 +1267,7 @@ public class SchemaAwareAttributeTest
assertTrue( attr5.isHumanReadable() );
assertTrue( attr5.contains( "a" ) );
assertTrue( attr5.contains( "b" ) );
- assertTrue( attr5.contains( NULL_STRING_VALUE ) );
+ assertTrue( attr5.contains( nullStringValue ) );
assertTrue( attr5.contains( "d" ) );
Attribute attr6 = new DefaultAttribute( atPwd );
@@ -1288,51 +1288,51 @@ public class SchemaAwareAttributeTest
assertEquals( 0, attr1.size() );
- attr1.add( NULL_STRING_VALUE );
+ attr1.add( nullStringValue );
assertEquals( 1, attr1.size() );
- assertTrue( attr1.contains( NULL_STRING_VALUE ) );
+ assertTrue( attr1.contains( nullStringValue ) );
attr1.clear();
- attr1.add( STR_VALUE1, STR_VALUE2, STR_VALUE3 );
+ attr1.add( stringValue1, stringValue2, stringValue3 );
assertEquals( 3, attr1.size() );
- assertTrue( attr1.contains( STR_VALUE1 ) );
- assertTrue( attr1.contains( STR_VALUE2 ) );
- assertTrue( attr1.contains( STR_VALUE3 ) );
+ assertTrue( attr1.contains( stringValue1 ) );
+ assertTrue( attr1.contains( stringValue2 ) );
+ assertTrue( attr1.contains( stringValue3 ) );
attr1.clear();
- attr1.add( STR_VALUE1, NULL_STRING_VALUE, STR_VALUE3 );
+ attr1.add( stringValue1, nullStringValue, stringValue3 );
assertEquals( 3, attr1.size() );
- assertTrue( attr1.contains( STR_VALUE1 ) );
- assertTrue( attr1.contains( NULL_STRING_VALUE ) );
- assertTrue( attr1.contains( STR_VALUE3 ) );
+ assertTrue( attr1.contains( stringValue1 ) );
+ assertTrue( attr1.contains( nullStringValue ) );
+ assertTrue( attr1.contains( stringValue3 ) );
attr1.clear();
- attr1.add( STR_VALUE1, NULL_STRING_VALUE, BIN_VALUE3 );
+ attr1.add( stringValue1, nullStringValue, binaryValue3 );
assertEquals( 2, attr1.size() );
- assertTrue( attr1.contains( STR_VALUE1 ) );
- assertTrue( attr1.contains( NULL_STRING_VALUE ) );
- assertFalse( attr1.contains( STR_VALUE3 ) );
+ assertTrue( attr1.contains( stringValue1 ) );
+ assertTrue( attr1.contains( nullStringValue ) );
+ assertFalse( attr1.contains( stringValue3 ) );
Attribute attr2 = new DefaultAttribute( atPwd );
assertEquals( 0, attr2.size() );
- attr2.add( NULL_BINARY_VALUE );
+ attr2.add( nullBinaryValue );
assertEquals( 1, attr2.size() );
- assertTrue( attr2.contains( NULL_BINARY_VALUE ) );
+ assertTrue( attr2.contains( nullBinaryValue ) );
attr2.clear();
- attr2.add( BIN_VALUE1, BIN_VALUE2, BIN_VALUE3 );
+ attr2.add( binaryValue1, binaryValue2, binaryValue3 );
assertEquals( 3, attr2.size() );
- assertTrue( attr2.contains( BIN_VALUE1 ) );
- assertTrue( attr2.contains( BIN_VALUE2 ) );
- assertTrue( attr2.contains( BIN_VALUE3 ) );
+ assertTrue( attr2.contains( binaryValue1 ) );
+ assertTrue( attr2.contains( binaryValue2 ) );
+ assertTrue( attr2.contains( binaryValue3 ) );
attr2.clear();
- attr2.add( BIN_VALUE1, NULL_BINARY_VALUE, STR_VALUE3 );
+ attr2.add( binaryValue1, nullBinaryValue, stringValue3 );
assertEquals( 2, attr2.size() );
- assertTrue( attr2.contains( BIN_VALUE1 ) );
- assertTrue( attr2.contains( NULL_BINARY_VALUE ) );
- assertFalse( attr2.contains( BIN_VALUE3 ) );
+ assertTrue( attr2.contains( binaryValue1 ) );
+ assertTrue( attr2.contains( nullBinaryValue ) );
+ assertFalse( attr2.contains( binaryValue3 ) );
}
@@ -1344,61 +1344,61 @@ public class SchemaAwareAttributeTest
{
Attribute attr1 = new DefaultAttribute( atEMail );
- assertFalse( attr1.remove( STR_VALUE1 ) );
+ assertFalse( attr1.remove( stringValue1 ) );
attr1.add( "a", "b", "c" );
- assertTrue( attr1.remove( STR_VALUE1 ) );
+ assertTrue( attr1.remove( stringValue1 ) );
assertEquals( 2, attr1.size() );
- assertTrue( attr1.remove( STR_VALUE2, STR_VALUE3 ) );
+ assertTrue( attr1.remove( stringValue2, stringValue3 ) );
assertEquals( 0, attr1.size() );
- assertFalse( attr1.remove( STR_VALUE4 ) );
+ assertFalse( attr1.remove( stringValue4 ) );
attr1.clear();
attr1.add( "a", "b", "c" );
- assertFalse( attr1.remove( STR_VALUE2, STR_VALUE4 ) );
+ assertFalse( attr1.remove( stringValue2, stringValue4 ) );
assertEquals( 2, attr1.size() );
attr1.clear();
attr1.add( "a", ( String ) null, "b" );
- assertTrue( attr1.remove( NULL_STRING_VALUE, STR_VALUE1 ) );
+ assertTrue( attr1.remove( nullStringValue, stringValue1 ) );
assertEquals( 1, attr1.size() );
attr1.clear();
attr1.add( "a", ( String ) null, "b" );
attr1.add( BYTES3 );
- assertFalse( attr1.remove( NULL_STRING_VALUE, STR_VALUE1, BIN_VALUE3 ) );
+ assertFalse( attr1.remove( nullStringValue, stringValue1, binaryValue3 ) );
assertEquals( 1, attr1.size() );
Attribute attr2 = new DefaultAttribute( atPwd );
- assertFalse( attr2.remove( BIN_VALUE1 ) );
+ assertFalse( attr2.remove( binaryValue1 ) );
attr2.add( BYTES1, BYTES2, BYTES3 );
- assertTrue( attr2.remove( BIN_VALUE1 ) );
+ assertTrue( attr2.remove( binaryValue1 ) );
assertEquals( 2, attr2.size() );
- assertTrue( attr2.remove( BIN_VALUE2, BIN_VALUE3 ) );
+ assertTrue( attr2.remove( binaryValue2, binaryValue3 ) );
assertEquals( 0, attr2.size() );
- assertFalse( attr2.remove( BIN_VALUE4 ) );
+ assertFalse( attr2.remove( binaryValue4 ) );
attr2.clear();
attr2.add( BYTES1, BYTES2, BYTES3 );
- assertFalse( attr2.remove( BIN_VALUE2, STR_VALUE4 ) );
+ assertFalse( attr2.remove( binaryValue2, stringValue4 ) );
assertEquals( 2, attr2.size() );
attr2.clear();
attr2.add( BYTES1, ( byte[] ) null, BYTES3 );
- assertFalse( attr2.remove( NULL_STRING_VALUE, BIN_VALUE1 ) );
+ assertFalse( attr2.remove( nullStringValue, binaryValue1 ) );
assertEquals( 2, attr2.size() );
attr2.clear();
attr2.add( BYTES1, ( byte[] ) null, BYTES2 );
attr2.add( "c" );
assertEquals( 4, attr2.size() );
- assertFalse( attr2.remove( NULL_STRING_VALUE, BIN_VALUE1, STR_VALUE3 ) );
+ assertFalse( attr2.remove( nullStringValue, binaryValue1, stringValue3 ) );
assertEquals( 3, attr2.size() );
}
@@ -1770,7 +1770,7 @@ public class SchemaAwareAttributeTest
@Test
public void testDefaultServerAttributeAttributeTypeValueArray() throws Exception
{
- Attribute attr1 = new DefaultAttribute( atDC, STR_VALUE1, STR_VALUE2, NULL_STRING_VALUE );
+ Attribute attr1 = new DefaultAttribute( atDC, stringValue1, stringValue2, nullStringValue );
assertTrue( attr1.isHumanReadable() );
assertEquals( 3, attr1.size() );
@@ -1778,9 +1778,9 @@ public class SchemaAwareAttributeTest
assertEquals( "dc", attr1.getUpId() );
assertEquals( atDC, attr1.getAttributeType() );
assertTrue( attr1.contains( "a", "b" ) );
- assertTrue( attr1.contains( NULL_STRING_VALUE ) );
+ assertTrue( attr1.contains( nullStringValue ) );
- Attribute attr2 = new DefaultAttribute( atDC, STR_VALUE1, BIN_VALUE2, NULL_STRING_VALUE );
+ Attribute attr2 = new DefaultAttribute( atDC, stringValue1, binaryValue2, nullStringValue );
assertTrue( attr2.isHumanReadable() );
assertEquals( 2, attr2.size() );
@@ -1788,7 +1788,7 @@ public class SchemaAwareAttributeTest
assertEquals( "dc", attr2.getUpId() );
assertEquals( atDC, attr2.getAttributeType() );
assertTrue( attr2.contains( "a" ) );
- assertTrue( attr2.contains( NULL_STRING_VALUE ) );
+ assertTrue( attr2.contains( nullStringValue ) );
}
@@ -1798,7 +1798,7 @@ public class SchemaAwareAttributeTest
@Test
public void testDefaultServerAttributeStringAttributeTypeValueArray() throws LdapException
{
- Attribute attr1 = new DefaultAttribute( "dc", atDC, STR_VALUE1, STR_VALUE2, NULL_STRING_VALUE );
+ Attribute attr1 = new DefaultAttribute( "dc", atDC, stringValue1, stringValue2, nullStringValue );
assertTrue( attr1.isHumanReadable() );
assertEquals( 3, attr1.size() );
@@ -1806,9 +1806,9 @@ public class SchemaAwareAttributeTest
assertEquals( "dc", attr1.getUpId() );
assertEquals( atDC, attr1.getAttributeType() );
assertTrue( attr1.contains( "a", "b" ) );
- assertTrue( attr1.contains( NULL_STRING_VALUE ) );
+ assertTrue( attr1.contains( nullStringValue ) );
- Attribute attr2 = new DefaultAttribute( atDC, STR_VALUE1, BIN_VALUE2, NULL_STRING_VALUE );
+ Attribute attr2 = new DefaultAttribute( atDC, stringValue1, binaryValue2, nullStringValue );
assertTrue( attr2.isHumanReadable() );
assertEquals( 2, attr2.size() );
@@ -1816,10 +1816,10 @@ public class SchemaAwareAttributeTest
assertEquals( "dc", attr2.getUpId() );
assertEquals( atDC, attr2.getAttributeType() );
assertTrue( attr2.contains( "a" ) );
- assertTrue( attr2.contains( NULL_STRING_VALUE ) );
+ assertTrue( attr2.contains( nullStringValue ) );
- Attribute attr3 = new DefaultAttribute( "DomainComponent", atDC, STR_VALUE1, STR_VALUE2,
- NULL_STRING_VALUE );
+ Attribute attr3 = new DefaultAttribute( "DomainComponent", atDC, stringValue1, stringValue2,
+ nullStringValue );
assertTrue( attr3.isHumanReadable() );
assertEquals( 3, attr3.size() );
@@ -1827,10 +1827,10 @@ public class SchemaAwareAttributeTest
assertEquals( "DomainComponent", attr3.getUpId() );
assertEquals( atDC, attr3.getAttributeType() );
assertTrue( attr3.contains( "a", "b" ) );
- assertTrue( attr3.contains( NULL_STRING_VALUE ) );
+ assertTrue( attr3.contains( nullStringValue ) );
- Attribute attr4 = new DefaultAttribute( " 0.9.2342.19200300.100.1.25 ", atDC, STR_VALUE1, STR_VALUE2,
- NULL_STRING_VALUE );
+ Attribute attr4 = new DefaultAttribute( " 0.9.2342.19200300.100.1.25 ", atDC, stringValue1, stringValue2,
+ nullStringValue );
assertTrue( attr4.isHumanReadable() );
assertEquals( 3, attr4.size() );
@@ -1838,7 +1838,7 @@ public class SchemaAwareAttributeTest
assertEquals( " 0.9.2342.19200300.100.1.25 ", attr4.getUpId() );
assertEquals( atDC, attr4.getAttributeType() );
assertTrue( attr4.contains( "a", "b" ) );
- assertTrue( attr4.contains( NULL_STRING_VALUE ) );
+ assertTrue( attr4.contains( nullStringValue ) );
}
@@ -1856,9 +1856,9 @@ public class SchemaAwareAttributeTest
assertEquals( "email", attr1.getUpId() );
assertEquals( atEMail, attr1.getAttributeType() );
assertTrue( attr1.contains( "a", "b" ) );
- assertTrue( attr1.contains( NULL_STRING_VALUE ) );
+ assertTrue( attr1.contains( nullStringValue ) );
- Attribute attr2 = new DefaultAttribute( atEMail, STR_VALUE1, BIN_VALUE2, NULL_STRING_VALUE );
+ Attribute attr2 = new DefaultAttribute( atEMail, stringValue1, binaryValue2, nullStringValue );
assertTrue( attr2.isHumanReadable() );
assertEquals( 2, attr2.size() );
@@ -1866,7 +1866,7 @@ public class SchemaAwareAttributeTest
assertEquals( "email", attr2.getUpId() );
assertEquals( atEMail, attr2.getAttributeType() );
assertTrue( attr2.contains( "a" ) );
- assertTrue( attr2.contains( NULL_STRING_VALUE ) );
+ assertTrue( attr2.contains( nullStringValue ) );
}
@@ -1884,7 +1884,7 @@ public class SchemaAwareAttributeTest
assertEquals( "email", attr1.getUpId() );
assertEquals( atEMail, attr1.getAttributeType() );
assertTrue( attr1.contains( "a", "b" ) );
- assertTrue( attr1.contains( NULL_STRING_VALUE ) );
+ assertTrue( attr1.contains( nullStringValue ) );
Attribute attr2 = new DefaultAttribute( "EMail", atEMail, "a", "b", ( String ) null );
@@ -1894,7 +1894,7 @@ public class SchemaAwareAttributeTest
assertEquals( "EMail", attr2.getUpId() );
assertEquals( atEMail, attr2.getAttributeType() );
assertTrue( attr2.contains( "a", "b" ) );
- assertTrue( attr2.contains( NULL_STRING_VALUE ) );
+ assertTrue( attr2.contains( nullStringValue ) );
Attribute attr3 = new DefaultAttribute( " 1.2.840.113549.1.9.1 ", atEMail, "a", "b",
( String ) null );
@@ -1905,7 +1905,7 @@ public class SchemaAwareAttributeTest
assertEquals( " 1.2.840.113549.1.9.1 ", attr3.getUpId() );
assertEquals( atEMail, attr3.getAttributeType() );
assertTrue( attr3.contains( "a", "b" ) );
- assertTrue( attr3.contains( NULL_STRING_VALUE ) );
+ assertTrue( attr3.contains( nullStringValue ) );
}
@@ -1923,9 +1923,9 @@ public class SchemaAwareAttributeTest
assertEquals( "userPassword", attr1.getUpId() );
assertEquals( atPwd, attr1.getAttributeType() );
assertTrue( attr1.contains( BYTES1, BYTES2 ) );
- assertTrue( attr1.contains( NULL_BINARY_VALUE ) );
+ assertTrue( attr1.contains( nullBinaryValue ) );
- Attribute attr2 = new DefaultAttribute( atPwd, STR_VALUE1, BIN_VALUE2, NULL_BINARY_VALUE );
+ Attribute attr2 = new DefaultAttribute( atPwd, stringValue1, binaryValue2, nullBinaryValue );
assertFalse( attr2.isHumanReadable() );
assertEquals( 2, attr2.size() );
@@ -1933,7 +1933,7 @@ public class SchemaAwareAttributeTest
assertEquals( "userPassword", attr2.getUpId() );
assertEquals( atPwd, attr2.getAttributeType() );
assertTrue( attr2.contains( BYTES2 ) );
- assertTrue( attr2.contains( NULL_BINARY_VALUE ) );
+ assertTrue( attr2.contains( nullBinaryValue ) );
}
@@ -1951,9 +1951,9 @@ public class SchemaAwareAttributeTest
assertEquals( "userPassword", attr1.getUpId() );
assertEquals( atPwd, attr1.getAttributeType() );
assertTrue( attr1.contains( BYTES1, BYTES2 ) );
- assertTrue( attr1.contains( NULL_BINARY_VALUE ) );
+ assertTrue( attr1.contains( nullBinaryValue ) );
- Attribute attr2 = new DefaultAttribute( "2.5.4.35", atPwd, STR_VALUE1, BIN_VALUE2, NULL_BINARY_VALUE );
+ Attribute attr2 = new DefaultAttribute( "2.5.4.35", atPwd, stringValue1, binaryValue2, nullBinaryValue );
assertFalse( attr2.isHumanReadable() );
assertEquals( 2, attr2.size() );
@@ -1961,7 +1961,7 @@ public class SchemaAwareAttributeTest
assertEquals( "2.5.4.35", attr2.getUpId() );
assertEquals( atPwd, attr2.getAttributeType() );
assertTrue( attr2.contains( BYTES2 ) );
- assertTrue( attr2.contains( NULL_BINARY_VALUE ) );
+ assertTrue( attr2.contains( nullBinaryValue ) );
}
Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareEntryTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareEntryTest.java?rev=1689275&r1=1689274&r2=1689275&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareEntryTest.java (original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareEntryTest.java Sun Jul 5 18:48:07 2015
@@ -67,7 +67,7 @@ import com.mycila.junit.concurrent.Concu
@Concurrency()
public class SchemaAwareEntryTest
{
- private static Dn EXAMPLE_DN;
+ private static Dn exampleDn;
private static final byte[] BYTES1 = new byte[]
{ 'a', 'b' };
private static final byte[] BYTES2 = new byte[]
@@ -85,7 +85,7 @@ public class SchemaAwareEntryTest
{
try
{
- Entry entry = new DefaultEntry( EXAMPLE_DN );
+ Entry entry = new DefaultEntry( exampleDn );
Attribute attrOC = new DefaultAttribute( "objectClass", "top", "person" );
Attribute attrCN = new DefaultAttribute( "cn", "test1", "test2" );
@@ -184,7 +184,7 @@ public class SchemaAwareEntryTest
@BeforeClass
public static void setUpBeforeClass() throws Exception
{
- EXAMPLE_DN = new Dn( "dc=example,dc=com" );
+ exampleDn = new Dn( "dc=example,dc=com" );
schemaManager = new DefaultSchemaManager();
}
@@ -231,11 +231,11 @@ public class SchemaAwareEntryTest
@Test
public void testDefaultClientEntryLdapDN()
{
- Entry entry = new DefaultEntry( EXAMPLE_DN );
+ Entry entry = new DefaultEntry( exampleDn );
assertNotNull( entry );
assertNotNull( entry.getDn() );
- assertEquals( EXAMPLE_DN, entry.getDn() );
+ assertEquals( exampleDn, entry.getDn() );
assertEquals( 0, entry.size() );
}
@@ -374,7 +374,7 @@ public class SchemaAwareEntryTest
@Test
public void testClear() throws LdapException
{
- Entry entry = new DefaultEntry( EXAMPLE_DN );
+ Entry entry = new DefaultEntry( exampleDn );
assertEquals( 0, entry.size() );
assertNull( entry.get( "ObjectClass" ) );
@@ -403,11 +403,11 @@ public class SchemaAwareEntryTest
Entry entry2 = entry1.clone();
assertEquals( entry1, entry2 );
- entry2.setDn( EXAMPLE_DN );
+ entry2.setDn( exampleDn );
assertEquals( Dn.EMPTY_DN, entry1.getDn() );
- entry1.setDn( EXAMPLE_DN );
+ entry1.setDn( exampleDn );
entry2 = entry1.clone();
assertEquals( entry1, entry2 );
@@ -432,7 +432,7 @@ public class SchemaAwareEntryTest
@Test
public void testContainsEntryAttributeArray() throws LdapException
{
- Entry entry = new DefaultEntry( EXAMPLE_DN );
+ Entry entry = new DefaultEntry( exampleDn );
Attribute attrOC = new DefaultAttribute( "objectClass", "top", "person" );
Attribute attrCN = new DefaultAttribute( "cn", "test1", "test2" );
@@ -458,7 +458,7 @@ public class SchemaAwareEntryTest
@Test
public void testContainsStringByteArray() throws LdapException
{
- Entry entry = new DefaultEntry( EXAMPLE_DN );
+ Entry entry = new DefaultEntry( exampleDn );
assertFalse( entry.containsAttribute( "objectClass" ) );
@@ -482,7 +482,7 @@ public class SchemaAwareEntryTest
@Test
public void testContainsStringStringArray() throws LdapException
{
- Entry entry = new DefaultEntry( EXAMPLE_DN );
+ Entry entry = new DefaultEntry( exampleDn );
assertFalse( entry.containsAttribute( "objectClass" ) );
@@ -511,7 +511,7 @@ public class SchemaAwareEntryTest
@Test
public void testContainsStringValueArray() throws LdapException
{
- Entry entry = new DefaultEntry( EXAMPLE_DN );
+ Entry entry = new DefaultEntry( exampleDn );
assertFalse( entry.containsAttribute( "objectClass" ) );
@@ -544,7 +544,7 @@ public class SchemaAwareEntryTest
@Test
public void testContainsAttribute() throws LdapException
{
- Entry entry = new DefaultEntry( EXAMPLE_DN );
+ Entry entry = new DefaultEntry( exampleDn );
assertFalse( entry.containsAttribute( "objectClass" ) );
@@ -580,10 +580,10 @@ public class SchemaAwareEntryTest
assertEquals( entry1, entry2 );
- entry1.setDn( EXAMPLE_DN );
+ entry1.setDn( exampleDn );
assertNotSame( entry1, entry2 );
- entry2.setDn( EXAMPLE_DN );
+ entry2.setDn( exampleDn );
assertEquals( entry1, entry2 );
Attribute attrOC = new DefaultAttribute( "objectClass", "top", "person" );
@@ -623,7 +623,7 @@ public class SchemaAwareEntryTest
@Test
public void testGet() throws LdapException
{
- Entry entry = new DefaultEntry( EXAMPLE_DN );
+ Entry entry = new DefaultEntry( exampleDn );
assertNull( entry.get( "objectClass" ) );
@@ -651,9 +651,9 @@ public class SchemaAwareEntryTest
@Test
public void testGetDn() throws LdapException
{
- Entry entry = new DefaultEntry( EXAMPLE_DN );
+ Entry entry = new DefaultEntry( exampleDn );
- assertEquals( EXAMPLE_DN, entry.getDn() );
+ assertEquals( exampleDn, entry.getDn() );
Dn testDn = new Dn( "cn=test" );
entry.setDn( testDn );
@@ -668,15 +668,15 @@ public class SchemaAwareEntryTest
@Test
public void testHashCode() throws LdapException, LdapException
{
- Entry entry1 = new DefaultEntry( EXAMPLE_DN );
- Entry entry2 = new DefaultEntry( EXAMPLE_DN );
+ Entry entry1 = new DefaultEntry( exampleDn );
+ Entry entry2 = new DefaultEntry( exampleDn );
assertEquals( entry1.hashCode(), entry2.hashCode() );
entry2.setDn( new Dn( "ou=system,dc=com" ) );
assertNotSame( entry1.hashCode(), entry2.hashCode() );
- entry2.setDn( EXAMPLE_DN );
+ entry2.setDn( exampleDn );
assertEquals( entry1.hashCode(), entry2.hashCode() );
Attribute attrOC = new DefaultAttribute( "objectClass", "top", "person" );
@@ -689,7 +689,7 @@ public class SchemaAwareEntryTest
assertEquals( entry1.hashCode(), entry2.hashCode() );
- Entry entry3 = new DefaultEntry( EXAMPLE_DN );
+ Entry entry3 = new DefaultEntry( exampleDn );
entry3.add( attrOC, attrSN, attrCN, attrPWD );
assertEquals( entry1.hashCode(), entry3.hashCode() );
@@ -702,7 +702,7 @@ public class SchemaAwareEntryTest
@Test
public void testHasObjectClass() throws LdapException
{
- Entry entry = new DefaultEntry( EXAMPLE_DN );
+ Entry entry = new DefaultEntry( exampleDn );
assertFalse( entry.containsAttribute( "objectClass" ) );
assertFalse( entry.hasObjectClass( "top" ) );
@@ -754,7 +754,7 @@ public class SchemaAwareEntryTest
@Test
public void testPutEntryAttributeArray() throws LdapException
{
- Entry entry = new DefaultEntry( EXAMPLE_DN );
+ Entry entry = new DefaultEntry( exampleDn );
Attribute attrOC = new DefaultAttribute( "objectClass", "top", "person" );
Attribute attrCN = new DefaultAttribute( "cn", "test1", "test2" );
@@ -785,7 +785,7 @@ public class SchemaAwareEntryTest
@Test
public void testPutStringByteArrayArray()
{
- Entry entry = new DefaultEntry( EXAMPLE_DN );
+ Entry entry = new DefaultEntry( exampleDn );
try
{
@@ -831,7 +831,7 @@ public class SchemaAwareEntryTest
@Test
public void testPutStringStringArray()
{
- Entry entry = new DefaultEntry( EXAMPLE_DN );
+ Entry entry = new DefaultEntry( exampleDn );
try
{
@@ -877,7 +877,7 @@ public class SchemaAwareEntryTest
@Test
public void testPutStringValueArray()
{
- Entry entry = new DefaultEntry( EXAMPLE_DN );
+ Entry entry = new DefaultEntry( exampleDn );
Value<String> strValueTop = new StringValue( "top" );
Value<String> strValuePerson = new StringValue( "person" );
@@ -957,7 +957,7 @@ public class SchemaAwareEntryTest
@Test
public void testRemoveAttributesStringArray() throws LdapException
{
- Entry entry = new DefaultEntry( EXAMPLE_DN );
+ Entry entry = new DefaultEntry( exampleDn );
Attribute attrOC = new DefaultAttribute( "objectClass", "top", "person" );
Attribute attrCN = new DefaultAttribute( "cn", "test1", "test2" );
@@ -983,7 +983,7 @@ public class SchemaAwareEntryTest
@Test
public void testRemoveEntryAttributeArray() throws LdapException
{
- Entry entry = new DefaultEntry( EXAMPLE_DN );
+ Entry entry = new DefaultEntry( exampleDn );
Attribute attrOC = new DefaultAttribute( "objectClass", "top", "person" );
Attribute attrCN = new DefaultAttribute( "cn", "test1", "test2" );
@@ -1015,7 +1015,7 @@ public class SchemaAwareEntryTest
@Test
public void testRemoveStringByteArrayArray() throws LdapException
{
- Entry entry = new DefaultEntry( EXAMPLE_DN );
+ Entry entry = new DefaultEntry( exampleDn );
Attribute attrPWD = new DefaultAttribute( "userPassword", BYTES1, ( byte[] ) null, BYTES2 );
@@ -1066,7 +1066,7 @@ public class SchemaAwareEntryTest
@Test
public void testRemoveStringValueArray() throws LdapException
{
- Entry entry = new DefaultEntry( EXAMPLE_DN );
+ Entry entry = new DefaultEntry( exampleDn );
Attribute attrCN = new DefaultAttribute( "cn", "test1", "test2", ( String ) null );
Attribute attrPWD = new DefaultAttribute( "userPassword", BYTES1, BYTES2, ( byte[] ) null );
@@ -1109,8 +1109,8 @@ public class SchemaAwareEntryTest
assertEquals( Dn.EMPTY_DN, entry.getDn() );
- entry.setDn( EXAMPLE_DN );
- assertEquals( EXAMPLE_DN, entry.getDn() );
+ entry.setDn( exampleDn );
+ assertEquals( exampleDn, entry.getDn() );
}
@@ -1120,7 +1120,7 @@ public class SchemaAwareEntryTest
@Test
public void testSize() throws LdapException
{
- Entry entry = new DefaultEntry( EXAMPLE_DN );
+ Entry entry = new DefaultEntry( exampleDn );
assertEquals( 0, entry.size() );
entry.add( "ObjectClass", "top", "person" );
@@ -1140,7 +1140,7 @@ public class SchemaAwareEntryTest
@Test
public void testToString()
{
- Entry entry = new DefaultEntry( EXAMPLE_DN );
+ Entry entry = new DefaultEntry( exampleDn );
assertEquals( "Entry\n dn: dc=example,dc=com\n\n", entry.toString() );
@@ -1156,14 +1156,14 @@ public class SchemaAwareEntryTest
entry.put( "UserPassword", binValue1, binValue2, binNullValue );
String expected =
- "Entry\n" +
- " dn: dc=example,dc=com\n" +
- " ObjectClass: top\n" +
- " ObjectClass: person\n" +
- " ObjectClass: ''\n" +
- " UserPassword: 0x61 0x62 \n" +
- " UserPassword: 0x62 \n" +
- " UserPassword: ''\n";
+ "Entry\n"
+ + " dn: dc=example,dc=com\n"
+ + " ObjectClass: top\n"
+ + " ObjectClass: person\n"
+ + " ObjectClass: ''\n"
+ + " UserPassword: 0x61 0x62 \n"
+ + " UserPassword: 0x62 \n"
+ + " UserPassword: ''\n";
assertEquals( expected, entry.toString() );
}
Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareModificationSerializationTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareModificationSerializationTest.java?rev=1689275&r1=1689274&r2=1689275&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareModificationSerializationTest.java (original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareModificationSerializationTest.java Sun Jul 5 18:48:07 2015
@@ -57,7 +57,7 @@ import com.mycila.junit.concurrent.Concu
public class SchemaAwareModificationSerializationTest
{
private static SchemaManager schemaManager;
- private static AttributeType CN_AT;
+ private static AttributeType cnAT;
/**
@@ -67,7 +67,7 @@ public class SchemaAwareModificationSeri
public static void setup() throws Exception
{
schemaManager = new DefaultSchemaManager();
- CN_AT = schemaManager.getAttributeType( "cn" );
+ cnAT = schemaManager.getAttributeType( "cn" );
}
@@ -159,7 +159,7 @@ public class SchemaAwareModificationSeri
@Test
public void testCreateServerModification() throws LdapException
{
- Attribute attribute = new DefaultAttribute( "cn", CN_AT );
+ Attribute attribute = new DefaultAttribute( "cn", cnAT );
attribute.add( "test1", "test2" );
Modification mod = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attribute );
@@ -182,7 +182,7 @@ public class SchemaAwareModificationSeri
public void testSerializationModificationADD() throws ClassNotFoundException, IOException,
LdapInvalidAttributeValueException
{
- Attribute attribute = new DefaultAttribute( "cn", CN_AT );
+ Attribute attribute = new DefaultAttribute( "cn", cnAT );
attribute.add( "test1", "test2" );
DefaultModification mod = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attribute );
@@ -197,7 +197,7 @@ public class SchemaAwareModificationSeri
public void testSerializationModificationREPLACE() throws ClassNotFoundException, IOException,
LdapInvalidAttributeValueException
{
- Attribute attribute = new DefaultAttribute( "cn", CN_AT );
+ Attribute attribute = new DefaultAttribute( "cn", cnAT );
attribute.add( "test1", "test2" );
DefaultModification mod = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
@@ -212,7 +212,7 @@ public class SchemaAwareModificationSeri
public void testSerializationModificationREMOVE() throws ClassNotFoundException, IOException,
LdapInvalidAttributeValueException
{
- Attribute attribute = new DefaultAttribute( "cn", CN_AT );
+ Attribute attribute = new DefaultAttribute( "cn", cnAT );
attribute.add( "test1", "test2" );
DefaultModification mod = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE, attribute );
Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareValueSerializationTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareValueSerializationTest.java?rev=1689275&r1=1689274&r2=1689275&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareValueSerializationTest.java (original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/SchemaAwareValueSerializationTest.java Sun Jul 5 18:48:07 2015
@@ -52,7 +52,7 @@ import com.mycila.junit.concurrent.Concu
@Concurrency()
public class SchemaAwareValueSerializationTest
{
- private static byte[] data = new byte[]
+ private static final byte[] DATA = new byte[]
{ 0x01, 0x02, 0x03, 0x04 };
private static BinaryValue bv1;
private static BinaryValue bv2;
@@ -84,10 +84,10 @@ public class SchemaAwareValueSerializati
dc = schemaManager.getAttributeType( "dc" );
userCertificate = schemaManager.getAttributeType( "userCertificate" );
- bv1 = new BinaryValue( userCertificate, data );
+ bv1 = new BinaryValue( userCertificate, DATA );
bv2 = new BinaryValue( userCertificate, StringConstants.EMPTY_BYTES );
bv3 = new BinaryValue( userCertificate, null );
- bv1n = new BinaryValue( userCertificate, data );
+ bv1n = new BinaryValue( userCertificate, DATA );
bv2n = new BinaryValue( userCertificate, StringConstants.EMPTY_BYTES );
bv3n = new BinaryValue( userCertificate, null );
sv1 = new StringValue( cn, "test" );
Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/TestEntryUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/TestEntryUtils.java?rev=1689275&r1=1689274&r2=1689275&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/TestEntryUtils.java (original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/entry/TestEntryUtils.java Sun Jul 5 18:48:07 2015
@@ -42,7 +42,7 @@ import org.apache.directory.api.util.Str
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public class TestEntryUtils
+public final class TestEntryUtils
{
/**
* A local Syntax class for tests
@@ -149,9 +149,7 @@ public class TestEntryUtils
public int compare( String o1, String o2 )
{
- return ( o1 == null ?
- ( o2 == null ? 0 : -1 ) :
- ( o2 == null ? 1 : o1.compareTo( o2 ) ) );
+ return ( o1 == null ? ( o2 == null ? 0 : -1 ) : ( o2 == null ? 1 : o1.compareTo( o2 ) ) );
}
} );
@@ -216,9 +214,7 @@ public class TestEntryUtils
public int compare( String o1, String o2 )
{
- return ( ( o1 == null ) ?
- ( o2 == null ? 0 : -1 ) :
- ( o2 == null ? 1 : o1.compareTo( o2 ) ) );
+ return ( ( o1 == null ) ? ( o2 == null ? 0 : -1 ) : ( o2 == null ? 1 : o1.compareTo( o2 ) ) );
}
} );
@@ -293,4 +289,9 @@ public class TestEntryUtils
return attributeType;
}
+
+
+ private TestEntryUtils()
+ {
+ }
}