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:
hariprasad108
2017-06-04 21:39:21 +02:00
committed by maibin
parent 29e3437545
commit c17d19ff21
11 changed files with 291 additions and 4 deletions

View File

@@ -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);
}
}