clear System properties when the test tears down
@@ -6,6 +6,7 @@ import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;
+import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -34,4 +35,13 @@ public class SimpleJNDIUnitTest {
assertEquals(dsString, ds.toString());
}
+ @AfterEach
+ public void tearDown() {
+ System.clearProperty("java.naming.factory.initial");
+ System.clearProperty("org.osjava.sj.root");
+ System.clearProperty("org.osjava.sj.delimiter");
+ System.clearProperty("jndi.syntax.separator");
+ System.clearProperty("org.osjava.sj.space");
+ }
+
}
\ No newline at end of file
