juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfa...@apache.org
Subject svn commit: r767758 - in /webservices/juddi/branches/v3_trunk: juddi-core/src/test/java/org/apache/juddi/api/impl/ uddi-client/src/test/java/org/apache/juddi/client/ uddi-tck/src/main/java/org/uddi/api_v3/tck/ uddi-tck/src/main/resources/uddi_data/subs...
Date Thu, 23 Apr 2009 02:01:06 GMT
Author: jfaath
Date: Thu Apr 23 02:01:05 2009
New Revision: 767758

URL: http://svn.apache.org/viewvc?rev=767758&view=rev
Log:
updating tests for new subscription functionality.

Added:
    webservices/juddi/branches/v3_trunk/uddi-tck/src/main/resources/uddi_data/subscription/subscription2.xml
  (with props)
    webservices/juddi/branches/v3_trunk/uddi-tck/src/main/resources/uddi_data/subscription/subscriptionresults2.xml
  (with props)
Modified:
    webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/api/impl/API_080_SubscriptionTest.java
    webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_080_SubscriptionTest.java
    webservices/juddi/branches/v3_trunk/uddi-tck/src/main/java/org/uddi/api_v3/tck/TckSubscription.java

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/api/impl/API_080_SubscriptionTest.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/api/impl/API_080_SubscriptionTest.java?rev=767758&r1=767757&r2=767758&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/api/impl/API_080_SubscriptionTest.java
(original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/test/java/org/apache/juddi/api/impl/API_080_SubscriptionTest.java
Thu Apr 23 02:01:05 2009
@@ -40,9 +40,10 @@
 	private static TckBusiness tckBusiness = new TckBusiness(new UDDIPublicationImpl(), new
UDDIInquiryImpl());
 	private static TckBusinessService tckBusinessService = new TckBusinessService(new UDDIPublicationImpl(),
new UDDIInquiryImpl());
 	private static TckBindingTemplate tckBindingTemplate = new TckBindingTemplate(new UDDIPublicationImpl(),
new UDDIInquiryImpl());
-	private TckSubscription tckSubscription = new TckSubscription(new UDDISubscriptionImpl(),
new UDDISecurityImpl());
+	private static TckSubscription tckSubscription = new TckSubscription(new UDDISubscriptionImpl(),
new UDDISecurityImpl());
 
 	private static String authInfoJoe = null;
+	private static String authInfoSam = null;
 	
 	@BeforeClass
 	public static void setup() {
@@ -50,6 +51,10 @@
 		try {
 			api010.saveJoePublisher();
 			authInfoJoe = TckSecurity.getAuthToken(new UDDISecurityImpl(), TckPublisher.JOE_PUBLISHER_ID,
 TckPublisher.JOE_PUBLISHER_CRED);
+
+			api010.saveSamSyndicator();
+			authInfoSam = TckSecurity.getAuthToken(new UDDISecurityImpl(), TckPublisher.SAM_SYNDICATOR_ID,
 TckPublisher.SAM_SYNDICATOR_CRED);
+
 		} catch (DispositionReportFaultMessage e) {
 			logger.error(e.getMessage(), e);
 			Assert.fail("Could not obtain authInfo token.");
@@ -66,9 +71,9 @@
 			tckBindingTemplate.saveJoePublisherBinding(authInfoJoe);
 			tckSubscription.saveJoePublisherSubscription(authInfoJoe);
 			tckSubscription.getJoePublisherSubscriptionResults(authInfoJoe);
-			tckSubscription.deleteJoePublisherSubscription(authInfoJoe);
 		} 
 		finally {
+			tckSubscription.deleteJoePublisherSubscription(authInfoJoe);
 			tckBindingTemplate.deleteJoePublisherBinding(authInfoJoe);
 			tckBusinessService.deleteJoePublisherService(authInfoJoe);
 			tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
@@ -77,4 +82,23 @@
 		
 	}
 
+	@Test
+	public void samSyndicator() {
+		try {
+			tckTModel.saveSamSyndicatorTmodel(authInfoSam);
+			tckBusiness.saveSamSyndicatorBusiness(authInfoSam);
+			tckBusinessService.saveSamSyndicatorService(authInfoSam);
+			tckSubscription.saveSamSyndicatorSubscription(authInfoSam);
+			tckSubscription.getSamSyndicatorSubscriptionResults(authInfoSam);
+		} 
+		finally {
+			tckSubscription.deleteSamSyndicatorSubscription(authInfoSam);
+			tckBusinessService.deleteSamSyndicatorService(authInfoSam);
+			tckBusiness.deleteSamSyndicatorBusiness(authInfoSam);
+			tckTModel.deleteSamSyndicatorTmodel(authInfoSam);
+		}
+		
+	}
+
+	
 }

Modified: webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_080_SubscriptionTest.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_080_SubscriptionTest.java?rev=767758&r1=767757&r2=767758&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_080_SubscriptionTest.java
(original)
+++ webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_080_SubscriptionTest.java
Thu Apr 23 02:01:05 2009
@@ -49,6 +49,7 @@
 	private static TckSubscription tckSubscription = null;
 
 	private static String authInfoJoe = null;
+	private static String authInfoSam = null;
 
 	@BeforeClass
 	public static void setup() {
@@ -62,6 +63,8 @@
 	        	 UDDISecurityPortType security = transport.getSecurityService();
 	        	 authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.JOE_PUBLISHER_ID,
TckPublisher.JOE_PUBLISHER_CRED);
 	        	 Assert.assertNotNull(authInfoJoe);
+	        	 authInfoSam = TckSecurity.getAuthToken(security, TckPublisher.SAM_SYNDICATOR_ID,
TckPublisher.SAM_SYNDICATOR_CRED);
+	        	 Assert.assertNotNull(authInfoSam);
 	        	 
 	        	 UDDIPublicationPortType publication = transport.getPublishService();
 	        	 UDDIInquiryPortType inquiry = transport.getInquiryService();
@@ -90,6 +93,7 @@
 			tckBusinessService.saveJoePublisherService(authInfoJoe);
 			tckBindingTemplate.saveJoePublisherBinding(authInfoJoe);
 			tckSubscription.saveJoePublisherSubscription(authInfoJoe);
+			tckSubscription.getJoePublisherSubscriptionResults(authInfoJoe);
 		} 
 		finally {
 			tckSubscription.deleteJoePublisherSubscription(authInfoJoe);
@@ -100,4 +104,23 @@
 		}
 	}
 
+	@Test
+	public void samSyndicator() {
+		try {
+			tckTModel.saveSamSyndicatorTmodel(authInfoSam);
+			tckBusiness.saveSamSyndicatorBusiness(authInfoSam);
+			tckBusinessService.saveSamSyndicatorService(authInfoSam);
+			tckSubscription.saveSamSyndicatorSubscription(authInfoSam);
+			tckSubscription.getSamSyndicatorSubscriptionResults(authInfoSam);
+		} 
+		finally {
+			tckSubscription.deleteSamSyndicatorSubscription(authInfoSam);
+			tckBusinessService.deleteSamSyndicatorService(authInfoSam);
+			tckBusiness.deleteSamSyndicatorBusiness(authInfoSam);
+			tckTModel.deleteSamSyndicatorTmodel(authInfoSam);
+		}
+		
+	}
+
+	
 }

Modified: webservices/juddi/branches/v3_trunk/uddi-tck/src/main/java/org/uddi/api_v3/tck/TckSubscription.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/uddi-tck/src/main/java/org/uddi/api_v3/tck/TckSubscription.java?rev=767758&r1=767757&r2=767758&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/uddi-tck/src/main/java/org/uddi/api_v3/tck/TckSubscription.java
(original)
+++ webservices/juddi/branches/v3_trunk/uddi-tck/src/main/java/org/uddi/api_v3/tck/TckSubscription.java
Thu Apr 23 02:01:05 2009
@@ -21,11 +21,14 @@
 
 import org.apache.log4j.Logger;
 import org.junit.Assert;
+import org.uddi.api_v3.BusinessDetail;
+import org.uddi.api_v3.BusinessEntity;
 import org.uddi.api_v3.BusinessService;
 import org.uddi.api_v3.ServiceInfo;
 import org.uddi.api_v3.ServiceInfos;
 import org.uddi.sub_v3.DeleteSubscription;
 import org.uddi.sub_v3.GetSubscriptionResults;
+import org.uddi.sub_v3.KeyBag;
 import org.uddi.sub_v3.Subscription;
 import org.uddi.sub_v3.SubscriptionResultsList;
 import org.uddi.v3_service.UDDISecurityPortType;
@@ -40,10 +43,13 @@
 {	
 	final static String JOE_SUBSCRIPTION_XML = "uddi_data/subscription/subscription1.xml";
     final static String JOE_SUBSCRIPTION_KEY = "uddi:uddi.joepublisher.com:subscriptionone";
-    
 	final static String JOE_SUBSCRIPTIONRESULTS_XML = "uddi_data/subscription/subscriptionresults1.xml";
 
-
+	final static String SAM_SUBSCRIPTION_XML = "uddi_data/subscription/subscription2.xml";
+    final static String SAM_SUBSCRIPTION_KEY = "uddi:www.samco.com:subscriptionone";
+	final static String SAM_SUBSCRIPTIONRESULTS_XML = "uddi_data/subscription/subscriptionresults2.xml";
+	final static String SAM_DUMMYBUSINESSKEY = "uddi:www.this.key.doesnot.exist";
+	
 	private Logger logger = Logger.getLogger(this.getClass());
     UDDISubscriptionPortType subscription = null;
 	UDDISecurityPortType security = null;
@@ -62,8 +68,83 @@
 		deleteSubscription(authInfoJoe, JOE_SUBSCRIPTION_KEY);
 	}
 	
-	public void getJoePublisherSubscriptionResults(String authInfoJoe) {
-		getSubscriptionResults(authInfoJoe, JOE_SUBSCRIPTIONRESULTS_XML);
+	public void getJoePublisherSubscriptionResults(String authInfoJoe) {		
+		try {
+			GetSubscriptionResults getSubResultsIn = (GetSubscriptionResults)EntityCreator.buildFromDoc(JOE_SUBSCRIPTIONRESULTS_XML,
"org.uddi.sub_v3");
+			getSubResultsIn.setAuthInfo(authInfoJoe);
+			
+			SubscriptionResultsList result = subscription.getSubscriptionResults(getSubResultsIn);
+			if (result == null)
+				Assert.fail("Null result from getSubscriptionResults operation");
+
+			ServiceInfos sInfos = result.getServiceList().getServiceInfos();
+			if (sInfos == null)
+				Assert.fail("No result from getSubscriptionResults operation");
+			List<ServiceInfo> siList = sInfos.getServiceInfo();
+			if (siList == null || siList.size() == 0)
+				Assert.fail("No result from getSubscriptionResults operation");
+			ServiceInfo siOut = siList.get(0);
+			
+			BusinessService bsIn = (BusinessService)EntityCreator.buildFromDoc(TckBusinessService.JOE_SERVICE_XML,
"org.uddi.api_v3");
+
+			assertEquals(bsIn.getServiceKey(), siOut.getServiceKey());
+			
+			TckValidator.checkNames(bsIn.getName(), siOut.getName());
+		}
+		catch(Exception e) {
+			logger.error(e.getMessage(), e);
+			Assert.fail("No exception should be thrown");		
+		}
+		
+	}
+	
+	public void saveSamSyndicatorSubscription(String authInfoSam) {
+		saveSubscription(authInfoSam, SAM_SUBSCRIPTION_XML, SAM_SUBSCRIPTION_KEY);
+	}
+
+	public void deleteSamSyndicatorSubscription(String authInfoSam) {
+		deleteSubscription(authInfoSam, SAM_SUBSCRIPTION_KEY);
+	}
+
+	public void getSamSyndicatorSubscriptionResults(String authInfoSam) {		
+		try {
+			GetSubscriptionResults getSubResultsIn = (GetSubscriptionResults)EntityCreator.buildFromDoc(SAM_SUBSCRIPTIONRESULTS_XML,
"org.uddi.sub_v3");
+			getSubResultsIn.setAuthInfo(authInfoSam);
+			
+			SubscriptionResultsList result = subscription.getSubscriptionResults(getSubResultsIn);
+			if (result == null)
+				Assert.fail("Null result from getSubscriptionResults operation");
+
+			BusinessDetail busDetail = result.getBusinessDetail();
+			if (busDetail == null)
+				Assert.fail("No result from getSubscriptionResults operation");
+			List<BusinessEntity> beList = busDetail.getBusinessEntity();
+			if (beList == null || beList.size() == 0)
+				Assert.fail("No result from getSubscriptionResults operation");
+			BusinessEntity beOut = beList.get(0);
+			
+			BusinessEntity beIn = (BusinessEntity)EntityCreator.buildFromDoc(TckBusiness.SAM_BUSINESS_XML,
"org.uddi.api_v3");
+
+			assertEquals(beIn.getBusinessKey(), beOut.getBusinessKey());
+			
+			TckValidator.checkNames(beIn.getName(), beOut.getName());
+			TckValidator.checkDescriptions(beIn.getDescription(), beOut.getDescription());
+			TckValidator.checkDiscoveryUrls(beIn.getDiscoveryURLs(), beOut.getDiscoveryURLs());
+			TckValidator.checkContacts(beIn.getContacts(), beOut.getContacts());
+			TckValidator.checkCategories(beIn.getCategoryBag(), beOut.getCategoryBag());
+			
+			List<KeyBag> keyBagList = result.getKeyBag();
+			if (keyBagList == null || keyBagList.size() == 0)
+				Assert.fail("No keyBag from SamSyndicator getSubscriptionResults operation");
+			KeyBag keyBag = keyBagList.get(0);
+			assertEquals(SAM_DUMMYBUSINESSKEY, keyBag.getBusinessKey().get(0));
+			
+		}
+		catch(Exception e) {
+			logger.error(e.getMessage(), e);
+			Assert.fail("No exception should be thrown");		
+		}
+		
 	}
 	
 	private void saveSubscription(String authInfo, String subscriptionXML, String subscriptionKey)
{
@@ -88,8 +169,8 @@
 			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());
+			//assertEquals(subIn.getSubscriptionFilter().getFindService().getName().get(0).getValue(),

+			//			 subOut.getSubscriptionFilter().getFindService().getName().get(0).getValue());
 			
 		} catch (Exception e) {
 			logger.error(e.getMessage(), e);
@@ -112,34 +193,5 @@
 			Assert.fail("No exception should be thrown.");
 		}
 	}
-	
-	private void getSubscriptionResults(String authInfo, String subscriptionResultsXML) {
-		try {
-			GetSubscriptionResults getSubResultsIn = (GetSubscriptionResults)EntityCreator.buildFromDoc(subscriptionResultsXML,
"org.uddi.sub_v3");
-			getSubResultsIn.setAuthInfo(authInfo);
-			
-			SubscriptionResultsList result = subscription.getSubscriptionResults(getSubResultsIn);
-			if (result == null)
-				Assert.fail("Null result from getSubscriptionResults operation");
-
-			ServiceInfos sInfos = result.getServiceList().getServiceInfos();
-			if (sInfos == null)
-				Assert.fail("No result from getSubscriptionResults operation");
-			List<ServiceInfo> siList = sInfos.getServiceInfo();
-			if (siList == null || siList.size() == 0)
-				Assert.fail("No result from getSubscriptionResults operation");
-			ServiceInfo siOut = siList.get(0);
-			
-			BusinessService bsIn = (BusinessService)EntityCreator.buildFromDoc(TckBusinessService.JOE_SERVICE_XML,
"org.uddi.api_v3");
-
-			assertEquals(bsIn.getServiceKey(), siOut.getServiceKey());
-			
-			TckValidator.checkNames(bsIn.getName(), siOut.getName());
-		}
-		catch(Exception e) {
-			logger.error(e.getMessage(), e);
-			Assert.fail("No exception should be thrown");		
-		}
-	}
-	
+		
 }
\ No newline at end of file

Added: webservices/juddi/branches/v3_trunk/uddi-tck/src/main/resources/uddi_data/subscription/subscription2.xml
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/uddi-tck/src/main/resources/uddi_data/subscription/subscription2.xml?rev=767758&view=auto
==============================================================================
--- webservices/juddi/branches/v3_trunk/uddi-tck/src/main/resources/uddi_data/subscription/subscription2.xml
(added)
+++ webservices/juddi/branches/v3_trunk/uddi-tck/src/main/resources/uddi_data/subscription/subscription2.xml
Thu Apr 23 02:01:05 2009
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright 2001-2009 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+-->
+<subscription xmlns="urn:uddi-org:sub_v3">
+  <subscriptionKey>uddi:www.samco.com:subscriptionone</subscriptionKey>
+  <subscriptionFilter>
+    <get_businessDetail xmlns="urn:uddi-org:api_v3">
+      <businessKey>uddi:www.samco.com:samco</businessKey>
+      <businessKey>uddi:www.this.key.doesnot.exist</businessKey>
+    </get_businessDetail>
+  </subscriptionFilter>
+  <bindingKey xmlns="urn:uddi-org:api_v3">bindingKeyOfTheClientsNotifySubscriptionListenerService</bindingKey>
+  <notificationInterval>P5D</notificationInterval>
+  <maxEntities>1000</maxEntities>
+</subscription>
\ No newline at end of file

Propchange: webservices/juddi/branches/v3_trunk/uddi-tck/src/main/resources/uddi_data/subscription/subscription2.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: webservices/juddi/branches/v3_trunk/uddi-tck/src/main/resources/uddi_data/subscription/subscriptionresults2.xml
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/uddi-tck/src/main/resources/uddi_data/subscription/subscriptionresults2.xml?rev=767758&view=auto
==============================================================================
--- webservices/juddi/branches/v3_trunk/uddi-tck/src/main/resources/uddi_data/subscription/subscriptionresults2.xml
(added)
+++ webservices/juddi/branches/v3_trunk/uddi-tck/src/main/resources/uddi_data/subscription/subscriptionresults2.xml
Thu Apr 23 02:01:05 2009
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright 2001-2009 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+-->
+<get_subscriptionResults xmlns="urn:uddi-org:sub_v3">
+  <subscriptionKey>uddi:www.samco.com:subscriptionone</subscriptionKey>
+  <coveragePeriod>
+    <startPoint>2009-01-01T00:00:00.000Z</startPoint>
+    <endPoint>2010-01-01T00:00:00.000Z</endPoint>
+  </coveragePeriod>
+</get_subscriptionResults>
\ No newline at end of file

Propchange: webservices/juddi/branches/v3_trunk/uddi-tck/src/main/resources/uddi_data/subscription/subscriptionresults2.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain



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


Mime
View raw message