Package org.uddi.sub_v3

Examples of org.uddi.sub_v3.Subscription


  public void getSamSyndicatorSubscriptionResultsWithChunkingOnFind(String authInfoSam) {   
    try {
      GetSubscriptionResults getSubResultsIn = (GetSubscriptionResults)EntityCreator.buildFromDoc(SAM_SUBSCRIPTIONRESULTS2_XML, "org.uddi.sub_v3");
      getSubResultsIn.setAuthInfo(authInfoSam);
     
      Subscription subIn = (Subscription)EntityCreator.buildFromDoc(SAM_SUBSCRIPTION2_XML, "org.uddi.sub_v3");
     
      int expectedIterations = FINDQUALIFIER_TMODEL_TOTAL / subIn.getMaxEntities();
      if (FINDQUALIFIER_TMODEL_TOTAL % subIn.getMaxEntities() >0)
        expectedIterations++;
     
      String chunkToken = "";
      int iterations = 0;
      while (chunkToken != null) {
        iterations++;
       
        getSubResultsIn.setChunkToken(chunkToken);
        SubscriptionResultsList result = subscription.getSubscriptionResults(getSubResultsIn);
        if (result == null)
          Assert.fail("Null result from getSubscriptionResults operation");
       
        TModelList tmodelList = result.getTModelList();
        if (tmodelList == null)
          Assert.fail("No result from getSubscriptionResults operation on chunk attempt " + iterations);

        int resultSize = tmodelList.getTModelInfos().getTModelInfo().size();
       
        if (iterations < expectedIterations)
          assertEquals(resultSize, subIn.getMaxEntities().intValue());
        else {
          if (FINDQUALIFIER_TMODEL_TOTAL % subIn.getMaxEntities() > 0)
            assertEquals(resultSize, FINDQUALIFIER_TMODEL_TOTAL % subIn.getMaxEntities());
          else
            assertEquals(resultSize, subIn.getMaxEntities().intValue());
        }
       
        chunkToken = result.getChunkToken();
       
      }
View Full Code Here


  public void getSamSyndicatorSubscriptionResultsWithChunkingOnGet(String authInfoSam) {
    try {
      GetSubscriptionResults getSubResultsIn = (GetSubscriptionResults)EntityCreator.buildFromDoc(SAM_SUBSCRIPTIONRESULTS3_XML, "org.uddi.sub_v3");
      getSubResultsIn.setAuthInfo(authInfoSam);
         
      Subscription subIn = (Subscription)EntityCreator.buildFromDoc(SAM_SUBSCRIPTION3_XML, "org.uddi.sub_v3");
     
      int expectedIterations = FINDQUALIFIER_TMODEL_TOTAL / subIn.getMaxEntities();
      if (FINDQUALIFIER_TMODEL_TOTAL % subIn.getMaxEntities() >0)
        expectedIterations++;
     
      String chunkToken = "";
      int iterations = 0;
      while (chunkToken != null) {
        iterations++;
       
        getSubResultsIn.setChunkToken(chunkToken);
        SubscriptionResultsList result = subscription.getSubscriptionResults(getSubResultsIn);
        if (result == null)
          Assert.fail("Null result from getSubscriptionResults operation");
       
        TModelDetail tmodelDetail = result.getTModelDetail();
        if (tmodelDetail == null)
          Assert.fail("No result from getSubscriptionResults operation on chunk attempt " + iterations);

        int resultSize = tmodelDetail.getTModel().size();
       
        if (iterations < expectedIterations)
          assertEquals(resultSize, subIn.getMaxEntities().intValue());
        else {
          if (FINDQUALIFIER_TMODEL_TOTAL % subIn.getMaxEntities() > 0)
            assertEquals(resultSize, FINDQUALIFIER_TMODEL_TOTAL % subIn.getMaxEntities());
          else
            assertEquals(resultSize, subIn.getMaxEntities().intValue());
        }
       
        chunkToken = result.getChunkToken();
       
      }
View Full Code Here

    findAllServices.getName().add(name);
   
    SubscriptionFilter filter = new SubscriptionFilter();
    filter.setFindService(findAllServices);
   
    Subscription subscription = new Subscription();
    subscription.setSubscriptionFilter(filter);
    subscription.setBindingKey(bindingKey);
    subscription.setBrief(true);
    Duration oneMinute = DatatypeFactory.newInstance().newDuration("PT1M");
    subscription.setNotificationInterval(oneMinute);
    subscription.setSubscriptionKey(subscriptionKey);
    clerk.register(subscription);
  }
View Full Code Here

   
  }
 
  public void saveSubscription(String authInfo, String subscriptionXML, String subscriptionKey) {
    try {
      Subscription subIn = (Subscription)EntityCreator.buildFromDoc(subscriptionXML, "org.uddi.sub_v3");
      List<Subscription> subscriptionList = new ArrayList<Subscription>();
      subscriptionList.add(subIn);
      Holder<List<Subscription>> subscriptionHolder = new Holder<List<Subscription>>();
      subscriptionHolder.value = subscriptionList;
     
      subscription.saveSubscription(authInfo, subscriptionHolder);
     
      Subscription subDirectOut = subscriptionHolder.value.get(0);
      assertEquals(subIn.getSubscriptionKey(), subDirectOut.getSubscriptionKey());
     
      List<Subscription> outSubscriptionList = subscription.getSubscriptions(authInfo);
      Assert.assertNotNull(outSubscriptionList);
      Subscription subOut = outSubscriptionList.get(0);
     
      assertEquals(subIn.getSubscriptionKey(), subOut.getSubscriptionKey());
      assertEquals(subDirectOut.getExpiresAfter().getMonth(), subOut.getExpiresAfter().getMonth());
      assertEquals(subDirectOut.getExpiresAfter().getDay(), subOut.getExpiresAfter().getDay());
      assertEquals(subDirectOut.getExpiresAfter().getYear(), subOut.getExpiresAfter().getYear());
     
      //assertEquals(subIn.getSubscriptionFilter().getFindService().getName().get(0).getValue(),
      //       subOut.getSubscriptionFilter().getFindService().getName().get(0).getValue());
     
    } catch (Exception e) {
View Full Code Here

    deleteSubscription(authInfo, subscriptionKey);
  }
 
  public void saveSubscription(String authInfo, String subscriptionXML, String subscriptionKey) {
    try {
      Subscription subIn = (Subscription)EntityCreator.buildFromDoc(subscriptionXML, "org.uddi.sub_v3");
      List<Subscription> subscriptionList = new ArrayList<Subscription>();
      subscriptionList.add(subIn);
      Holder<List<Subscription>> subscriptionHolder = new Holder<List<Subscription>>();
      subscriptionHolder.value = subscriptionList;
     
      subscription.saveSubscription(authInfo, subscriptionHolder);
     
      Subscription subDirectOut = subscriptionHolder.value.get(0);
      assertEquals(subIn.getSubscriptionKey(), subDirectOut.getSubscriptionKey());
     
      List<Subscription> outSubscriptionList = subscription.getSubscriptions(authInfo);
      Assert.assertNotNull(outSubscriptionList);
      Subscription subOut = outSubscriptionList.get(0);
     
      //assertEquals(subIn.getSubscriptionKey(), subOut.getSubscriptionKey());
      assertEquals(subDirectOut.getExpiresAfter().getMonth(), subOut.getExpiresAfter().getMonth());
      assertEquals(subDirectOut.getExpiresAfter().getDay(), subOut.getExpiresAfter().getDay());
      assertEquals(subDirectOut.getExpiresAfter().getYear(), subOut.getExpiresAfter().getYear());
     
      //assertEquals(subIn.getSubscriptionFilter().getFindService().getName().get(0).getValue(),
      //       subOut.getSubscriptionFilter().getFindService().getName().get(0).getValue());
     
    } catch (Exception e) {
View Full Code Here

    findAllServices.getName().add(name);
   
    SubscriptionFilter filter = new SubscriptionFilter();
    filter.setFindService(findAllServices);
   
    Subscription subscription = new Subscription();
    subscription.setSubscriptionFilter(filter);
    subscription.setBindingKey(bindingKey);
    subscription.setBrief(true);
    Duration oneMinute = DatatypeFactory.newInstance().newDuration("PT1M");
    subscription.setNotificationInterval(oneMinute);
    subscription.setSubscriptionKey(subscriptionKey);
    clerk.register(subscription);
    this.subscriptionKey = subscriptionKey;
  }
View Full Code Here

        public void JUDDI_606_1() {
                System.out.println("JUDDI_606_1");
                Assume.assumeTrue(TckPublisher.isSubscriptionEnabled());
                // Null expiration time

                Subscription sub = new Subscription();
                Holder<List<Subscription>> data = new Holder<List<Subscription>>();
                data.value = new ArrayList<Subscription>();
                sub.setBrief(true);
                sub.setExpiresAfter(null);
                sub.setMaxEntities(1);
                sub.setNotificationInterval(null);
                sub.setBindingKey(null);
                sub.setSubscriptionFilter(new SubscriptionFilter());
                sub.getSubscriptionFilter().setFindService(new FindService());
                sub.getSubscriptionFilter().getFindService().setFindQualifiers(new FindQualifiers());
                sub.getSubscriptionFilter().getFindService().getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                sub.getSubscriptionFilter().getFindService().getName().add(new Name("%", null));
                data.value.add(sub);
                try {
                        tckSubscriptionJoe.subscription.saveSubscription(authInfoJoe, data);
                        Assert.assertNotNull(data.value.get(0).getExpiresAfter());
                } catch (Exception ex) {
View Full Code Here

                GregorianCalendar gcal = new GregorianCalendar();
                gcal.setTimeInMillis(System.currentTimeMillis());
                gcal.add(Calendar.DATE, -1);
                XMLGregorianCalendar newXMLGregorianCalendar = df.newXMLGregorianCalendar(gcal);

                Subscription sub = new Subscription();
                Holder<List<Subscription>> data = new Holder<List<Subscription>>();
                data.value = new ArrayList<Subscription>();
                sub.setBrief(true);
                sub.setExpiresAfter(newXMLGregorianCalendar);
                sub.setMaxEntities(1);
                sub.setNotificationInterval(null);
                sub.setBindingKey(null);
                sub.setSubscriptionFilter(new SubscriptionFilter());
                sub.getSubscriptionFilter().setFindService(new FindService());
                sub.getSubscriptionFilter().getFindService().setFindQualifiers(new FindQualifiers());
                sub.getSubscriptionFilter().getFindService().getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                sub.getSubscriptionFilter().getFindService().getName().add(new Name("%", null));
                data.value.add(sub);
                try {
                        tckSubscriptionJoe.subscription.saveSubscription(authInfoJoe, data);
                        Assert.fail();
                } catch (Exception ex) {
View Full Code Here

        public void JUDDI_606_3() {
                System.out.println("JUDDI_606_3");
                Assume.assumeTrue(TckPublisher.isSubscriptionEnabled());
                //

                Subscription sub = new Subscription();
                Holder<List<Subscription>> data = new Holder<List<Subscription>>();
                data.value = new ArrayList<Subscription>();
                sub.setBrief(true);
                sub.setExpiresAfter(null);
                sub.setMaxEntities(1);
                sub.setNotificationInterval(null);
                sub.setBindingKey(null);
                sub.setSubscriptionFilter(new SubscriptionFilter());
                sub.getSubscriptionFilter().setFindService(new FindService());
                sub.getSubscriptionFilter().getFindService().setFindQualifiers(new FindQualifiers());
                sub.getSubscriptionFilter().getFindService().getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                sub.getSubscriptionFilter().getFindService().getName().add(new Name("%", null));
                data.value.add(sub);
                try {
                        tckSubscriptionJoe.subscription.saveSubscription(authInfoJoe, data);
                        Assert.assertNotNull(data.value.get(0).getSubscriptionKey());
                        Assert.assertTrue(data.value.get(0).getSubscriptionKey().length() > 0);
View Full Code Here

        public void JUDDI_606_4() {
                System.out.println("JUDDI_606_4");
                //
                Assume.assumeTrue(TckPublisher.isSubscriptionEnabled());

                Subscription sub = new Subscription();
                Holder<List<Subscription>> data = new Holder<List<Subscription>>();
                data.value = new ArrayList<Subscription>();
                sub.setBrief(true);
                sub.setExpiresAfter(null);
                sub.setMaxEntities(1);
                sub.setNotificationInterval(null);
                sub.setBindingKey(null);
                sub.setSubscriptionFilter(null);

                try {
                        tckSubscriptionJoe.subscription.saveSubscription(authInfoJoe, data);
                        Assert.fail();
                } catch (Exception ex) {
View Full Code Here

TOP

Related Classes of org.uddi.sub_v3.Subscription

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.