@Test( expected = XulException.class ) public void testLoadDatabaseOptionsFragmentWithException() throws Exception { XulComponent component = mock( XulComponent.class ); XulComponent parent = mock( XulComponent.class ); when( component.getParent() ).thenReturn( parent ); when( document.getElementById( "database-options-box" ) ).thenReturn( component ); when( xulDomContainer.loadFragment( anyString(), any( Object.class ) ) ).thenThrow( new XulException() ); fragmentHandler.loadDatabaseOptionsFragment( null ); }
protected void loadDatabaseOptionsFragment( String fragmentUri ) throws XulException { XulComponent groupElement = document.getElementById( "database-options-box" ); XulComponent parentElement = groupElement.getParent(); XulDomContainer fragmentContainer; try { fragmentContainer = this.xulDomContainer.loadFragment( fragmentUri, Messages.getBundle() ); XulComponent newGroup = fragmentContainer.getDocumentRoot().getFirstChild(); parentElement.replaceChild( groupElement, newGroup ); } catch ( XulException e ) { e.printStackTrace(); throw e; } }
FragmentHandler extends AbstractXulEventHandler { protected void loadDatabaseOptionsFragment( String fragmentUri ) throws XulException { XulComponent groupElement = document.getElementById( "database-options-box" ); XulComponent parentElement = groupElement.getParent(); XulDomContainer fragmentContainer; try { fragmentContainer = this.xulDomContainer.loadFragment( fragmentUri, Messages.getBundle() ); XulComponent newGroup = fragmentContainer.getDocumentRoot().getFirstChild(); parentElement.replaceChild( groupElement, newGroup ); } catch ( XulException e ) { e.printStackTrace(); throw e; } } }
FragmentHandler extends AbstractXulEventHandler { protected void loadDatabaseOptionsFragment( String fragmentUri ) throws XulException { XulComponent groupElement = document.getElementById( "database-options-box" ); XulComponent parentElement = groupElement.getParent(); XulDomContainer fragmentContainer; try { fragmentContainer = this.xulDomContainer.loadFragment( fragmentUri, Messages.getBundle() ); XulComponent newGroup = fragmentContainer.getDocumentRoot().getFirstChild(); parentElement.replaceChild( groupElement, newGroup ); } catch ( XulException e ) { e.printStackTrace(); throw e; } } FragmentHandler(); }
FragmentHandler extends AbstractXulEventHandler { protected void loadDatabaseOptionsFragment( String fragmentUri ) throws XulException { XulComponent groupElement = document.getElementById( "database-options-box" ); XulComponent parentElement = groupElement.getParent(); XulDomContainer fragmentContainer; try { fragmentContainer = this.xulDomContainer.loadFragment( fragmentUri, Messages.getBundle() ); XulComponent newGroup = fragmentContainer.getDocumentRoot().getFirstChild(); parentElement.replaceChild( groupElement, newGroup ); } catch ( XulException e ) { e.printStackTrace(); throw e; } } FragmentHandler(); void refreshOptions(); Object getData(); void setData( Object arg0 ); }
FragmentHandler extends AbstractXulEventHandler { protected void loadDatabaseOptionsFragment( String fragmentUri ) throws XulException { XulComponent groupElement = document.getElementById( "database-options-box" ); XulComponent parentElement = groupElement.getParent(); XulDomContainer fragmentContainer; try { fragmentContainer = this.xulDomContainer.loadFragment( fragmentUri, Messages.getBundle() ); XulComponent newGroup = fragmentContainer.getDocumentRoot().getFirstChild(); parentElement.replaceChild( groupElement, newGroup ); } catch ( XulException e ) { e.printStackTrace(); throw e; } } FragmentHandler(); void refreshOptions(); Object getData(); void setData( Object arg0 );  }