1   /*
2    *   @(#) $Id: OperationScopeTest.java 292098 2005-09-28 02:38:36Z trustin $
3    *
4    *   Copyright 2004 The Apache Software Foundation
5    *
6    *   Licensed under the Apache License, Version 2.0 (the "License");
7    *   you may not use this file except in compliance with the License.
8    *   You may obtain a copy of the License at
9    *
10   *       http://www.apache.org/licenses/LICENSE-2.0
11   *
12   *   Unless required by applicable law or agreed to in writing, software
13   *   distributed under the License is distributed on an "AS IS" BASIS,
14   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   *   See the License for the specific language governing permissions and
16   *   limitations under the License.
17   *
18   */
19  package org.apache.ldap.server.authz.support;
20  
21  import junit.framework.Assert;
22  import junit.framework.TestCase;
23  
24  /***
25   * Tests {@link OperationScope}.
26   *
27   * @author The Apache Directory Project
28   * @version $Rev: 292098 $, $Date: 2005-09-27 22:38:36 -0400 (Tue, 27 Sep 2005) $
29   *
30   */
31  public class OperationScopeTest extends TestCase
32  {
33      public void testGetName() throws Exception
34      {
35          Assert.assertEquals( "Entry", OperationScope.ENTRY.getName() );
36          Assert.assertEquals( "Attribute Type", OperationScope.ATTRIBUTE_TYPE.getName() );
37          Assert.assertEquals( "Attribute Type & Value", OperationScope.ATTRIBUTE_TYPE_AND_VALUE.getName() );
38      }
39      
40      public void testGetNameAndToStringEquality()
41      {
42          Assert.assertEquals( OperationScope.ENTRY.getName(), OperationScope.ENTRY.toString() );
43          Assert.assertEquals( OperationScope.ATTRIBUTE_TYPE.getName(), OperationScope.ATTRIBUTE_TYPE.toString() );
44          Assert.assertEquals( OperationScope.ATTRIBUTE_TYPE_AND_VALUE.getName(), OperationScope.ATTRIBUTE_TYPE_AND_VALUE.toString() );
45      }
46  }