use of uk.ac.bbsrc.tgac.miso.core.data.Instrument in project miso-lims by miso-lims.
the class HibernateInstrumentDaoIT method testGetUsageByQcsNone.
@Test
public void testGetUsageByQcsNone() throws Exception {
Instrument instrument = (Instrument) currentSession().get(InstrumentImpl.class, 1L);
assertEquals(0L, dao.getUsageByQcs(instrument));
}
use of uk.ac.bbsrc.tgac.miso.core.data.Instrument in project miso-lims by miso-lims.
the class HibernateServiceRecordDaoIT method testSaveEdit.
@Test
public void testSaveEdit() throws IOException {
ServiceRecord rec = dao.get(1L);
String newTitle = "ChangedTitle";
rec.setTitle(newTitle);
Instrument sr = Mockito.mock(Instrument.class);
Mockito.when(sr.getId()).thenReturn(1L);
rec.setInstrument(sr);
assertEquals(1L, dao.save(rec));
ServiceRecord saved = dao.get(1L);
assertEquals(newTitle, saved.getTitle());
}
use of uk.ac.bbsrc.tgac.miso.core.data.Instrument in project miso-lims by miso-lims.
the class HibernateInstrumentDao method getByName.
@Override
public Instrument getByName(String name) throws IOException {
Criteria criteria = currentSession().createCriteria(InstrumentImpl.class);
criteria.add(Restrictions.eq("name", name));
return (Instrument) criteria.uniqueResult();
}
Aggregations