Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 30232 invoked from network); 22 Dec 2006 10:45:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Dec 2006 10:45:36 -0000 Received: (qmail 8347 invoked by uid 500); 22 Dec 2006 10:45:43 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 8323 invoked by uid 500); 22 Dec 2006 10:45:43 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 8312 invoked by uid 99); 22 Dec 2006 10:45:43 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Dec 2006 02:45:43 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Dec 2006 02:45:35 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 40E351A981A; Fri, 22 Dec 2006 02:44:46 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r489607 - in /directory/trunks/shared/ldap/src: main/java/org/apache/directory/shared/ldap/schema/syntax/SupportedAlgorithmSyntaxChecker.java test/java/org/apache/directory/shared/ldap/schema/syntax/SupportedAlgorithmSyntaxCheckerTest.java Date: Fri, 22 Dec 2006 10:44:46 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061222104446.40E351A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: elecharny Date: Fri Dec 22 02:44:45 2006 New Revision: 489607 URL: http://svn.apache.org/viewvc?view=rev&rev=489607 Log: Added the SupportedAlgorithm SC Added: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/SupportedAlgorithmSyntaxChecker.java directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SupportedAlgorithmSyntaxCheckerTest.java Added: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/SupportedAlgorithmSyntaxChecker.java URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/SupportedAlgorithmSyntaxChecker.java?view=auto&rev=489607 ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/SupportedAlgorithmSyntaxChecker.java (added) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/SupportedAlgorithmSyntaxChecker.java Fri Dec 22 02:44:45 2006 @@ -0,0 +1,64 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.directory.shared.ldap.schema.syntax; + + +/** + * A SyntaxChecker which verifies that a value is a SupportedAlgorithm according to RFC 2252. + * + * It has been removed in RFC 4517 + * + * @author Apache Directory Project + * @version $Rev: 488616 $ + */ +public class SupportedAlgorithmSyntaxChecker extends BinarySyntaxChecker +{ + /** the Apache assigned internal OID for this syntax checker */ + private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.49"; + + + /** + * Private default constructor to prevent unnecessary instantiation. + */ + public SupportedAlgorithmSyntaxChecker() + { + super( SC_OID ); + } + + /** + * + * Creates a new instance of SupportedAlgorithmSyntaxChecker. + * + * @param the oid to associate with this new SyntaxChecker + * + */ + protected SupportedAlgorithmSyntaxChecker( String oid ) + { + super( oid ); + } + + /** + * @see org.apache.directory.shared.ldap.schema.syntax.SyntaxChecker#isValidSyntax(Object) + */ + public boolean isValidSyntax( Object value ) + { + return true; + } +} Added: directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SupportedAlgorithmSyntaxCheckerTest.java URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SupportedAlgorithmSyntaxCheckerTest.java?view=auto&rev=489607 ============================================================================== --- directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SupportedAlgorithmSyntaxCheckerTest.java (added) +++ directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SupportedAlgorithmSyntaxCheckerTest.java Fri Dec 22 02:44:45 2006 @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.directory.shared.ldap.schema.syntax; + +import junit.framework.TestCase; + +/** + * Test cases for SupportedAlgorithmSyntaxChecker. + * + * @author Apache Directory Project + * @version $Rev$ + */ +public class SupportedAlgorithmSyntaxCheckerTest extends TestCase +{ + SupportedAlgorithmSyntaxChecker checker = new SupportedAlgorithmSyntaxChecker(); + + + public void testNullString() + { + assertTrue( checker.isValidSyntax( null ) ); + } + + + public void testEmptyString() + { + assertTrue( checker.isValidSyntax( "" ) ); + } + + public void testOid() + { + assertEquals( "1.3.6.1.4.1.1466.115.121.1.49", checker.getSyntaxOid() ); + } + + public void testCorrectCase() + { + assertTrue( checker.isValidSyntax( "FALSE" ) ); + assertTrue( checker.isValidSyntax( new byte[]{0x01, (byte)0xFF} ) ); + } +}