Spring Framework
  1. Spring Framework
  2. SPR-8569

Proposition of a annotation for testing performance oriented sql

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Data, Test
    • Labels:
    • Last commented by a User:
      false

      Description

      It would be nice if the Spring TestContext Framework provided support for performance tests oriented sql.
      It is well know that some ORM in the hands of novice developer can produce methods in dao that will generate against with real datas a lot of queries.

      Actually it is possible but it is done programmatically,(start, call Mydao, stop and count...) so a lot of copy/paste is done.

      This performance testing need is more a cross-cutting concern.
      It will even able to reuse previous tess done for example againts legacy database dumped from the production.

      The annotation will prevent the arise of thoses issues by limiting the numbers of jdbc queries made by a specific test and will help new developers to spot more quickly any performance degradation newly introduced.

      Proposed Annotation Names

      @MaxQueries

      Code Examples

      @MaxQueries(10)
      public void testFindPersonsByName() throws Exception{
       
      }

      @Test

        Activity

        Hide
        Sam Brannen added a comment -

        Hi Omar,

        Thanks for the proposal!

        Unfortunately, due to the numerous possible ways that data access can be configured in a Java/Spring application, I would consider performance testing of SQL queries beyond the scope of the Spring TestContext Framework.

        If you're interested in timed performance (as opposed to the number of queries executed), you might consider using the timeout attribute of JUnit's @Test annotation or the timeOut attribute of TestNG's @Test annotation.

        I'm therefore resolving this issue as Won't Fix.

        Regards,

        Sam

        Show
        Sam Brannen added a comment - Hi Omar, Thanks for the proposal! Unfortunately, due to the numerous possible ways that data access can be configured in a Java/Spring application, I would consider performance testing of SQL queries beyond the scope of the Spring TestContext Framework. If you're interested in timed performance (as opposed to the number of queries executed), you might consider using the timeout attribute of JUnit's @Test annotation or the timeOut attribute of TestNG's @Test annotation. I'm therefore resolving this issue as Won't Fix . Regards, Sam

          People

          • Assignee:
            Sam Brannen
            Reporter:
            omar elmandour
            Last updater:
            Sam Brannen
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              38 weeks, 6 days ago