From e56fe3d0b0b40c248c646904037dd5c949839a72 Mon Sep 17 00:00:00 2001
From: Nicolas Capponi <nicolas.capponi@forgerock.com>
Date: Fri, 09 Sep 2016 09:45:25 +0000
Subject: [PATCH] OPENDJ-3089 Delete Syntax classes with compilation errors, and associated test classes
---
/dev/null | 66 ----------------------
opendj-server-legacy/src/test/java/org/opends/server/schema/AttributeTypeSyntaxTest.java | 65 ---------------------
2 files changed, 1 insertions(+), 130 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/schema/AttributeTypeSyntax.java b/opendj-server-legacy/src/main/java/org/opends/server/schema/AttributeTypeSyntax.java
deleted file mode 100644
index 049af28..0000000
--- a/opendj-server-legacy/src/main/java/org/opends/server/schema/AttributeTypeSyntax.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * The contents of this file are subject to the terms of the Common Development and
- * Distribution License (the License). You may not use this file except in compliance with the
- * License.
- *
- * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
- * specific language governing permission and limitations under the License.
- *
- * When distributing Covered Software, include this CDDL Header Notice in each file and include
- * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
- * Header, with the fields enclosed by brackets [] replaced by your own identifying
- * information: "Portions Copyright [year] [name of copyright owner]".
- *
- * Copyright 2006-2009 Sun Microsystems, Inc.
- * Portions Copyright 2011-2016 ForgeRock AS.
- */
-package org.opends.server.schema;
-
-import static org.forgerock.opendj.ldap.schema.SchemaOptions.*;
-import static org.opends.server.schema.SchemaConstants.*;
-
-import java.util.List;
-
-import org.forgerock.i18n.LocalizableMessage;
-import org.forgerock.opendj.config.server.ConfigChangeResult;
-import org.forgerock.opendj.config.server.ConfigException;
-import org.forgerock.opendj.ldap.schema.Schema;
-import org.forgerock.opendj.ldap.schema.Syntax;
-import org.forgerock.opendj.config.server.ConfigurationChangeListener;
-import org.forgerock.opendj.server.config.server.AttributeTypeDescriptionAttributeSyntaxCfg;
-import org.opends.server.api.AttributeSyntax;
-import org.opends.server.core.ServerContext;
-import org.opends.server.types.DirectoryException;
-import org.opends.server.types.InitializationException;
-import org.opends.server.util.RemoveOnceSDKSchemaIsUsed;
-
-/**
- * This class defines the attribute type description syntax, which is used to
- * hold attribute type definitions in the server schema. The format of this
- * syntax is defined in RFC 2252.
- */
-@RemoveOnceSDKSchemaIsUsed
-public class AttributeTypeSyntax
- extends AttributeSyntax<AttributeTypeDescriptionAttributeSyntaxCfg>
- implements
- ConfigurationChangeListener<AttributeTypeDescriptionAttributeSyntaxCfg> {
-
- /**
- * The reference to the configuration for this attribute type description
- * syntax.
- */
- private AttributeTypeDescriptionAttributeSyntaxCfg currentConfig;
-
-
-
- /** If true strip the suggested minimum upper bound from the syntax OID. */
- private static boolean stripMinimumUpperBound;
-
- private ServerContext serverContext;
-
-
- /**
- * Creates a new instance of this syntax. Note that the only thing that
- * should be done here is to invoke the default constructor for the
- * superclass. All initialization should be performed in the
- * <CODE>initializeSyntax</CODE> method.
- */
- public AttributeTypeSyntax()
- {
- super();
- }
-
- @Override
- public void
- initializeSyntax(AttributeTypeDescriptionAttributeSyntaxCfg configuration, ServerContext serverContext)
- throws ConfigException, InitializationException, DirectoryException
- {
- this.serverContext = serverContext;
-
- // This syntax is one of the Directory Server's core syntaxes and therefore
- // it may be instantiated at times without a configuration entry. If that
- // is the case, then we'll exit now before doing anything that could require
- // access to that entry.
- if (configuration == null)
- {
- return;
- }
-
- currentConfig = configuration;
- currentConfig.addAttributeTypeDescriptionChangeListener(this);
- stripMinimumUpperBound = configuration.isStripSyntaxMinUpperBound();
- serverContext.getSchema().updateSchemaOption(STRIP_UPPER_BOUND_FOR_ATTRIBUTE_TYPE, stripMinimumUpperBound);
- }
-
- @Override
- public Syntax getSDKSyntax(Schema schema)
- {
- return schema.getSyntax(SchemaConstants.SYNTAX_ATTRIBUTE_TYPE_OID);
- }
-
- @Override
- public String getName()
- {
- return SYNTAX_ATTRIBUTE_TYPE_NAME;
- }
-
- @Override
- public String getOID()
- {
- return SYNTAX_ATTRIBUTE_TYPE_OID;
- }
-
- @Override
- public String getDescription()
- {
- return SYNTAX_ATTRIBUTE_TYPE_DESCRIPTION;
- }
-
- @Override
- public ConfigChangeResult applyConfigurationChange(
- AttributeTypeDescriptionAttributeSyntaxCfg configuration)
- {
- ConfigChangeResult ccr = new ConfigChangeResult();
- currentConfig = configuration;
- stripMinimumUpperBound = configuration.isStripSyntaxMinUpperBound();
- try
- {
- serverContext.getSchema().updateSchemaOption(STRIP_UPPER_BOUND_FOR_ATTRIBUTE_TYPE, stripMinimumUpperBound);
- }
- catch (DirectoryException e)
- {
- ccr.setResultCode(e.getResultCode());
- ccr.addMessage(e.getMessageObject());
- }
- return ccr;
- }
-
- @Override
- public boolean isConfigurationChangeAcceptable(
- AttributeTypeDescriptionAttributeSyntaxCfg configuration,
- List<LocalizableMessage> unacceptableReasons)
- {
- // The configuration will always be acceptable.
- return true;
- }
-
- /**
- * Boolean that indicates that the minimum upper bound value should be
- * stripped from the Attribute Type Syntax Description.
- *
- * @return True if the minimum upper bound value should be stripped.
- */
- public static boolean isStripSyntaxMinimumUpperBound() {
- return stripMinimumUpperBound;
- }
-}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/schema/CertificateSyntax.java b/opendj-server-legacy/src/main/java/org/opends/server/schema/CertificateSyntax.java
deleted file mode 100644
index d3ba13d..0000000
--- a/opendj-server-legacy/src/main/java/org/opends/server/schema/CertificateSyntax.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * The contents of this file are subject to the terms of the Common Development and
- * Distribution License (the License). You may not use this file except in compliance with the
- * License.
- *
- * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
- * specific language governing permission and limitations under the License.
- *
- * When distributing Covered Software, include this CDDL Header Notice in each file and include
- * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
- * Header, with the fields enclosed by brackets [] replaced by your own identifying
- * information: "Portions Copyright [year] [name of copyright owner]".
- *
- * Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions Copyright 2012-2016 ForgeRock AS.
- * Portions Copyright 2013-2014 Manuel Gaupp
- */
-package org.opends.server.schema;
-
-import static org.opends.server.schema.SchemaConstants.*;
-
-import java.util.List;
-
-import org.forgerock.i18n.LocalizableMessage;
-import org.forgerock.opendj.config.server.ConfigChangeResult;
-import org.forgerock.opendj.config.server.ConfigException;
-import org.forgerock.opendj.ldap.schema.Schema;
-import org.forgerock.opendj.ldap.schema.SchemaOptions;
-import org.forgerock.opendj.ldap.schema.Syntax;
-import org.forgerock.opendj.config.server.ConfigurationChangeListener;
-import org.forgerock.opendj.server.config.server.CertificateAttributeSyntaxCfg;
-import org.opends.server.api.AttributeSyntax;
-import org.opends.server.core.ServerContext;
-import org.opends.server.types.DirectoryException;
-
-
-/**
- * This class implements the certificate attribute syntax. It is restricted to
- * accept only X.509 certificates.
- */
-public class CertificateSyntax
- extends AttributeSyntax<CertificateAttributeSyntaxCfg>
- implements ConfigurationChangeListener<CertificateAttributeSyntaxCfg>
-{
-
- /** The current configuration. */
- private volatile CertificateAttributeSyntaxCfg config;
-
- private ServerContext serverContext;
-
- /**
- * Creates a new instance of this syntax. Note that the only thing that
- * should be done here is to invoke the default constructor for the
- * superclass. All initialization should be performed in the
- * <CODE>initializeSyntax</CODE> method.
- */
- public CertificateSyntax()
- {
- super();
- }
-
- @Override
- public void initializeSyntax(CertificateAttributeSyntaxCfg configuration, ServerContext serverContext)
- throws ConfigException, DirectoryException
- {
- this.config = configuration;
- this.serverContext = serverContext;
- serverContext.getSchema().updateSchemaOption(SchemaOptions.ALLOW_MALFORMED_CERTIFICATES, !config.isStrictFormat());
- config.addCertificateChangeListener(this);
- }
-
- @Override
- public Syntax getSDKSyntax(Schema schema)
- {
- return schema.getSyntax(SchemaConstants.SYNTAX_CERTIFICATE_OID);
- }
-
- @Override
- public boolean isConfigurationChangeAcceptable(
- CertificateAttributeSyntaxCfg configuration,
- List<LocalizableMessage> unacceptableReasons)
- {
- // The configuration is always acceptable.
- return true;
- }
-
- @Override
- public ConfigChangeResult applyConfigurationChange(
- CertificateAttributeSyntaxCfg configuration)
- {
- this.config = configuration;
- final ConfigChangeResult ccr = new ConfigChangeResult();
- try
- {
- serverContext.getSchema()
- .updateSchemaOption(SchemaOptions.ALLOW_MALFORMED_CERTIFICATES, !config.isStrictFormat());
- }
- catch (DirectoryException e)
- {
- ccr.setResultCode(e.getResultCode());
- ccr.addMessage(e.getMessageObject());
- }
- return ccr;
- }
-
- /**
- * Retrieves the common name for this attribute syntax.
- *
- * @return The common name for this attribute syntax.
- */
- @Override
- public String getName()
- {
- return SYNTAX_CERTIFICATE_NAME;
- }
-
- /**
- * Retrieves the OID for this attribute syntax.
- *
- * @return The OID for this attribute syntax.
- */
- @Override
- public String getOID()
- {
- return SYNTAX_CERTIFICATE_OID;
- }
-
- /**
- * Retrieves a description for this attribute syntax.
- *
- * @return A description for this attribute syntax.
- */
- @Override
- public String getDescription()
- {
- return SYNTAX_CERTIFICATE_DESCRIPTION;
- }
-}
-
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/schema/CountryStringSyntax.java b/opendj-server-legacy/src/main/java/org/opends/server/schema/CountryStringSyntax.java
deleted file mode 100644
index 4e8099b..0000000
--- a/opendj-server-legacy/src/main/java/org/opends/server/schema/CountryStringSyntax.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * The contents of this file are subject to the terms of the Common Development and
- * Distribution License (the License). You may not use this file except in compliance with the
- * License.
- *
- * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
- * specific language governing permission and limitations under the License.
- *
- * When distributing Covered Software, include this CDDL Header Notice in each file and include
- * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
- * Header, with the fields enclosed by brackets [] replaced by your own identifying
- * information: "Portions Copyright [year] [name of copyright owner]".
- *
- * Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions Copyright 2012-2016 ForgeRock AS.
- * Portions Copyright 2012 Manuel Gaupp
- */
-package org.opends.server.schema;
-
-import static org.forgerock.opendj.ldap.schema.SchemaOptions.*;
-import static org.opends.server.schema.SchemaConstants.*;
-
-import java.util.List;
-
-import org.forgerock.i18n.LocalizableMessage;
-import org.forgerock.opendj.config.server.ConfigChangeResult;
-import org.forgerock.opendj.config.server.ConfigException;
-import org.forgerock.opendj.ldap.schema.Schema;
-import org.forgerock.opendj.ldap.schema.Syntax;
-import org.forgerock.opendj.config.server.ConfigurationChangeListener;
-import org.forgerock.opendj.server.config.server.CountryStringAttributeSyntaxCfg;
-import org.opends.server.api.AttributeSyntax;
-import org.opends.server.core.ServerContext;
-import org.opends.server.types.DirectoryException;
-
-/**
- * This class defines the country string attribute syntax, which should be a
- * two-character ISO 3166 country code. However, for maintainability, it will
- * accept any value consisting entirely of two printable characters. In most
- * ways, it will behave like the directory string attribute syntax.
- */
-public class CountryStringSyntax
- extends AttributeSyntax<CountryStringAttributeSyntaxCfg>
- implements ConfigurationChangeListener<CountryStringAttributeSyntaxCfg>
-{
-
- /** The current configuration. */
- private volatile CountryStringAttributeSyntaxCfg config;
-
- private ServerContext serverContext;
-
- /**
- * Creates a new instance of this syntax. Note that the only thing that
- * should be done here is to invoke the default constructor for the
- * superclass. All initialization should be performed in the
- * <CODE>initializeSyntax</CODE> method.
- */
- public CountryStringSyntax()
- {
- super();
- }
-
- @Override
- public void initializeSyntax(CountryStringAttributeSyntaxCfg configuration, ServerContext serverContext)
- throws ConfigException, DirectoryException
- {
- this.config = configuration;
- this.serverContext = serverContext;
- serverContext.getSchema().updateSchemaOption(STRICT_FORMAT_FOR_COUNTRY_STRINGS, config.isStrictFormat());
- config.addCountryStringChangeListener(this);
- }
-
- @Override
- public Syntax getSDKSyntax(Schema schema)
- {
- return schema.getSyntax(SchemaConstants.SYNTAX_COUNTRY_STRING_OID);
- }
-
- @Override
- public boolean isConfigurationChangeAcceptable(
- CountryStringAttributeSyntaxCfg configuration,
- List<LocalizableMessage> unacceptableReasons)
- {
- // The configuration is always acceptable.
- return true;
- }
-
- @Override
- public ConfigChangeResult applyConfigurationChange(CountryStringAttributeSyntaxCfg configuration)
- {
- this.config = configuration;
-
- final ConfigChangeResult ccr = new ConfigChangeResult();
- try
- {
- serverContext.getSchema().updateSchemaOption(STRICT_FORMAT_FOR_COUNTRY_STRINGS, config.isStrictFormat());
- }
- catch (DirectoryException e)
- {
- ccr.setResultCode(e.getResultCode());
- ccr.addMessage(e.getMessageObject());
- }
- return ccr;
- }
-
- @Override
- public String getName()
- {
- return SYNTAX_COUNTRY_STRING_NAME;
- }
-
- @Override
- public String getOID()
- {
- return SYNTAX_COUNTRY_STRING_OID;
- }
-
- @Override
- public String getDescription()
- {
- return SYNTAX_COUNTRY_STRING_DESCRIPTION;
- }
-}
-
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/schema/DirectoryStringSyntax.java b/opendj-server-legacy/src/main/java/org/opends/server/schema/DirectoryStringSyntax.java
deleted file mode 100644
index b1cef82..0000000
--- a/opendj-server-legacy/src/main/java/org/opends/server/schema/DirectoryStringSyntax.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * The contents of this file are subject to the terms of the Common Development and
- * Distribution License (the License). You may not use this file except in compliance with the
- * License.
- *
- * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
- * specific language governing permission and limitations under the License.
- *
- * When distributing Covered Software, include this CDDL Header Notice in each file and include
- * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
- * Header, with the fields enclosed by brackets [] replaced by your own identifying
- * information: "Portions Copyright [year] [name of copyright owner]".
- *
- * Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions Copyright 2012-2016 ForgeRock AS.
- */
-package org.opends.server.schema;
-
-import static org.forgerock.opendj.ldap.schema.SchemaOptions.*;
-import static org.opends.server.schema.SchemaConstants.*;
-
-import java.util.List;
-
-import org.forgerock.i18n.LocalizableMessage;
-import org.forgerock.opendj.config.server.ConfigChangeResult;
-import org.forgerock.opendj.config.server.ConfigException;
-import org.forgerock.opendj.ldap.schema.Schema;
-import org.forgerock.opendj.ldap.schema.Syntax;
-import org.forgerock.opendj.config.server.ConfigurationChangeListener;
-import org.forgerock.opendj.server.config.server.DirectoryStringAttributeSyntaxCfg;
-import org.opends.server.api.AttributeSyntax;
-import org.opends.server.core.ServerContext;
-import org.opends.server.types.DirectoryException;
-
-
-/**
- * This class defines the directory string attribute syntax, which is simply a
- * set of UTF-8 characters. By default, they will be treated in a
- * case-insensitive manner, and equality, ordering, substring, and approximate
- * matching will be allowed.
- */
-public class DirectoryStringSyntax
- extends AttributeSyntax<DirectoryStringAttributeSyntaxCfg>
- implements ConfigurationChangeListener<DirectoryStringAttributeSyntaxCfg>
-{
-
- /** Indicates whether we will allow zero-length values. */
- private boolean allowZeroLengthValues;
-
- /** The reference to the configuration for this directory string syntax. */
- private DirectoryStringAttributeSyntaxCfg currentConfig;
-
- private ServerContext serverContext;
-
- /**
- * Creates a new instance of this syntax. Note that the only thing that
- * should be done here is to invoke the default constructor for the
- * superclass. All initialization should be performed in the
- * <CODE>initializeSyntax</CODE> method.
- */
- public DirectoryStringSyntax()
- {
- super();
- }
-
- @Override
- public void initializeSyntax(DirectoryStringAttributeSyntaxCfg configuration, ServerContext serverContext)
- throws ConfigException, DirectoryException
- {
- this.serverContext = serverContext;
-
- // This syntax is one of the Directory Server's core syntaxes and therefore
- // it may be instantiated at times without a configuration entry. If that
- // is the case, then we'll exit now before doing anything that could require
- // access to that entry.
- if (configuration == null)
- {
- return;
- }
-
- currentConfig = configuration;
- currentConfig.addDirectoryStringChangeListener(this);
- allowZeroLengthValues = currentConfig.isAllowZeroLengthValues();
- serverContext.getSchema().updateSchemaOption(ALLOW_ZERO_LENGTH_DIRECTORY_STRINGS, allowZeroLengthValues);
- }
-
- @Override
- public Syntax getSDKSyntax(Schema schema)
- {
- return schema.getSyntax(SchemaConstants.SYNTAX_DIRECTORY_STRING_OID);
- }
-
- @Override
- public void finalizeSyntax()
- {
- currentConfig.removeDirectoryStringChangeListener(this);
- }
-
- @Override
- public String getName()
- {
- return SYNTAX_DIRECTORY_STRING_NAME;
- }
-
- @Override
- public String getOID()
- {
- return SYNTAX_DIRECTORY_STRING_OID;
- }
-
- @Override
- public String getDescription()
- {
- return SYNTAX_DIRECTORY_STRING_DESCRIPTION;
- }
-
- /**
- * Indicates whether zero-length values will be allowed. This is technically
- * forbidden by the LDAP specification, but it was allowed in earlier versions
- * of the server, and the discussion of the directory string syntax in RFC
- * 2252 does not explicitly state that they are not allowed.
- *
- * @return <CODE>true</CODE> if zero-length values should be allowed for
- * attributes with a directory string syntax, or <CODE>false</CODE>
- * if not.
- */
- public boolean allowZeroLengthValues()
- {
- return allowZeroLengthValues;
- }
-
- @Override
- public boolean isConfigurationChangeAcceptable(
- DirectoryStringAttributeSyntaxCfg configuration,
- List<LocalizableMessage> unacceptableReasons)
- {
- // The configuration will always be acceptable.
- return true;
- }
-
- @Override
- public ConfigChangeResult applyConfigurationChange(
- DirectoryStringAttributeSyntaxCfg configuration)
- {
- currentConfig = configuration;
- allowZeroLengthValues = configuration.isAllowZeroLengthValues();
- final ConfigChangeResult ccr = new ConfigChangeResult();
- try
- {
- serverContext.getSchema().updateSchemaOption(ALLOW_ZERO_LENGTH_DIRECTORY_STRINGS, allowZeroLengthValues);
- }
- catch (DirectoryException e)
- {
- ccr.setResultCode(e.getResultCode());
- ccr.addMessage(e.getMessageObject());
- }
- return ccr;
- }
-}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/schema/JPEGSyntax.java b/opendj-server-legacy/src/main/java/org/opends/server/schema/JPEGSyntax.java
deleted file mode 100644
index 3d143c6..0000000
--- a/opendj-server-legacy/src/main/java/org/opends/server/schema/JPEGSyntax.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * The contents of this file are subject to the terms of the Common Development and
- * Distribution License (the License). You may not use this file except in compliance with the
- * License.
- *
- * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
- * specific language governing permission and limitations under the License.
- *
- * When distributing Covered Software, include this CDDL Header Notice in each file and include
- * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
- * Header, with the fields enclosed by brackets [] replaced by your own identifying
- * information: "Portions Copyright [year] [name of copyright owner]".
- *
- * Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions Copyright 2012-2016 ForgeRock AS.
- */
-package org.opends.server.schema;
-
-import static org.opends.server.schema.SchemaConstants.*;
-
-import java.util.List;
-
-import org.forgerock.i18n.LocalizableMessage;
-import org.forgerock.opendj.config.server.ConfigChangeResult;
-import org.forgerock.opendj.config.server.ConfigException;
-import org.forgerock.opendj.ldap.schema.Schema;
-import org.forgerock.opendj.ldap.schema.SchemaOptions;
-import org.forgerock.opendj.ldap.schema.Syntax;
-import org.forgerock.opendj.config.server.ConfigurationChangeListener;
-import org.forgerock.opendj.server.config.server.JPEGAttributeSyntaxCfg;
-import org.opends.server.api.AttributeSyntax;
-import org.opends.server.core.ServerContext;
-import org.opends.server.types.DirectoryException;
-
-/**
- * This class implements the JPEG attribute syntax. This is actually
- * two specifications - JPEG and JFIF. As an extension we allow JPEG
- * and Exif, which is what most digital cameras use. We only check for
- * valid JFIF and Exif headers.
- */
-public class JPEGSyntax
- extends AttributeSyntax<JPEGAttributeSyntaxCfg>
- implements ConfigurationChangeListener<JPEGAttributeSyntaxCfg>
-{
-
- /** The current configuration for this JPEG syntax. */
- private volatile JPEGAttributeSyntaxCfg config;
-
- private ServerContext serverContext;
-
- /**
- * Creates a new instance of this syntax. Note that the only thing that
- * should be done here is to invoke the default constructor for the
- * superclass. All initialization should be performed in the
- * <CODE>initializeSyntax</CODE> method.
- */
- public JPEGSyntax()
- {
- super();
- }
-
- @Override
- public void initializeSyntax(JPEGAttributeSyntaxCfg configuration, ServerContext serverContext)
- throws ConfigException, DirectoryException
- {
- this.config = configuration;
- this.serverContext = serverContext;
- serverContext.getSchema().updateSchemaOption(SchemaOptions.ALLOW_MALFORMED_JPEG_PHOTOS, !config.isStrictFormat());
- config.addJPEGChangeListener(this);
- }
-
- @Override
- public Syntax getSDKSyntax(Schema schema)
- {
- return schema.getSyntax(SchemaConstants.SYNTAX_JPEG_OID);
- }
-
- @Override
- public String getName()
- {
- return SYNTAX_JPEG_NAME;
- }
-
- @Override
- public String getOID()
- {
- return SYNTAX_JPEG_OID;
- }
-
- @Override
- public String getDescription()
- {
- return SYNTAX_JPEG_DESCRIPTION;
- }
-
- @Override
- public boolean isConfigurationChangeAcceptable(
- JPEGAttributeSyntaxCfg configuration,
- List<LocalizableMessage> unacceptableReasons)
- {
- // The configuration will always be acceptable.
- return true;
- }
-
- @Override
- public ConfigChangeResult applyConfigurationChange(
- JPEGAttributeSyntaxCfg configuration)
- {
- this.config = configuration;
- final ConfigChangeResult ccr = new ConfigChangeResult();
- try
- {
- serverContext.getSchema().updateSchemaOption(SchemaOptions.ALLOW_MALFORMED_JPEG_PHOTOS, !config.isStrictFormat());
- }
- catch (DirectoryException e)
- {
- ccr.setResultCode(e.getResultCode());
- ccr.addMessage(e.getMessageObject());
- }
- return ccr;
- }
-}
-
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/schema/TelephoneNumberSyntax.java b/opendj-server-legacy/src/main/java/org/opends/server/schema/TelephoneNumberSyntax.java
deleted file mode 100644
index 38f0b46..0000000
--- a/opendj-server-legacy/src/main/java/org/opends/server/schema/TelephoneNumberSyntax.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * The contents of this file are subject to the terms of the Common Development and
- * Distribution License (the License). You may not use this file except in compliance with the
- * License.
- *
- * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
- * specific language governing permission and limitations under the License.
- *
- * When distributing Covered Software, include this CDDL Header Notice in each file and include
- * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
- * Header, with the fields enclosed by brackets [] replaced by your own identifying
- * information: "Portions Copyright [year] [name of copyright owner]".
- *
- * Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions Copyright 2012-2016 ForgeRock AS.
- */
-package org.opends.server.schema;
-
-import static org.opends.server.schema.SchemaConstants.*;
-
-import java.util.List;
-
-import org.forgerock.i18n.LocalizableMessage;
-import org.forgerock.opendj.config.server.ConfigChangeResult;
-import org.forgerock.opendj.config.server.ConfigException;
-import org.forgerock.opendj.ldap.schema.Schema;
-import org.forgerock.opendj.ldap.schema.SchemaOptions;
-import org.forgerock.opendj.ldap.schema.Syntax;
-import org.forgerock.opendj.config.server.ConfigurationChangeListener;
-import org.forgerock.opendj.server.config.server.TelephoneNumberAttributeSyntaxCfg;
-import org.opends.server.api.AttributeSyntax;
-import org.opends.server.core.ServerContext;
-import org.opends.server.types.DirectoryException;
-
-/**
- * This class implements the telephone number attribute syntax, which is defined
- * in RFC 2252. Note that this can have two modes of operation, depending on
- * its configuration. Most of the time, it will be very lenient when deciding
- * what to accept, and will allow anything but only pay attention to the digits.
- * However, it can also be configured in a "strict" mode, in which case it will
- * only accept values in the E.123 international telephone number format.
- */
-public class TelephoneNumberSyntax
- extends AttributeSyntax<TelephoneNumberAttributeSyntaxCfg>
- implements ConfigurationChangeListener<TelephoneNumberAttributeSyntaxCfg>
-{
-
- /** Indicates whether this matching rule should operate in strict mode. */
- private boolean strictMode;
-
- /** The current configuration for this telephone number syntax. */
- private TelephoneNumberAttributeSyntaxCfg currentConfig;
-
- private ServerContext serverContext;
-
- /**
- * Creates a new instance of this syntax. Note that the only thing that
- * should be done here is to invoke the default constructor for the
- * superclass. All initialization should be performed in the
- * <CODE>initializeSyntax</CODE> method.
- */
- public TelephoneNumberSyntax()
- {
- super();
- }
-
- @Override
- public void initializeSyntax(TelephoneNumberAttributeSyntaxCfg configuration, ServerContext serverContext)
- throws ConfigException, DirectoryException
- {
- this.serverContext = serverContext;
-
- // We may or may not have access to the config entry. If we do, then see if
- // we should use the strict compliance mode. If not, just assume that we won't.
- strictMode = false;
- if (configuration != null)
- {
- currentConfig = configuration;
- currentConfig.addTelephoneNumberChangeListener(this);
- strictMode = currentConfig.isStrictFormat();
- serverContext.getSchema().updateSchemaOption(SchemaOptions.ALLOW_NON_STANDARD_TELEPHONE_NUMBERS, !strictMode);
- }
- }
-
- @Override
- public Syntax getSDKSyntax(Schema schema)
- {
- return schema.getSyntax(SchemaConstants.SYNTAX_TELEPHONE_OID);
- }
-
- @Override
- public void finalizeSyntax()
- {
- currentConfig.removeTelephoneNumberChangeListener(this);
- }
-
- @Override
- public String getName()
- {
- return SYNTAX_TELEPHONE_NAME;
- }
-
- @Override
- public String getOID()
- {
- return SYNTAX_TELEPHONE_OID;
- }
-
- @Override
- public String getDescription()
- {
- return SYNTAX_TELEPHONE_DESCRIPTION;
- }
-
- @Override
- public boolean isConfigurationChangeAcceptable(
- TelephoneNumberAttributeSyntaxCfg configuration,
- List<LocalizableMessage> unacceptableReasons)
- {
- // The configuration will always be acceptable.
- return true;
- }
-
- @Override
- public ConfigChangeResult applyConfigurationChange(
- TelephoneNumberAttributeSyntaxCfg configuration)
- {
- currentConfig = configuration;
- strictMode = configuration.isStrictFormat();
- final ConfigChangeResult ccr = new ConfigChangeResult();
- try
- {
- serverContext.getSchema().updateSchemaOption(SchemaOptions.ALLOW_NON_STANDARD_TELEPHONE_NUMBERS, !strictMode);
- }
- catch (DirectoryException e)
- {
- ccr.setResultCode(e.getResultCode());
- ccr.addMessage(e.getMessageObject());
- }
- return ccr;
- }
-}
-
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/schema/AttributeTypeSyntaxTest.java b/opendj-server-legacy/src/test/java/org/opends/server/schema/AttributeTypeSyntaxTest.java
index 1257214..101034d 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/schema/AttributeTypeSyntaxTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/schema/AttributeTypeSyntaxTest.java
@@ -25,12 +25,10 @@
import org.forgerock.opendj.ldap.schema.SchemaBuilder;
import org.forgerock.opendj.ldap.schema.Syntax;
import org.opends.server.TestCaseUtils;
-import org.opends.server.api.AttributeSyntax;
import org.opends.server.core.DirectoryServer;
import org.opends.server.protocols.internal.InternalSearchOperation;
import org.opends.server.protocols.internal.SearchRequest;
import org.opends.server.util.RemoveOnceSDKSchemaIsUsed;
-import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import static org.opends.server.protocols.internal.InternalClientConnection.*;
@@ -39,69 +37,8 @@
/** Test the AttributeTypeSyntax. */
@RemoveOnceSDKSchemaIsUsed
-public class AttributeTypeSyntaxTest extends AttributeSyntaxTest
+public class AttributeTypeSyntaxTest extends SchemaTestCase
{
- @Override
- protected AttributeSyntax getRule()
- {
- return new AttributeTypeSyntax();
- }
-
- @Override
- @DataProvider(name="acceptableValues")
- public Object[][] createAcceptableValues()
- {
- return new Object [][] {
- {"(1.2.8.5 NAME 'testtype' DESC 'full type' OBSOLETE SUP cn " +
- " EQUALITY caseIgnoreMatch ORDERING caseIgnoreOrderingMatch" +
- " SUBSTR caseIgnoreSubstringsMatch" +
- " SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE" +
- " USAGE userApplications )",
- true},
- {"(1.2.8.5 NAME 'testtype' DESC 'full type' OBSOLETE " +
- " EQUALITY caseIgnoreMatch ORDERING caseIgnoreOrderingMatch" +
- " SUBSTR caseIgnoreSubstringsMatch" +
- " SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE" +
- " COLLECTIVE USAGE userApplications )",
- true},
- {"(1.2.8.5 NAME 'testtype')", true},
- {"(1.2.8.5 NAME 'testtype' DESC 'full type')",
- true},
- {"(1.2.8.5 NAME 'testType' DESC 'full type' EQUALITY caseIgnoreMatch " +
- " SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)",
- true},
- {"(1.2.8.5 NAME 'testType' DESC 'full type' EQUALITY caseIgnoreMatch " +
- " SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'test' )",
- true},
- {"(1.2.8.5 NAME 'testType' DESC 'full type' EQUALITY caseIgnoreMatch " +
- " SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'test')",
- true},
- {"(1.2.8.5 NAME 'testType' DESC 'full type' EQUALITY caseIgnoreMatch " +
- " SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'test' " +
- " X-SCHEMA-FILE '33-test.ldif' )",
- true},
- {"(1.2.8.5 USAGE directoryOperation )",
- true},
- {"(1.2.8.5 NAME 'testtype' DESC 'full type' OBSOLETE SUP cn " +
- " EQUALITY caseIgnoreMatch ORDERING caseIgnoreOrderingMatch" +
- " SUBSTR caseIgnoreSubstringsMatch" +
- " SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE" +
- " COLLECTIVE USAGE userApplications )",
- true}, // Collective can inherit from non-collective
- {"(1.2.8.5 NAME 'testtype' DESC 'full type' OBSOLETE " +
- " EQUALITY caseIgnoreMatch ORDERING caseIgnoreOrderingMatch" +
- " SUBSTR caseIgnoreSubstringsMatch" +
- " SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE" +
- " COLLECTIVE USAGE directoryOperation )",
- true}, // Collective can be operational
- {"(1.2.8.5 NAME 'testType' DESC 'full type' EQUALITY caseIgnoreMatch " +
- " SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'test' " +
- " X-SCHEMA-FILE '33-test.ldif' X-NAME )",
- false}, // X-NAME is invalid extension (no value)
- };
- }
-
-
/**
* Tests the use of the "X-APPROX" extension to specify a particular
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/schema/CertificateSyntaxTest.java b/opendj-server-legacy/src/test/java/org/opends/server/schema/CertificateSyntaxTest.java
deleted file mode 100644
index 39b041f..0000000
--- a/opendj-server-legacy/src/test/java/org/opends/server/schema/CertificateSyntaxTest.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * The contents of this file are subject to the terms of the Common Development and
- * Distribution License (the License). You may not use this file except in compliance with the
- * License.
- *
- * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
- * specific language governing permission and limitations under the License.
- *
- * When distributing Covered Software, include this CDDL Header Notice in each file and include
- * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
- * Header, with the fields enclosed by brackets [] replaced by your own identifying
- * information: "Portions Copyright [year] [name of copyright owner]".
- *
- * Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions Copyright 2012-2016 ForgeRock AS.
- */
-package org.opends.server.schema;
-
-import org.forgerock.opendj.ldap.ByteString;
-import org.opends.server.ServerContextBuilder;
-import org.forgerock.opendj.config.server.ConfigurationChangeListener;
-import org.forgerock.opendj.server.config.server.AttributeSyntaxCfg;
-import org.forgerock.opendj.server.config.server.CertificateAttributeSyntaxCfg;
-import org.opends.server.api.AttributeSyntax;
-import org.opends.server.core.SchemaHandler;
-import org.opends.server.core.ServerContext;
-import org.forgerock.opendj.ldap.DN;
-import org.opends.server.util.Base64;
-import org.opends.server.util.RemoveOnceSDKSchemaIsUsed;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
-/** Test the CertificateSyntax. */
-@RemoveOnceSDKSchemaIsUsed
-@Test
-public class CertificateSyntaxTest extends BinaryAttributeSyntaxTest
-{
-
- @Override
- protected AttributeSyntax<?> getRule() throws Exception
- {
- CertificateSyntax syntax = new CertificateSyntax();
- CertificateAttributeSyntaxCfg cfg = new CertificateAttributeSyntaxCfg()
- {
- @Override
- public DN dn()
- {
- return null;
- }
-
- @Override
- public void removeChangeListener(
- ConfigurationChangeListener<AttributeSyntaxCfg> listener)
- {
- // Stub.
- }
-
-
-
- @Override
- public boolean isEnabled()
- {
- // Stub.
- return false;
- }
-
-
-
- @Override
- public void addChangeListener(
- ConfigurationChangeListener<AttributeSyntaxCfg> listener)
- {
- // Stub.
- }
-
-
-
- @Override
- public void removeCertificateChangeListener(
- ConfigurationChangeListener<CertificateAttributeSyntaxCfg> listener)
- {
- // Stub.
- }
-
-
-
- @Override
- public boolean isStrictFormat()
- {
- return true;
- }
-
-
-
- @Override
- public String getJavaClass()
- {
- // Stub.
- return null;
- }
-
-
-
- @Override
- public Class<? extends CertificateAttributeSyntaxCfg> configurationClass()
- {
- // Stub.
- return null;
- }
-
-
-
- @Override
- public void addCertificateChangeListener(
- ConfigurationChangeListener<CertificateAttributeSyntaxCfg> listener)
- {
- // Stub.
- }
- };
-
- ServerContext serverContext = ServerContextBuilder.aServerContext()
- .schemaHandler(new SchemaHandler()) // provides core schema
- .build();
- syntax.initializeSyntax(cfg, serverContext);
- return syntax;
- }
-
- @Override
- @DataProvider(name="acceptableValues")
- public Object[][] createAcceptableValues()
- {
- String validcert1 =
- "MIICpTCCAg6gAwIBAgIJALeoA6I3ZC/cMA0GCSqGSIb3DQEBBQUAMFYxCzAJBgNV" +
- "BAYTAlVTMRMwEQYDVQQHEwpDdXBlcnRpb25lMRwwGgYDVQQLExNQcm9kdWN0IERl" +
- "dmVsb3BtZW50MRQwEgYDVQQDEwtCYWJzIEplbnNlbjAeFw0xMjA1MDIxNjM0MzVa" +
- "Fw0xMjEyMjExNjM0MzVaMFYxCzAJBgNVBAYTAlVTMRMwEQYDVQQHEwpDdXBlcnRp" +
- "b25lMRwwGgYDVQQLExNQcm9kdWN0IERldmVsb3BtZW50MRQwEgYDVQQDEwtCYWJz" +
- "IEplbnNlbjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApysa0c9qc8FB8gIJ" +
- "8zAb1pbJ4HzC7iRlVGhRJjFORkGhyvU4P5o2wL0iz/uko6rL9/pFhIlIMbwbV8sm" +
- "mKeNUPitwiKOjoFDmtimcZ4bx5UTAYLbbHMpEdwSpMC5iF2UioM7qdiwpAfZBd6Z" +
- "69vqNxuUJ6tP+hxtr/aSgMH2i8ECAwEAAaN7MHkwCQYDVR0TBAIwADAsBglghkgB" +
- "hvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYE" +
- "FLlZD3aKDa8jdhzoByOFMAJDs2osMB8GA1UdIwQYMBaAFLlZD3aKDa8jdhzoByOF" +
- "MAJDs2osMA0GCSqGSIb3DQEBBQUAA4GBAE5vccY8Ydd7by2bbwiDKgQqVyoKrkUg" +
- "6CD0WRmc2pBeYX2z94/PWO5L3Fx+eIZh2wTxScF+FdRWJzLbUaBuClrxuy0Y5ifj" +
- "axuJ8LFNbZtsp1ldW3i84+F5+SYT+xI67ZcoAtwx/VFVI9s5I/Gkmu9f9nxjPpK7" +
- "1AIUXiE3Qcck";
-
- String invalidcert1 =
- "MIICpTCCAg6gAwIBBQIJALeoA6I3ZC/cMA0GCSqGSIb3DQEBBQUAMFYxCzAJBgNV" +
- "BAYTAlVTMRMwEQYDVQQHEwpDdXBlcnRpb25lMRwwGgYDVQQLExNQcm9kdWN0IERl" +
- "dmVsb3BtZW50MRQwEgYDVQQDEwtCYWJzIEplbnNlbjAeFw0xMjA1MDIxNjM0MzVa" +
- "Fw0xMjEyMjExNjM0MzVaMFYxCzAJBgNVBAYTAlVTMRMwEQYDVQQHEwpDdXBlcnRp" +
- "b25lMRwwGgYDVQQLExNQcm9kdWN0IERldmVsb3BtZW50MRQwEgYDVQQDEwtCYWJz" +
- "IEplbnNlbjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApysa0c9qc8FB8gIJ" +
- "8zAb1pbJ4HzC7iRlVGhRJjFORkGhyvU4P5o2wL0iz/uko6rL9/pFhIlIMbwbV8sm" +
- "mKeNUPitwiKOjoFDmtimcZ4bx5UTAYLbbHMpEdwSpMC5iF2UioM7qdiwpAfZBd6Z" +
- "69vqNxuUJ6tP+hxtr/aSgMH2i8ECAwEAAaN7MHkwCQYDVR0TBAIwADAsBglghkgB" +
- "hvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYE" +
- "FLlZD3aKDa8jdhzoByOFMAJDs2osMB8GA1UdIwQYMBaAFLlZD3aKDa8jdhzoByOF" +
- "MAJDs2osMA0GCSqGSIb3DQEBBQUAA4GBAE5vccY8Ydd7by2bbwiDKgQqVyoKrkUg" +
- "6CD0WRmc2pBeYX2z94/PWO5L3Fx+eIZh2wTxScF+FdRWJzLbUaBuClrxuy0Y5ifj" +
- "axuJ8LFNbZtsp1ldW3i84+F5+SYT+xI67ZcoAtwx/VFVI9s5I/Gkmu9f9nxjPpK7" +
- "1AIUXiE3Qcck";
-
- String brokencert1 =
- "MIICpTCCAg6gAwIBAgIJALeoA6I3ZC/cMA0GCSqGSIb3DQEBBQUAMFYxCzAJBgNV";
-
- try {
- return new Object [][] {
- {ByteString.wrap(Base64.decode(validcert1)), true},
- {ByteString.valueOfUtf8(validcert1), false},
- {ByteString.wrap(Base64.decode(invalidcert1)), false},
- {ByteString.wrap(Base64.decode(brokencert1)), false},
- {ByteString.valueOfUtf8("invalid"), false}
- };
- }
- catch (Exception e)
- {
- return new Object[][] {};
- }
- }
-}
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
deleted file mode 100644
index 51f66d5..0000000
--- a/opendj-server-legacy/src/test/java/org/opends/server/schema/CountryStringSyntaxTest.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * The contents of this file are subject to the terms of the Common Development and
- * Distribution License (the License). You may not use this file except in compliance with the
- * License.
- *
- * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
- * specific language governing permission and limitations under the License.
- *
- * When distributing Covered Software, include this CDDL Header Notice in each file and include
- * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
- * Header, with the fields enclosed by brackets [] replaced by your own identifying
- * information: "Portions Copyright [year] [name of copyright owner]".
- *
- * Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions Copyright 2012-2016 ForgeRock AS.
- * Portions Copyright 2012 Manuel Gaupp
- */
-package org.opends.server.schema;
-
-import org.forgerock.opendj.ldap.DN;
-import org.opends.server.ServerContextBuilder;
-import org.opends.server.api.AttributeSyntax;
-import org.forgerock.opendj.config.server.ConfigurationChangeListener;
-import org.forgerock.opendj.server.config.server.AttributeSyntaxCfg;
-import org.forgerock.opendj.server.config.server.CountryStringAttributeSyntaxCfg;
-import org.opends.server.core.SchemaHandler;
-import org.opends.server.core.ServerContext;
-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
-{
-
- @Override
- protected AttributeSyntax<?> getRule() throws Exception
- {
- 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.
- return false;
- }
-
-
-
- @Override
- public void addChangeListener(
- ConfigurationChangeListener<AttributeSyntaxCfg> listener)
- {
- // Stub.
- }
-
-
-
- @Override
- public void removeCountryStringChangeListener(
- ConfigurationChangeListener<CountryStringAttributeSyntaxCfg> listener)
- {
- // Stub.
- }
-
-
-
- @Override
- public boolean isStrictFormat()
- {
- return true;
- }
-
-
-
- @Override
- public String getJavaClass()
- {
- // Stub.
- return null;
- }
-
-
-
- @Override
- public Class<? extends CountryStringAttributeSyntaxCfg> configurationClass()
- {
- // Stub.
- return null;
- }
-
-
-
- @Override
- public void addCountryStringChangeListener(
- ConfigurationChangeListener<CountryStringAttributeSyntaxCfg> listener)
- {
- // Stub.
- }
- };
-
- ServerContext serverContext = ServerContextBuilder.aServerContext()
- .schemaHandler(new SchemaHandler()) // provides core schema
- .build();
- syntax.initializeSyntax(cfg, serverContext);
- return syntax;
- }
-
- @Override
- @DataProvider(name="acceptableValues")
- public Object[][] createAcceptableValues()
- {
- return new Object [][] {
- {"DE", true},
- {"de", false},
- {"SX", true},
- {"12", false},
- {"UK", true},
- {"Xf", false},
- {"\u00D6\u00C4", false},
- };
- }
-}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/schema/JPEGSyntaxTest.java b/opendj-server-legacy/src/test/java/org/opends/server/schema/JPEGSyntaxTest.java
deleted file mode 100644
index f3b8d1d..0000000
--- a/opendj-server-legacy/src/test/java/org/opends/server/schema/JPEGSyntaxTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * The contents of this file are subject to the terms of the Common Development and
- * Distribution License (the License). You may not use this file except in compliance with the
- * License.
- *
- * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
- * specific language governing permission and limitations under the License.
- *
- * When distributing Covered Software, include this CDDL Header Notice in each file and include
- * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
- * Header, with the fields enclosed by brackets [] replaced by your own identifying
- * information: "Portions Copyright [year] [name of copyright owner]".
- *
- * Portions Copyright 2012-2016 ForgeRock AS.
- */
-package org.opends.server.schema;
-
-import org.forgerock.opendj.ldap.ByteString;
-import org.opends.server.api.AttributeSyntax;
-import org.opends.server.util.Base64;
-import org.opends.server.util.RemoveOnceSDKSchemaIsUsed;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
-/** Test the JPEGSyntax. */
-@RemoveOnceSDKSchemaIsUsed
-@Test
-public class JPEGSyntaxTest extends BinaryAttributeSyntaxTest
-{
- @Override
- protected AttributeSyntax<?> getRule()
- {
- return new JPEGSyntax();
- }
-
- @Override
- @DataProvider(name="acceptableValues")
- public Object[][] createAcceptableValues()
- {
- String jfif_image =
- "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDACMYGh4aFiMeHB4nJSMpNFc4NDAwNGpM" +
- "UD9Xfm+EgnxveneLnMipi5S9lnd6ru2wvc7V4OLgh6f1//PZ/8jb4Nf/2wBDASUn" +
- "JzQuNGY4OGbXj3qP19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX" +
- "19fX19fX19fX19fX19f/wAARCAABAAEDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEA" +
- "AAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIh" +
- "MUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6" +
- "Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZ" +
- "mqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx" +
- "8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREA" +
- "AgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAV" +
- "YnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hp" +
- "anN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPE" +
- "xcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwCC" +
- "iiiuM9g//9k=";
- try
- {
- return new Object [][] {
- {ByteString.wrap(Base64.decode(jfif_image)), true},
- };
- }
- catch (Exception e)
- {
- return new Object[][] {};
- }
- }
-}
--
Gitblit v1.10.0