316N/A/*
316N/A * CDDL HEADER START
316N/A *
316N/A * The contents of this file are subject to the terms of the
316N/A * Common Development and Distribution License, Version 1.0 only
316N/A * (the "License"). You may not use this file except in compliance
316N/A * with the License.
316N/A *
316N/A * You can obtain a copy of the license at
316N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE
316N/A * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
316N/A * See the License for the specific language governing permissions
316N/A * and limitations under the License.
316N/A *
316N/A * When distributing Covered Code, include this CDDL HEADER in each
316N/A * file and include the License file at
316N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
316N/A * add the following below this CDDL HEADER, with the fields enclosed
873N/A * by brackets "[]" replaced with your own identifying information:
316N/A * Portions Copyright [yyyy] [name of copyright owner]
316N/A *
316N/A * CDDL HEADER END
316N/A *
316N/A *
3232N/A * Copyright 2006-2008 Sun Microsystems, Inc.
316N/A */
316N/Apackage org.opends.server.schema;
316N/A
316N/Aimport org.opends.server.api.AttributeSyntax;
316N/Aimport org.testng.annotations.DataProvider;
316N/A
316N/A/**
316N/A * Test the DITContentRuleSyntax.
316N/A */
316N/Apublic class DITContentRuleSyntaxTest extends AttributeSyntaxTest
316N/A{
316N/A
316N/A /**
316N/A * {@inheritDoc}
316N/A */
316N/A @Override
2342N/A protected AttributeSyntax getRule()
316N/A {
316N/A return new DITContentRuleSyntax();
316N/A }
316N/A
316N/A @Override
316N/A @DataProvider(name="acceptableValues")
316N/A public Object[][] createAcceptableValues()
316N/A {
316N/A return new Object [][] {
316N/A {"( 2.5.6.4 DESC 'content rule for organization' NOT "
316N/A + "( x121Address $ telexNumber ) )", true},
316N/A {"( 2.5.6.4 NAME 'full rule' DESC 'rule with all possible fields' "
316N/A + " OBSOLETE"
723N/A + " AUX ( posixAccount )"
316N/A + " MUST ( cn $ sn )"
316N/A + " MAY ( dc )"
316N/A + " NOT ( x121Address $ telexNumber ) )"
316N/A , true},
316N/A {"( 2.5.6.4 NAME 'full rule' DESC 'ommit parenthesis' "
316N/A + " OBSOLETE"
723N/A + " AUX posixAccount "
316N/A + " MUST cn "
316N/A + " MAY dc "
316N/A + " NOT x121Address )"
316N/A , true},
316N/A {"( 2.5.6.4 NAME 'full rule' DESC 'use numeric OIDs' "
316N/A + " OBSOLETE"
723N/A + " AUX 1.3.6.1.1.1.2.0"
316N/A + " MUST cn "
316N/A + " MAY dc "
316N/A + " NOT x121Address )"
316N/A , true},
316N/A {"( 2.5.6.4 NAME 'full rule' DESC 'illegal OIDs' "
316N/A + " OBSOLETE"
316N/A + " AUX 2.5.6.."
316N/A + " MUST cn "
316N/A + " MAY dc "
316N/A + " NOT x121Address )"
316N/A , false},
316N/A {"( 2.5.6.4 NAME 'full rule' DESC 'illegal OIDs' "
316N/A + " OBSOLETE"
316N/A + " AUX 2.5.6.x"
316N/A + " MUST cn "
316N/A + " MAY dc "
316N/A + " NOT x121Address )"
316N/A , false},
316N/A {"( 2.5.6.4 NAME 'full rule' DESC 'missing closing parenthesis' "
316N/A + " OBSOLETE"
723N/A + " AUX posixAccount"
316N/A + " MUST cn "
316N/A + " MAY dc "
316N/A + " NOT x121Address"
316N/A , false},
316N/A {"( 2.5.6.4 NAME 'full rule' DESC 'extra parameterss' "
316N/A + " MUST cn "
316N/A + "( this is an extra parameter )"
316N/A , true},
316N/A
316N/A };
316N/A }
316N/A
316N/A}