Skip to content
Snippets Groups Projects
Commit f0eda1d4 authored by Bhabesh Bhabani Mukhopadhyay's avatar Bhabesh Bhabani Mukhopadhyay
Browse files

test class fixed

Some test method including testGetResult corrected
parent 636ebaa8
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,6 @@ import org.junit.jupiter.api.AfterEach; ...@@ -24,7 +24,6 @@ import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;
/** /**
...@@ -59,23 +58,17 @@ public class AlternariaModelTest { ...@@ -59,23 +58,17 @@ public class AlternariaModelTest {
public void testGetResult() throws Exception { public void testGetResult() throws Exception {
System.out.println("getResult"); System.out.println("getResult");
ModelConfiguration config = this.getConfiguration("/weatherdata_leaf_wetness_temperature.json"); ModelConfiguration config = this.getConfiguration("/weatherdata_leaf_wetness_temperature.json");
// dataMatrix = new DataMatrix();
//Date currentDate = this.dataMatrix.getFirstDateWithParameterValue(DataMatrix.BT);
//System.out.println("Current Date : "+currentDate.toString());
AlternariaModel instance = new AlternariaModel(); AlternariaModel instance = new AlternariaModel();
instance.setConfiguration(config); instance.setConfiguration(config);
List<Result> result = instance.getResult();
assertNotNull(result);
for(Result res:result)
{
System.out.println(res.toString());
}
//TODO temporary commented out
// List<Result> expResult = null;
List<Result> result = instance.getResult();
// assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
assertNotSame(0, result.size());
//fail("The test case is a prototype.");
} }
/** /**
...@@ -84,12 +77,10 @@ public class AlternariaModelTest { ...@@ -84,12 +77,10 @@ public class AlternariaModelTest {
@org.junit.jupiter.api.Test @org.junit.jupiter.api.Test
public void testGetModelId() { public void testGetModelId() {
System.out.println("getModelId"); System.out.println("getModelId");
AlternariaModel instance = new AlternariaModel(); AlternariaModel instance = new AlternariaModel();
ModelId expResult = null; ModelId expResult = new ModelId(AlternariaModel.NAME_MODEL_ID);
ModelId result = instance.getModelId(); ModelId result = instance.getModelId();
assertEquals(expResult, result); assertEquals(expResult.toString(), result.toString());
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
} }
/** /**
...@@ -99,11 +90,8 @@ public class AlternariaModelTest { ...@@ -99,11 +90,8 @@ public class AlternariaModelTest {
public void testGetModelName_0args() { public void testGetModelName_0args() {
System.out.println("getModelName"); System.out.println("getModelName");
AlternariaModel instance = new AlternariaModel(); AlternariaModel instance = new AlternariaModel();
String expResult = "";
String result = instance.getModelName(); String result = instance.getModelName();
assertEquals(expResult, result); assertNotNull(result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
} }
/** /**
...@@ -114,11 +102,8 @@ public class AlternariaModelTest { ...@@ -114,11 +102,8 @@ public class AlternariaModelTest {
System.out.println("getModelName"); System.out.println("getModelName");
String language = ""; String language = "";
AlternariaModel instance = new AlternariaModel(); AlternariaModel instance = new AlternariaModel();
String expResult = "";
String result = instance.getModelName(language); String result = instance.getModelName(language);
assertEquals(expResult, result); assertNotNull(result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
} }
/** /**
...@@ -144,9 +129,7 @@ public class AlternariaModelTest { ...@@ -144,9 +129,7 @@ public class AlternariaModelTest {
AlternariaModel instance = new AlternariaModel(); AlternariaModel instance = new AlternariaModel();
String expResult = ""; String expResult = "";
String result = instance.getCopyright(); String result = instance.getCopyright();
assertEquals(expResult, result); assertNotNull(result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
} }
/** /**
...@@ -158,9 +141,7 @@ public class AlternariaModelTest { ...@@ -158,9 +141,7 @@ public class AlternariaModelTest {
AlternariaModel instance = new AlternariaModel(); AlternariaModel instance = new AlternariaModel();
String expResult = ""; String expResult = "";
String result = instance.getModelDescription(); String result = instance.getModelDescription();
assertEquals(expResult, result); assertNotNull(result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
} }
/** /**
...@@ -256,7 +237,7 @@ public class AlternariaModelTest { ...@@ -256,7 +237,7 @@ public class AlternariaModelTest {
@org.junit.jupiter.api.Test @org.junit.jupiter.api.Test
public void testSetConfiguration() throws Exception { public void testSetConfiguration() throws Exception {
System.out.println("setConfiguration"); System.out.println("setConfiguration");
ModelConfiguration config = null; ModelConfiguration config = this.getConfiguration("/weatherdata_leaf_wetness_temperature.json");
AlternariaModel instance = new AlternariaModel(); AlternariaModel instance = new AlternariaModel();
instance.setConfiguration(config); instance.setConfiguration(config);
// TODO review the generated test code and remove the default call to fail. // TODO review the generated test code and remove the default call to fail.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment