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.event;
21:
22: import javax.swing.JInternalFrame;
23: import javax.swing.SwingTestCase;
24:
25: public class InternalFrameEventTest extends SwingTestCase {
26: private JInternalFrame frame;
27:
28: /*
29: * Constructor for InternalFrameEventTest.
30: * @param name
31: */
32: public InternalFrameEventTest(final String name) {
33: super (name);
34: }
35:
36: /*
37: * @see TestCase#setUp()
38: */
39: @Override
40: protected void setUp() throws Exception {
41: super .setUp();
42: frame = new JInternalFrame();
43: }
44:
45: /*
46: * Class under test for JInternalFrame getInternalFrame()
47: */
48: public void testGetInternalFrame() {
49: InternalFrameEvent event = new InternalFrameEvent(frame,
50: InternalFrameEvent.INTERNAL_FRAME_CLOSED);
51: assertTrue("== frame", event.getInternalFrame() == frame);
52: assertTrue("== getSource()", event.getInternalFrame() == event
53: .getSource());
54: }
55:
56: /*
57: * Class under test for String paramString()
58: */
59: public void testParamString() {
60: InternalFrameEvent event = new InternalFrameEvent(frame,
61: InternalFrameEvent.INTERNAL_FRAME_ACTIVATED);
62: assertTrue("paramString() cannot return null", event
63: .paramString() != null);
64: }
65: }
|