29
29
import io .seata .rm .DefaultResourceManager ;
30
30
import org .apache .seata .mockserver .MockCoordinator ;
31
31
import org .apache .seata .mockserver .MockServer ;
32
- import org .junit .jupiter .api .AfterAll ;
33
- import org .junit .jupiter .api .Assertions ;
34
- import org .junit .jupiter .api .BeforeAll ;
35
- import org .junit .jupiter .api .Test ;
32
+ import org .junit .jupiter .api .*;
36
33
import org .slf4j .Logger ;
37
34
import org .slf4j .LoggerFactory ;
38
35
39
36
/**
40
37
* the type MockServerTest
41
38
*/
39
+ @ TestMethodOrder (MethodOrderer .OrderAnnotation .class )
42
40
public class MockTest {
43
41
44
42
static String RESOURCE_ID = "mock-action-061" ;
@@ -57,39 +55,45 @@ public static void after() {
57
55
}
58
56
59
57
@ Test
58
+ @ Order (1 )
60
59
public void testCommit () throws Exception {
61
60
String xid = doTestCommit (0 );
62
61
Assertions .assertEquals (1 , Action1Impl .getCommitTimes (xid ));
63
62
Assertions .assertEquals (0 , Action1Impl .getRollbackTimes (xid ));
64
63
}
65
64
66
65
@ Test
66
+ @ Order (2 )
67
67
public void testCommitRetry () throws Exception {
68
68
String xid = doTestCommit (2 );
69
69
Assertions .assertEquals (3 , Action1Impl .getCommitTimes (xid ));
70
70
Assertions .assertEquals (0 , Action1Impl .getRollbackTimes (xid ));
71
71
}
72
72
73
73
@ Test
74
+ @ Order (3 )
74
75
public void testRollback () throws Exception {
75
76
String xid = doTestRollback (0 );
76
77
Assertions .assertEquals (0 , Action1Impl .getCommitTimes (xid ));
77
78
Assertions .assertEquals (1 , Action1Impl .getRollbackTimes (xid ));
78
79
}
79
80
80
81
@ Test
82
+ @ Order (4 )
81
83
public void testRollbackRetry () throws Exception {
82
84
String xid = doTestRollback (2 );
83
85
Assertions .assertEquals (0 , Action1Impl .getCommitTimes (xid ));
84
86
Assertions .assertEquals (3 , Action1Impl .getRollbackTimes (xid ));
85
87
}
86
88
87
89
@ Test
90
+ @ Order (5 )
88
91
public void testTm () throws Exception {
89
92
TmClientTest .testTm ();
90
93
}
91
94
92
95
@ Test
96
+ @ Order (6 )
93
97
public void testRm () throws Exception {
94
98
RmClientTest .testRm ("testRM01" );
95
99
}
0 commit comments