From ba663b53d933130d2b6a68c1644e5744428dd1d6 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 25 Nov 2016 11:41:50 +0000
Subject: [PATCH] Manual fixes/changes post inlining DirectoryServer.getSchema()

---
 opendj-server-legacy/src/test/java/org/opends/server/controls/MatchedValuesControlTest.java |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/opendj-server-legacy/src/test/java/org/opends/server/controls/MatchedValuesControlTest.java b/opendj-server-legacy/src/test/java/org/opends/server/controls/MatchedValuesControlTest.java
index f3bac19..7e6a6ba 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/controls/MatchedValuesControlTest.java
+++ b/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));
   }

--
Gitblit v1.10.0