01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: /**
18: * @author Evgeniya G. Maenkova
19: * @version $Revision$
20: */package javax.swing;
21:
22: import javax.accessibility.AccessibleState;
23:
24: public class JEditorPane_AccessibleJEditorPaneTest extends
25: SwingTestCase {
26: JEditorPane jep;
27:
28: JFrame jf;
29:
30: JEditorPane.AccessibleJEditorPane accessible;
31:
32: @Override
33: protected void setUp() throws Exception {
34: super .setUp();
35: setIgnoreNotImplemented(true);
36: jep = new JEditorPane();
37: jf = new JFrame();
38: jf.getContentPane().add(jep);
39: jf.setSize(200, 300);
40: jf.pack();
41: accessible = jep.new AccessibleJEditorPane();
42: }
43:
44: @Override
45: protected void tearDown() throws Exception {
46: jf.dispose();
47: super .tearDown();
48: }
49:
50: public void testGetAccessibleStateSet() {
51: assertTrue(accessible.getAccessibleStateSet().contains(
52: AccessibleState.MULTI_LINE));
53: }
54:
55: public void testGetAccessibleDescription() {
56: assertEquals("text/plain", accessible
57: .getAccessibleDescription());
58: // TODO: uncomment when HTML support is implemented
59: // jep.setContentType("text/html");
60: // assertEquals("text/html", accessible.getAccessibleDescription());
61: jep.setContentType("test");
62: assertEquals("text/plain", accessible
63: .getAccessibleDescription());
64: // TODO: uncomment when RTF support is implemented
65: // jep.setContentType("text/rtf");
66: // assertEquals("text/rtf", accessible.getAccessibleDescription());
67: }
68: }
|