Add FileTools methods to load URL file.

This commit is contained in:
Christian P. MOMON 2014-12-01 16:33:38 +01:00
parent 69d900c297
commit a4e1e94702
2 changed files with 26 additions and 0 deletions

View file

@ -18,6 +18,8 @@
*/ */
package fr.devinsy.util; package fr.devinsy.util;
import java.io.IOException;
import org.apache.log4j.BasicConfigurator; import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Level; import org.apache.log4j.Level;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
@ -45,6 +47,26 @@ public class FileToolsTest
/** /**
* *
*/
@Test
public void loadToStringListURL01() throws IOException
{
//
logger.debug("===== test starting...");
//
StringList source = FileTools.loadToStringList(FileTools.class.getResource("/fr/devinsy/util/lines.txt"));
//
Assert.assertEquals(4, source.size());
Assert.assertEquals("trois", source.get(3 - 1));
//
logger.debug("===== test done.");
}
/**
* @throws IOException
*
*/ */
@Test @Test
public void testGetExtension() public void testGetExtension()

View file

@ -0,0 +1,4 @@
un
deux
trois
quatre