1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. 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,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 *
19 */
20 package org.apache.directory.server.core.authz.support;
21
22
23 import org.apache.directory.server.core.authz.support.OperationScope;
24
25 import junit.framework.Assert;
26 import junit.framework.TestCase;
27
28
29 /**
30 * Tests {@link OperationScope}.
31 *
32 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
33 * @version $Rev: 437012 $, $Date: 2006-08-26 01:25:30 +0200 (Sa, 26 Aug 2006) $
34 *
35 */
36 public class OperationScopeTest extends TestCase
37 {
38 public void testGetName() throws Exception
39 {
40 Assert.assertEquals( "Entry", OperationScope.ENTRY.getName() );
41 Assert.assertEquals( "Attribute Type", OperationScope.ATTRIBUTE_TYPE.getName() );
42 Assert.assertEquals( "Attribute Type & Value", OperationScope.ATTRIBUTE_TYPE_AND_VALUE.getName() );
43 }
44
45
46 public void testGetNameAndToStringEquality()
47 {
48 Assert.assertEquals( OperationScope.ENTRY.getName(), OperationScope.ENTRY.toString() );
49 Assert.assertEquals( OperationScope.ATTRIBUTE_TYPE.getName(), OperationScope.ATTRIBUTE_TYPE.toString() );
50 Assert.assertEquals( OperationScope.ATTRIBUTE_TYPE_AND_VALUE.getName(), OperationScope.ATTRIBUTE_TYPE_AND_VALUE
51 .toString() );
52 }
53 }