| | |
| | | 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; |
| | |
| | | import org.testng.annotations.DataProvider; |
| | | import org.testng.annotations.Test; |
| | | |
| | | import static org.opends.server.TestCaseUtils.*; |
| | | import static org.testng.Assert.*; |
| | | |
| | | /** Test MatchedValuesControl. */ |
| | |
| | | } |
| | | |
| | | |
| | | AttributeType attType = DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(type); |
| | | AttributeType attType = getServerContext().getSchema().getAttributeType(type); |
| | | ByteString attVal = null; |
| | | if (attType != null) |
| | | { |
| | |
| | | |
| | | // 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) |
| | |
| | | } |
| | | |
| | | // ( AttributeType attributeType, ByteString assertionValue |
| | | AttributeType attType = DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(type); |
| | | AttributeType attType = getServerContext().getSchema().getAttributeType(type); |
| | | ByteString attVal = null; |
| | | if (attType != null) |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | AttributeType attType = DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(type); |
| | | AttributeType attType = getServerContext().getSchema().getAttributeType(type); |
| | | ByteString attVal = null ; |
| | | if (attType != null) |
| | | { |
| | |
| | | assertEquals(mvf.getMatchType(), MatchedValuesFilter.PRESENT_TYPE); |
| | | |
| | | // ( AttributeType attributeType |
| | | AttributeType attType = DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(type); |
| | | AttributeType attType = getServerContext().getSchema().getAttributeType(type); |
| | | |
| | | try |
| | | { |
| | |
| | | } |
| | | |
| | | // ( AttributeType attributeType, ByteString assertionValue |
| | | AttributeType attType = DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(type); |
| | | AttributeType attType = getServerContext().getSchema().getAttributeType(type); |
| | | ByteString attVal = null ; |
| | | if (attType != null) |
| | | { |
| | |
| | | |
| | | // 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. |
| | |
| | | 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)); |
| | | } |