4
4
using System . Drawing ;
5
5
using System . Globalization ;
6
6
using System . IO ;
7
+ using System . Reflection ;
7
8
using System . Text ;
8
9
using System . Threading . Tasks ;
9
10
using System . Windows . Forms ;
@@ -18,13 +19,17 @@ public partial class TestRunnerWindow : Form
18
19
private const int Steps = 1000 ;
19
20
20
21
private readonly RealTimeTestRunner testRunner ;
22
+ private readonly object pluginIntegration ;
21
23
private readonly BindingList < TestResult > testResults = new BindingList < TestResult > ( ) ;
24
+
22
25
private int totalNumberOfTests ;
23
26
private int rowIndexOnRightClick ;
24
27
25
- public TestRunnerWindow ( RealTimeTestRunner testRunner )
28
+ public TestRunnerWindow ( RealTimeTestRunner testRunner , object pluginIntegration )
26
29
{
27
30
this . testRunner = testRunner ;
31
+ this . pluginIntegration = pluginIntegration ;
32
+
28
33
InitializeComponent ( ) ;
29
34
30
35
var bindingSource = new BindingSource { DataSource = testResults } ;
@@ -497,18 +502,29 @@ private void gridResults_SelectionChanged(object sender, EventArgs e)
497
502
498
503
private void gridResults_CellDoubleClick ( object sender , DataGridViewCellEventArgs e )
499
504
{
500
- var testResult = testResults [ e . RowIndex ] ;
501
- //PlsqlDeveloperUtPlsqlPlugin.OpenPackageBody(testResult.Owner, testResult.Package);
505
+ if ( pluginIntegration != null )
506
+ {
507
+ invokeOpenPackageBody ( e ) ;
508
+ }
502
509
}
503
510
504
511
private void gridTestFailures_CellDoubleClick ( object sender , DataGridViewCellEventArgs e )
512
+ {
513
+ if ( pluginIntegration != null )
514
+ {
515
+ invokeOpenPackageBody ( e ) ;
516
+ }
517
+ }
518
+
519
+ private void invokeOpenPackageBody ( DataGridViewCellEventArgs e )
505
520
{
506
521
var testResult = testResults [ e . RowIndex ] ;
507
- //PlsqlDeveloperUtPlsqlPlugin.OpenPackageBody(testResult.Owner, testResult.Package);
522
+
523
+ MethodInfo methodInfo = pluginIntegration . GetType ( ) . GetMethod ( "OpenPackageBody" ) ;
524
+ methodInfo . Invoke ( pluginIntegration , new object [ ] { testResult . Owner , testResult . Package } ) ;
508
525
}
509
526
510
- private void gridResults_CellContextMenuStripNeeded ( object sender ,
511
- DataGridViewCellContextMenuStripNeededEventArgs e )
527
+ private void gridResults_CellContextMenuStripNeeded ( object sender , DataGridViewCellContextMenuStripNeededEventArgs e )
512
528
{
513
529
rowIndexOnRightClick = e . RowIndex ;
514
530
}
@@ -517,7 +533,7 @@ private void menuItemRunTests_Click(object sender, EventArgs e)
517
533
{
518
534
var testResult = testResults [ rowIndexOnRightClick ] ;
519
535
520
- var testResultWindow = new TestRunnerWindow ( testRunner ) ;
536
+ var testResultWindow = new TestRunnerWindow ( testRunner , pluginIntegration ) ;
521
537
testResultWindow . RunTestsAsync ( RealTimeTestRunner . Procedure , testResult . Owner , testResult . Package ,
522
538
testResult . Procedure , false ) ;
523
539
}
@@ -526,7 +542,7 @@ private void menuItemCoverage_Click(object sender, EventArgs e)
526
542
{
527
543
var testResult = testResults [ rowIndexOnRightClick ] ;
528
544
529
- var testResultWindow = new TestRunnerWindow ( testRunner ) ;
545
+ var testResultWindow = new TestRunnerWindow ( testRunner , pluginIntegration ) ;
530
546
testResultWindow . RunTestsAsync ( RealTimeTestRunner . Procedure , testResult . Owner , testResult . Package ,
531
547
testResult . Procedure , true ) ;
532
548
}
0 commit comments