use of com.intel.mtwilson.as.data.TblOs in project OpenAttestation by OpenAttestation.
the class OsBO method updateOs.
/**
*
* @param osData
* @return
*/
public String updateOs(OsData osData) {
try {
TblOs tblOs = tblOsJpaController.findTblOsByNameVersion(osData.getName(), osData.getVersion());
if (tblOs == null) {
throw new ASException(ErrorCode.WS_OS_DOES_NOT_EXIST, osData.getName(), osData.getVersion());
}
tblOs.setDescription(osData.getDescription());
tblOsJpaController.edit(tblOs);
} catch (ASException ase) {
throw ase;
} catch (Exception e) {
throw new ASException(e);
}
return "true";
}
use of com.intel.mtwilson.as.data.TblOs in project OpenAttestation by OpenAttestation.
the class OsBOTest method testDeleteOs.
@Test
public void testDeleteOs() {
TblOs tblOs = new TblOs(OS_ID1, "Fedora", "20");
doReturn(tblOs).when(tblOsJpaController).findTblOsByNameVersion(anyString(), anyString());
String result = osBO.deleteOs(tblOs.getName(), tblOs.getVersion());
assertEquals("true", result);
}
use of com.intel.mtwilson.as.data.TblOs in project OpenAttestation by OpenAttestation.
the class OsBOTest method testGetAllOs.
@Test
public void testGetAllOs() {
List<TblOs> allRecords = new ArrayList<TblOs>();
TblOs tblOs1 = new TblOs(OS_ID1, "Fedora", "20");
TblOs tblOs2 = new TblOs(OS_ID2, "Fedora", "19");
allRecords.add(tblOs1);
allRecords.add(tblOs2);
doReturn(allRecords).when(tblOsJpaController).findTblOsEntities();
List<OsData> allData = osBO.getAllOs();
assertNotNull(allData);
assertEquals(2, allData.size());
}
Aggregations