Atozed Forums

Full Version: Intraweb DUnit Testing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Using Toyko 10.2.3 with the "DUnit Test Project" for Intraweb.

Using Intraweb 14.2.7

I can't get the program to start up at all as it bombs out due to not being able to access "IW_FAVICON"

Code:
exception message  : Cannot find internal file: IW_FAVICON.

main thread ($2d20):
006b9ad4 +18 CrashLinkTesting.exe IWException             119  +2 EIWException.IfTrue
007264d7 +57 CrashLinkTesting.exe IWServerInternalFiles   135  +2 TIWServerInternalFiles.GetResourceStream
00726905 +4d CrashLinkTesting.exe IWServerInternalFiles   226  +2 TIWServerInternalFiles.InternalAdd
00726c6d +15 CrashLinkTesting.exe IWServerInternalFiles   276  +2 TIWServerInternalFiles.AddSystemFiles
0072664a +52 CrashLinkTesting.exe IWServerInternalFiles   159  +7 TIWServerInternalFiles.Create
007dfb97 +13 CrashLinkTesting.exe IWServerInternalFiles   460  +1 initialization
0040a372 +42 CrashLinkTesting.exe System                22836 +21 InitUnits
0040a3db +3f CrashLinkTesting.exe System                22911 +14 @StartExe
0041196a +42 CrashLinkTesting.exe SysInit                1482 +11 @InitExe
007e0b0f +0b CrashLinkTesting.exe CrashLinkTesting         21  +0 initialization
76d38482 +22 KERNEL32.DLL                                         BaseThreadInitThunk


006b9abc     public IWException.EIWException.IfTrue:  ; function entry point
006b9abc 117   push    ebp
006b9abd       mov     ebp, esp
006b9abf       push    ebx
006b9ac0       push    esi
006b9ac1       mov     esi, ecx
006b9ac3       mov     ebx, eax
006b9ac5 118   test    dl, dl
006b9ac7       jz      loc_6b9ad9
006b9ac9 119   mov     ecx, esi
006b9acb       mov     dl, 1
006b9acd       mov     eax, ebx
006b9acf       call    -$2612e4 ($4587f0)     ; System.SysUtils.Exception.Create
006b9ad4     > call    -$2afaa5 ($40a034)     ; System.@RaiseExcept
006b9ad9 121   pop     esi
006b9ada       pop     ebx
006b9adb       pop     ebp
006b9adc       ret

Any ideas?

Oh and is there any good documentation on how to do IW related unit testing?

Code:
procedure T.Test;
begin
 with NewSession do ///// <--- exception error
   try
     with MainForm as TIWForm1 do
     begin

     end;
   finally
     Free;
   end;
end;

This is the example code it generates for a test ....  But it doesn't really reflect how you would stage this all up properly to work with MY forms and such.

'with NewSession do" generates an exception error "IW Application not properly initilized"
Look here, maybe this is what you are trying to do?

https://github.com/Atozed/IntraWeb/tree/.../CGIRunner
Hello,
I have also this error

Project xxx.exe raised exception class EIXException with message 'Cannot fin internal file : IW_FAVICON'.
I used intraweb 14 version with embarcadero rio in delphi.

I'm migrating from XE2 to RIO in delphi.
I deleted the frame but it still seems to exist.
While migrating to RIO, I can't compile anymore due to the above error.

Would you have an idea to remove the use of this frame and the error please?

Thanks
(06-05-2020, 10:36 AM)sigiaccio Wrote: [ -> ]Hello,
I have also this error

Project xxx.exe raised exception class EIXException with message 'Cannot fin internal file : IW_FAVICON'.
I used intraweb 14 version with embarcadero rio in delphi.

I'm migrating from XE2 to RIO in delphi.
I deleted the frame but it still seems to exist.
While migrating to RIO, I can't compile anymore due to the above error.

Would you have an idea to remove the use of this frame and the error please?

Thanks

Hello,
could you give me some solutions, please?

Thank you very much.
Hello,
Could you please help me find a solution?

My problem is still not solved

Thank you
"I'm migrating from XE2 to RIO in delphi.
I deleted the frame but it still seems to exist.
While migrating to RIO, I can't compile anymore due to the above error."

What exact error are you receiving?
As I can understand this is not an actual IW application but a unit test, correct?

You need to add

IWApplication,
IWServerInternalFiles,

to your project's uses clause. Also include

{$R IWData.res}

and try to rebuild it. IWData.res contain required resources. Make sure it is available to your application.

This the DPR file may look:

uses
SysUtils,
// your files here
IWApplication,
IWServerInternalFiles;

{R *.RES}
{$R IWData.res}

begin
System.ReportMemoryLeaksOnShutdown := True;
UnitTestRunner.RunRegisteredTests;
FreeAndNil(gSessions);
TIWServerInternalFiles.Finalize;
end.
(09-07-2020, 09:07 PM)Alexandre Machado Wrote: [ -> ]As I can understand this is not an actual IW application but a unit test, correct?

You need to add

  IWApplication,
  IWServerInternalFiles,

to your project's uses clause. Also include

{$R IWData.res}

and try to rebuild it. IWData.res contain required resources. Make sure it is available to your application.

This the DPR file may look:

uses
  SysUtils,
  // your files here
  IWApplication,
  IWServerInternalFiles;

{R *.RES}
{$R IWData.res}

begin
  System.ReportMemoryLeaksOnShutdown := True;
  UnitTestRunner.RunRegisteredTests;
  FreeAndNil(gSessions);
  TIWServerInternalFiles.Finalize;
end.

Hello,
Thank you for your response.

I found my problem.
There was still a call to the frame created in a library file.
There was also the call to components (search on IW and delete).

Thanks to all of you
WIth IntraWeb 15, I cannot get this to work. I keep getting the error "IW application not property initialized".

Before IntraWeb 15, I could add the following code:

GAppModeInit(Application);

But that no longer compiles.

Any idea?

Does anyone have an example of an IntraWeb 15 Unit Testing Project? Tjanks in advance!

Groetjes, Bob Swart
Until IW 12 there was a GAppModeInit variable that pointed to AppModeInit() procedure.

In IW 15 it has been replaced by GAppInt which points to AppInit() procedure.

Cheers,
Pages: 1 2 3