Skip to content

Commit 6618b95

Browse files
committed
* Ajuste de console test Lazarus e Delphi, adicionando porta personalizada
1 parent 246576f commit 6618b95

4 files changed

Lines changed: 98 additions & 17 deletions

File tree

Delphi/Console/RALTestServerDelphiConsole.dpr

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type
2828

2929
constructor TRALApplication.Create(AOwner: TComponent);
3030
var
31-
opt: integer;
31+
opt, port: integer;
3232
begin
3333
WriteLn('RALTestServer Delphi Console v' + RALVERSION);
3434
WriteLn('Choose the engine:');
@@ -52,15 +52,18 @@ begin
5252
TRALSaguiServer(FServer).LibPath := ExtractFilePath(ParamStr(0)) + SG_LIB_NAME;
5353
end;
5454
end;
55-
FServer.Port := 8083;
55+
WriteLn('Type the port used by server (0 for default 8000)');
56+
ReadLn(port);
57+
if port <= 0 then port := 8000;
58+
FServer.Port := port;
5659
FServer.CreateRoute('ping', Ping);
5760
FServer.Start;
5861
end;
5962

6063
destructor TRALApplication.Destroy;
6164
begin
6265
FServer.Stop;
63-
FServer.Free;
66+
FreeAndNil(FServer);
6467
inherited;
6568
end;
6669

@@ -70,7 +73,7 @@ var
7073
begin
7174
while not(input = 'exit') do
7275
begin
73-
WriteLn('Server online on port 8083');
76+
WriteLn('Server online on port ' + FServer.Port.ToString);
7477
WriteLn('type exit to close');
7578
ReadLn(input);
7679
end

Lazarus/Console/RALTestServerConsoleLazarus.lpr

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ TRALApplication = class(TCustomApplication)
5353
constructor TRALApplication.Create(AOwner: TComponent);
5454
var
5555
opt: integer;
56+
port: integer;
5657
begin
5758
inherited Create(AOwner);
5859
StopOnException := True;
@@ -61,7 +62,7 @@ TRALApplication = class(TCustomApplication)
6162
WriteLn('Choose the engine:');
6263
WriteLn('1 - Synopse mORMot2 ' + SYNOPSE_FRAMEWORK_VERSION);
6364
WriteLn('2 - Indy ' + gsIdVersion);
64-
WriteLn('3 - FpHttp');
65+
WriteLn('3 - FpHttp ' + 'v3.5');
6566
WriteLn('4 - Sagui ' + Format('%d.%d.%d', [SG_VERSION_MAJOR, SG_VERSION_MINOR,
6667
SG_VERSION_PATCH]) + ' (' + SG_LIB_NAME + ' required)');
6768
ReadLn(opt);
@@ -74,7 +75,10 @@ TRALApplication = class(TCustomApplication)
7475
TRALSaguiServer(FServer).LibPath := ExtractFilePath(ParamStr(0)) + SG_LIB_NAME;
7576
end;
7677
end;
77-
FServer.Port := 8083;
78+
WriteLn('Type the port used by server (0 for default 8000)');
79+
ReadLn(port);
80+
if port <= 0 then port := 8000;
81+
FServer.Port := port;
7882
FServer.CreateRoute('ping', @Ping);
7983
FServer.Start;
8084
end;

Lazarus/Console/RALTestServerConsoleLazarus.lps

Lines changed: 60 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
<ProjectSession>
44
<PathDelim Value="\"/>
55
<Version Value="12"/>
6-
<BuildModes Active="Linux64"/>
6+
<BuildModes Active="Debug"/>
77
<Units>
88
<Unit>
99
<Filename Value="RALTestServerConsoleLazarus.lpr"/>
1010
<IsPartOfProject Value="True"/>
11-
<IsVisibleTab Value="True"/>
12-
<TopLine Value="66"/>
13-
<CursorPos X="54" Y="73"/>
14-
<UsageCount Value="35"/>
11+
<TopLine Value="62"/>
12+
<CursorPos X="30" Y="75"/>
13+
<UsageCount Value="39"/>
1514
<Loaded Value="True"/>
1615
</Unit>
1716
<Unit>
@@ -73,8 +72,51 @@
7372
<CursorPos X="28" Y="170"/>
7473
<UsageCount Value="9"/>
7574
</Unit>
75+
<Unit>
76+
<Filename Value="D:\IDE\lazarus\3.4\lazarus\lcl\interfaces\lcl.pas"/>
77+
<UnitName Value="LCL"/>
78+
<EditorIndex Value="-1"/>
79+
<UsageCount Value="10"/>
80+
</Unit>
81+
<Unit>
82+
<Filename Value="D:\IDE\lazarus\3.4\lazarus\lcl\interfaces\gtk2\alllclintfunits.pas"/>
83+
<UnitName Value="AllLCLIntfUnits"/>
84+
<EditorIndex Value="-1"/>
85+
<UsageCount Value="10"/>
86+
</Unit>
87+
<Unit>
88+
<Filename Value="D:\IDE\lazarus\3.4\lazarus\packager\registration\lazaruspackageintf.pas"/>
89+
<UnitName Value="LazarusPackageIntf"/>
90+
<EditorIndex Value="-1"/>
91+
<TopLine Value="76"/>
92+
<UsageCount Value="10"/>
93+
</Unit>
94+
<Unit>
95+
<Filename Value="D:\IDE\lazarus\3.4\fpcsrc\packages\fcl-base\src\custapp.pp"/>
96+
<UnitName Value="CustApp"/>
97+
<EditorIndex Value="-1"/>
98+
<TopLine Value="13"/>
99+
<UsageCount Value="10"/>
100+
</Unit>
101+
<Unit>
102+
<Filename Value="..\..\..\PascalRAL-dev\src\base\RALRoutes.pas"/>
103+
<IsVisibleTab Value="True"/>
104+
<EditorIndex Value="1"/>
105+
<TopLine Value="222"/>
106+
<CursorPos X="24" Y="230"/>
107+
<UsageCount Value="12"/>
108+
<Loaded Value="True"/>
109+
</Unit>
110+
<Unit>
111+
<Filename Value="D:\IDE\lazarus\3.4\fpcsrc\rtl\objpas\classes\classesh.inc"/>
112+
<EditorIndex Value="2"/>
113+
<TopLine Value="466"/>
114+
<CursorPos X="3" Y="480"/>
115+
<UsageCount Value="12"/>
116+
<Loaded Value="True"/>
117+
</Unit>
76118
</Units>
77-
<JumpHistory HistoryIndex="9">
119+
<JumpHistory HistoryIndex="12">
78120
<Position>
79121
<Filename Value="RALTestServerConsoleLazarus.lpr"/>
80122
<Caret Line="75" Column="34" TopLine="59"/>
@@ -115,6 +157,18 @@
115157
<Filename Value="RALTestServerConsoleLazarus.lpr"/>
116158
<Caret Line="75" Column="25" TopLine="60"/>
117159
</Position>
160+
<Position>
161+
<Filename Value="RALTestServerConsoleLazarus.lpr"/>
162+
<Caret Line="9" Column="11"/>
163+
</Position>
164+
<Position>
165+
<Filename Value="..\..\..\PascalRAL-dev\src\base\RALRoutes.pas"/>
166+
<Caret Line="53" Column="34" TopLine="34"/>
167+
</Position>
168+
<Position>
169+
<Filename Value="..\..\..\PascalRAL-dev\src\base\RALRoutes.pas"/>
170+
<Caret Line="64" Column="29" TopLine="49"/>
171+
</Position>
118172
</JumpHistory>
119173
<RunParams>
120174
<FormatVersion Value="2"/>

Lazarus/Server/TestServer.lps

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<UnitName Value="Main"/>
2222
<IsVisibleTab Value="True"/>
2323
<EditorIndex Value="1"/>
24-
<CursorPos X="17" Y="7"/>
24+
<CursorPos X="63" Y="10"/>
2525
<UsageCount Value="112"/>
2626
<Loaded Value="True"/>
2727
<LoadedDesigner Value="True"/>
@@ -30,7 +30,7 @@
3030
<Filename Value="uroutes.pas"/>
3131
<IsPartOfProject Value="True"/>
3232
<UnitName Value="uRoutes"/>
33-
<EditorIndex Value="2"/>
33+
<EditorIndex Value="3"/>
3434
<TopLine Value="54"/>
3535
<UsageCount Value="83"/>
3636
<Loaded Value="True"/>
@@ -362,22 +362,34 @@
362362
</Unit>
363363
<Unit>
364364
<Filename Value="..\..\..\PascalRAL-dev\src\base\RALServer.pas"/>
365-
<EditorIndex Value="3"/>
365+
<EditorIndex Value="4"/>
366366
<TopLine Value="234"/>
367367
<CursorPos X="14" Y="246"/>
368368
<UsageCount Value="10"/>
369369
<Loaded Value="True"/>
370370
</Unit>
371371
<Unit>
372372
<Filename Value="..\..\..\PascalRAL-dev\src\base\RALRoutes.pas"/>
373-
<EditorIndex Value="4"/>
373+
<EditorIndex Value="5"/>
374374
<TopLine Value="337"/>
375375
<CursorPos X="24" Y="351"/>
376376
<UsageCount Value="10"/>
377377
<Loaded Value="True"/>
378378
</Unit>
379+
<Unit>
380+
<Filename Value="..\..\..\PascalRAL-dev\src\database\sqldb\RALDBSQLDB.pas"/>
381+
<EditorIndex Value="2"/>
382+
<CursorPos X="12" Y="10"/>
383+
<UsageCount Value="10"/>
384+
<Loaded Value="True"/>
385+
</Unit>
386+
<Unit>
387+
<Filename Value="..\..\..\PascalRAL-dev\src\database\RALDBBase.pas"/>
388+
<EditorIndex Value="-1"/>
389+
<UsageCount Value="10"/>
390+
</Unit>
379391
</Units>
380-
<JumpHistory HistoryIndex="26">
392+
<JumpHistory HistoryIndex="28">
381393
<Position>
382394
<Filename Value="main.pas"/>
383395
<Caret Line="202" Column="49" TopLine="184"/>
@@ -486,6 +498,14 @@
486498
<Filename Value="main.pas"/>
487499
<Caret Line="12" Column="10"/>
488500
</Position>
501+
<Position>
502+
<Filename Value="main.pas"/>
503+
<Caret Line="10" Column="53"/>
504+
</Position>
505+
<Position>
506+
<Filename Value="..\..\..\PascalRAL-dev\src\database\sqldb\RALDBSQLDB.pas"/>
507+
<Caret Line="10" Column="12"/>
508+
</Position>
489509
</JumpHistory>
490510
<RunParams>
491511
<FormatVersion Value="2"/>

0 commit comments

Comments
 (0)