Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Bughue committed Feb 4, 2024
1 parent fe00da5 commit 35ba3c8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,22 @@ public class MockServerTest {

static String RESOURCE_ID = "mock-action";

private static volatile boolean inited = false;

@BeforeAll
public static void before() {
MockServer.start();
startMockServer();
}

public static void startMockServer() {
if (!inited) {
synchronized (MockServerTest.class) {
if (!inited) {
MockServer.start();
inited = true;
}
}
}
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,10 @@ public class RmClientTest {

protected static final Logger LOGGER = LoggerFactory.getLogger(RmClientTest.class);

@BeforeAll
public static void before() {
MockServer.start();
}



@Test
public void testRm() throws TransactionException {
MockServerTest.startMockServer();
String resourceId = "mock-action";
String xid = "1111";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,10 @@ public class TmClientTest {

protected static final Logger LOGGER = LoggerFactory.getLogger(TmClientTest.class);

@BeforeAll
public static void before() {
MockServer.start();
}


@Test
public void testTm() throws Exception {

MockServerTest.startMockServer();
TransactionManager tm = getTm();

//globalBegin:TYPE_GLOBAL_BEGIN = 1 , TYPE_GLOBAL_BEGIN_RESULT = 2
Expand Down

0 comments on commit 35ba3c8

Please sign in to comment.