modif DataCsv.java et repertoir test
This commit is contained in:
parent
7cca3b7522
commit
8f554b3936
2 changed files with 11 additions and 5 deletions
|
|
@ -18,9 +18,9 @@ public class DataCsv {
|
||||||
/**
|
/**
|
||||||
* La methode de recuperation dun fichier csv
|
* La methode de recuperation dun fichier csv
|
||||||
*/
|
*/
|
||||||
public void getCsv() throws IOException{
|
public void getCsv(String fileZip) throws IOException{
|
||||||
String fileZip = "src/main/java/resources/loto_201911.zip";
|
|
||||||
File desDir = new File("src/main/java/resources/");
|
File desDir = new File("src/main/resources/");
|
||||||
byte[] buffer = new byte[1024];
|
byte[] buffer = new byte[1024];
|
||||||
ZipInputStream zis = new ZipInputStream(new FileInputStream(fileZip));
|
ZipInputStream zis = new ZipInputStream(new FileInputStream(fileZip));
|
||||||
ZipEntry zipEntry = zis.getNextEntry();
|
ZipEntry zipEntry = zis.getNextEntry();
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,17 @@ package fr.myny.data;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
class DataCsvTest {
|
class DataCsvTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void getCsv() {
|
void getCSV() throws IOException {
|
||||||
|
DataCsv csv = new DataCsv();
|
||||||
|
csv.getCsv("src/main/resources/loto_201911.zip");
|
||||||
|
|
||||||
|
File f = new File("src/main/resources/loto_201911.csv");
|
||||||
|
assertTrue(f.exists());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in a new issue