| | |
| | | */ |
| | | package org.opends.server.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.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. |
| | | */ |
| | | @RemoveOnceSDKSchemaIsUsed |
| | | @Test |
| | | public class CountryStringSyntaxTest extends AttributeSyntaxTest |
| | | { |
| | | |
| | |
| | | CountryStringSyntax syntax = new CountryStringSyntax(); |
| | | CountryStringAttributeSyntaxCfg cfg = new CountryStringAttributeSyntaxCfg() |
| | | { |
| | | @Override |
| | | public DN dn() |
| | | { |
| | | return null; |
| | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void removeChangeListener(ConfigurationChangeListener<AttributeSyntaxCfg> listener) |
| | | { |
| | | // Stub. |
| | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public boolean isEnabled() |
| | | { |
| | | // Stub. |
| | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void addChangeListener( |
| | | ConfigurationChangeListener<AttributeSyntaxCfg> listener) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void removeCountryStringChangeListener( |
| | | ConfigurationChangeListener<CountryStringAttributeSyntaxCfg> listener) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public boolean isStrictFormat() |
| | | { |
| | | return true; |
| | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public String getJavaClass() |
| | | { |
| | | // Stub. |
| | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Class<? extends CountryStringAttributeSyntaxCfg> configurationClass() |
| | | { |
| | | // Stub. |
| | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void addCountryStringChangeListener( |
| | | ConfigurationChangeListener<CountryStringAttributeSyntaxCfg> listener) |
| | | { |
| | |
| | | |
| | | try |
| | | { |
| | | syntax.initializeSyntax(cfg); |
| | | Schema schema = Schema.getCoreSchema(); |
| | | ServerContext serverContext = ServerContextBuilder.aServerContext() |
| | | .schemaNG(schema) |
| | | .schemaUpdater(new ServerContextBuilder.MockSchemaUpdater(schema)).build(); |
| | | syntax.initializeSyntax(cfg, serverContext); |
| | | } |
| | | catch (ConfigException e) |
| | | { |