ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/branches/udr/udr/testsuite/FBUDRTestApp.pas
(Generate patch)
# Line 48 | Line 48
48    { TFBUDRTestApp }
49  
50    TFBUDRTestApp = class(TTestApplication)
51 +  private
52 +    FUDRPlugin: TFBUdrPluginEmulator;
53    public
54      constructor Create(TheOwner: TComponent); override;
55 +    destructor Destroy; override;
56      function getModuleName: AnsiString; virtual;
57 +    property UDRPlugin: TFBUdrPluginEmulator read FUDRPlugin;
58    end;
59  
60    { TFBUDRTestBase }
61  
62    TFBUDRTestBase = class(TTestBase)
59  private
60    FUDRPlugin: TFBUdrPlugin;
63      function getModuleName: AnsiString;
64 <  protected
65 <    procedure CreateObjects(Application: TTestApplication); override;
64 >  private
65 >    function GetUDRPlugin: TFBUdrPluginEmulator;
66    public
65    destructor Destroy; override;
67      procedure ApplyDDL(attachment: IAttachment; sql: array of AnsiString);
68 <    property UDRPlugin: TFBUdrPlugin read FUDRPlugin;
68 >    property UDRPlugin: TFBUdrPluginEmulator read GetUDRPlugin;
69    end;
70  
71  
# Line 77 | Line 78
78    Result := (Owner as TFBUDRTestApp).getModuleName;
79   end;
80  
81 < procedure TFBUDRTestBase.CreateObjects(Application: TTestApplication);
81 > function TFBUDRTestBase.GetUDRPlugin: TFBUdrPluginEmulator;
82   begin
83 <  inherited CreateObjects(Application);
83 <  if FUDRPlugin = nil then
84 <    FUDRPlugin := TFBUdrPlugin.Create(getModuleName);
85 < end;
86 <
87 < destructor TFBUDRTestBase.Destroy;
88 < begin
89 <  if FUDRPlugin <> nil then
90 <    FUDRPlugin.Free;
91 <  inherited Destroy;
83 >  Result := (Owner as TFBUDRTestApp).UDRPlugin;
84   end;
85  
86   procedure TFBUDRTestBase.ApplyDDL(attachment: IAttachment;
# Line 110 | Line 102
102   begin
103    inherited Create(TheOwner);
104    StopOnException := True;
105 +  if FUDRPlugin = nil then
106 +    FUDRPlugin := TFBUdrPluginEmulator.Create(getModuleName);
107 + end;
108 +
109 + destructor TFBUDRTestApp.Destroy;
110 + begin
111 +  if FUDRPlugin <> nil then
112 +    FUDRPlugin.Free;
113 +  inherited Destroy;
114   end;
115  
116   function TFBUDRTestApp.getModuleName: AnsiString;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines