Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public class SysProps {
private static Map<String, String> map = new LinkedHashMap<String, String>();

public static void reset() {
for (String key : map.keySet()) {
System.clearProperty(key);
}
map.clear();
}

Expand All @@ -36,9 +39,6 @@ public static void setProperty(String key, String value) {
}

public static void clear() {
for (String key : map.keySet()) {
System.clearProperty(key);
}
reset();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public class SysProps {
private static Map<String, String> map = new LinkedHashMap<String, String>();

public static void reset() {
for (String key : map.keySet()) {
System.clearProperty(key);
}
map.clear();
}

Expand All @@ -36,9 +39,6 @@ public static void setProperty(String key, String value) {
}

public static void clear() {
for (String key : map.keySet()) {
System.clearProperty(key);
}
reset();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ class SpringBootConfigPropsTest {

@BeforeAll
public static void beforeAll() {
// Clear JVM System properties that other tests in the same JVM may have left set to
// disable metrics. Dubbo resolves dubbo.metrics.* from the System properties with the
// highest precedence, which would otherwise override this test's @SpringBootTest
// property dubbo.metrics.protocol=prometheus and fail the assertion below.
System.clearProperty("dubbo.metrics.protocol");
System.clearProperty("dubbo.metrics.enabled");
DubboBootstrap.reset();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ class SpringBootMultipleConfigPropsTest {

@BeforeAll
public static void beforeAll() {
// Clear JVM System properties that other tests in the same JVM may have left set to
// disable metrics. Dubbo resolves dubbo.metrics.* from the System properties with the
// highest precedence, which would otherwise override the prometheus setting expected
// by this test.
System.clearProperty("dubbo.metrics.protocol");
System.clearProperty("dubbo.metrics.enabled");
DubboBootstrap.reset();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public class SysProps {
private static Map<String, String> map = new LinkedHashMap<>();

public static void reset() {
for (String key : map.keySet()) {
System.clearProperty(key);
}
map.clear();
}

Expand All @@ -36,9 +39,6 @@ public static void setProperty(String key, String value) {
}

public static void clear() {
for (String key : map.keySet()) {
System.clearProperty(key);
}
reset();
}
}
Loading