public void findAllBusiness() { try { FindBusiness body = (FindBusiness)EntityCreator.buildFromDoc(FIND_ALL_BUSINESSES_XML, "org.uddi.api_v3"); BusinessList result = inquiry.findBusiness(body); if (result == null) Assert.fail("Null result from find business operation"); BusinessInfos bInfos = result.getBusinessInfos(); if (bInfos == null) Assert.fail("No result from find business operation"); List<BusinessInfo> biList = bInfos.getBusinessInfo(); if (biList == null || biList.size() == 0) Assert.fail("No result from find business operation"); //expecting more than 2 businesses Assert.assertTrue(biList.size()>1); } catch(Exception e) { logger.error(e.getMessage(), e); Assert.fail("No exception should be thrown." + e.getMessage()); } }
public List<BusinessInfo> findAllSignedBusiness() { List<BusinessInfo> biList = null; try { FindBusiness body = (FindBusiness)EntityCreator.buildFromDoc(FIND_ALL_SIGNED_BUSINESSES_XML, "org.uddi.api_v3"); BusinessList result = inquiry.findBusiness(body); if (result == null) Assert.fail("Null result from find business operation"); BusinessInfos bInfos = result.getBusinessInfos(); if (bInfos == null) Assert.fail("No result from find business operation"); biList = bInfos.getBusinessInfo(); if (biList == null || biList.size() == 0) Assert.fail("No result from find business operation"); //expecting at one business Assert.assertTrue(biList.size()==1); return biList; } catch(Exception e) { logger.error(e.getMessage(), e); Assert.fail("No exception should be thrown."); } return biList; }
public static String DumpAllBusinesses(String authinfo, UDDIInquiryPortType inquriy) { StringBuilder sb = new StringBuilder(); FindBusiness fs = new FindBusiness(); fs.setAuthInfo(authinfo); fs.setFindQualifiers(new FindQualifiers()); fs.getFindQualifiers().getFindQualifier().add("approximateMatch"); fs.getName().add(new Name("%", null)); try { BusinessList findService = inquriy.findBusiness(fs); if (findService.getBusinessInfos() == null) { return ("NO BUSINESSES RETURNED!"); } else { for (int i = 0; i < findService.getBusinessInfos().getBusinessInfo().size(); i++) { sb.append(findService.getBusinessInfos().getBusinessInfo().get(i).getName().get(0).getValue()). append(" lang=").append(findService.getBusinessInfos().getBusinessInfo().get(i).getName().get(0).getLang()). append(" ").append(findService.getBusinessInfos().getBusinessInfo().get(i).getBusinessKey()) .append(System.getProperty("line.separator")); } } } catch (Exception ex) { return ex.getMessage(); } return sb.toString(); }
BusinessList serviceDetail = config.inquiry.findBusiness(req); if (serviceDetail == null || serviceDetail.getBusinessInfos() == null || serviceDetail.getBusinessInfos().getBusinessInfo().isEmpty()) { ret.append("No Businesses are defined in the UDDI registry. Endpoints cannot be published");
public void findBusiness() { try { FindBusiness body = (FindBusiness)EntityCreator.buildFromDoc(FIND_BUSINESS_XML, "org.uddi.api_v3"); BusinessList result = inquiry.findBusiness(body); if (result == null) Assert.fail("Null result from find business operation"); BusinessInfos bInfos = result.getBusinessInfos(); if (bInfos == null) Assert.fail("No result from find business operation"); List<BusinessInfo> biList = bInfos.getBusinessInfo(); if (biList == null || biList.size() == 0) Assert.fail("No result from find business operation"); BusinessInfo biOut = biList.get(0); BusinessEntity beIn = (BusinessEntity)EntityCreator.buildFromDoc(TckBusiness.JOE_BUSINESS_XML, "org.uddi.api_v3"); assertEquals(beIn.getBusinessKey(), biOut.getBusinessKey()); TckValidator.checkNames(beIn.getName(), biOut.getName()); TckValidator.checkDescriptions(beIn.getDescription(), biOut.getDescription()); } catch(Exception e) { logger.error(e.getMessage(), e); Assert.fail("No exception should be thrown."); } }