juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfa...@apache.org
Subject svn commit: r763852 - in /webservices/juddi/branches/v3_trunk: juddi-core/src/test/java/org/apache/juddi/api/impl/API_080_SubscriptionTest.java uddi-client/src/test/java/org/apache/juddi/client/UDDI_080_SubscriptionTest.java
Date Fri, 10 Apr 2009 01:17:14 GMT
Author: jfaath
Date: Fri Apr 10 01:17:13 2009
New Revision: 763852

URL: http://svn.apache.org/viewvc?rev=763852&view=rev
Log:
creating direct and client tests for saving/deleting subscriptions

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

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=763852&r1=763851&r2=763852&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
Fri Apr 10 01:17:13 2009
@@ -18,33 +18,62 @@
 import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.uddi.api_v3.tck.TckBindingTemplate;
 import org.uddi.api_v3.tck.TckBusiness;
+import org.uddi.api_v3.tck.TckBusinessService;
 import org.uddi.api_v3.tck.TckPublisher;
-import org.uddi.api_v3.tck.TckPublisherAssertion;
 import org.uddi.api_v3.tck.TckSecurity;
-import org.uddi.api_v3.tck.TckSubscriber;
+import org.uddi.api_v3.tck.TckSubscription;
 import org.uddi.api_v3.tck.TckTModel;
 import org.uddi.v3_service.DispositionReportFaultMessage;
-import org.uddi.v3_service.UDDISecurityPortType;
 
 /**
- * @author <a href="mailto:tcunningh@apache.org">Tom Cunningham</a>
+ * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
  * @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
  */
 public class API_080_SubscriptionTest 
 {
-	private TckSubscriber tckSubscriber = new TckSubscriber(new UDDISubscriptionImpl(), new
UDDISecurityImpl());
-	private static Logger logger = Logger.getLogger(API_060_PublisherAssertionTest.class);
-	
-	private static API_080_SubscriptionTest api010  = new API_080_SubscriptionTest();
+	private static Logger logger = Logger.getLogger(API_080_SubscriptionTest.class);
 
-	@Test
-	public void saveSubscriber() {
-		tckSubscriber.saveSubscription();
+	private static API_010_PublisherTest api010 = new API_010_PublisherTest();
+	private static TckTModel tckTModel = new TckTModel(new UDDIPublicationImpl(), new UDDIInquiryImpl());
+	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 String authInfoJoe = null;
+	
+	@BeforeClass
+	public static void setup() {
+		logger.debug("Getting auth token..");
+		try {
+			api010.saveJoePublisher();
+			authInfoJoe = TckSecurity.getAuthToken(new UDDISecurityImpl(), TckPublisher.JOE_PUBLISHER_ID,
 TckPublisher.JOE_PUBLISHER_CRED);
+		} catch (DispositionReportFaultMessage e) {
+			logger.error(e.getMessage(), e);
+			Assert.fail("Could not obtain authInfo token.");
+		}
 	}
 
+	
 	@Test
-	public void deleteSubscriber() {
-		tckSubscriber.deleteSubscription();
+	public void joePublisher() {
+		try {
+			tckTModel.saveJoePublisherTmodel(authInfoJoe);
+			tckBusiness.saveJoePublisherBusiness(authInfoJoe);
+			tckBusinessService.saveJoePublisherService(authInfoJoe);
+			tckBindingTemplate.saveJoePublisherBinding(authInfoJoe);
+			tckSubscription.saveJoePublisherSubscription(authInfoJoe);
+		} 
+		finally {
+			tckSubscription.deleteJoePublisherSubscription(authInfoJoe);
+			tckBindingTemplate.deleteJoePublisherBinding(authInfoJoe);
+			tckBusinessService.deleteJoePublisherService(authInfoJoe);
+			tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
+			tckTModel.deleteJoePublisherTmodel(authInfoJoe);
+		}
+		
 	}
+
 }

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=763852&r1=763851&r2=763852&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
Fri Apr 10 01:17:13 2009
@@ -18,36 +18,61 @@
 import org.apache.log4j.helpers.Loader;
 import org.junit.Assert;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.uddi.api_v3.client.config.ClientConfig;
 import org.uddi.api_v3.client.config.Property;
 import org.uddi.api_v3.client.transport.Transport;
-import org.uddi.api_v3.tck.TckSubscriber;
+import org.uddi.api_v3.tck.TckBindingTemplate;
+import org.uddi.api_v3.tck.TckBusiness;
+import org.uddi.api_v3.tck.TckBusinessService;
+import org.uddi.api_v3.tck.TckPublisher;
+import org.uddi.api_v3.tck.TckSecurity;
+import org.uddi.api_v3.tck.TckSubscription;
+import org.uddi.api_v3.tck.TckTModel;
+import org.uddi.v3_service.UDDIInquiryPortType;
+import org.uddi.v3_service.UDDIPublicationPortType;
 import org.uddi.v3_service.UDDISecurityPortType;
 import org.uddi.v3_service.UDDISubscriptionPortType;
 
 /**
- * @author <a href="mailto:tcunningh@apache.org">Tom Cunningham</a>
+ * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
  * @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
  */
 public class UDDI_080_SubscriptionTest 
 {
 	private static Logger logger = Logger.getLogger(UDDI_080_SubscriptionTest.class);
-	private static TckSubscriber tckSubscriber = null;
-	
+
+	private static TckTModel tckTModel                    = null;
+	private static TckBusiness tckBusiness                = null;
+	private static TckBusinessService tckBusinessService  = null;
+	private static TckBindingTemplate tckBindingTemplate  = null;
+	private static TckSubscription tckSubscription = null;
+
+	private static String authInfoJoe = null;
+
 	@BeforeClass
 	public static void setup() {
 		logger.debug("Getting subscriber proxy..");
 		try {
-	    	 String clazz = ClientConfig.getConfiguration().getString(Property.UDDI_PROXY_TRANSPORT,Property.DEFAULT_UDDI_PROXY_TRANSPORT);
+	    	 String clazz = ClientConfig.getConfiguration().getString(Property.UDDI_PROXY_TRANSPORT,
Property.DEFAULT_UDDI_PROXY_TRANSPORT);
 	         Class<?> transportClass = Loader.loadClass(clazz);
 	         if (transportClass!=null) {
 	        	 Transport transport = (Transport) transportClass.newInstance();
 	        	 
 	        	 UDDISecurityPortType security = transport.getSecurityService();
-	        	 UDDISubscriptionPortType subscriber = transport.getSubscriptionService();
-	        	 tckSubscriber = new TckSubscriber(subscriber, security);
+	        	 authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.JOE_PUBLISHER_ID,
TckPublisher.JOE_PUBLISHER_CRED);
+	        	 Assert.assertNotNull(authInfoJoe);
+	        	 
+	        	 UDDIPublicationPortType publication = transport.getPublishService();
+	        	 UDDIInquiryPortType inquiry = transport.getInquiryService();
+	        	 UDDISubscriptionPortType subscription = transport.getSubscriptionService();
+
+	        	 tckTModel  = new TckTModel(publication, inquiry);
+	        	 tckBusiness = new TckBusiness(publication, inquiry);
+	        	 tckBusinessService = new TckBusinessService(publication, inquiry);
+	        	 tckBindingTemplate = new TckBindingTemplate(publication, inquiry);
+
+	        	 tckSubscription = new TckSubscription(subscription, security);
 	         } else {
 	        	 Assert.fail();
 	         }
@@ -57,13 +82,22 @@
 	     } 
 	}
 	
-	@Test 
-	public void saveSubscription() {
-		tckSubscriber.saveSubscription();
-	}
-
 	@Test
-	public void deleteSubscription() {
-		tckSubscriber.deleteSubscription();
+	public void joePublisher() {
+		try {
+			tckTModel.saveJoePublisherTmodel(authInfoJoe);
+			tckBusiness.saveJoePublisherBusiness(authInfoJoe);
+			tckBusinessService.saveJoePublisherService(authInfoJoe);
+			tckBindingTemplate.saveJoePublisherBinding(authInfoJoe);
+			tckSubscription.saveJoePublisherSubscription(authInfoJoe);
+		} 
+		finally {
+			tckSubscription.deleteJoePublisherSubscription(authInfoJoe);
+			tckBindingTemplate.deleteJoePublisherBinding(authInfoJoe);
+			tckBusinessService.deleteJoePublisherService(authInfoJoe);
+			tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
+			tckTModel.deleteJoePublisherTmodel(authInfoJoe);
+		}
 	}
+
 }



---------------------------------------------------------------------
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