Add FileTools methods to load URL file.
This commit is contained in:
parent
69d900c297
commit
a4e1e94702
2 changed files with 26 additions and 0 deletions
|
@ -18,6 +18,8 @@
|
|||
*/
|
||||
package fr.devinsy.util;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.log4j.BasicConfigurator;
|
||||
import org.apache.log4j.Level;
|
||||
import org.apache.log4j.Logger;
|
||||
|
@ -47,6 +49,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
|
||||
public void testGetExtension()
|
||||
{
|
||||
//
|
||||
|
|
4
test/fr/devinsy/util/lines.txt
Normal file
4
test/fr/devinsy/util/lines.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
un
|
||||
deux
|
||||
trois
|
||||
quatre
|
Loading…
Reference in a new issue