/*
* Copyright 2013, 2014, 2015 EnergyOS.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.energyos.espi.common.domain;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.energyos.espi.common.support.TestUtils;
import org.junit.Test;
public class ElectricPowerUsageSummaryPersistenceTests {
@Test
public void persistence() {
TestUtils.assertAnnotationPresent(ElectricPowerUsageSummary.class,
Entity.class);
TestUtils.assertAnnotationPresent(ElectricPowerUsageSummary.class,
Table.class);
}
@Test
public void ratchetDemandPeriod() {
TestUtils.assertAnnotationPresent(ElectricPowerUsageSummary.class,
"ratchetDemandPeriod", Embedded.class);
}
@Test
public void billingPeriod() {
TestUtils.assertAnnotationPresent(ElectricPowerUsageSummary.class,
"billingPeriod", Embedded.class);
}
@Test
public void currentBillingPeriodOverAllConsumption() {
TestUtils.assertAnnotationPresent(ElectricPowerUsageSummary.class,
"currentBillingPeriodOverAllConsumption", Embedded.class);
}
@Test
public void currentDayLastYearNetConsumption() {
TestUtils.assertAnnotationPresent(ElectricPowerUsageSummary.class,
"currentDayLastYearNetConsumption", Embedded.class);
}
@Test
public void currentDayNetConsumption() {
TestUtils.assertAnnotationPresent(ElectricPowerUsageSummary.class,
"currentDayNetConsumption", Embedded.class);
}
@Test
public void currentDayOverallConsumption() {
TestUtils.assertAnnotationPresent(ElectricPowerUsageSummary.class,
"currentDayOverallConsumption", Embedded.class);
}
@Test
public void peakDemand() {
TestUtils.assertAnnotationPresent(ElectricPowerUsageSummary.class,
"peakDemand", Embedded.class);
}
@Test
public void previousDayLastYearOverallConsumption() {
TestUtils.assertAnnotationPresent(ElectricPowerUsageSummary.class,
"previousDayLastYearOverallConsumption", Embedded.class);
}
@Test
public void previousDayNetConsumption() {
TestUtils.assertAnnotationPresent(ElectricPowerUsageSummary.class,
"previousDayNetConsumption", Embedded.class);
}
@Test
public void previousDayOverallConsumption() {
TestUtils.assertAnnotationPresent(ElectricPowerUsageSummary.class,
"previousDayOverallConsumption", Embedded.class);
}
@Test
public void ratchetDemand() {
TestUtils.assertAnnotationPresent(ElectricPowerUsageSummary.class,
"ratchetDemand", Embedded.class);
}
@Test
public void usagePoint() {
TestUtils.assertAnnotationPresent(ElectricPowerUsageSummary.class,
"usagePoint", ManyToOne.class);
TestUtils.assertAnnotationPresent(ElectricPowerUsageSummary.class,
"usagePoint", JoinColumn.class);
}
}