Commit 15:18
javadoc
This commit is contained in:
34
Projet.iml
34
Projet.iml
@@ -7,5 +7,39 @@
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module-library" scope="TEST">
|
||||
<library name="JUnit6">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/6.0.0/junit-jupiter-6.0.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/6.0.0/junit-jupiter-api-6.0.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/6.0.0/junit-platform-commons-6.0.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/jspecify/jspecify/1.0.0/jspecify-1.0.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/6.0.0/junit-jupiter-params-6.0.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/6.0.0/junit-jupiter-engine-6.0.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/6.0.0/junit-platform-engine-6.0.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/6.0.0/junit-jupiter-6.0.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/6.0.0/junit-jupiter-api-6.0.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/6.0.0/junit-platform-commons-6.0.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/jspecify/jspecify/1.0.0/jspecify-1.0.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/6.0.0/junit-jupiter-params-6.0.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/6.0.0/junit-jupiter-engine-6.0.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/6.0.0/junit-platform-engine-6.0.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
</component>
|
||||
</module>
|
||||
4
data/test.csv
Normal file
4
data/test.csv
Normal file
@@ -0,0 +1,4 @@
|
||||
Sample_code;Station;Latitude;Longitude;Depth;d13C_raw;d13C_corr;d15N;C_N;StandardLength;TrophicLevel;Anisakis_abdominalcavity;Anisakis_Liver;Anisakis_gonads;Anisakis_stomach;NParasitesViscera;Anisakis_Muscle_Right;Anisakis_Muscle_Left;Aniskis_Muscle_total;NParasitesTotal
|
||||
TRACTRA_S0575_A0439;S0575;48.8692264;-4.3976635;96.84;-20.09735065;-19.14374028;12.52361179;4.316778148;257;3.117572211;7;1;0;1;9;1;3;4;13
|
||||
TRACTRA_S0575_A0440;S0575;48.8692264;-4.3976635;96.84;-20.02738845;-19.42703789;12.25444555;3.959950061;252;3.038405671;263;5;0;21;289;12;11;23;312
|
||||
TRACTRA_S0575_A0441;S0575;48.8692264;-4.3976635;96.84;-19.82735569;-18.83090708;12.97020596;4.360049101;254;3.248923438;51;1;12;1;65;2;3;5;70
|
||||
|
@@ -4,6 +4,9 @@ import ecoparasite.poisson.Poisson;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* Interface définissant la fonction de Parsing des données
|
||||
*/
|
||||
public interface DataParsing {
|
||||
|
||||
public HashSet<Poisson> parse(RawData data);
|
||||
|
||||
43
src/ecoparasite/input/RawDataTest.java
Normal file
43
src/ecoparasite/input/RawDataTest.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package ecoparasite.input;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import ecoparasite.input.RawData;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
class RawDataTest {
|
||||
|
||||
|
||||
@Test
|
||||
void getColumnsNames() throws InputFileException {
|
||||
RawData test = InputFactory.readData("test.csv");
|
||||
|
||||
HashSet<String> d = new HashSet<>();
|
||||
|
||||
for (int i = 0; i < test.getData().size(); i++){
|
||||
d.add(test.getData().get(i).getFirst());
|
||||
}
|
||||
|
||||
System.out.println(test.getColumnsNames());
|
||||
System.out.println(d);
|
||||
|
||||
assertIterableEquals(test.getColumnsNames(),d);
|
||||
}
|
||||
|
||||
@Test
|
||||
void getDataFromColumn() throws InputFileException {
|
||||
RawData test = InputFactory.readData("test.csv");
|
||||
|
||||
System.out.println(test.getDataFromColumn("Sample_code"));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
void getEntry() throws InputFileException, RawDataOverflow {
|
||||
RawData test = InputFactory.readData("test.csv");
|
||||
|
||||
System.out.println(test.getEntry(2));
|
||||
}
|
||||
}
|
||||
@@ -10,10 +10,21 @@ import java.util.HashSet;
|
||||
* Ajoute les fonctions de Parsing liés aux données collectées sur le Mackerel.
|
||||
*/
|
||||
public class Mackerel extends Poisson implements DataParsing {
|
||||
public Mackerel(String species, Double length, Double infestation) {
|
||||
super(species, length, null, infestation);
|
||||
|
||||
/**
|
||||
* Constructeur de Mackerel
|
||||
* @param length
|
||||
* @param infestation
|
||||
*/
|
||||
public Mackerel(Double length, Double infestation) {
|
||||
super("Mackerel", length, null, infestation);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implémentation de la fonction parse de Dataparsing
|
||||
* @param data
|
||||
* @return tableau des poissons
|
||||
*/
|
||||
@Override
|
||||
public HashSet<Poisson> parse(RawData data) {
|
||||
|
||||
|
||||
36
src/ecoparasite/test/InputFactoryTest.java
Normal file
36
src/ecoparasite/test/InputFactoryTest.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package ecoparasite.test;
|
||||
|
||||
|
||||
import static ecoparasite.input.InputFactory.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
||||
|
||||
import ecoparasite.input.InputFactory;
|
||||
import ecoparasite.input.InputFileException;
|
||||
import ecoparasite.input.RawData;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class InputFactoryTest{
|
||||
|
||||
@org.junit.jupiter.api.Test
|
||||
void buildDataPath() {
|
||||
|
||||
String d = "data/Campagne/mackerel.97442.csv";
|
||||
String e = "data/Campagne/merlu2018_75164.csv";
|
||||
|
||||
assertArrayEquals(d.toCharArray(), InputFactory.buildDataPath("Campagne/mackerel.97442.csv").toCharArray());
|
||||
assertArrayEquals(e.toCharArray(), InputFactory.buildDataPath("Campagne/merlu2018_75164.csv").toCharArray());
|
||||
|
||||
}
|
||||
|
||||
@org.junit.jupiter.api.Test
|
||||
void readData() throws InputFileException {
|
||||
RawData test = InputFactory.readData("test.csv");
|
||||
|
||||
System.out.println(test.getData());
|
||||
|
||||
}
|
||||
|
||||
@org.junit.jupiter.api.Test
|
||||
void testReadData() {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user