-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #910 from Daimler/feature-908-upgrade-spring
Upgrade SpringBoot to 2.5.7
- Loading branch information
Showing
13 changed files
with
129 additions
and
58 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
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
24 changes: 24 additions & 0 deletions
24
...shared-kernel/src/main/java/com/daimler/sechub/sharedkernel/monitoring/MemoryRuntime.java
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// SPDX-License-Identifier: MIT | ||
package com.daimler.sechub.sharedkernel.monitoring; | ||
|
||
/** | ||
* Memory runtime data | ||
* | ||
* @author Albert Tregnaghi | ||
* | ||
*/ | ||
public class MemoryRuntime { | ||
|
||
public long getMaxMemory() { | ||
return Runtime.getRuntime().maxMemory(); | ||
} | ||
|
||
public long getTotalMemory() { | ||
return Runtime.getRuntime().totalMemory(); | ||
} | ||
|
||
public long getFreeMemory() { | ||
return Runtime.getRuntime().freeMemory(); | ||
} | ||
|
||
} |
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
40 changes: 40 additions & 0 deletions
40
...ed-kernel/src/test/java/com/daimler/sechub/sharedkernel/monitoring/MemoryRuntimeTest.java
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// SPDX-License-Identifier: MIT | ||
package com.daimler.sechub.sharedkernel.monitoring; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
class MemoryRuntimeTest { | ||
|
||
@Test | ||
void getter_for_memory_have_same_values_than_system_runtime_pendants() { | ||
/* prepare */ | ||
MemoryRuntime runtimeToTest = new MemoryRuntime(); | ||
Runtime systemRuntime = Runtime.getRuntime(); | ||
|
||
// define/consume local variables before calling system runtime | ||
long maxMemory = 0; | ||
long totalMemory = 1; | ||
long freeMemory = 2; | ||
|
||
long maxMemory2 = 3; | ||
long totalMemory2 = 4; | ||
long freeMemory2 = 5; | ||
|
||
/* execute */ | ||
maxMemory = systemRuntime.maxMemory(); | ||
totalMemory = systemRuntime.totalMemory(); | ||
freeMemory = systemRuntime.freeMemory(); | ||
|
||
maxMemory2 = runtimeToTest.getMaxMemory(); | ||
totalMemory2 = runtimeToTest.getTotalMemory(); | ||
freeMemory2 = runtimeToTest.getFreeMemory(); | ||
|
||
/* test */ | ||
assertEquals(maxMemory, maxMemory2); | ||
assertEquals(totalMemory, totalMemory2); | ||
assertEquals(freeMemory, freeMemory2); | ||
} | ||
|
||
} |
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