Working of failing unit tests (WIP)

This commit is contained in:
Daniele Teti 2023-06-05 00:38:44 +02:00
parent e0f980b0db
commit 201d739e25
8 changed files with 25 additions and 22 deletions

View File

@ -27,7 +27,7 @@ package SwagDoc;
{$ENDIF IMPLICITBUILDING}
{$DESCRIPTION 'SwagDoc Library'}
{$RUNONLY}
{$IMPLICITBUILD ON}
{$IMPLICITBUILD OFF}
requires
rtl;

View File

@ -62,6 +62,7 @@
<VerInfo_Keys>CompanyName=Jaloto Software;FileDescription=$(MSBuildProjectName);FileVersion=1.0.3.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<DCC_Description>SwagDoc Library</DCC_Description>
<RuntimeOnlyPackage>true</RuntimeOnlyPackage>
<DCC_OutputNeverBuildDcps>true</DCC_OutputNeverBuildDcps>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Android)'!=''">
<DCC_CBuilderOutput>None</DCC_CBuilderOutput>

View File

@ -25,7 +25,7 @@ package dmvcframeworkRT;
{$IMAGEBASE $400000}
{$DEFINE DEBUG}
{$ENDIF IMPLICITBUILDING}
{$DESCRIPTION 'DMVCFramework - CopyRight (2010-2023) Daniele Teti and the DMVCFramework Team'}
{$DESCRIPTION 'DMVCFramework - Copyright (2010-2023) Daniele Teti and the DMVCFramework Team'}
{$LIBSUFFIX '113'}
{$RUNONLY}
{$IMPLICITBUILD ON}

View File

@ -108,7 +108,7 @@
<VerInfo_MajorVer>3</VerInfo_MajorVer>
<VerInfo_MinorVer>4</VerInfo_MinorVer>
<DllSuffix>113</DllSuffix>
<DCC_Description>DMVCFramework - CopyRight (2010-2023) Daniele Teti and the DMVCFramework Team</DCC_Description>
<DCC_Description>DMVCFramework - Copyright (2010-2023) Daniele Teti and the DMVCFramework Team</DCC_Description>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>

View File

@ -284,7 +284,7 @@ begin
// Result := fRequest.Version;
ReqIDX_URL:
begin
Result := URLDecode(String(fRequest.Path));
Result := URLDecode(fRequest.Path);
end;
ReqIDX_Query:
begin
@ -578,9 +578,9 @@ end;
procedure TMVCCrossSocketAppResponse.SendRedirect(const URI: string);
begin
fResponse.Redirect(URI);
// fHeaders.Values['Location'] := URI;
// StatusCode := http_status.Found;
fResponse.Header.Add('Location', URI);
fResponse.SendStatus(HTTP_STATUS.MovedPermanently, '');
// fResponse.Redirect(URI);
end;
procedure TMVCCrossSocketAppResponse.SendResponse;

View File

@ -301,8 +301,7 @@ begin
begin
if not AContext.Request.PathInfo.EndsWith('/') then
begin
AContext.Response.StatusCode := HTTP_STATUS.MovedPermanently;
AContext.Response.CustomHeaders.Values['Location'] := AContext.Request.PathInfo + '/';
AContext.Response.RawWebResponse.SendRedirect(AContext.Request.PathInfo + '/');
AHandled := True;
Exit;
end;

View File

@ -3811,16 +3811,19 @@ var
R: TMVCErrorResponse;
begin
ResponseStatus(AStatusCode, AReasonMessage);
R := TMVCErrorResponse.Create;
try
R.StatusCode := AStatusCode;
R.ReasonString := HTTP_STATUS.ReasonStringFor(AStatusCode);
R.Message := AReasonMessage;
R.Classname := AErrorClassName;
R.Data := ADataObject;
Render(R, False, stProperties);
finally
R.Free;
if AStatusCode >= 300 then
begin
R := TMVCErrorResponse.Create;
try
R.StatusCode := AStatusCode;
R.ReasonString := HTTP_STATUS.ReasonStringFor(AStatusCode);
R.Message := AReasonMessage;
R.Classname := AErrorClassName;
R.Data := ADataObject;
Render(R, False, stProperties);
finally
R.Free;
end;
end;
end;

View File

@ -466,10 +466,10 @@ end;
procedure TTestServerController.EchoBody;
var
JSON: TJSONObject;
JSON: TJDOJsonObject;
begin
JSON := TJSONObject.ParseJSONValue(Context.Request.Body) as TJSONObject;
JSON.AddPair('echo', 'from server');
JSON := StrToJSONObject(Context.Request.Body);
JSON.S['echo'] := 'from server';
Render(JSON, True);
end;