diff --git a/inlong-manager/manager-schedule/src/test/java/org/apache/inlong/manager/schedule/dolphinscheduler/DolphinScheduleContainerEnvTest.java b/inlong-manager/manager-schedule/src/test/java/org/apache/inlong/manager/schedule/dolphinscheduler/DolphinScheduleContainerTestEnv.java similarity index 97% rename from inlong-manager/manager-schedule/src/test/java/org/apache/inlong/manager/schedule/dolphinscheduler/DolphinScheduleContainerEnvTest.java rename to inlong-manager/manager-schedule/src/test/java/org/apache/inlong/manager/schedule/dolphinscheduler/DolphinScheduleContainerTestEnv.java index cb2b26a0e3..d821065c26 100644 --- a/inlong-manager/manager-schedule/src/test/java/org/apache/inlong/manager/schedule/dolphinscheduler/DolphinScheduleContainerEnvTest.java +++ b/inlong-manager/manager-schedule/src/test/java/org/apache/inlong/manager/schedule/dolphinscheduler/DolphinScheduleContainerTestEnv.java @@ -61,17 +61,17 @@ import static org.apache.inlong.manager.schedule.dolphinscheduler.DolphinSchedulerContainerEnvConstants.DS_USERNAME; import static org.apache.inlong.manager.schedule.dolphinscheduler.DolphinSchedulerContainerEnvConstants.HTTP_BASE_URL; -public abstract class DolphinScheduleContainerEnvTest extends BaseScheduleTest { +public abstract class DolphinScheduleContainerTestEnv extends BaseScheduleTest { protected static GenericContainer dolphinSchedulerContainer; - private static final Logger DS_LOG = LoggerFactory.getLogger(DolphinScheduleContainerEnvTest.class); + private static final Logger DS_LOG = LoggerFactory.getLogger(DolphinScheduleContainerTestEnv.class); // DS env generated final url and final token protected static String DS_URL; protected static String DS_TOKEN; - public static void setUp() throws Exception { + public static void envSetUp() throws Exception { dolphinSchedulerContainer = new GenericContainer<>(DS_IMAGE_NAME + ":" + DS_IMAGE_TAG) .withExposedPorts(12345, 25333) @@ -126,7 +126,7 @@ private static String accessToken() throws Exception { return null; } - public static void tearDown() { + public static void envShutDown() { if (dolphinSchedulerContainer != null) { dolphinSchedulerContainer.close(); } diff --git a/inlong-manager/manager-schedule/src/test/java/org/apache/inlong/manager/schedule/dolphinscheduler/DolphinScheduleEngineTest.java b/inlong-manager/manager-schedule/src/test/java/org/apache/inlong/manager/schedule/dolphinscheduler/DolphinScheduleEngineTest.java index 48eeb292fd..4c39a11d21 100644 --- a/inlong-manager/manager-schedule/src/test/java/org/apache/inlong/manager/schedule/dolphinscheduler/DolphinScheduleEngineTest.java +++ b/inlong-manager/manager-schedule/src/test/java/org/apache/inlong/manager/schedule/dolphinscheduler/DolphinScheduleEngineTest.java @@ -21,7 +21,10 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; import org.junit.jupiter.api.Timeout; import static org.apache.inlong.manager.schedule.dolphinscheduler.DolphinSchedulerContainerEnvConstants.INLONG_DS_TEST_ADDRESS; @@ -30,14 +33,14 @@ import static org.apache.inlong.manager.schedule.dolphinscheduler.DolphinSchedulerContainerEnvConstants.INLONG_DS_TEST_USERNAME; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; - -public class DolphinScheduleEngineTest extends DolphinScheduleContainerEnvTest { +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) +public class DolphinScheduleEngineTest extends DolphinScheduleContainerTestEnv { private static DolphinScheduleEngine dolphinScheduleEngine; @BeforeAll public static void initDolphinSchedulerEngine() throws Exception { - setUp(); + envSetUp(); assertTrue(dolphinSchedulerContainer.isRunning(), "DolphinScheduler container should be running"); dolphinScheduleEngine = new DolphinScheduleEngine(INLONG_DS_TEST_ADDRESS, INLONG_DS_TEST_PORT, @@ -45,6 +48,7 @@ public static void initDolphinSchedulerEngine() throws Exception { } @Test + @Order(1) @Timeout(30) public void testRegisterScheduleInfo() { // 1. test for normal schedule @@ -63,6 +67,7 @@ private void testRegister(ScheduleInfo scheduleInfo) { } @Test + @Order(2) @Timeout(30) public void testUnRegisterScheduleInfo() { // 1. test for normal schedule @@ -85,6 +90,7 @@ private void testUnRegister(ScheduleInfo scheduleInfo) { } @Test + @Order(3) @Timeout(30) public void testUpdateScheduleInfo() { // 1. test for normal schedule @@ -105,6 +111,6 @@ private void testUpdate(ScheduleInfo scheduleInfo) { @AfterAll public static void testStopEngine() { dolphinScheduleEngine.stop(); - tearDown(); + envShutDown(); } }