add jndi.properties

This commit is contained in:
azhwani 2020-06-10 00:31:44 +02:00
parent b1214ca64d
commit 7d7662a352
2 changed files with 5 additions and 16 deletions

View File

@ -6,7 +6,6 @@ import javax.naming.Context;
import javax.naming.InitialContext; import javax.naming.InitialContext;
import javax.sql.DataSource; import javax.sql.DataSource;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -16,12 +15,6 @@ public class SimpleJNDIUnitTest {
@BeforeEach @BeforeEach
public void setup() throws Exception { public void setup() throws Exception {
System.setProperty("java.naming.factory.initial", "org.osjava.sj.SimpleContextFactory");
System.setProperty("org.osjava.sj.root", "file://src/test/resources");
System.setProperty("org.osjava.sj.delimiter", ".");
System.setProperty("jndi.syntax.separator", "/");
System.setProperty("org.osjava.sj.space", "java:/comp/env");
this.initContext = new InitialContext(); this.initContext = new InitialContext();
} }
@ -35,13 +28,4 @@ public class SimpleJNDIUnitTest {
assertEquals(dsString, ds.toString()); 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");
}
} }

View File

@ -0,0 +1,5 @@
java.naming.factory.initial=org.osjava.sj.SimpleContextFactory
org.osjava.sj.root=file://src/test/resources
org.osjava.sj.delimiter=.
jndi.syntax.separator=/
org.osjava.sj.space=java:/comp/env