juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexo...@apache.org
Subject svn commit: r1563649 - in /juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck: UDDI_090_SubscriptionListenerExternalTest.java UDDI_090_SubscriptionListenerIntegrationTest.java
Date Sun, 02 Feb 2014 16:17:00 GMT
Author: alexoree
Date: Sun Feb  2 16:16:59 2014
New Revision: 1563649

URL: http://svn.apache.org/r1563649
Log:
JUDDI-242 adding smtp delivery test for getBusinessDetails

Modified:
    juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_090_SubscriptionListenerExternalTest.java
    juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_090_SubscriptionListenerIntegrationTest.java

Modified: juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_090_SubscriptionListenerExternalTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_090_SubscriptionListenerExternalTest.java?rev=1563649&r1=1563648&r2=1563649&view=diff
==============================================================================
--- juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_090_SubscriptionListenerExternalTest.java
(original)
+++ juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_090_SubscriptionListenerExternalTest.java
Sun Feb  2 16:16:59 2014
@@ -698,10 +698,6 @@ public class UDDI_090_SubscriptionListen
                         for (int i = 0; i < TckPublisher.getSubscriptionTimeout(); i++)
{
                                 Thread.sleep(1000);
                                 System.out.print(".");
-                                if (UDDISubscriptionListenerImpl.notificationCount > 0)
{
-                                //        logger.info("Received Notification");
-                                       // break;
-                                }
                         }
                         
                         if (UDDISubscriptionListenerImpl.notificationCount == 0) {
@@ -751,6 +747,94 @@ public class UDDI_090_SubscriptionListen
         }
 
        
+        
+                /**
+         * getBusiness tests
+         * joe want's updates on mary's business
+         * @throws Exception 
+         */
+        @Test
+        //@Ignore
+        public void joePublisherUpdate_SMTP_GET_BUSINESS_DETAIL() throws Exception{
+                logger.info("joePublisherUpdate_SMTP_GET_BUSINESS_DETAIL");
+                TckCommon.removeAllExistingSubscriptions(authInfoJoe, subscriptionJoe);
+                Holder<List<Subscription>> holder=null;
+                try {
+                        UDDISubscriptionListenerImpl.notifcationMap.clear();
+                        UDDISubscriptionListenerImpl.notificationCount = 0;
+                        String before = TckCommon.DumpAllBusinesses(authInfoJoe, inquiryJoe);
+
+                        tckTModelJoe.saveJoePublisherTmodel(authInfoJoe);
+                        tckTModelJoe.saveTModels(authInfoJoe, TckTModel.JOE_PUBLISHER_TMODEL_XML_SUBSCRIPTION3);
+                        
+                        tckTModelMary.saveMaryPublisherTmodel(authInfoMary);
+                        BusinessEntity saveMaryPublisherBusiness = tckBusinessMary.saveMaryPublisherBusiness(authInfoMary);
+                        
+                        tckBusinessJoe.saveJoePublisherBusiness(authInfoJoe);
+                        tckBusinessServiceJoe.saveJoePublisherService(authInfoJoe);
+                        //Saving the Listener Service
+                        tckSubscriptionListenerJoe.saveService(authInfoJoe, TckSubscriptionListener.LISTENER_SMTP_SERVICE_EXTERNAL_XML,
0, email);
+                        //Saving the Subscription
+                        holder = new Holder<List<Subscription>>();
+                        holder.value = new ArrayList<Subscription>();
+                        Subscription sub = new Subscription();
+                        sub.setBindingKey("uddi:uddi.joepublisher.com:bindinglistenersmtp");
+                        sub.setNotificationInterval(DatatypeFactory.newInstance().newDuration(5000));
+                        sub.setSubscriptionFilter(new SubscriptionFilter());
+                        sub.getSubscriptionFilter().setGetBusinessDetail(new GetBusinessDetail());
+                        sub.getSubscriptionFilter().getGetBusinessDetail().getBusinessKey().add(TckBusiness.MARY_BUSINESS_KEY);
+                        
+                        holder.value.add(sub);
+                        subscriptionJoe.saveSubscription(authInfoJoe, holder);
+                        //tckSubscriptionListenerJoe.saveNotifierSubscription(authInfoJoe,
TckSubscriptionListener.SUBSCRIPTION3_XML);
+                        //Changing the service we subscribed to "JoePublisherService"
+                        Thread.sleep(1000);
+                        logger.info("updating Mary's business ********** ");
+                        updatePublisherBusiness(authInfoMary,saveMaryPublisherBusiness, publicationMary);
+                        
+                        logger.info("Waiting " + TckPublisher.getSubscriptionTimeout() +
" seconds for delivery");
+                        //waiting up to 100 seconds for the listener to notice the change.
+                        boolean received = false;
+                        for (int i = 0; i < TckPublisher.getSubscriptionTimeout(); i++)
{
+                                Thread.sleep(1000);
+                                System.out.print(".");
+                                if (fetchMail("tModel One") > 0) {
+                                        logger.info("Received Email Notification");
+                                        received = true;
+                                        break;
+                                }
+                        }
+                        
+                        if (!received) {
+                                logger.warn("Test failed, dumping business list");
+                                logger.warn("BEFORE " + before);
+                                logger.warn("After " + TckCommon.DumpAllBusinesses(authInfoJoe,
inquiryJoe));
+                                Assert.fail("No Notification was sent");
+                        }
+
+                } catch (Exception e) {
+                        logger.error("No exceptions please.");
+                        e.printStackTrace();
+
+                        Assert.fail();
+                } finally {
+                        //tckSubscriptionListenerJoe.deleteNotifierSubscription(authInfoJoe,
TckSubscriptionListener.SUBSCRIPTION_KEY);
+                        DeleteSubscription ds = new DeleteSubscription();
+                        ds.setAuthInfo(authInfoJoe);
+                        ds.getSubscriptionKey().add(holder.value.get(0).getSubscriptionKey());
+                        subscriptionJoe.deleteSubscription(ds);
+                        tckBusinessMary.deleteMaryPublisherBusiness(authInfoMary);
+                        tckTModelMary.deleteMaryPublisherTmodel(authInfoMary);
+                        
+                        tckBusinessServiceJoe.deleteJoePublisherService(authInfoJoe);
+                        tckBusinessJoe.deleteJoePublisherBusiness(authInfoJoe);
+                        tckTModelJoe.deleteJoePublisherTmodel(authInfoJoe);
+                        tckTModelJoe.deleteTModel(authInfoJoe, TckTModel.JOE_PUBLISHER_TMODEL_SUBSCRIPTION3_TMODEL_KEY,
TckTModel.JOE_PUBLISHER_TMODEL_XML_SUBSCRIPTION3);
+                        
+                }
+        }
+
+
 
         /**
          * adds a new name to the business, then resaves it

Modified: juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_090_SubscriptionListenerIntegrationTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_090_SubscriptionListenerIntegrationTest.java?rev=1563649&r1=1563648&r2=1563649&view=diff
==============================================================================
--- juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_090_SubscriptionListenerIntegrationTest.java
(original)
+++ juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_090_SubscriptionListenerIntegrationTest.java
Sun Feb  2 16:16:59 2014
@@ -393,7 +393,6 @@ public class UDDI_090_SubscriptionListen
          * @throws Exception 
          */
         @Test
-        //@Ignore
         public void joePublisherUpdate_HTTP_GET_BUSINESS_DETAIL() throws Exception{
                 logger.info("joePublisherUpdate_HTTP_GET_BUSINESS_DETAIL");
                 TckCommon.removeAllExistingSubscriptions(authInfoJoe, subscriptionJoe);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org


Mime
View raw message