1 |
|
unit Test1; |
2 |
|
{$IFDEF MSWINDOWS} |
3 |
|
{$DEFINE WINDOWS} |
4 |
– |
{$IF defined(CompilerVersion) and (CompilerVersion >= 28)} |
5 |
– |
{Delphi XE7 onwards}} |
6 |
– |
{$define HASREQEX} |
7 |
– |
{$IFEND} |
4 |
|
{$ENDIF} |
5 |
|
|
6 |
|
{Create and Drop a Database} |
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; |
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'; |
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); |
93 |
< |
writeln(outfile,'DB Charset ID = ',Attachment.GetDefaultCharSetID); |
94 |
< |
writeln(outfile,'DB SQL Dialect = ',Attachment.GetSQLDialect); |
95 |
< |
writeln(outfile,'DB Remote Protocol = ', Attachment.GetRemoteProtocol); |
96 |
< |
writeln(outfile,'DB ODS Major Version = ',Attachment.GetODSMajorVersion); |
97 |
< |
writeln(outfile,'DB ODS Minor Version = ',Attachment.GetODSMinorVersion); |
100 |
> |
WriteAttachmentInfo(Attachment); |
101 |
|
PrintDPB(Attachment.getDPB); |
102 |
|
|
103 |
|
{$IFDEF HASREQEX} |
123 |
|
|
124 |
|
Attachment := FirebirdAPI.CreateDatabase(Owner.GetNewDatabaseName,DPB); |
125 |
|
|
126 |
< |
writeln(outfile,'DB Connect String = ',Attachment.GetConnectString); |
124 |
< |
writeln(outfile,'DB Charset ID = ',Attachment.GetDefaultCharSetID); |
125 |
< |
writeln(outfile,'DB SQL Dialect = ',Attachment.GetSQLDialect); |
126 |
< |
writeln(outfile,'DB Remote Protocol = ', Attachment.GetRemoteProtocol); |
127 |
< |
writeln(outfile,'DB ODS Major Version = ',Attachment.GetODSMajorVersion); |
128 |
< |
writeln(outfile,'DB ODS Minor Version = ',Attachment.GetODSMinorVersion); |
126 |
> |
WriteAttachmentInfo(Attachment); |
127 |
|
|
128 |
|
writeln(OutFile,'Dropping Database'); |
129 |
|
if Attachment <> nil then |
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); |
146 |
< |
writeln(outfile,'DB Charset ID = ',Attachment.GetDefaultCharSetID); |
147 |
< |
writeln(outfile,'DB SQL Dialect = ',Attachment.GetSQLDialect); |
148 |
< |
writeln(outfile,'DB Remote Protocol = ', Attachment.GetRemoteProtocol); |
149 |
< |
writeln(outfile,'DB ODS Major Version = ',Attachment.GetODSMajorVersion); |
150 |
< |
writeln(outfile,'DB ODS Minor Version = ',Attachment.GetODSMinorVersion); |
143 |
> |
WriteAttachmentInfo(Attachment); |
144 |
|
|
145 |
|
{Querying Database} |
146 |
|
DoQuery(Attachment); |