Uploaded image for project: 'Apache Submarine'
  1. Apache Submarine
  2. SUBMARINE-1297

Modify the logic of mybatis to determine the test class

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • 0.9.0
    • Backend Server
    • None

    Description

      The current mybatis method for determining the test class is based on the following codes:

        private static void checkCalledByTestMethod() {
          StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
          for (StackTraceElement element : stackTraceElements) {
            if (element.getClassName().endsWith("Test")) {
              usingTestDatabase();
              return;
            }
          }
        }
      

      Such code is clearly a hard code approach and may not cover all test methods by name.
      We should use something that is easier to determine and more precise

      Attachments

        Activity

          People

            Unassigned Unassigned
            chenxiang cdmikechen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: