quick update

This commit is contained in:
azhwani 2020-06-10 00:33:21 +01:00
parent 861030bef5
commit fc78b24107
2 changed files with 16 additions and 5 deletions

View File

@ -1,5 +0,0 @@
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

View File

@ -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;
@ -15,6 +16,12 @@ public class SimpleJNDIUnitTest {
@BeforeEach
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();
}
@ -27,4 +34,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");
}
}