forked from Terracotta-OSS/terracotta-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ Terracotta-OSS#191 : Stabilize some ITs
- Loading branch information
1 parent
c1bd590
commit 1426f35
Showing
8 changed files
with
143 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import com.fasterxml.jackson.databind.JsonNode; | ||
import com.fasterxml.jackson.databind.MapperFeature; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.databind.SerializationFeature; | ||
import org.junit.Rule; | ||
|
@@ -56,7 +57,7 @@ | |
*/ | ||
public abstract class AbstractTest { | ||
|
||
private final ObjectMapper mapper = new ObjectMapper(); | ||
private final ObjectMapper mapper = new ObjectMapper().configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true); | ||
|
||
private Connection managementConnection; | ||
private Cluster cluster; | ||
|
@@ -198,4 +199,25 @@ protected void queryAllRemoteStatsUntil(Predicate<List<? extends ContextualStati | |
assertTrue(test.test(statistics)); | ||
} | ||
|
||
protected String removeRandomValues(String currentTopo) { | ||
// removes all random values | ||
return currentTopo | ||
.replaceAll("\"(hostName)\":\"[^\"]*\"", "\"$1\":\"<hostname>\"") | ||
.replaceAll("\"hostAddress\":[^,]*", "\"hostAddress\":\"127\\.0\\.0\\.1\"") | ||
.replaceAll("\"bindPort\":[0-9]+", "\"bindPort\":0") | ||
.replaceAll("\"groupPort\":[0-9]+", "\"groupPort\":0") | ||
.replaceAll("\"port\":[0-9]+", "\"port\":0") | ||
.replaceAll("\"activateTime\":[0-9]+", "\"activateTime\":0") | ||
.replaceAll("\"time\":[0-9]+", "\"time\":0") | ||
.replaceAll("\"startTime\":[0-9]+", "\"startTime\":0") | ||
.replaceAll("\"upTimeSec\":[0-9]+", "\"upTimeSec\":0") | ||
.replaceAll("\"id\":\"[0-9]+@[^:]*:([^:]*):[^\"]*\",\"pid\":[0-9]+", "\"id\":\"[email protected]:$1:<uuid>\",\"pid\":0") | ||
.replaceAll("\"buildId\":\"[^\"]*\"", "\"buildId\":\"Build ID\"") | ||
.replaceAll("\"version\":\"[^\"]*\"", "\"version\":\"<version>\"") | ||
.replaceAll("\"clientId\":\"[0-9]+@[^:]*:([^:]*):[^\"]*\"", "\"clientId\":\"[email protected]:$1:<uuid>\"") | ||
.replaceAll("\"logicalConnectionUid\":\"[^\"]*\"", "\"logicalConnectionUid\":\"<uuid>\"") | ||
.replaceAll("\"id\":\"[^\"]*\",\"logicalConnectionUid\":\"[^\"]*\"", "\"id\":\"<uuid>:SINGLE:testServer0:127.0.0.1:0\",\"logicalConnectionUid\":\"<uuid>\"") | ||
.replaceAll("\"vmId\":\"[^\"]*\"", "\"vmId\":\"[email protected]\""); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.