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 Vadim L. Bogdanov
19: * @version $Revision$
20: */package javax.swing;
21:
22: public class JTabbedPaneRTest extends SwingTestCase {
23: private JTabbedPane pane;
24:
25: public JTabbedPaneRTest(final String name) {
26: super (name);
27: }
28:
29: @Override
30: protected void setUp() throws Exception {
31: super .setUp();
32: pane = new JTabbedPane();
33: }
34:
35: @Override
36: protected void tearDown() throws Exception {
37: super .tearDown();
38: }
39:
40: /**
41: * Regression test for HARMONY-2515
42: * */
43: public void testAddComponentToTail() {
44: pane.add(new JButton(), -1);
45: }
46:
47: public void testAddNull() {
48: final JComponent comp1 = new JLabel();
49: final JComponent comp3 = new JLabel();
50: pane.add("tab1", comp1);
51: pane.add("tab2", null);
52: pane.add("tab3", comp3);
53: assertEquals(2, pane.getComponentCount());
54: assertSame(comp1, pane.getComponentAt(0));
55: assertNull(pane.getComponentAt(1));
56: assertSame(comp3, pane.getComponentAt(2));
57: }
58: }
|