Difference between url and uri bael 864 hariprasad (#1987)
* Commit URUURLJNDIFS added.
* URI URL REST commit.
* Revert "URI URL REST commit."
This reverts commit d9e26399be.
* Difference URI URL REST BAEL-864.
* Commit Difference URI URL REST #864, small changes.
* Difference URI URL REST project has been moved to spring-rest.
* BAEL-864. Deleted unused project and did one small change.
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
package com.baeldung.filesystem.jndi.test;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import javax.naming.InitialContext;
|
||||
import javax.naming.NamingException;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.baeldung.filesystem.jndi.LookupFSJNDI;
|
||||
|
||||
public class LookupFSJNDITest {
|
||||
LookupFSJNDI fsjndi;
|
||||
File file;
|
||||
InitialContext ctx = null;
|
||||
final String FILENAME = "test.find";
|
||||
|
||||
public LookupFSJNDITest() {
|
||||
try {
|
||||
fsjndi = new LookupFSJNDI();
|
||||
} catch (NamingException e) {
|
||||
fsjndi = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenInitializationLookupFSJNDIIsNotNull_thenSuccess() {
|
||||
assertNotNull("Class LookupFSJNDI has instance", fsjndi);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenLookupFSJNDI_whengetInitialContextIsNotNull_thenSuccess() {
|
||||
ctx = fsjndi.getCtx();
|
||||
assertNotNull("Context exists", ctx);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenInitialContext_whenLokupFileExists_thenSuccess() {
|
||||
File file = fsjndi.getFile(FILENAME);
|
||||
assertNotNull("File exists", file);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user