mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noël Rouvignac
25.15.2016 ba663b53d933130d2b6a68c1644e5744428dd1d6
opendj-server-legacy/src/test/java/org/opends/server/controls/MatchedValuesControlTest.java
@@ -24,7 +24,6 @@
import org.forgerock.opendj.ldap.Base64;
import org.forgerock.opendj.ldap.schema.CoreSchema;
import org.forgerock.opendj.ldap.schema.MatchingRule;
import org.opends.server.core.DirectoryServer;
import org.forgerock.opendj.ldap.schema.AttributeType;
import org.forgerock.opendj.ldap.ByteString;
import org.forgerock.opendj.ldap.ByteStringBuilder;
@@ -33,6 +32,7 @@
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import static org.opends.server.TestCaseUtils.*;
import static org.testng.Assert.*;
/** Test MatchedValuesControl. */
@@ -110,7 +110,7 @@
    }
    AttributeType attType = DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(type);
    AttributeType attType = getServerContext().getSchema().getAttributeType(type);
    ByteString attVal = null;
    if (attType != null)
    {
@@ -189,7 +189,7 @@
    // input parameter
    String             rawAttTypeTest = type;
    AttributeType         attTypeTest = DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(type);
    AttributeType         attTypeTest = getServerContext().getSchema().getAttributeType(type);
    ByteString            subInitialTest = ByteString.valueOfUtf8(subInitial);
    List<ByteString> subAnyTest = new ArrayList<>(subAny.size());
    for (String s : subAny)
@@ -367,7 +367,7 @@
    }
    // ( AttributeType attributeType, ByteString assertionValue
    AttributeType attType = DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(type);
    AttributeType attType = getServerContext().getSchema().getAttributeType(type);
    ByteString attVal = null;
    if (attType != null)
    {
@@ -463,7 +463,7 @@
    }
    AttributeType attType = DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(type);
    AttributeType attType = getServerContext().getSchema().getAttributeType(type);
    ByteString attVal = null ;
    if (attType != null)
    {
@@ -539,7 +539,7 @@
    assertEquals(mvf.getMatchType(), MatchedValuesFilter.PRESENT_TYPE);
    // ( AttributeType attributeType
    AttributeType attType = DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(type);
    AttributeType attType = getServerContext().getSchema().getAttributeType(type);
    try
    {
@@ -608,7 +608,7 @@
    }
    // ( AttributeType attributeType, ByteString assertionValue
    AttributeType attType = DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(type);
    AttributeType attType = getServerContext().getSchema().getAttributeType(type);
    ByteString attVal = null ;
    if (attType != null)
    {
@@ -680,7 +680,7 @@
    // input value
    String          rawAttTypeTest = type ;
    AttributeType      attTypeTest = DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(type) ;
    AttributeType      attTypeTest = getServerContext().getSchema().getAttributeType(type) ;
    String             matchingRuleIdTest = matchingRule.getOID() ;
    ByteString    attValueTest = (attTypeTest == null) ? null : ByteString.valueOfUtf8(value);
    // parameter used for the test.
@@ -790,7 +790,7 @@
  public void testDifferentNormalization(String type, ByteString value,
                                         String assertion)
  {
    AttributeType attrType = DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType("usercertificate");
    AttributeType attrType = getServerContext().getSchema().getAttributeType("usercertificate");
    MatchedValuesFilter mvf = MatchedValuesFilter.createEqualityFilter(type, ByteString.valueOfUtf8(assertion));
    assertTrue(mvf.valueMatches(attrType, value));
  }