Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Caputre RPC DSRequest and DSResponse to files

    we are writing some tests which use DSRequest as input and DSResponse as expected output. capturing these is tedious. is there a way to have the logging dump them to a file?

    edit: just to be clear, the things you can capture with copy/paste from Dev Console

    #2
    Bump.

    Comment


      #3
      Can you clarify what you're capturing and from where - you say "Dev Console" but this could mean either the Eclipse console or the SmartGWT Developer Console or browser built-in tools, so we're not sure if you're talking about server logs or client logs.

      Also what kind of testing are you doing here: regression, performance, etc?

      A few general options:

      1. use DataSource.transformRequest / transformResponse on the client side to capture information on the client side

      2. use HTTP-level recording as is typical for eg JMeter. Note that the HTTP-level requests are not a supported API, hence could change; we've had to make changes in the past to work around, for example, egregious new memory leaks introduced in IE9

      3. server-side, use custom DataSources with an override of DataSource.execute(), or use a subclass of IDACall. The latter approach would also allow capture of non-DataSource RPC requests, as well as allow you to capture the fact that the request(s) were part of a queue

      Comment


        #4
        Interesting.

        Yes, so right now, we use the smartGWT Dev Console to copy paste the DSRequest and DSResponse RPC calls.

        In a perfect world, I'd be able to start the app with some system property and have it record these to files like req_<DSNAME><OPERATIONType><OperationID>.json

        we already override DataSource and extend that for other reasons.

        edit: i don't seem to hit an overloaded Execute(DSRequest req) method. our system uses DS.xml files with a operation pointing to a specific class/method in a class that extends BasicDataSource.

        I feel like I'm missing something here, I'm off to peruse the javadoc.
        Last edited by mtmattek; 17 Feb 2017, 12:15.

        Comment


          #5
          If you are using .ds.xml files to configure DMI for operations, and you never call dsRequest.execute(), you won't hit execute(). But the IDACall subclass approach still applies.

          If you end up with further questions please be sure to post a new reply rather than just edit existing posts. Forums do not send notifications for just edits, so we won't know about new questions.

          Comment


            #6
            Ok, I have the place where we already are subclassing IDACall. However, in my execute, how do I capture the raw JSON of the request to write to a file?

            DSRequest.toString() just returns the hashcode (btw, this is less than ideal for a class in a public API).

            I see some things about exporting, but don't see how to actually call the export in the javadoc.

            Comment


              #7
              Anyone help here? Should I do this at the httpServlet level (with a filter?)

              Comment

              Working...
              X