juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ks...@apache.org
Subject svn commit: r777692 - in /webservices/juddi/branches/v3_trunk: uddi-client/src/test/java/org/apache/juddi/client/ uddi-client/src/test/resources/ uddi-tck/src/main/java/org/uddi/api_v3/tck/
Date Fri, 22 May 2009 20:22:55 GMT
Author: kstam
Date: Fri May 22 20:22:54 2009
New Revision: 777692

URL: http://svn.apache.org/viewvc?rev=777692&view=rev
Log:
juddi-181 adding first load test. Adding Services loadtest

Added:
    webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_040_BusinessServiceLoadTest.java
Modified:
    webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_030_BusinessEntityLoadTest.java
    webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_040_BusinessServiceIntegrationTest.java
    webservices/juddi/branches/v3_trunk/uddi-client/src/test/resources/uddi.properties
    webservices/juddi/branches/v3_trunk/uddi-tck/src/main/java/org/uddi/api_v3/tck/TckBusiness.java
    webservices/juddi/branches/v3_trunk/uddi-tck/src/main/java/org/uddi/api_v3/tck/TckBusinessService.java

Modified: webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_030_BusinessEntityLoadTest.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_030_BusinessEntityLoadTest.java?rev=777692&r1=777691&r2=777692&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_030_BusinessEntityLoadTest.java
(original)
+++ webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_030_BusinessEntityLoadTest.java
Fri May 22 20:22:54 2009
@@ -33,11 +33,11 @@
 	public void testJoePublisherBusinessEntity() {
 		tckTModel.saveJoePublisherTmodel(authInfoJoe);
 		long startSave = System.currentTimeMillis();
-		tckBusiness.saveJoePublisherBusinesses(authInfoJoe, "", numberOfBusinesses);
+		tckBusiness.saveJoePublisherBusinesses(authInfoJoe, numberOfBusinesses);
 		long saveDuration = System.currentTimeMillis() - startSave;
 		System.out.println("Save " + numberOfBusinesses + " Joes Duration=" + saveDuration);
 		long startDelete = System.currentTimeMillis();
-		tckBusiness.deleteJoePublisherBusinesses(authInfoJoe, "", numberOfBusinesses);
+		tckBusiness.deleteJoePublisherBusinesses(authInfoJoe, numberOfBusinesses);
 		long deleteDuration = System.currentTimeMillis() - startDelete;
 	    System.out.println("Delete " + numberOfBusinesses + " Joes Duration= " + deleteDuration);
 	    tckTModel.deleteJoePublisherTmodel(authInfoJoe);
@@ -47,11 +47,11 @@
 	public void testSamSyndicatorBusiness() {
 		tckTModel.saveSamSyndicatorTmodel(authInfoSam);
 		long startSave = System.currentTimeMillis();
-		tckBusiness.saveSamSyndicatorBusinesses(authInfoSam, "", numberOfBusinesses);
+		tckBusiness.saveSamSyndicatorBusinesses(authInfoSam, numberOfBusinesses);
 		long saveDuration = System.currentTimeMillis() - startSave;
 		System.out.println("Save " + numberOfBusinesses + " Sams Duration=" + saveDuration);
 		long startDelete = System.currentTimeMillis();
-		tckBusiness.deleteSamSyndicatorBusinesses(authInfoSam, "", numberOfBusinesses);
+		tckBusiness.deleteSamSyndicatorBusinesses(authInfoSam, numberOfBusinesses);
 		long deleteDuration = System.currentTimeMillis() - startDelete;
 	    System.out.println("Delete " + numberOfBusinesses + " Sams Duration= " + deleteDuration);
 	    tckTModel.deleteSamSyndicatorTmodel(authInfoSam);

Modified: webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_040_BusinessServiceIntegrationTest.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_040_BusinessServiceIntegrationTest.java?rev=777692&r1=777691&r2=777692&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_040_BusinessServiceIntegrationTest.java
(original)
+++ webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_040_BusinessServiceIntegrationTest.java
Fri May 22 20:22:54 2009
@@ -40,12 +40,12 @@
 	 
     private static Logger logger                     = Logger.getLogger(UDDI_040_BusinessServiceIntegrationTest.class);
 	
-	private static TckTModel tckTModel               = null;
-	private static TckBusiness tckBusiness           = null;
-	private static TckBusinessService tckBusinessService  = null;
+	protected static TckTModel tckTModel               = null;
+	protected static TckBusiness tckBusiness           = null;
+	protected static TckBusinessService tckBusinessService  = null;
 	
-	private static String authInfoJoe                = null;
-	private static String authInfoSam                = null;
+	protected static String authInfoJoe                = null;
+	protected static String authInfoSam                = null;
 	
 	@BeforeClass
 	public static void setup() {

Added: webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_040_BusinessServiceLoadTest.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_040_BusinessServiceLoadTest.java?rev=777692&view=auto
==============================================================================
--- webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_040_BusinessServiceLoadTest.java
(added)
+++ webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_040_BusinessServiceLoadTest.java
Fri May 22 20:22:54 2009
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+package org.apache.juddi.client;
+
+import org.junit.Test;
+
+/**
+ * @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
+ */
+public class UDDI_040_BusinessServiceLoadTest extends UDDI_040_BusinessServiceIntegrationTest
+{	
+	int numberOfServices=1100;
+	@Test @Override
+	public void joepublisher() {
+		tckTModel.saveJoePublisherTmodel(authInfoJoe);
+		tckBusiness.saveJoePublisherBusiness(authInfoJoe);
+		long startSave = System.currentTimeMillis();
+		tckBusinessService.saveJoePublisherServices(authInfoJoe, numberOfServices);
+		long saveDuration = System.currentTimeMillis() - startSave;
+		System.out.println("Save " + numberOfServices + " Joes Services Duration=" + saveDuration);
+		long startDelete = System.currentTimeMillis();
+		tckBusinessService.deleteJoePublisherServices(authInfoJoe, numberOfServices);
+		long deleteDuration = System.currentTimeMillis() - startDelete;
+		System.out.println("Delete " + numberOfServices + " Joes Services Duration= " + deleteDuration);
+		tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
+		tckTModel.deleteJoePublisherTmodel(authInfoJoe);
+	}
+	
+	@Test @Override
+	public void samsyndicator() {
+		tckTModel.saveSamSyndicatorTmodel(authInfoSam);
+		tckBusiness.saveSamSyndicatorBusiness(authInfoSam);
+		long startSave = System.currentTimeMillis();
+		tckBusinessService.saveSamSyndicatorServices(authInfoSam, numberOfServices);
+		long saveDuration = System.currentTimeMillis() - startSave;
+		System.out.println("Save " + numberOfServices + " Sams Services Duration=" + saveDuration);
+		long startDelete = System.currentTimeMillis();
+		tckBusinessService.deleteSamSyndicatorServices(authInfoSam, numberOfServices);
+		long deleteDuration = System.currentTimeMillis() - startDelete;
+		System.out.println("Delete " + numberOfServices + " Sams Services Duration= " + deleteDuration);
+		tckBusiness.deleteSamSyndicatorBusiness(authInfoSam);
+		tckTModel.deleteSamSyndicatorTmodel(authInfoSam);
+	}
+	
+}

Modified: webservices/juddi/branches/v3_trunk/uddi-client/src/test/resources/uddi.properties
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/uddi-client/src/test/resources/uddi.properties?rev=777692&r1=777691&r2=777692&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/uddi-client/src/test/resources/uddi.properties (original)
+++ webservices/juddi/branches/v3_trunk/uddi-client/src/test/resources/uddi.properties Fri
May 22 20:22:54 2009
@@ -1,9 +1,9 @@
-uddi.custody.transfer.url =http://localhost:8880/juddi/services/custody-transfer?wsdl
-uddi.inquiry.url          =http://localhost:8880/juddi/services/inquiry?wsdl
-uddi.publish.url          =http://localhost:8880/juddi/services/publish?wsdl
-uddi.security.url         =http://localhost:8880/juddi/services/security?wsdl
-uddi.subscription.url     =http://localhost:8880/juddi/services/subscription?wsdl
-uddi.subscription.listener.url =http://localhost:8880/juddi/services/subscription-listener?wsdl
+uddi.custody.transfer.url =http://localhost:8080/juddi/services/custody-transfer?wsdl
+uddi.inquiry.url          =http://localhost:8080/juddi/services/inquiry?wsdl
+uddi.publish.url          =http://localhost:8080/juddi/services/publish?wsdl
+uddi.security.url         =http://localhost:8080/juddi/services/security?wsdl
+uddi.subscription.url     =http://localhost:8080/juddi/services/subscription?wsdl
+uddi.subscription.listener.url =http://localhost:8080/juddi/services/subscription-listener?wsdl
 
 uddi.proxy.transport           =org.uddi.api_v3.client.transport.JAXWSTransport
 #only used by RMITransport

Modified: webservices/juddi/branches/v3_trunk/uddi-tck/src/main/java/org/uddi/api_v3/tck/TckBusiness.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/uddi-tck/src/main/java/org/uddi/api_v3/tck/TckBusiness.java?rev=777692&r1=777691&r2=777692&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/uddi-tck/src/main/java/org/uddi/api_v3/tck/TckBusiness.java
(original)
+++ webservices/juddi/branches/v3_trunk/uddi-tck/src/main/java/org/uddi/api_v3/tck/TckBusiness.java
Fri May 22 20:22:54 2009
@@ -53,32 +53,32 @@
 		saveBusiness(authInfoSam, SAM_BUSINESS_XML, SAM_BUSINESS_KEY);
 	}
 
-	public void saveSamSyndicatorBusinesses(String authInfoSam, String keyPostFix, int numberOfCopies)
{
-		saveBusinesses(authInfoSam, SAM_BUSINESS_XML, SAM_BUSINESS_KEY+keyPostFix, numberOfCopies);
+	public void saveSamSyndicatorBusinesses(String authInfoSam, int numberOfCopies) {
+		saveBusinesses(authInfoSam, SAM_BUSINESS_XML, SAM_BUSINESS_KEY, numberOfCopies);
 	}
 	
 	public void deleteSamSyndicatorBusiness(String authInfoSam) {
 		deleteBusiness(authInfoSam, SAM_BUSINESS_XML, SAM_BUSINESS_KEY);
 	}
 	
-	public void deleteSamSyndicatorBusinesses(String authInfoSam, String keyPostFix, int numberOfCopies)
{
-		deleteBusinesses(authInfoSam, SAM_BUSINESS_XML, SAM_BUSINESS_KEY+keyPostFix, numberOfCopies);
+	public void deleteSamSyndicatorBusinesses(String authInfoSam, int numberOfCopies) {
+		deleteBusinesses(authInfoSam, SAM_BUSINESS_XML, SAM_BUSINESS_KEY, numberOfCopies);
 	}
 	
 	public void saveJoePublisherBusiness(String authInfoJoe) {
 		saveBusiness(authInfoJoe, JOE_BUSINESS_XML, JOE_BUSINESS_KEY);
     }
 	
-	public void saveJoePublisherBusinesses(String authInfoJoe, String keyPostFix, int numberOfCopies)
{
-    	saveBusinesses(authInfoJoe, JOE_BUSINESS_XML, JOE_BUSINESS_KEY+keyPostFix, numberOfCopies);
+	public void saveJoePublisherBusinesses(String authInfoJoe, int numberOfCopies) {
+    	saveBusinesses(authInfoJoe, JOE_BUSINESS_XML, JOE_BUSINESS_KEY, numberOfCopies);
     }
     
 	public void deleteJoePublisherBusiness(String authInfoJoe) {
     	deleteBusiness(authInfoJoe, JOE_BUSINESS_XML, JOE_BUSINESS_KEY);
     }
 	
-	public void deleteJoePublisherBusinesses(String authInfoJoe, String keyPostFix, int numberOfCopies)
{
-    	deleteBusinesses(authInfoJoe, JOE_BUSINESS_XML, JOE_BUSINESS_KEY+keyPostFix, numberOfCopies);
+	public void deleteJoePublisherBusinesses(String authInfoJoe, int numberOfCopies) {
+    	deleteBusinesses(authInfoJoe, JOE_BUSINESS_XML, JOE_BUSINESS_KEY, numberOfCopies);
     }
 	 
 	private void saveBusinesses(String authInfo, String businessXML, String businessKey, int
numberOfCopies) {

Modified: webservices/juddi/branches/v3_trunk/uddi-tck/src/main/java/org/uddi/api_v3/tck/TckBusinessService.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/uddi-tck/src/main/java/org/uddi/api_v3/tck/TckBusinessService.java?rev=777692&r1=777691&r2=777692&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/uddi-tck/src/main/java/org/uddi/api_v3/tck/TckBusinessService.java
(original)
+++ webservices/juddi/branches/v3_trunk/uddi-tck/src/main/java/org/uddi/api_v3/tck/TckBusinessService.java
Fri May 22 20:22:54 2009
@@ -53,18 +53,58 @@
 		saveService(authInfoJoe, JOE_SERVICE_XML, JOE_SERVICE_KEY);
 	}
 	
+	public void saveJoePublisherServices(String authInfoJoe, int numberOfCopies) {
+		saveServices(authInfoJoe, JOE_SERVICE_XML, JOE_SERVICE_KEY, numberOfCopies);
+	}
+	
 	public void deleteJoePublisherService(String authInfoJoe) {
 		deleteService(authInfoJoe, JOE_SERVICE_KEY);
 	}
 	
+	public void deleteJoePublisherServices(String authInfoJoe, int numberOfCopies) {
+		deleteServices(authInfoJoe, JOE_SERVICE_KEY, numberOfCopies);
+	}
+	
 	public void saveSamSyndicatorService(String authInfoSam) {
 		saveService(authInfoSam, SAM_SERVICE_XML, SAM_SERVICE_KEY);
 	}
 	
+	public void saveSamSyndicatorServices(String authInfoSam, int numberOfCopies) {
+		saveServices(authInfoSam, SAM_SERVICE_XML, SAM_SERVICE_KEY, numberOfCopies);
+	}
+	
 	public void deleteSamSyndicatorService(String authInfoSam) {
 		deleteService(authInfoSam, SAM_SERVICE_KEY);
 	}
 	
+	public void deleteSamSyndicatorServices(String authInfoSam, int numberOfCopies) {
+		deleteServices(authInfoSam, SAM_SERVICE_KEY, numberOfCopies);
+	}
+	
+	private void saveServices(String authInfo, String serviceXML, String serviceKey, int numberOfCopies)
{
+		try {
+			org.uddi.api_v3.BusinessService bsIn = (org.uddi.api_v3.BusinessService)EntityCreator.buildFromDoc(serviceXML,
"org.uddi.api_v3");
+			String serviceName = bsIn.getName().get(0).getValue();
+			String bindingKey = bsIn.getBindingTemplates().getBindingTemplate().get(0).getBindingKey();
+			for (int i=0; i<numberOfCopies; i++) {
+			    // save the entity
+				SaveService ss = new SaveService();
+				ss.setAuthInfo(authInfo);
+				bsIn.getName().get(0).setValue(serviceName + "-" + i);
+				
+				bsIn.setServiceKey(serviceKey + "-" + i);
+				bsIn.getBindingTemplates().getBindingTemplate().get(0).setBindingKey(bindingKey + "-"
+ i);
+				ss.getBusinessService().add(bsIn);
+				publication.saveService(ss);
+				logger.debug("Add service with key " + bsIn.getServiceKey());
+			}
+		}
+		catch(Exception e) {
+			logger.error(e.getMessage(), e);
+			Assert.fail("No exception should be thrown.");
+		}
+	}
+	
 	
 	private void saveService(String authInfo, String serviceXML, String serviceKey) {
 		try {
@@ -111,5 +151,23 @@
 			Assert.fail("No exception should be thrown.");
 		}
 	}
+	
+	private void deleteServices(String authInfo, String serviceKey, int numberOfCopies) {
+		try {
+			for (int i=0; i<numberOfCopies; i++) {
+				// Delete the entity and make sure it is removed
+				DeleteService ds = new DeleteService();
+				ds.setAuthInfo(authInfo);
+				
+				ds.getServiceKey().add(serviceKey + "-" + i);
+				publication.deleteService(ds);
+				logger.debug("Deleted Service with key " + serviceKey + "-" + i);
+			}
+		}
+		catch(Exception e) {
+			logger.error(e.getMessage(), e);
+			Assert.fail("No exception should be thrown.");
+		}
+	}
 
 }
\ No newline at end of file



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