-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ad2d8b
commit 9d84d7c
Showing
4 changed files
with
53 additions
and
25 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
34 changes: 34 additions & 0 deletions
34
...fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/util/DatabaseSupportUtil.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,34 @@ | ||
package ca.uhn.fhir.jpa.util; | ||
|
||
import org.apache.commons.lang3.StringUtils; | ||
import org.apache.commons.lang3.SystemUtils; | ||
|
||
public final class DatabaseSupportUtil { | ||
|
||
private DatabaseSupportUtil() {} | ||
|
||
public static boolean canUseMsSql2019() { | ||
return isSupportAmd64Architecture(); | ||
} | ||
|
||
public static boolean canUseOracle() { | ||
return isSupportAmd64Architecture(); | ||
} | ||
|
||
private static boolean isSupportAmd64Architecture() { | ||
if (!isMac()) { | ||
return true; | ||
} | ||
return isColimaConfigured(); | ||
} | ||
|
||
private static boolean isMac() { | ||
return SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_MAC_OSX; | ||
} | ||
|
||
private static boolean isColimaConfigured() { | ||
return StringUtils.isNotBlank(System.getenv("TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE")) | ||
&& StringUtils.isNotBlank(System.getenv("DOCKER_HOST")) | ||
&& System.getenv("DOCKER_HOST").contains("colima"); | ||
} | ||
} |