AHATcrdbTest.java [test/database/ahat] Revision: default Date:
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package database.ahat;
import csip.ServiceException;
import csip.annotations.Resource;
import database.DBResources;
import gisobjects.GISObject;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.ArrayList;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
import org.testng.Reporter;
/**
*
* @author <a href="mailto:shaun.case@colostate.edu">Shaun Case</a>
*/
@Resource(from = DBResources.class)
public class AHATcrdbTest {
AHATcrdb instance;
public AHATcrdbTest() throws SQLException, ServiceException, Exception {
instance = new AHATcrdb(createDataSource(), null);
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
private static synchronized Connection createDataSource() throws Exception {
Connection connection = null;
Reporter.log("Attempting to load the database driver for CRDB");
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Reporter.log("Driver was loaded for: com.microsoft.sqlserver.jdbc.SQLServerDriver");
connection = DriverManager.getConnection("jdbc:sqlserver://129.82.20.129:1433;databaseName=conservation_resources;user=sdmro;password=emHBcNq3");
Reporter.log("Connection to the local Conservation Resources DB Service was successful");
return connection;
}
/**
* Test of validate method, of class AHATcrdb.
*/
//@Test
public void testValidate() throws Exception {
System.out.println("validate");
instance.validate();
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of getLightingTypeUseFactor method, of class AHATcrdb.
*/
//@Test
public void testGetLightingTypeUseFactor_2args_1() {
System.out.println("getLightingTypeUseFactor");
int house = 0;
int lightingType = 0;
double expResult = 0.0;
double result = instance.getLightingTypeUseFactor(house, lightingType);
assertEquals(expResult, result, 0.0);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of close method, of class AHATcrdb.
*/
//@Test
public void testClose() throws Exception {
System.out.println("close");
instance.close();
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of getLightingTypeBaseFactor method, of class AHATcrdb.
*/
//@Test
public void testGetLightingTypeBaseFactor_3args_1() {
System.out.println("getLightingTypeBaseFactor");
int house = 0;
int lightingType = 0;
boolean reimeId = false;
double expResult = 0.0;
double result = instance.getLightingTypeBaseFactor(house, lightingType, reimeId);
assertEquals(expResult, result, 0.0);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetAnimalTypeDisplay method, of class AHATcrdb.
*/
//@Test
public void testGetAnimalTypeDisplay() throws Exception {
System.out.println("GetAnimalTypeDisplay");
int animal_id = 0;
String expResult = "";
String result = instance.GetAnimalTypeDisplay(animal_id);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetAnimalTypes method, of class AHATcrdb.
*/
@Test
public void testGetAnimalTypes() throws Exception {
System.out.println("GetAnimalTypes");
ArrayList<AHATcrdb.AnimalType> expResult = null;
ArrayList<AHATcrdb.AnimalType> result = instance.GetAnimalTypes();
assertEquals(3, result.size());
}
/**
* Test of GetDairyLightingGroupEfficientUseFactor method, of class
* AHATcrdb.
*/
//@Test
public void testGetDairyLightingGroupEfficientUseFactor() throws Exception {
System.out.println("GetDairyLightingGroupEfficientUseFactor");
String inList = "";
double expResult = 0.0;
double result = instance.GetDairyLightingGroupEfficientUseFactor(inList);
assertEquals(expResult, result, 0.0);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetEnergyCostForEnergyId method, of class AHATcrdb.
*/
//@Test
public void testGetEnergyCostForEnergyId() throws Exception {
System.out.println("GetEnergyCostForEnergyId");
int energyId = 0;
double expResult = 0.0;
double result = instance.GetEnergyCostForEnergyId(energyId);
assertEquals(expResult, result, 0.0);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetFarrowHeatingUseFactor method, of class AHATcrdb.
*/
//@Test
public void testGetFarrowHeatingUseFactor() throws Exception {
System.out.println("GetFarrowHeatingUseFactor");
int key = 0;
double expResult = 0.0;
double result = instance.GetFarrowHeatingUseFactor(key);
assertEquals(expResult, result, 0.0);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetFarrowHeatingBestOptionScenarios method, of class AHATcrdb.
*/
//@Test
public void testGetFarrowHeatingBestOptionScenarios() throws Exception {
System.out.println("GetFarrowHeatingBestOptionScenarios");
int heatKey = 0;
String inList = "";
ArrayList<AHATcrdb.HeatingOption> expResult = null;
ArrayList<AHATcrdb.HeatingOption> result = instance.GetFarrowHeatingBestOptionScenarios(heatKey, inList);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetGroupIdForLightingId method, of class AHATcrdb.
*/
//@Test
public void testGetGroupIdForLightingId() throws Exception {
System.out.println("GetGroupIdForLightingId");
int lightingID = 0;
int expResult = 0;
int result = instance.GetGroupIdForLightingId(lightingID);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetHeatingBestOptionScenarios method, of class AHATcrdb.
*/
//@Test
public void testGetHeatingBestOptionScenarios() throws Exception {
System.out.println("GetHeatingBestOptionScenarios");
int heatKey = 0;
String inList = "";
ArrayList<AHATcrdb.HeatingOption> expResult = null;
ArrayList<AHATcrdb.HeatingOption> result = instance.GetHeatingBestOptionScenarios(heatKey, inList);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetPoultryHeatingBestOptionScenarios method, of class AHATcrdb.
*/
//@Test
public void testGetPoultryHeatingBestOptionScenarios() throws Exception {
System.out.println("GetPoultryHeatingBestOptionScenarios");
int heatKey = 0;
ArrayList<AHATcrdb.HeatingOption> expResult = null;
ArrayList<AHATcrdb.HeatingOption> result = instance.GetPoultryHeatingBestOptionScenarios(heatKey);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetHeatingTypeNameForId method, of class AHATcrdb.
*/
//@Test
public void testGetHeatingTypeNameForId() throws Exception {
System.out.println("GetHeatingTypeNameForId");
int heatingId = 0;
String expResult = "";
String result = instance.GetHeatingTypeNameForId(heatingId);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetHeatingTypes method, of class AHATcrdb.
*/
//@Test
public void testGetHeatingTypes() throws Exception {
System.out.println("GetHeatingTypes");
ArrayList<AHATcrdb.HeatingType> expResult = null;
ArrayList<AHATcrdb.HeatingType> result = instance.GetHeatingTypes();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetHeatingUseFactor method, of class AHATcrdb.
*/
//@Test
public void testGetHeatingUseFactor() throws Exception {
System.out.println("GetHeatingUseFactor");
int key = 0;
double expResult = 0.0;
double result = instance.GetHeatingUseFactor(key);
assertEquals(expResult, result, 0.0);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetLightingTypeBaseFactor method, of class AHATcrdb.
*/
//@Test
public void testGetLightingTypeBaseFactor_3args_2() throws Exception {
System.out.println("GetLightingTypeBaseFactor");
int animalID = 0;
int lightingID = 0;
int regimeID = 0;
int expResult = 0;
int result = instance.GetLightingTypeBaseFactor(animalID, lightingID, regimeID);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetLightingTypeBestBaseFactorForGroup method, of class AHATcrdb.
*/
//@Test
public void testGetLightingTypeBestBaseFactorForGroup() throws Exception {
System.out.println("GetLightingTypeBestBaseFactorForGroup");
int lightingID = 0;
int regimeID = 0;
int expResult = 0;
int result = instance.GetLightingTypeBestBaseFactorForGroup(lightingID, regimeID);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetLightingTypeBaseUseFactor method, of class AHATcrdb.
*/
//@Test
public void testGetLightingTypeBaseUseFactor() throws Exception {
System.out.println("GetLightingTypeBaseUseFactor");
int animalID = 0;
int lightingID = 0;
int regimeID = 0;
double expResult = 0.0;
double result = instance.GetLightingTypeBaseUseFactor(animalID, lightingID, regimeID);
assertEquals(expResult, result, 0.0);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetLightingTypeDetail method, of class AHATcrdb.
*/
//@Test
public void testGetLightingTypeDetail() throws Exception {
System.out.println("GetLightingTypeDetail");
int lightingID = 0;
ArrayList<AHATcrdb.LightingType> expResult = null;
ArrayList<AHATcrdb.LightingType> result = instance.GetLightingTypeDetail(lightingID);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetLightingTypes method, of class AHATcrdb.
*/
//@Test
public void testGetLightingTypes() throws Exception {
System.out.println("GetLightingTypes");
int animalId = 0;
ArrayList<AHATcrdb.LightType> expResult = null;
ArrayList<AHATcrdb.LightType> result = instance.GetLightingTypes(animalId);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetLightingTypeUseFactor method, of class AHATcrdb.
*/
//@Test
public void testGetLightingTypeUseFactor_2args_2() throws Exception {
System.out.println("GetLightingTypeUseFactor");
int animalID = 0;
int lightingID = 0;
double expResult = 0.0;
double result = instance.GetLightingTypeUseFactor(animalID, lightingID);
assertEquals(expResult, result, 0.0);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetLightingTypeWorseBaseFactorForGroup method, of class AHATcrdb.
*/
//@Test
public void testGetLightingTypeWorseBaseFactorForGroup() throws Exception {
System.out.println("GetLightingTypeWorseBaseFactorForGroup");
int lightingID = 0;
int regimeID = 0;
int expResult = 0;
int result = instance.GetLightingTypeWorseBaseFactorForGroup(lightingID, regimeID);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetMilkCoolingBestOptionScenarios method, of class AHATcrdb.
*/
//@Test
public void testGetMilkCoolingBestOptionScenarios() throws Exception {
System.out.println("GetMilkCoolingBestOptionScenarios");
int coolingKey = 0;
ArrayList<AHATcrdb.CoolingOption> expResult = null;
ArrayList<AHATcrdb.CoolingOption> result = instance.GetMilkCoolingBestOptionScenarios(coolingKey);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetMilkCoolingUseFactor method, of class AHATcrdb.
*/
//@Test
public void testGetMilkCoolingUseFactor() throws Exception {
System.out.println("GetMilkCoolingUseFactor");
int coolingKey = 0;
double expResult = 0.0;
double result = instance.GetMilkCoolingUseFactor(coolingKey);
assertEquals(expResult, result, 0.0);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetPoultryHeatingUseFactor method, of class AHATcrdb.
*/
//@Test
public void testGetPoultryHeatingUseFactor() throws Exception {
System.out.println("GetPoultryHeatingUseFactor");
int key = 0;
double expResult = 0.0;
double result = instance.GetPoultryHeatingUseFactor(key);
assertEquals(expResult, result, 0.0);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetVentilationUseFactor method, of class AHATcrdb.
*/
//@Test
public void testGetVentilationUseFactor() throws Exception {
System.out.println("GetVentilationUseFactor");
int ventKey = 0;
double expResult = 0.0;
double result = instance.GetVentilationUseFactor(ventKey);
assertEquals(expResult, result, 0.0);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetVentilationBestOptionScenarios method, of class AHATcrdb.
*/
//@Test
public void testGetVentilationBestOptionScenarios() throws Exception {
System.out.println("GetVentilationBestOptionScenarios");
int ventKey = 0;
String inList = "";
ArrayList<AHATcrdb.VentilationOption> expResult = null;
ArrayList<AHATcrdb.VentilationOption> result = instance.GetVentilationBestOptionScenarios(ventKey, inList);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetHeatingDegreeFactorForPoultryLatLon method, of class AHATcrdb.
*/
//@Test
public void testGetHeatingDegreeFactorForPoultryLatLon() throws Exception {
System.out.println("GetHeatingDegreeFactorForPoultryLatLon");
GISObject location = null;
double expResult = 0.0;
double result = instance.GetHeatingDegreeFactorForPoultryLatLon(location);
assertEquals(expResult, result, 0.0);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of GetHeatingDegreeFactorForSwineLatLon method, of class AHATcrdb.
*/
//@Test
public void testGetHeatingDegreeFactorForSwineLatLon() throws Exception {
System.out.println("GetHeatingDegreeFactorForSwineLatLon");
GISObject location = null;
double expResult = 0.0;
double result = instance.GetHeatingDegreeFactorForSwineLatLon(location);
assertEquals(expResult, result, 0.0);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
}