MleBO { public List<MleData> listMles(String searchCriteria) { List<MleData> mleDataList = new ArrayList<MleData>(); List<TblMle> tblMleList; try { if (searchCriteria != null && !searchCriteria.isEmpty()) { tblMleList = mleJpaController.findMleByNameSearchCriteria(searchCriteria); } else { tblMleList = mleJpaController.findTblMleEntities(); } if (tblMleList != null) { log.debug("Found {} mle results for search criteria {}", tblMleList.size(), searchCriteria); for (TblMle tblMle : tblMleList) { MleData mleData = createMleDataFromDatabaseRecord(tblMle, false); mleDataList.add(mleData); } } else { log.debug("Found {} mle results for search criteria {}", 0, searchCriteria); } } catch (ASException ase) { throw ase; } catch (Exception e) { log.error("Error during retrieval of MLE information.", e); throw new ASException(ErrorCode.WS_MLE_RETRIEVAL_ERROR, e.getClass().getSimpleName()); } return mleDataList; } MleBO(); String addMLe(MleData mleData, String mleUuid); String updateMle(MleData mleData, String mleUuid); String deleteMle(String mleName, String mleVersion, String osName, String osVersion, String oemName, String mleUuid); List<MleData> listMles(String searchCriteria); MleData findMle(String mleName, String mleVersion, String osName, String osVersion, String oemName); MleData createMleDataFromDatabaseRecord(TblMle tblMle, boolean addManifest); String addPCRWhiteList(PCRWhiteList pcrData); String addPCRWhiteList(PCRWhiteList pcrData, EntityManager em, String uuid, String mleUuid); String updatePCRWhiteList(PCRWhiteList pcrData); String updatePCRWhiteList(PCRWhiteList pcrData, EntityManager em, String uuid); String deletePCRWhiteList(String pcrName, String algorithmBank, String mleName, String mleVersion, String osName, String osVersion, String oemName, String pcrUuid); String addModuleWhiteList(ModuleWhiteList moduleData); String addModuleWhiteList(ModuleWhiteList moduleData, EntityManager em, String uuid, String mleUuid); String updateModuleWhiteList(ModuleWhiteList moduleData); String updateModuleWhiteList(ModuleWhiteList moduleData, EntityManager em, String uuid); String deleteModuleWhiteList(String componentName, String eventName, String pcrBank, String mleName, String mleVersion,
            String osName, String osVersion, String oemName, String uuid); List<ModuleWhiteList> getModuleWhiteList(String mleName, String mleVersion,
            String osName, String osVersion, String oemName); String addMleSource(MleSource mleSourceObj, String uuid, String mleUuid); String updateMleSource(MleSource mleSourceObj, String mleUuid); String deleteMleSource(String mleName, String mleVersion, String osName, String osVersion, String oemName, String mleUuid); String getMleSource(String mleName, String mleVersion, String osName, String osVersion, String oemName);  }
@Test public void testQueryFOrMLE() { System.out.println("queryFOrMLE"); MleData mleData = getVmmMle(); String searchCriteria = mleData.getName(); MleBO instance = new MleBO(); List result = instance.listMles(searchCriteria); assertNotNull(result); if( result.isEmpty() ) { testAddMleVmm(); result = instance.listMles(searchCriteria); assertEquals(result.size(), 1); } }