You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@submarine.apache.org by "cdmikechen (Jira)" <ji...@apache.org> on 2022/07/24 09:22:00 UTC

[jira] [Created] (SUBMARINE-1297) Modify the logic of mybatis to determine the test class

cdmikechen created SUBMARINE-1297:
-------------------------------------

             Summary: Modify the logic of mybatis to determine the test class
                 Key: SUBMARINE-1297
                 URL: https://issues.apache.org/jira/browse/SUBMARINE-1297
             Project: Apache Submarine
          Issue Type: Improvement
          Components: Backend Server
            Reporter: cdmikechen
             Fix For: 0.8.0


The current mybatis method for determining the test class is based on the following codes:
{code:java}
  private static void checkCalledByTestMethod() {
    StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
    for (StackTraceElement element : stackTraceElements) {
      if (element.getClassName().endsWith("Test")) {
        usingTestDatabase();
        return;
      }
    }
  }
{code}

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




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org