This project has retired. For details please refer to its Attic page.
UDDI_040_BusinessServiceLoadIntegrationTest xref
View Javadoc
1   /*
2    * Copyright 2001-2009 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *      http://www.apache.org/licenses/LICENSE-2.0
8    * 
9    * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */
15  package org.apache.juddi.v3.tck;
16  
17  import org.apache.juddi.v3.client.UDDIConstants;
18  import org.junit.Assert;
19  import org.junit.Assume;
20  import org.junit.Test;
21  import org.uddi.api_v3.FindQualifiers;
22  import org.uddi.api_v3.FindService;
23  import org.uddi.api_v3.Name;
24  
25  /**
26   * @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
27   * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
28   */
29  public class UDDI_040_BusinessServiceLoadIntegrationTest extends UDDI_040_BusinessServiceIntegrationTest
30  {	
31  	int numberOfServices=1100;
32  	@Test @Override
33  	public void joepublisher() throws Exception{
34            Assume.assumeTrue(TckPublisher.isEnabled());
35                  logger.info("UDDI_040_BusinessServiceLoadIntegrationTest joepublisher Servoce Load test " + numberOfServices);
36                  Assume.assumeTrue(TckPublisher.isLoadTest());
37                  numberOfServices = TckPublisher.getMaxLoadServices();
38  		tckTModelJoe.saveJoePublisherTmodel(authInfoJoe);
39  		tckBusinessJoe.saveJoePublisherBusiness(authInfoJoe);
40  		long startSave = System.currentTimeMillis();
41  		tckBusinessServiceJoe.saveJoePublisherServices(authInfoJoe, 0, numberOfServices);
42  		long saveDuration = System.currentTimeMillis() - startSave;
43  		logger.info("****************** Save " + numberOfServices + " Joes Services Duration=" + saveDuration);
44  		
45                  long startFind=System.currentTimeMillis();
46                  FindService fs = new FindService();
47                  fs.setAuthInfo(authInfoJoe);
48                  fs.getName().add(new Name(UDDIConstants.WILDCARD, null));
49                  fs.setFindQualifiers(new FindQualifiers());
50                  fs.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
51                  inquiryJoe.findService(fs);
52                  long endFind = System.currentTimeMillis() - startFind;
53                  logger.info("****************** Find " + numberOfServices + " Joes Services Duration= " + endFind);
54                  
55                  long startDelete = System.currentTimeMillis();
56  		tckBusinessServiceJoe.deleteJoePublisherServices(authInfoJoe, 0, numberOfServices);
57  		long deleteDuration = System.currentTimeMillis() - startDelete;
58  		logger.info("****************** Delete " + numberOfServices + " Joes Services Duration= " + deleteDuration);
59  		tckBusinessJoe.deleteJoePublisherBusiness(authInfoJoe);
60  		tckTModelJoe.deleteJoePublisherTmodel(authInfoJoe);
61                  
62                  Assert.assertTrue("That took way too long at " + endFind, endFind < (5*60*1000));
63  	}
64  	
65  	@Test @Override
66  	public void samsyndicator() throws Exception {
67            Assume.assumeTrue(TckPublisher.isEnabled());
68                  Assume.assumeTrue(TckPublisher.isLoadTest());
69                  logger.info("UDDI_040_BusinessServiceLoadIntegrationTest samsyndicator Servoce Load test " + numberOfServices);
70                  numberOfServices = TckPublisher.getMaxLoadServices();
71  		tckTModelSam.saveSamSyndicatorTmodel(authInfoSam);
72  		tckBusinessSam.saveSamSyndicatorBusiness(authInfoSam);
73  		long startSave = System.currentTimeMillis();
74  		tckBusinessServiceSam.saveSamSyndicatorServices(authInfoSam, 0, numberOfServices);
75  		long saveDuration = System.currentTimeMillis() - startSave;
76  		logger.info("****************** Save " + numberOfServices + " Sams Services Duration=" + saveDuration);
77                  
78                  long startFind=System.currentTimeMillis();
79                  FindService fs = new FindService();
80                  fs.setAuthInfo(authInfoSam);
81                  fs.getName().add(new Name(UDDIConstants.WILDCARD, null));
82                  fs.setFindQualifiers(new FindQualifiers());
83                  fs.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
84                  inquirySam.findService(fs);
85                  long endFind = System.currentTimeMillis() - startFind;
86                  logger.info("****************** Find " + numberOfServices + " Sams Services Duration= " + endFind);
87                  
88  		long startDelete = System.currentTimeMillis();
89  		tckBusinessServiceSam.deleteSamSyndicatorServices(authInfoSam, 0, numberOfServices);
90  		long deleteDuration = System.currentTimeMillis() - startDelete;
91  		logger.info("****************** Delete " + numberOfServices + " Sams Services Duration= " + deleteDuration);
92  		tckBusinessSam.deleteSamSyndicatorBusiness(authInfoSam);
93  		tckTModelSam.deleteSamSyndicatorTmodel(authInfoSam);
94                  Assert.assertTrue("That took way too long at " + endFind, endFind < (5*60*1000));
95  	}
96  	
97  }