001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: /**
018: * @author Dmitry A. Durnev
019: * @version $Revision$
020: */package java.awt;
021:
022: import java.awt.CheckboxMenuItem.AccessibleAWTCheckboxMenuItem;
023:
024: import javax.accessibility.AccessibleAction;
025: import javax.accessibility.AccessibleContext;
026: import javax.accessibility.AccessibleRole;
027: import javax.accessibility.AccessibleValue;
028:
029: import junit.framework.TestCase;
030:
031: public class AccessibleAWTCheckboxMenuItemTest extends TestCase {
032:
033: CheckboxMenuItem item;
034: AccessibleContext ac;
035: AccessibleValue value;
036: AccessibleAction action;
037:
038: @Override
039: protected void setUp() throws Exception {
040: super .setUp();
041: item = new CheckboxMenuItem();
042: ac = item.getAccessibleContext();
043: action = ac.getAccessibleAction();
044: value = ac.getAccessibleValue();
045: }
046:
047: /*
048: * Test method for 'java.awt.CheckboxMenuItem.AccessibleAWTCheckboxMenuItem.getAccessibleAction()'
049: */
050: public void testGetAccessibleAction() {
051: assertSame(ac, ac.getAccessibleAction());
052: }
053:
054: /*
055: * Test method for 'java.awt.CheckboxMenuItem.AccessibleAWTCheckboxMenuItem.getAccessibleRole()'
056: */
057: public void testGetAccessibleRole() {
058: assertSame(AccessibleRole.CHECK_BOX, ac.getAccessibleRole());
059: }
060:
061: /*
062: * Test method for 'java.awt.CheckboxMenuItem.AccessibleAWTCheckboxMenuItem.getAccessibleValue()'
063: */
064: public void testGetAccessibleValue() {
065: assertSame(ac, ac.getAccessibleValue());
066: }
067:
068: /*
069: * Test method for 'java.awt.CheckboxMenuItem.AccessibleAWTCheckboxMenuItem.getAccessibleActionCount()'
070: */
071: public void testGetAccessibleActionCount() {
072: assertEquals(0, action.getAccessibleActionCount());
073: }
074:
075: /*
076: * Test method for 'java.awt.CheckboxMenuItem.AccessibleAWTCheckboxMenuItem.doAccessibleAction(int)'
077: */
078: public void testDoAccessibleAction() {
079: assertFalse(action.doAccessibleAction(0));
080: }
081:
082: /*
083: * Test method for 'java.awt.CheckboxMenuItem.AccessibleAWTCheckboxMenuItem.getCurrentAccessibleValue()'
084: */
085: public void testGetCurrentAccessibleValue() {
086: assertNull(value.getCurrentAccessibleValue());
087: }
088:
089: /*
090: * Test method for 'java.awt.CheckboxMenuItem.AccessibleAWTCheckboxMenuItem.getMaximumAccessibleValue()'
091: */
092: public void testGetMaximumAccessibleValue() {
093: assertNull(value.getMaximumAccessibleValue());
094: }
095:
096: /*
097: * Test method for 'java.awt.CheckboxMenuItem.AccessibleAWTCheckboxMenuItem.getMinimumAccessibleValue()'
098: */
099: public void testGetMinimumAccessibleValue() {
100: assertNull(value.getMaximumAccessibleValue());
101: }
102:
103: /*
104: * Test method for 'java.awt.CheckboxMenuItem.AccessibleAWTCheckboxMenuItem.setCurrentAccessibleValue(Number)'
105: */
106: public void testSetCurrentAccessibleValue() {
107: assertFalse(value.setCurrentAccessibleValue(null));
108: assertFalse(value.setCurrentAccessibleValue(new Integer(1)));
109: }
110:
111: /*
112: * Test method for 'java.awt.CheckboxMenuItem.AccessibleAWTCheckboxMenuItem.getAccessibleActionDescription(int)'
113: */
114: public void testGetAccessibleActionDescription() {
115: assertNull(action.getAccessibleActionDescription(0));
116:
117: }
118:
119: /*
120: * Test method for 'java.awt.CheckboxMenuItem.AccessibleAWTCheckboxMenuItem.AccessibleAWTCheckboxMenuItem(CheckboxMenuItem)'
121: */
122: public void testAccessibleAWTCheckboxMenuItem() {
123: assertTrue(ac instanceof AccessibleAWTCheckboxMenuItem);
124: }
125:
126: }
|