Package org.uddi.api_v2

Examples of org.uddi.api_v2.BusinessList


                        tckBusiness.saveBusinesses(authInfoJoe, TOM_BUSINESS_XML, TOM_BUSINESS_KEY, 1);

                        try {
                                int size = 0;
                                BusinessList bl = null;

                                FindBusiness fbb = new FindBusiness();
                                TModelBag tmb = new TModelBag();
                                tmb.getTModelKey().add(TOM_PUBLISHER_TMODEL01_KEY);
                                fbb.setTModelBag(tmb);
                                bl = inquiry.findBusiness(fbb);
                                size = bl.getBusinessInfos().getBusinessInfo().size();
                                if (size != 1) {
                                        Assert.fail("Should have found one entry on FindBusiness with TModelBag, "
                                                + "found " + size);
                                } else {
                                        List<BusinessInfo> biList = bl.getBusinessInfos().getBusinessInfo();
                                        if (biList.get(0).getServiceInfos().getServiceInfo().size() != 2) {
                                                Assert.fail("Should have found two ServiceInfos");
                                        } else {
                                                List<ServiceInfo> siList = biList.get(0).getServiceInfos().getServiceInfo();
                                                ServiceInfo si = siList.get(0);
View Full Code Here


                FindBusiness fb = new FindBusiness();
                fb.setMaxRows(1);
                fb.getName().add(new Name(UDDIConstants.WILDCARD, null));
                fb.setFindQualifiers(new FindQualifiers());
                fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                BusinessList findBusiness = inquiry.findBusiness(fb);
                Assume.assumeTrue(findBusiness != null);
                Assume.assumeTrue(findBusiness.getBusinessInfos() != null);
                Assume.assumeTrue(!findBusiness.getBusinessInfos().getBusinessInfo().isEmpty());

                String url = manager.getClientConfig().getHomeNode().getInquiry_REST_Url();

                Assume.assumeNotNull(url);
                HttpClient client = new DefaultHttpClient();
                HttpGet httpGet = new HttpGet(url + "?businessKey=" + findBusiness.getBusinessInfos().getBusinessInfo().get(0).getBusinessKey());
                logger.info("Fetching " + httpGet.getURI());
                HttpResponse response = client.execute(httpGet);
               
                Assert.assertTrue(response.getStatusLine().getStatusCode() == 200);
                logger.info("Response content: " + response.getEntity().getContent());
                BusinessEntity unmarshal = JAXB.unmarshal(response.getEntity().getContent(), BusinessEntity.class);
                client.getConnectionManager().shutdown();
                Assert.assertNotNull(unmarshal);
                Assert.assertEquals(unmarshal.getBusinessKey(), findBusiness.getBusinessInfos().getBusinessInfo().get(0).getBusinessKey());


        }
View Full Code Here

      tckBusiness.saveBusiness(authInfoJoe, TOM_BUSINESS1_XML, TOM_BUSINESS1_KEY);
      tckBusiness.saveBusiness(authInfoJoe, TOM_BUSINESS2_XML, TOM_BUSINESS2_KEY);
      try {
        int size = 0;
        BusinessList bl = null;

        FindBusiness fb = new FindBusiness();
        FindQualifiers fqs = new FindQualifiers();
        fqs.getFindQualifier().add("combineCategoryBags");
        fb.setFindQualifiers(fqs);

        KeyedReference keyRef1 = new KeyedReference();
        keyRef1.setTModelKey(TOM_PUBLISHER_TMODEL01_KEY);
        keyRef1.setKeyValue("value-z");

        KeyedReference keyRef2 = new KeyedReference();
        keyRef2.setTModelKey(TOM_PUBLISHER_TMODEL02_KEY);
        keyRef2.setKeyValue("value-x");

        CategoryBag cb = new CategoryBag();
        cb.getKeyedReference().add(keyRef1);
        cb.getKeyedReference().add(keyRef2);
        fb.setCategoryBag(cb);

        bl = inquiry.findBusiness(fb);
        if (bl.getBusinessInfos() == null) {
          Assert.fail("Should have found one entry on FindBusiness with TModelBag, "
              + "found " + size);
        }
        size = bl.getBusinessInfos().getBusinessInfo().size();
        if (size != 1) {
          Assert.fail("Should have found one entry on FindBusiness with TModelBag, "
              + "found " + size);
        } else {
          List<BusinessInfo> biList = bl.getBusinessInfos().getBusinessInfo();
          String businessKey = biList.get(0).getBusinessKey();
          if (!BUSINESS_KEY.equals(businessKey)) {
            Assert.fail("Should have found business key " + BUSINESS_KEY
                + " but found [" + businessKey + "]");
          }
View Full Code Here

      tckBusiness.saveBusiness(authInfoJoe, TOM_BUSINESS545_XML, TOM_BUSINESS545_KEY);
     
      try {
        int size = 0;
        BusinessList bl = null;

        FindBusiness fb = new FindBusiness();
        FindQualifiers fqs = new FindQualifiers();
        fqs.getFindQualifier().add("combineCategoryBags");
        fb.setFindQualifiers(fqs);

        KeyedReference keyRef1 = new KeyedReference();
        keyRef1.setTModelKey(TOM_PUBLISHER_TMODEL01_KEY);
        keyRef1.setKeyValue("value-z");

        KeyedReference keyRef2 = new KeyedReference();
        keyRef2.setTModelKey(TOM_PUBLISHER_TMODEL02_KEY);
        keyRef2.setKeyValue("value-x");
       
        KeyedReference keyRef3 = new KeyedReference();
        keyRef3.setTModelKey(TOM_PUBLISHER_TMODEL01_KEY);
        keyRef3.setKeyValue("value-y");

        CategoryBag cb = new CategoryBag();
        cb.getKeyedReference().add(keyRef1);
        cb.getKeyedReference().add(keyRef2);
        cb.getKeyedReference().add(keyRef3);
        fb.setCategoryBag(cb);

        bl = inquiry.findBusiness(fb);
        if (bl.getBusinessInfos() == null) {
          Assert.fail("Should have found one entry on FindBusiness with TModelBag, "
              + "found " + size);
        }
        size = bl.getBusinessInfos().getBusinessInfo().size();
        if (size != 1) {
          Assert.fail("Should have found one entry on FindBusiness with TModelBag, "
              + "found " + size);
        } else {
          List<BusinessInfo> biList = bl.getBusinessInfos().getBusinessInfo();
          String businessKey = biList.get(0).getBusinessKey();
          if (!BUSINESS_KEY545.equals(businessKey)) {
            Assert.fail("Should have found business key " + BUSINESS_KEY545
                + " but found [" + businessKey + "]");
          }
View Full Code Here

        n.setValue("%");
        fb.getName().add(n);
        fb.setFindQualifiers(new FindQualifiers());
        fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
        try {
            BusinessList findBusiness = inquiry.findBusiness(fb);
            if (findBusiness.getBusinessInfos() != null) {
                for (int i = 0; i < findBusiness.getBusinessInfos().getBusinessInfo().size(); i++) {
                    if (businesskeysToDelete.contains(findBusiness.getBusinessInfos().getBusinessInfo().get(i).getBusinessKey())) {
                        found1++;
                    }
                }
            }
        } catch (Exception ex) {
            HandleException(ex);
            Assert.fail("unexpected failure");
        }
        if (found1 != 2) {
            failuremsg += "No lang defined, " + found1 + " records found instead of 2";
        }



        found1 = 0;
        fb = new FindBusiness();
        fb.setAuthInfo(authInfoJoe);
        n = new Name();
        n.setLang("en");
        n.setValue("%");
        fb.getName().add(n);
        fb.setFindQualifiers(new FindQualifiers());
        fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
        try {
            BusinessList findBusiness = inquiry.findBusiness(fb);
            if (findBusiness.getBusinessInfos() != null) {
                for (int i = 0; i < findBusiness.getBusinessInfos().getBusinessInfo().size(); i++) {
                    if (businesskeysToDelete.contains(findBusiness.getBusinessInfos().getBusinessInfo().get(i).getBusinessKey())) {
                        found1++;
                    }
                }
            }
        } catch (Exception ex) {
View Full Code Here

    Name name = new Name();
    name.setValue("John%");
    fb.getName().add(name);
    fb.setMaxRows(20);
    long startFind = System.currentTimeMillis();
    BusinessList result = inquiry.findBusiness(fb);
    long findDuration = System.currentTimeMillis() - startFind;
    System.out.println("Find 20 businesses took "  +  findDuration + "ms. Size=" + result.getBusinessInfos().getBusinessInfo().size());
    // it takes less then 1 second, make sure it stays faster then 5 seconds
    //Assert.assertTrue(findDuration < 5000);
       
    FindService fs = new FindService();
    fs.setFindQualifiers(apiFq);
View Full Code Here

     
      tckBusiness.saveBusinesses(authInfoJoe, TOM_BUSINESS_XML, TOM_BUSINESS_KEY, 1);
     
      try {
        int size = 0;
        BusinessList bl = null;
 
        FindBusiness fbb = new FindBusiness();
        TModelBag tmb = new TModelBag();
        tmb.getTModelKey().add(TOM_PUBLISHER_TMODEL01_KEY);
        fbb.setTModelBag(tmb);
        bl = inquiry.findBusiness(fbb);
        size = bl.getBusinessInfos().getBusinessInfo().size();
        if (size != 1) {
          Assert.fail("Should have found one entry on FindBusiness with TModelBag, "
              + "found " + size);
        } else {
          List<BusinessInfo> biList = bl.getBusinessInfos().getBusinessInfo();
          if (biList.get(0).getServiceInfos().getServiceInfo().size() != 2) {
            Assert.fail("Should have found two ServiceInfos");
          } else {
              List<ServiceInfo> siList = biList.get(0).getServiceInfos().getServiceInfo();
              ServiceInfo si = siList.get(0);
View Full Code Here

      tckBusiness.saveBusiness(authInfoJoe, TOM_BUSINESS1_XML, TOM_BUSINESS1_KEY);
      tckBusiness.saveBusiness(authInfoJoe, TOM_BUSINESS2_XML, TOM_BUSINESS2_KEY);
      try {
        int size = 0;
        BusinessList bl = null;

        FindBusiness fb = new FindBusiness();
        FindQualifiers fqs = new FindQualifiers();
        fqs.getFindQualifier().add("combineCategoryBags");
        fb.setFindQualifiers(fqs);

        KeyedReference keyRef1 = new KeyedReference();
        keyRef1.setTModelKey(TOM_PUBLISHER_TMODEL01_KEY);
        keyRef1.setKeyValue("value-z");

        KeyedReference keyRef2 = new KeyedReference();
        keyRef2.setTModelKey(TOM_PUBLISHER_TMODEL02_KEY);
        keyRef2.setKeyValue("value-x");

        CategoryBag cb = new CategoryBag();
        cb.getKeyedReference().add(keyRef1);
        cb.getKeyedReference().add(keyRef2);
        fb.setCategoryBag(cb);

        bl = inquiry.findBusiness(fb);
        if (bl.getBusinessInfos() == null) {
          Assert.fail("Should have found one entry on FindBusiness with TModelBag, "
              + "found " + size);
        }
        size = bl.getBusinessInfos().getBusinessInfo().size();
        if (size != 1) {
          Assert.fail("Should have found one entry on FindBusiness with TModelBag, "
              + "found " + size);
        } else {
          List<BusinessInfo> biList = bl.getBusinessInfos().getBusinessInfo();
          String businessKey = biList.get(0).getBusinessKey();
          if (!BUSINESS_KEY.equals(businessKey)) {
            Assert.fail("Should have found business key " + BUSINESS_KEY
                + " but found [" + businessKey + "]");
          }
View Full Code Here

      tckBusiness.saveBusiness(authInfoJoe, TOM_BUSINESS545_XML, TOM_BUSINESS545_KEY);
     
      try {
        int size = 0;
        BusinessList bl = null;

        FindBusiness fb = new FindBusiness();
        FindQualifiers fqs = new FindQualifiers();
        fqs.getFindQualifier().add("combineCategoryBags");
        fb.setFindQualifiers(fqs);

        KeyedReference keyRef1 = new KeyedReference();
        keyRef1.setTModelKey(TOM_PUBLISHER_TMODEL01_KEY);
        keyRef1.setKeyValue("value-z");

        KeyedReference keyRef2 = new KeyedReference();
        keyRef2.setTModelKey(TOM_PUBLISHER_TMODEL02_KEY);
        keyRef2.setKeyValue("value-x");
       
        KeyedReference keyRef3 = new KeyedReference();
        keyRef3.setTModelKey(TOM_PUBLISHER_TMODEL01_KEY);
        keyRef3.setKeyValue("value-y");

        CategoryBag cb = new CategoryBag();
        cb.getKeyedReference().add(keyRef1);
        cb.getKeyedReference().add(keyRef2);
        cb.getKeyedReference().add(keyRef3);
        fb.setCategoryBag(cb);

        bl = inquiry.findBusiness(fb);
        if (bl.getBusinessInfos() == null) {
          Assert.fail("Should have found one entry on FindBusiness with TModelBag, "
              + "found " + size);
        }
        size = bl.getBusinessInfos().getBusinessInfo().size();
        if (size != 1) {
          Assert.fail("Should have found one entry on FindBusiness with TModelBag, "
              + "found " + size);
        } else {
          List<BusinessInfo> biList = bl.getBusinessInfos().getBusinessInfo();
          String businessKey = biList.get(0).getBusinessKey();
          if (!BUSINESS_KEY545.equals(businessKey)) {
            Assert.fail("Should have found business key " + BUSINESS_KEY545
                + " but found [" + businessKey + "]");
          }
View Full Code Here

   public void Browse(String[] args) {
      try {

         String token = GetAuthKey("uddi", "uddi");
         BusinessList findBusiness = GetBusinessList(token);
         PrintBusinessInfo(findBusiness.getBusinessInfos());
         PrintBusinessDetails(findBusiness.getBusinessInfos(), token);
         PrintServiceDetailsByBusiness(findBusiness.getBusinessInfos(), token);

         security.discardAuthToken(new DiscardAuthToken(token));

      } catch (Exception e) {
         e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.uddi.api_v2.BusinessList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.