This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 50297
Collapse All | Expand All

(-)test/unit/src/org/netbeans/core/output2/OutputWindowTest.java (-2 / +48 lines)
Lines 86-92 Link Here
86
    
86
    
87
    public class Shower implements Runnable {
87
    public class Shower implements Runnable {
88
        public void run() {
88
        public void run() {
89
            jf.show();
89
            jf.setVisible(true);
90
        }
90
        }
91
    }
91
    }
92
92
Lines 212-217 Link Here
212
        assertSame ("OutputWriter should not be replaced by calling clearing/reset() on it", writer, io.getOut());
212
        assertSame ("OutputWriter should not be replaced by calling clearing/reset() on it", writer, io.getOut());
213
        assertNotSame ("Underlying OutWriter should be replaced by calling reset() on a used NbWriter", outwriter, writer.out());
213
        assertNotSame ("Underlying OutWriter should be replaced by calling reset() on a used NbWriter", outwriter, writer.out());
214
    }
214
    }
215
    
216
    public void testTabsSwitching() {
217
        System.out.println("testTabsSwitching");
218
        
219
        NbIO io1 = (NbIO) provider.getIO("SwitchTest1", true);
220
        io1.getOut().println("I'm first tab");
221
        sleep();
222
        
223
        NbIO io2 = (NbIO) provider.getIO("SwitchTest2", true);
224
        io2.getOut().println("I'm second tab");
225
        sleep();
226
        
227
        NbIO io3 = (NbIO) provider.getIO("SwitchTest3", true);
228
        io3.getOut().println("I'm third tab");
229
        sleep();
230
        
231
        AbstractOutputTab[] tabs = win.getTabs();
232
        assertSame("\"SwitchTest3\"(last) tab should be selected.", win.getSelectedTab(), tabs[2]);
233
        
234
        win.selectNextTab(win.getSelectedTab());
235
        assertSame("\"SwitchTest1\" tab should be selected.", win.getSelectedTab(), tabs[0]);
236
        sleep();
237
        
238
        win.selectPreviousTab(win.getSelectedTab());
239
        assertSame("\"SwitchTest3\" tab should be selected.", win.getSelectedTab(), tabs[2]);
240
        sleep();
241
        
242
        win.selectPreviousTab(win.getSelectedTab());
243
        sleep();
244
        win.selectPreviousTab(win.getSelectedTab());
245
        sleep();
246
        win.selectNextTab(win.getSelectedTab());
247
        sleep();
248
        assertSame("\"SwitchTest2\" tab should be selected.", win.getSelectedTab(), tabs[1]);
249
        
250
        // Ensure the actions are paying attention
251
        SwingUtilities.invokeLater(new Runnable() {
252
            public void run() {
253
                win.getController().nextTabAction.actionPerformed(
254
                    new ActionEvent(win.getSelectedTab(), ActionEvent.ACTION_PERFORMED, "nextTab"));
255
            }
256
        });
257
        sleep();
258
        sleep();
259
        assertSame("\"SwitchTest1\" tab should be selected after invoking nextTab action.",
260
            win.getSelectedTab(), tabs[2]);
261
    }
215
262
216
263
217
    public void testListenersCleared() throws Exception {
264
    public void testListenersCleared() throws Exception {
Lines 342-348 Link Here
342
            ls4[i].assertCleared("CloseInputOutput should cause all OutputListeners to be cleared");
389
            ls4[i].assertCleared("CloseInputOutput should cause all OutputListeners to be cleared");
343
        }
390
        }
344
    }
391
    }
345
346
392
347
    public class L implements OutputListener {
393
    public class L implements OutputListener {
348
        private OutputEvent clearedEvent = null;
394
        private OutputEvent clearedEvent = null;

Return to bug 50297