-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set memory limit for Keycloak container
Closes #1350 Signed-off-by: Martin Bartoš <[email protected]>
- Loading branch information
1 parent
374d3db
commit 2b907f1
Showing
4 changed files
with
57 additions
and
0 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
40 changes: 40 additions & 0 deletions
40
...t-service-keycloak/src/test/java/io/quarkus/test/services/containers/MemoryLimitTest.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 @@ | ||
package io.quarkus.test.services.containers; | ||
|
||
import static io.quarkus.test.services.containers.KeycloakGenericDockerContainerManagedResource.convertMiBtoBytes; | ||
import static org.hamcrest.MatcherAssert.assertThat; | ||
|
||
import org.hamcrest.CoreMatchers; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class MemoryLimitTest { | ||
|
||
@Test | ||
void convertMiBToBytes() { | ||
assertThat(convertMiBtoBytes(0), CoreMatchers.is(0L)); | ||
assertThat(convertMiBtoBytes(-0), CoreMatchers.is(0L)); | ||
|
||
assertThat(convertMiBtoBytes(1000L), CoreMatchers.is(1048576000L)); | ||
assertThat(convertMiBtoBytes(1000), CoreMatchers.is(1048576000L)); | ||
assertThat(convertMiBtoBytes(100), CoreMatchers.is(104857600L)); | ||
assertThat(convertMiBtoBytes(10), CoreMatchers.is(10485760L)); | ||
assertThat(convertMiBtoBytes(1), CoreMatchers.is(1048576L)); | ||
|
||
assertThat(convertMiBtoBytes(-1000L), CoreMatchers.is(-1048576000L)); | ||
assertThat(convertMiBtoBytes(-1000), CoreMatchers.is(-1048576000L)); | ||
assertThat(convertMiBtoBytes(-100), CoreMatchers.is(-104857600L)); | ||
assertThat(convertMiBtoBytes(-10), CoreMatchers.is(-10485760L)); | ||
assertThat(convertMiBtoBytes(-1), CoreMatchers.is(-1048576L)); | ||
|
||
assertThat(convertMiBtoBytes(2000), CoreMatchers.is(2097152000L)); | ||
assertThat(convertMiBtoBytes(20000), CoreMatchers.is(20971520000L)); | ||
assertThat(convertMiBtoBytes(200000), CoreMatchers.is(209715200000L)); | ||
|
||
assertThat(convertMiBtoBytes(999999999999999999L), CoreMatchers.is(Long.MAX_VALUE)); | ||
|
||
assertThat(convertMiBtoBytes(Integer.MAX_VALUE), CoreMatchers.is((long) Integer.MAX_VALUE << 20)); | ||
assertThat(convertMiBtoBytes(Integer.MIN_VALUE), CoreMatchers.is((long) Integer.MIN_VALUE << 20)); | ||
|
||
assertThat(convertMiBtoBytes(Long.MAX_VALUE), CoreMatchers.is(Long.MAX_VALUE)); | ||
assertThat(convertMiBtoBytes(Long.MIN_VALUE), CoreMatchers.is(Long.MIN_VALUE)); | ||
} | ||
} |