ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/fbintf/testsuite/Test1.pas
(Generate patch)

Comparing ibx/trunk/fbintf/testsuite/Test1.pas (file contents):
Revision 117 by tony, Mon Jan 22 13:58:11 2018 UTC vs.
Revision 143 by tony, Fri Feb 23 12:11:21 2018 UTC

# Line 17 | Line 17 | unit Test1;
17   {$IFDEF FPC}
18   {$mode delphi}
19   {$codepage utf8}
20 + {$define HASREQEX}
21   {$ENDIF}
22  
23   interface
# Line 31 | Line 32 | type
32    TTest1 = class(TTestBase)
33    private
34      procedure DoQuery(Attachment: IAttachment);
35 +    procedure WriteAttachmentInfo(Attachment: IAttachment);
36    public
37      function TestTitle: AnsiString; override;
38      procedure RunTest(CharSet: AnsiString; SQLDialect: integer); override;
# Line 62 | Line 64 | begin
64      end;
65   end;
66  
67 + procedure TTest1.WriteAttachmentInfo(Attachment: IAttachment);
68 + begin
69 +  writeln(outfile,'DB Connect String = ',Attachment.GetConnectString);
70 +  writeln(outfile,'DB Charset ID = ',Attachment.GetDefaultCharSetID);
71 +  writeln(outfile,'DB SQL Dialect = ',Attachment.GetSQLDialect);
72 +  writeln(outfile,'DB Remote Protocol = ', Attachment.GetRemoteProtocol);
73 +  writeln(outfile,'DB ODS Major Version = ',Attachment.GetODSMajorVersion);
74 +  writeln(outfile,'DB ODS Minor Version = ',Attachment.GetODSMinorVersion);
75 +  writeln(outfile,'User Authentication Method = ',Attachment.GetAuthenticationMethod);
76 + end;
77 +
78   function TTest1.TestTitle: AnsiString;
79   begin
80    Result := 'Test 1: Create and Drop a Database';
# Line 84 | Line 97 | begin
97                        [Owner.GetNewDatabaseName, Owner.GetUserName, Owner.GetPassword, CharSet]);
98    Attachment := FirebirdAPI.CreateDatabase(createSQL,SQLDialect);
99    WriteDBInfo(Attachment.GetDBInformation([isc_info_db_id,isc_info_db_SQL_Dialect]));
100 <  writeln(outfile,'DB Connect String = ',Attachment.GetConnectString);
88 <  writeln(outfile,'DB Charset ID = ',Attachment.GetDefaultCharSetID);
89 <  writeln(outfile,'DB SQL Dialect = ',Attachment.GetSQLDialect);
90 <  writeln(outfile,'DB Remote Protocol = ', Attachment.GetRemoteProtocol);
91 <  writeln(outfile,'DB ODS Major Version = ',Attachment.GetODSMajorVersion);
92 <  writeln(outfile,'DB ODS Minor Version = ',Attachment.GetODSMinorVersion);
100 >  WriteAttachmentInfo(Attachment);
101    PrintDPB(Attachment.getDPB);
102  
103 +  {$IFDEF HASREQEX}
104    {Demonstrate reconnect when database created with SQL Statement}
105 <  Attachment.Disconnect;
106 <  Attachment.Connect;
105 >  try
106 >    Attachment.Disconnect;
107 >    Attachment.Connect;
108 >  except on E:Exception do
109 >    writeln(OutFile,'Error reconnecting to Database: ',E.Message);
110 >  end;
111 >  {$ENDIF}
112  
113    writeln(OutFile,'Dropping Database');
114    if Attachment <> nil then
# Line 109 | Line 123 | begin
123  
124    Attachment := FirebirdAPI.CreateDatabase(Owner.GetNewDatabaseName,DPB);
125  
126 <  writeln(outfile,'DB Connect String = ',Attachment.GetConnectString);
113 <  writeln(outfile,'DB Charset ID = ',Attachment.GetDefaultCharSetID);
114 <  writeln(outfile,'DB SQL Dialect = ',Attachment.GetSQLDialect);
115 <  writeln(outfile,'DB Remote Protocol = ', Attachment.GetRemoteProtocol);
116 <  writeln(outfile,'DB ODS Major Version = ',Attachment.GetODSMajorVersion);
117 <  writeln(outfile,'DB ODS Minor Version = ',Attachment.GetODSMinorVersion);
126 >  WriteAttachmentInfo(Attachment);
127  
128    writeln(OutFile,'Dropping Database');
129    if Attachment <> nil then
# Line 131 | Line 140 | begin
140      Exit;
141    end;
142    WriteDBInfo(Attachment.GetDBInformation([isc_info_db_id,isc_info_ods_version,isc_info_ods_minor_version]));
143 <  writeln(outfile,'DB Connect String = ',Attachment.GetConnectString);
135 <  writeln(outfile,'DB Charset ID = ',Attachment.GetDefaultCharSetID);
136 <  writeln(outfile,'DB SQL Dialect = ',Attachment.GetSQLDialect);
137 <  writeln(outfile,'DB Remote Protocol = ', Attachment.GetRemoteProtocol);
138 <  writeln(outfile,'DB ODS Major Version = ',Attachment.GetODSMajorVersion);
139 <  writeln(outfile,'DB ODS Minor Version = ',Attachment.GetODSMinorVersion);
143 >  WriteAttachmentInfo(Attachment);
144  
145    {Querying Database}
146    DoQuery(Attachment);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines