@ContextConfiguration(classes={ServletInitializer.class,AppConfig.class,HibernateConfig.class}) @WebAppConfiguration public class TestHibernate extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
(package private) org.hibernate.SessionFactory |
sessionFactory |
Constructor | Description |
---|---|
TestHibernate() |
Modifier and Type | Method | Description |
---|---|---|
private java.util.List<SensorDataEntity> |
getDataBySensor(SensorEntity sensorEntity) |
Get all the data for the input
SensorEntity . |
private java.util.List<SensorEntity> |
getSensorsByBorderRouter(BorderRouterEntity borderRouterEntity) |
Get all the sensors for the input borderRouter
|
private void |
saveDataForSensor(SensorEntity sensor) |
Generate data entries for the input sensor, store the data in database
|
private void |
saveSensorforBorderRouter(BorderRouterEntity borderRouter) |
Generate dummy sensor for the input borderRouter, store them in database
|
void |
test1() |
create borderRouters, store them in database
|
void |
test2() |
create sensors for each borderRouter, store them in database
|
void |
test3() |
generate dummy data for each sensor
|
void |
test4() |
Test for reading data for each sensor of each borderRouter form database,
create
BorderRouterWrapper respectively. |
@Transactional @Commit public void test1()
@Transactional @Commit public void test2()
@Transactional @Commit public void test3() throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingException
@Transactional @Commit public void test4() throws java.io.IOException
BorderRouterWrapper
respectively.java.io.IOException
private java.util.List<SensorDataEntity> getDataBySensor(SensorEntity sensorEntity)
SensorEntity
.sensorEntity
- private java.util.List<SensorEntity> getSensorsByBorderRouter(BorderRouterEntity borderRouterEntity)
borderRouterEntity
- SensorEntity
private void saveDataForSensor(SensorEntity sensor) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingException
private void saveSensorforBorderRouter(BorderRouterEntity borderRouter)