Java Code Examples for io.quarkus.runtime.configuration.ProfileManager#setRuntimeDefaultProfile()

The following examples show how to use io.quarkus.runtime.configuration.ProfileManager#setRuntimeDefaultProfile() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProfileManagerTestCase.java    From quarkus with Apache License 2.0 5 votes vote down vote up
private void resetProfileManagerState() {
    ProfileManager.setLaunchMode(LaunchMode.TEST); // Tests should be run in LaunchMode.TEST by default
    ProfileManager.setRuntimeDefaultProfile(null);
    System.clearProperty(ProfileManager.QUARKUS_PROFILE_PROP);
    System.clearProperty(ProfileManager.QUARKUS_TEST_PROFILE_PROP);
    System.clearProperty(BACKWARD_COMPATIBLE_QUARKUS_PROFILE_PROP);
    Assertions.assertNull(System.getenv(ProfileManager.QUARKUS_PROFILE_ENV));
}
 
Example 2
Source File: ProfileManagerTestCase.java    From quarkus with Apache License 2.0 5 votes vote down vote up
private void testCustomProfile(LaunchMode launchMode) {
    ProfileManager.setLaunchMode(launchMode);
    ProfileManager.setRuntimeDefaultProfile("foo");
    String customProfile = "bar";
    System.setProperty(ProfileManager.QUARKUS_PROFILE_PROP, customProfile);
    Assertions.assertEquals(customProfile, ProfileManager.getActiveProfile());
}
 
Example 3
Source File: ProfileManagerTestCase.java    From quarkus with Apache License 2.0 5 votes vote down vote up
private void testBackwardCompatibleCustomProfile(LaunchMode launchMode) {
    ProfileManager.setLaunchMode(launchMode);
    ProfileManager.setRuntimeDefaultProfile("foo");
    String customProfile = "bar";
    System.setProperty(BACKWARD_COMPATIBLE_QUARKUS_PROFILE_PROP, customProfile);
    Assertions.assertEquals(customProfile, ProfileManager.getActiveProfile());
}
 
Example 4
Source File: ProfileManagerTestCase.java    From quarkus with Apache License 2.0 4 votes vote down vote up
private void testCustomRuntimeProfile(LaunchMode launchMode) {
    ProfileManager.setLaunchMode(launchMode);
    String customProfile = "foo";
    ProfileManager.setRuntimeDefaultProfile(customProfile);
    Assertions.assertEquals(customProfile, ProfileManager.getActiveProfile());
}