From 8b3cd28204e15e0a98ce038b355f100cd7c44e3c Mon Sep 17 00:00:00 2001
From: Nicolas Capponi <capponi.nicolas@gmail.com>
Date: Thu, 28 Jan 2016 08:28:20 +0000
Subject: [PATCH] OPENDJ-1632 (PR-201) Migrate AttributeType in one shot
---
opendj-server-legacy/src/test/java/org/opends/server/schema/CountryStringSyntaxTest.java | 34 +++++++++-------------------------
1 files changed, 9 insertions(+), 25 deletions(-)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/schema/CountryStringSyntaxTest.java b/opendj-server-legacy/src/test/java/org/opends/server/schema/CountryStringSyntaxTest.java
index cc9ee5c..fdb22ee 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/schema/CountryStringSyntaxTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/schema/CountryStringSyntaxTest.java
@@ -22,35 +22,31 @@
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions Copyright 2012-2015 ForgeRock AS
+ * Portions Copyright 2012-2016 ForgeRock AS
* Portions Copyright 2012 Manuel Gaupp
*/
package org.opends.server.schema;
+import org.forgerock.opendj.ldap.schema.Schema;
import org.opends.server.ServerContextBuilder;
-import org.opends.server.api.AttributeSyntax;
import org.opends.server.admin.server.ConfigurationChangeListener;
import org.opends.server.admin.std.server.AttributeSyntaxCfg;
import org.opends.server.admin.std.server.CountryStringAttributeSyntaxCfg;
+import org.opends.server.api.AttributeSyntax;
import org.opends.server.core.ServerContext;
-import org.forgerock.opendj.config.server.ConfigException;
-import org.forgerock.opendj.ldap.schema.Schema;
import org.opends.server.types.DN;
import org.opends.server.util.RemoveOnceSDKSchemaIsUsed;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
-/**
- * Test the CountryStringSyntax.
- */
+/** Test the CountryStringSyntax. */
@RemoveOnceSDKSchemaIsUsed
@Test
public class CountryStringSyntaxTest extends AttributeSyntaxTest
{
- /** {@inheritDoc} */
@Override
- protected AttributeSyntax getRule()
+ protected AttributeSyntax<?> getRule() throws Exception
{
CountryStringSyntax syntax = new CountryStringSyntax();
CountryStringAttributeSyntaxCfg cfg = new CountryStringAttributeSyntaxCfg()
@@ -132,24 +128,13 @@
}
};
- try
- {
- Schema schema = Schema.getCoreSchema();
- ServerContext serverContext = ServerContextBuilder.aServerContext()
- .schemaNG(schema)
- .schemaUpdater(new ServerContextBuilder.MockSchemaUpdater(schema)).build();
- syntax.initializeSyntax(cfg, serverContext);
- }
- catch (ConfigException e)
- {
- // Should never happen.
- throw new RuntimeException(e);
- }
-
+ ServerContext serverContext = ServerContextBuilder.aServerContext()
+ .schema(new org.opends.server.types.Schema(Schema.getCoreSchema()))
+ .build();
+ syntax.initializeSyntax(cfg, serverContext);
return syntax;
}
- /** {@inheritDoc} */
@Override
@DataProvider(name="acceptableValues")
public Object[][] createAcceptableValues()
@@ -164,5 +149,4 @@
{"\u00D6\u00C4", false},
};
}
-
}
--
Gitblit v1.10.0