File tree Expand file tree Collapse file tree
artemis-dto/src/test/java/org/apache/activemq/artemis/dto Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030public class XmlUtilTest extends ArtemisTestCase {
3131
3232 @ Test
33- public void testPropertySubstituion (@ TempDir Path tempDir ) throws Exception {
33+ public void testPropertySubstitution (@ TempDir Path tempDir ) throws Exception {
3434 final String SYSTEM_PROP_NAME = getTestMethodName () + "SysPropName" ;
3535 final String SYSTEM_PROP_VALUE = getTestMethodName () + "SysPropValue" ;
3636 System .setProperty (SYSTEM_PROP_NAME , SYSTEM_PROP_VALUE );
3737
3838 // since System.getenv() returns an immutable Map we rely here on an environment variable that is likely to exist
39- final String ENV_VAR_NAME = "HOME" ;
39+ String ENV_VAR_NAME = "HOME" ;
40+
41+ // override to USERPROFILE if OS is windows
42+ if (System .getProperty ("os.name" ).toLowerCase ().contains ("win" )) {
43+ ENV_VAR_NAME = "USERPROFILE" ;
44+ }
4045
4146 BrokerDTO brokerDTO = getBrokerDTO (tempDir , SYSTEM_PROP_NAME , ENV_VAR_NAME );
4247 assertEquals (SYSTEM_PROP_VALUE , ((JaasSecurityDTO )brokerDTO .security ).domain );
4348 assertEquals (System .getenv (ENV_VAR_NAME ), brokerDTO .server .configuration );
4449 }
4550
4651 @ Test
47- public void testPropertySubstituionPrecedence (@ TempDir Path tempDir ) throws Exception {
52+ public void testPropertySubstitutionPrecedence (@ TempDir Path tempDir ) throws Exception {
4853 final String SYSTEM_PROP_NAME = "HOME" ;
4954 final String SYSTEM_PROP_VALUE = getTestMethodName () + "SysPropValue" ;
5055 System .setProperty (SYSTEM_PROP_NAME , SYSTEM_PROP_VALUE );
You can’t perform that action at this time.
0 commit comments