Return-Path: X-Original-To: apmail-juddi-commits-archive@www.apache.org Delivered-To: apmail-juddi-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6F6F4109FD for ; Sun, 2 Feb 2014 16:17:23 +0000 (UTC) Received: (qmail 34699 invoked by uid 500); 2 Feb 2014 16:17:22 -0000 Delivered-To: apmail-juddi-commits-archive@juddi.apache.org Received: (qmail 34666 invoked by uid 500); 2 Feb 2014 16:17:22 -0000 Mailing-List: contact commits-help@juddi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@juddi.apache.org Received: (qmail 34658 invoked by uid 99); 2 Feb 2014 16:17:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Feb 2014 16:17:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Feb 2014 16:17:20 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 6FA9E23888E4; Sun, 2 Feb 2014 16:17:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@juddi.apache.org From: alexoree@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140202161700.6FA9E23888E4@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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> 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>(); + holder.value = new ArrayList(); + 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