public void testEventDispatchedWithEventHidden() { int listenerCount = documentListenerCount(); recorder.componentShown(textField); HierarchyEvent event = new HierarchyEvent( textField, HierarchyEvent.SHOWING_CHANGED, textField, new JPanel(), HierarchyEvent.DISPLAYABILITY_CHANGED); recorder.eventDispatched(event); assertEquals(listenerCount, documentListenerCount()); }
public void testEventDispatchedWithComponentShown() throws InterruptedException, InvocationTargetException { int listenerCount = documentListenerCount(); JTextField textField = textField(); HierarchyEvent event = new HierarchyEvent( textField, HierarchyEvent.DISPLAYABILITY_CHANGED, textField, new JPanel(), HierarchyEvent.SHOWING_CHANGED); recorder.eventDispatched(event); recorder.componentHidden(textField); assertEquals(listenerCount, documentListenerCount()); }