Jump to content

Wagner Landgraf

Members
  • Content Count

    122
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Wagner Landgraf


  1. 5 minutes ago, Uwe Raabe said:

    I followed your steps and the cursor is on line 27, while the editor top line is 25. 

     

    Embarcadero® Delphi 10.4 Version 27.0.40680.4203 (with MMX Code Explorer , Project Magician, Selective Debugging and wuppdi Welcome Page)

    Using same exact version: Embarcadero® RAD Studio 10.4 Version 27.0.40680.4203.

    No IDE plugins installed, only components.

    The fact you can't reproduce is really intriguing, it might mean there is some settings that "fix" this behavior? Or maybe your IDE plugins are affecting it?


  2. Weird. How did you test it? Using latest Delphi 10.4.2 Sydney, you can do just this:

     

    1. Create a new VCL blank application

     

    2. Double click the form to create a FormCreate event handler.

    Cursor is located between begin..end lines (line 27)

     

    3. Press Ctrl+Shift+Up.

    Cursor goes to FormCreate declaration in interface section (line 11)

     

    4. Press Ctrl+Shift+Down.

    Cursor goes back to FormCreate implementation, but now cursor is in procedure line (line 25), not between begin..end lines

     

    You don't see that behavior?


  3. I wonder if someone notice these "minor" but really annoying changes in IDE behavior in 10.4.2. This really decreases productivity significantly when you sum up the small things.

     

     

    1. Interface/implementation navigation 

    a) When you navigate from method declaration in interface to method implementation, using Ctrl+Shift+Arrow Down, the IDE goes to the implementation, but cursor is now located in the procedure/function declaration, not in the first line of the implementation (after begin). 

    Thus, if you want to start coding, you have to press down key several times (especially if you have lots of local variables declared) just to get to the first line of code.

     

    b) Also when navigating to implementation, the cursor is now located in the middle of the editor, instead of top. Thus, you only see "half" of the implementation code that would you see if the cursor is located in the top of editor.

     

    2. Forward class declaration navigation

    When you control-click a forward class declaration like

     

      TMappingExplorer = class;

     

    It won't navigate anymore to the actual class declaration.

     

    I wonder if you noticed the same and you know workarounds. The only one I found was to disable new LSP but this brings lots of stability issues, besides not having the new LSP features, obviously.


  4. On 2/27/2021 at 3:39 AM, Stéphane Wierzbicki said:

    Thanks for your reply. Object's lifetime cycle is actually handle by Aurelius' manager. Object's stored within TList are only queried for additional checks, needs to see TList acting like a cache. 

     

    I'll then use .ToArray and then free TList.

     

    Ps: @Wagner Landgraf it will be nice allowing TMS Biz products using Spring4D library 😄

     

     

    That's for sure. We could even use more things and types from Spring4D.

    The main problem, actually - besides some time to integrate - is the deploy of it. Installation is already complex, it's rather complex to add Spring4D as a dependency, worse, as an optional dependency. That's why I'm really looking forward to @Vincent Parrett's DPM, when it's ready, we could deploy several different packages, and it will just download and install whatever dependencies it needs.

    • Like 2

  5. In the case of TMS Aurelius Nullable type, specifically, there are helper methods for you to use that do the job for you. It's TMappingExplorer.GetMemberValue and SetMemberValue. Here is some info:

    https://support.tmssoftware.com/t/how-to-get-a-property-by-its-name/7777/2

     

    But in general, you do what @Attila Kovacs mentioned: get the whole record, modify its fields via RTTI, and then set the record back to the field/property. That's what Aurelius does.


  6. 3 hours ago, Edwin Yip said:

    Yes, those are really good Delphi guys 😉

    It's their endeavor, but not Delphi's ever-increasing licensing fees, that drives the prosperity of the Delphi community 😉

    Excellent! I'm always pleased with people that see the positive side of things.

    • Like 1

  7. 1 minute ago, Arnaud Bouchez said:

    This is not TMS DB Remote for sure.

    But a request like GET /tms/xdata/Customer?$filter=Country/Name eq 'USA'&$orderby=Name&$top=10 seems very close to a SQL SELECT.

     

    Security seems pretty basic: is there something more than the CRUD permissions of https://download.tmssoftware.com/business/xdata/doc/web/entity_sets_permissions.html ?

    Even if the client is authenticated, how to you go deeper into the authorization? For instance, if you have a DB with all customers for all salers, how to prevent one saler to get the customers of other salers from the same table?

     

    What I would like to emphase is that it may be a 3-tier physical architecture, but it is still a 2-tier logical Architecture. The logic is still in the client.
    A much cleaner n-Tier architecture would be to create a real business layer (logical 3-tier) - or even better an application layer (logicial 4-tier as in DDD), and expose only safe and efficient REST endpoints to the clients.
    The client side is still much too tied to the underlying database. In a clean SOA architecture, you don't start from the database, but from the client use-cases.

    I will not get into an architectural discussion or in a feature discussion, it's out of the scope of the topic.

    It's a tool that anyone can use if they want. It's not SQL SELECT, there is no injection, it's more secure. Yes, you can do complex authorization mechanisms.

    Finally, that is not "XData", but one of XData tools. If user wants, he can simply choose not to use it, and do a 15-tiered application without any client-side logic. 

    I'm just answering the OP question.

    • Thanks 1

  8. Hi, is there anyone here using Delphi with Mac using Parallels virtual machines?

     

    I've recently migrated from VMWare to Parallels - and very happy for it, it's noticeable faster.

     

    However, I'm having a small but annoying issue that didn't happen in VMWare: whenever I try to scroll the source code using the mouse scroll (trackpad, in this case), it goes too fast. 

     

    It's interesting to note that when scrolling up, it works fine. When scrolling down, it goes too fast. That only happens in this virtual machine, only with Parallels, and only with Delphi - no other Windows applications behave like that.

     

    I have also know another person who uses it like that, and he has the exactly same problem. From some Parallels forum posts, it looks like it happens to other as well.

     

    Thus, I believe this happens to everyone using Delphi with Parallels, and I believe given the number of Delphi users here, some DelphiPraxis forum members might also be in the same situation.

     

    So I wonder, does it happen to you as well? If yes, have you found a workaround, or have you just accepted it as a fact of life?

     

    Some references:

    https://forum.parallels.com/threads/smooth-scrolling.346361/

    https://forum.parallels.com/threads/trackpad-scrolling-is-too-fast-and-frequently-uncontrollable.346338/page-2

    https://stackoverflow.com/questions/59163058/how-to-make-delphis-ide-scroll-correctly

     

     


  9. TMS XData does that. These three videos show it in details:

     

    https://www.youtube.com/watch?v=AZs9e2DNXdI

    https://www.youtube.com/watch?v=e31Co9Fv3YY

    https://www.youtube.com/watch?v=QvgS8pjpfkk

     

    This has nothing to do with executing arbitrary SQL statements. It's regular REST endpoints.

     

    Regarding being 1:1 with underlying db system, in my opinion it depends. As someone mentioned here, you might need an "inner" use in which this is not a problem. Or, you might use it for simple entities like a list of countries or something like that. So for example use it for simple or non-critical entities, and then implement DTOs and specific business logic for more complex or critical business operations.

     

    Like anything, it's just a nice tool which is available. Use if it's helpful for you.

    • Thanks 1

  10. Ok. Reading the code I think TI is just not prepared for it. In many places you consider the test name to be ClassName + TestName, as in:

     

    function GetFullQualifiedName(const test: ITest): string;
    begin
      Result := (test as TObject).ClassName + '.' + test.Name;
    end;

    Also, TTestInsightListener.StartSuite and EndSuite are not implemented, and I believe that's what would allow a tree-like structure in the IDE plugin. 

    I also don't know how the plugin handles the information sent to it, but from what is available in TTestInsightResult and no StartSuite/EndSuite information I believe it's not trivial to show the results reflecting the original tree structure.

     

    Thanks for your help!


  11. 50 minutes ago, Stefan Glienke said:

    Please show how these tests show in TI grouped by type.

    I tried it again, I must be doing something wrong. This is what I get when I run it for the first time. Some warnings:

     

    image.thumb.png.240387731c19874fde26e59e94167ad7.png

     

    And then remaining tests passed. The tests that are not replicated and grouped by database:

     

    image.thumb.png.a5e76e9425c464a86c5e691c5f3f9fce.png

     

    And the tests that are supposed to be replicated and grouped by database:

     

    image.thumb.png.92e33e1e3e13b7260385141c9b729f1f.png

     

    If I click "group by type" it doesn't help much:

     

    image.thumb.png.e1c673d81d1f2b6d2541c242e21ce676.png

     

    Finally, I must say that all tests were run in the first place. Note that what I do is to run the application with Ctrl+Shift+F9. 

     


  12. The tests are organized more or less this way (never mind some unfriendly names):

     

    1945293399_PastedGraphic.thumb.png.a48b465c0382e6dd983b93ee12dee789.png

     

    As you can see, there are several setups (NativeSQLite, FireDacMSSQL, etc.). For each of then, there is a test suite named "TTestBasicCriteria" for example, with several test methods.

     

    This is all setup dynamically by a code like this, which gathers all registered "Aurelius tests" and then create the proper DUnit tests based on it:

     

      // Wrap all registered tests into a single test setup for initial set up and final tear down }
      for Setup in AureliusDBSetups do
      begin
        testconfig := TTestConfig.Create(Setup);
        DBTest := CreateSuiteFromConfig(testConfig, Setup.Name);
        RegisterTest(DBTest);
        if Setup.RemoteDB then
        begin
          testConfig := TRemoteDBTestConfig.Create(Setup);
          DBTest := CreateSuiteFromConfig(testConfig, Setup.Name + ' - Remote');
          RegisterTest(DBTest);
        end;
        if Setup.GenericDB then
        begin
          testConfig := TGenericDBTestConfig.Create(Setup);
          DBTest := CreateSuiteFromConfig(testConfig, Setup.Name + ' - Generic');
          RegisterTest(DBTest);
        end;
      end;

     

    You can also see some of the test cases are not replicated among all databases, because it doesn't make sense - like TTestMemoryDataset, for example.


  13. Of course no one is forcing me! 🙂  It's just it's a nice tool with several benefits that I'd love to use. I will see what I will do.

     

    My case is different, I also use test inheritance when applicable but as I said, in my case I have hundreds of tests, spread over different TTestCase objects because it makes sense - logical grouping, different setup and teardown mechanisms, etc. Then all of those tests are grouped by decorators to work with different "Setups" - different databases, for example. So they are actually the same test, even double clicking won't solve because they will all point to the same source code.

     

     


  14. 1. This is (almost) a showstopper for me, unless I'm not fully understanding or building my tests wrongly. The thing is TMS Aurelius for example has thousands and thousands of tests. Reason is tests are replicated in several scenarios: for MySQL, for SQL Server, for Oracle, using RemoteDB, not using RemoteDB, etc.. Thus information about hierarchy is a must to understand which tests failed in which situation (the test was a "SaveBlob", but was it with SQL Server or Firebird? Using RemoteDB? Etc.) Not sure if there is an alternative way to do so or TI was not built for such scenario?

     

    2. Ok, I will check it again with more attention.

     

    3. Ok, I will check it also, thanks a lot.


  15. Thanks @Stefan Glienke. I'm not sure if you prefer I open an issue, but I consider this more a discussion, so will ask it here first.

    I'm trying to use Test Insight with my tests as-is, but I'm having some issues which relates to my understanding of how it works. For example:

     

    1. Hierarchy

    My tests have some hierarchical structure that are displayed in the DUnit GUI test runner. I manually use several test decorators to organize it, and sometimes I register test with dots in names to organize it.

    When using TestInsight, the results are not displayed in the same structure, but all test results are displayed in a "flat" layout. Is this known, intentional, or there is something I could do to improve it?

     

    2. Loop

    I understand the tests keep running in a loop? Or at least I can't finalize the test application, which seems to keep running in background. Is this also the normal behavior?

     

    3. Test selection

    I understand that I can select the tests to be executed, but only after one initial execution of all tests are performed. My tests take a lot of time to execute, so that's not a viable option. Is there a workaround to be able to select the tests to be executed before they are actually first executed?

     

    Thanks!

×