Skip to content
Snippets Groups Projects
Commit d3b0f810 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Tests are complete.

Refatoring name
parent 65884c11
No related branches found
No related tags found
No related merge requests found
.gitignore 100755 → 100644
target/
classes/
/nbproject/
\ No newline at end of file
......@@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>no.nibio.vips.model</groupId>
<artifactId>SeptoriaWetHourModel</artifactId>
<artifactId>SeptoriaHumidityModel</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
......@@ -29,4 +29,5 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<name>SeptoriaHumidityModel</name>
</project>
\ No newline at end of file
......@@ -17,7 +17,7 @@
*
*/
package no.nibio.vips.model.septoriawethourmodel;
package no.nibio.vips.model.septoriahumiditymodel;
import no.nibio.vips.util.DateMap;
......@@ -32,8 +32,13 @@ public class DataMatrix extends DateMap {
public final static String UM = "UM";
// Hourly leaf wetness
public final static String BT = "BT";
// Wet hour sum for sliding middle
public final static String WHS = "WHS";
// Current hour is wet hour? 1 : 0
public final static String WH = "WH";
// Humid hour sum for sliding middle
public final static String HHS = "HHS";
// Current hour is humid hour? 1 : 0
public final static String HH = "HH";
// Humid period hour (consecutive humid hours)
public final static String HPH = "HPH";
// Humid period hour (consecutive humid hours) corrected for protection period
public final static String HPHPP = "HPHPP";
}
# Copyright (c) 2014 NIBIO <http://www.nibio.no/>.
#
# This file is part of AppleScabModel.
# AppleScabModel is free software: you can redistribute it and/or modify
# it under the terms of the NIBIO Open Source License as published by
# NIBIO, either version 1 of the License, or (at your option) any
# later version.
#
# AppleScabModel is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# NIBIO Open Source License for more details.
#
# You should have received a copy of the NIBIO Open Source License
# along with AppleScabModel. If not, see <http://www.nibio.no/licenses/>.
#
name=Septoria Humitidy Model
usage=TODO\t
description=TODO
statusInterpretation=TODO
# Copyright (c) 2014 NIBIO <http://www.nibio.no/>.
#
# This file is part of AppleScabModel.
# AppleScabModel is free software: you can redistribute it and/or modify
# it under the terms of the NIBIO Open Source License as published by
# NIBIO, either version 1 of the License, or (at your option) any
# later version.
#
# AppleScabModel is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# NIBIO Open Source License for more details.
#
# You should have received a copy of the NIBIO Open Source License
# along with AppleScabModel. If not, see <http://www.nibio.no/licenses/>.
#
name=Septoria-fuktmodell
usage=TODO
description=TODO
statusInterpretation=TODO
/*
* Copyright (c) 2018 NIBIO <http://www.nibio.no/>.
*
* This file is part of SeptoriaWetHourModel.
* SeptoriaWetHourModel is free software: you can redistribute it and/or modify
* This file is part of SeptoriaHumidityModel.
* SeptoriaHumidityModel is free software: you can redistribute it and/or modify
* it under the terms of the NIBIO Open Source License as published by
* NIBIO, either version 1 of the License, or (at your option) any
* later version.
*
* SeptoriaWetHourModel is distributed in the hope that it will be useful,
* SeptoriaHumidityModel is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* NIBIO Open Source License for more details.
*
* You should have received a copy of the NIBIO Open Source License
* along with SeptoriaWetHourModel. If not, see <http://www.nibio.no/licenses/>.
* along with SeptoriaHumidityModel. If not, see <http://www.nibio.no/licenses/>.
*
*/
package no.nibio.vips.model.septoriawethourmodel;
package no.nibio.vips.model.septoriahumiditymodel;
import java.util.List;
import no.nibio.vips.entity.ModelConfiguration;
import no.nibio.vips.entity.Result;
import no.nibio.vips.model.ConfigValidationException;
import no.nibio.vips.model.ModelId;
import no.nibio.vips.util.test.WeatherDataFileReader;
import org.junit.After;
......@@ -35,11 +36,11 @@ import static org.junit.Assert.*;
*
* @author treinar
*/
public class SeptoriaWetHourModelTest {
public class SeptoriaHumidityModelTest {
private WeatherDataFileReader weatherDataFileReader;
public SeptoriaWetHourModelTest() {
public SeptoriaHumidityModelTest() {
}
@BeforeClass
......@@ -60,12 +61,12 @@ public class SeptoriaWetHourModelTest {
}
/**
* Test of getResult method, of class SeptoriaWetHourModel.
* Test of getResult method, of class SeptoriaHumidityModel.
*/
@org.junit.Test
public void testGetResult() throws Exception {
System.out.println("getResult");
SeptoriaWetHourModel instance = new SeptoriaWetHourModel();
SeptoriaHumidityModel instance = new SeptoriaHumidityModel();
ModelConfiguration config = this.weatherDataFileReader.getModelConfigurationWithWeatherData("/2017_aalborg.json", instance.getModelId().toString());
config.setConfigParameter("timeZone", "Europe/Oslo");
config.setConfigParameter("thresholdRelativeHumidity", 85.0);
......@@ -74,197 +75,168 @@ public class SeptoriaWetHourModelTest {
config.setConfigParameter("thresholdHumidPeriodHours", 19);
config.setConfigParameter("slidingHoursPast", 36);
config.setConfigParameter("slidingHoursAhead", 36);
config.setConfigParameter("sprayingProtectionDays", 10);
config.setConfigParameter("dateGs31", "2017-05-01");
config.setConfigParameter("dateSpraying1", "2017-05-11");
config.setConfigParameter("dateSpraying2", "2017-05-19");
instance.setConfiguration(config);
List<Result> expResult = null;
List<Result> result = instance.getResult();
assertNotNull(result);
result.stream().forEach(r->System.out.println(r));
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
//result.stream().forEach(r->System.out.println(r));
}
/**
* Test of getModelId method, of class SeptoriaWetHourModel.
* Test of getModelId method, of class SeptoriaHumidityModel.
*/
//@org.junit.Test
@org.junit.Test
public void testGetModelId() {
System.out.println("getModelId");
SeptoriaWetHourModel instance = new SeptoriaWetHourModel();
ModelId expResult = null;
SeptoriaHumidityModel instance = new SeptoriaHumidityModel();
ModelId expResult = new ModelId("SEPTORIAHU");
ModelId result = instance.getModelId();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
assertEquals(expResult.toString(), result.toString());
}
/**
* Test of getModelName method, of class SeptoriaWetHourModel.
* Test of getModelName method, of class SeptoriaHumidityModel.
*/
//@org.junit.Test
@org.junit.Test
public void testGetModelName_0args() {
System.out.println("getModelName");
SeptoriaWetHourModel instance = new SeptoriaWetHourModel();
String expResult = "";
SeptoriaHumidityModel instance = new SeptoriaHumidityModel();
String result = instance.getModelName();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
assertNotNull(result);
}
/**
* Test of getModelName method, of class SeptoriaWetHourModel.
* Test of getModelName method, of class SeptoriaHumidityModel.
*/
//@org.junit.Test
@org.junit.Test
public void testGetModelName_String() {
System.out.println("getModelName");
String language = "";
SeptoriaWetHourModel instance = new SeptoriaWetHourModel();
String expResult = "";
SeptoriaHumidityModel instance = new SeptoriaHumidityModel();
String result = instance.getModelName(language);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
assertNotNull(result);
}
/**
* Test of getLicense method, of class SeptoriaWetHourModel.
* Test of getLicense method, of class SeptoriaHumidityModel.
*/
//@org.junit.Test
@org.junit.Test
public void testGetLicense() {
System.out.println("getLicense");
SeptoriaWetHourModel instance = new SeptoriaWetHourModel();
String expResult = "";
SeptoriaHumidityModel instance = new SeptoriaHumidityModel();
String result = instance.getLicense();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
assertNotNull(result);
}
/**
* Test of getCopyright method, of class SeptoriaWetHourModel.
* Test of getCopyright method, of class SeptoriaHumidityModel.
*/
//@org.junit.Test
@org.junit.Test
public void testGetCopyright() {
System.out.println("getCopyright");
SeptoriaWetHourModel instance = new SeptoriaWetHourModel();
String expResult = "";
SeptoriaHumidityModel instance = new SeptoriaHumidityModel();
String result = instance.getCopyright();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
assertNotNull(result);
}
/**
* Test of getModelDescription method, of class SeptoriaWetHourModel.
* Test of getModelDescription method, of class SeptoriaHumidityModel.
*/
//@org.junit.Test
@org.junit.Test
public void testGetModelDescription_0args() {
System.out.println("getModelDescription");
SeptoriaWetHourModel instance = new SeptoriaWetHourModel();
String expResult = "";
SeptoriaHumidityModel instance = new SeptoriaHumidityModel();
String result = instance.getModelDescription();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
assertNotNull(result);
}
/**
* Test of getModelDescription method, of class SeptoriaWetHourModel.
* Test of getModelDescription method, of class SeptoriaHumidityModel.
*/
//@org.junit.Test
@org.junit.Test
public void testGetModelDescription_String() {
System.out.println("getModelDescription");
String language = "";
SeptoriaWetHourModel instance = new SeptoriaWetHourModel();
String expResult = "";
SeptoriaHumidityModel instance = new SeptoriaHumidityModel();
String result = instance.getModelDescription(language);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
assertNotNull(result);
}
/**
* Test of getWarningStatusInterpretation method, of class SeptoriaWetHourModel.
* Test of getWarningStatusInterpretation method, of class SeptoriaHumidityModel.
*/
//@org.junit.Test
@org.junit.Test
public void testGetWarningStatusInterpretation_0args() {
System.out.println("getWarningStatusInterpretation");
SeptoriaWetHourModel instance = new SeptoriaWetHourModel();
String expResult = "";
SeptoriaHumidityModel instance = new SeptoriaHumidityModel();
String result = instance.getWarningStatusInterpretation();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
assertNotNull(result);
}
/**
* Test of getWarningStatusInterpretation method, of class SeptoriaWetHourModel.
* Test of getWarningStatusInterpretation method, of class SeptoriaHumidityModel.
*/
//@org.junit.Test
@org.junit.Test
public void testGetWarningStatusInterpretation_String() {
System.out.println("getWarningStatusInterpretation");
String language = "";
SeptoriaWetHourModel instance = new SeptoriaWetHourModel();
String expResult = "";
SeptoriaHumidityModel instance = new SeptoriaHumidityModel();
String result = instance.getWarningStatusInterpretation(language);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
assertNotNull(result);
}
/**
* Test of getModelUsage method, of class SeptoriaWetHourModel.
* Test of getModelUsage method, of class SeptoriaHumidityModel.
*/
//@org.junit.Test
@org.junit.Test
public void testGetModelUsage_0args() {
System.out.println("getModelUsage");
SeptoriaWetHourModel instance = new SeptoriaWetHourModel();
String expResult = "";
SeptoriaHumidityModel instance = new SeptoriaHumidityModel();
String result = instance.getModelUsage();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
assertNotNull(result);
}
/**
* Test of getModelUsage method, of class SeptoriaWetHourModel.
* Test of getModelUsage method, of class SeptoriaHumidityModel.
*/
//@org.junit.Test
@org.junit.Test
public void testGetModelUsage_String() {
System.out.println("getModelUsage");
String language = "";
SeptoriaWetHourModel instance = new SeptoriaWetHourModel();
String expResult = "";
SeptoriaHumidityModel instance = new SeptoriaHumidityModel();
String result = instance.getModelUsage(language);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
assertNotNull(result);
}
/**
* Test of getSampleConfig method, of class SeptoriaWetHourModel.
* Test of getSampleConfig method, of class SeptoriaHumidityModel.
*/
//@org.junit.Test
@org.junit.Test
public void testGetSampleConfig() {
System.out.println("getSampleConfig");
SeptoriaWetHourModel instance = new SeptoriaWetHourModel();
String expResult = "";
SeptoriaHumidityModel instance = new SeptoriaHumidityModel();
String result = instance.getSampleConfig();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
assertNotNull(result);
}
/**
* Test of setConfiguration method, of class SeptoriaWetHourModel.
* Test of setConfiguration method, of class SeptoriaHumidityModel.
*/
@org.junit.Test
public void testSetConfiguration() throws Exception {
System.out.println("setConfiguration");
SeptoriaWetHourModel instance = new SeptoriaWetHourModel();
SeptoriaHumidityModel instance = new SeptoriaHumidityModel();
ModelConfiguration config = this.weatherDataFileReader.getModelConfigurationWithWeatherData("/2017_aas.json", instance.getModelId().toString());
config.setConfigParameter("timeZone", "Europe/Oslo");
config.setConfigParameter("thresholdRelativeHumidity", 85.0);
......@@ -273,10 +245,17 @@ public class SeptoriaWetHourModelTest {
config.setConfigParameter("thresholdHumidPeriodHours", 19);
config.setConfigParameter("slidingHoursPast", 36);
config.setConfigParameter("slidingHoursAhead", 36);
config.setConfigParameter("sprayingProtectionDays", 10);
config.setConfigParameter("dateGs31", "2017-05-01");
config.setConfigParameter("dateSpraying1", "2017-05-01");
config.setConfigParameter("dateSpraying2", "2017-05-10");
instance.setConfiguration(config);
try
{
instance.setConfiguration(config);
}catch(ConfigValidationException ex){
fail(ex.getMessage());
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment