bunti/src/test/java/de/ctdo/bunti/dao/BuntiDevicesDAOImplTest.java

44 lines
1.2 KiB
Java

package de.ctdo.bunti.dao;
import de.ctdo.bunti.model.BuntiDMXDevice;
import de.ctdo.bunti.model.BuntiDevice;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.Collection;
import java.util.List;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNull;
@ContextConfiguration(locations = { "classpath:/de/ctdo/bunti/hibernate-test-context.xml" })
@RunWith(SpringJUnit4ClassRunner.class)
public class BuntiDevicesDAOImplTest {
@Autowired
BuntiDevicesDAO dut;
@Test
public void testGetAllDMXDevices() throws Exception {
List<BuntiDMXDevice> deviceList = dut.getAllDMXDevices();
assertEquals(4, deviceList.size());
}
@Test
public void testGetAllDevices() throws Exception {
List<BuntiDevice> deviceList = dut.getAllDevices();
assertEquals(4, deviceList.size());
}
@Test
public void testGetDeviceById() throws Exception {
BuntiDevice device = dut.getDeviceById(2);
assertEquals("Lampe2", device.getDeviceName());
}
}