@Test public void testPerformAction() { action = new ExportAction( actionPlugin, previewPane ); doReturn( false ).when( actionPlugin ).isEnabled(); action.actionPerformed( null ); verify( actionPlugin, never() ).performExport( any( MasterReport.class ) ); doReturn( true ).when( actionPlugin ).isEnabled(); doReturn( null ).when( previewPane ).getReportJob(); action.actionPerformed( null ); verify( actionPlugin, never() ).performExport( any( MasterReport.class ) ); MasterReport report = mock( MasterReport.class ); doReturn( report ).when( previewPane ).getReportJob(); doReturn( report ).when( report ).clone(); action.actionPerformed( null ); verify( actionPlugin ).performExport( report ); }
public void actionPerformed( final ActionEvent e ) { if ( actionPlugin.isEnabled() == false ) { return; } final MasterReport reportJob = previewPane.getReportJob(); if ( reportJob == null ) { return; } actionPlugin.performExport( (MasterReport) reportJob.clone() ); }
ExportAction extends AbstractAction { public void actionPerformed( final ActionEvent e ) { if ( actionPlugin.isEnabled() == false ) { return; } final MasterReport reportJob = previewPane.getReportJob(); if ( reportJob == null ) { return; } actionPlugin.performExport( (MasterReport) reportJob.clone() ); } }
ExportAction extends AbstractAction { public void actionPerformed( final ActionEvent e ) { if ( actionPlugin.isEnabled() == false ) { return; } final MasterReport reportJob = previewPane.getReportJob(); if ( reportJob == null ) { return; } actionPlugin.performExport( (MasterReport) reportJob.clone() ); } ExportAction( final ExportActionPlugin actionPlugin, final PreviewPane previewPane ); }
ExportAction extends AbstractAction { public void actionPerformed( final ActionEvent e ) { if ( actionPlugin.isEnabled() == false ) { return; } final MasterReport reportJob = previewPane.getReportJob(); if ( reportJob == null ) { return; } actionPlugin.performExport( (MasterReport) reportJob.clone() ); } ExportAction( final ExportActionPlugin actionPlugin, final PreviewPane previewPane ); void actionPerformed( final ActionEvent e ); }
ExportAction extends AbstractAction { public void actionPerformed( final ActionEvent e ) { if ( actionPlugin.isEnabled() == false ) { return; } final MasterReport reportJob = previewPane.getReportJob(); if ( reportJob == null ) { return; } actionPlugin.performExport( (MasterReport) reportJob.clone() ); } ExportAction( final ExportActionPlugin actionPlugin, final PreviewPane previewPane ); void actionPerformed( final ActionEvent e );  }