juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexo...@apache.org
Subject svn commit: r1555648 [7/13] - in /juddi/trunk: ./ docs/examples/auth/ juddi-client/src/main/java/org/apache/juddi/v3/client/config/ juddi-core-openjpa/ juddi-core/src/main/java/org/apache/juddi/api/impl/ juddi-core/src/main/java/org/apache/juddi/subscr...
Date Mon, 06 Jan 2014 02:18:39 GMT
Added: juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_040_BusinessServiceLoadIntegrationTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_040_BusinessServiceLoadIntegrationTest.java?rev=1555648&view=auto
==============================================================================
--- juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_040_BusinessServiceLoadIntegrationTest.java
(added)
+++ juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_040_BusinessServiceLoadIntegrationTest.java
Mon Jan  6 02:18:37 2014
@@ -0,0 +1,95 @@
+/*
+ * 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.v3.tck;
+
+import org.apache.juddi.v3.client.UDDIConstants;
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.Test;
+import org.uddi.api_v3.FindQualifiers;
+import org.uddi.api_v3.FindService;
+import org.uddi.api_v3.Name;
+
+/**
+ * @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
+ * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
+ */
+public class UDDI_040_BusinessServiceLoadIntegrationTest extends UDDI_040_BusinessServiceIntegrationTest
+{	
+	int numberOfServices=1100;
+	@Test @Override
+	public void joepublisher() throws Exception{
+                logger.info("UDDI_040_BusinessServiceLoadIntegrationTest joepublisher Servoce
Load test " + numberOfServices);
+                Assume.assumeTrue(TckPublisher.isLoadTest());
+                numberOfServices = TckPublisher.getMaxLoadServices();
+		tckTModelJoe.saveJoePublisherTmodel(authInfoJoe);
+		tckBusinessJoe.saveJoePublisherBusiness(authInfoJoe);
+		long startSave = System.currentTimeMillis();
+		tckBusinessServiceJoe.saveJoePublisherServices(authInfoJoe, 0, numberOfServices);
+		long saveDuration = System.currentTimeMillis() - startSave;
+		logger.info("****************** Save " + numberOfServices + " Joes Services Duration="
+ saveDuration);
+		
+                long startFind=System.currentTimeMillis();
+                FindService fs = new FindService();
+                fs.setAuthInfo(authInfoJoe);
+                fs.getName().add(new Name(UDDIConstants.WILDCARD, null));
+                fs.setFindQualifiers(new FindQualifiers());
+                fs.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
+                inquiryJoe.findService(fs);
+                long endFind = System.currentTimeMillis() - startFind;
+                logger.info("****************** Find " + numberOfServices + " Joes Services
Duration= " + endFind);
+                
+                long startDelete = System.currentTimeMillis();
+		tckBusinessServiceJoe.deleteJoePublisherServices(authInfoJoe, 0, numberOfServices);
+		long deleteDuration = System.currentTimeMillis() - startDelete;
+		logger.info("****************** Delete " + numberOfServices + " Joes Services Duration=
" + deleteDuration);
+		tckBusinessJoe.deleteJoePublisherBusiness(authInfoJoe);
+		tckTModelJoe.deleteJoePublisherTmodel(authInfoJoe);
+                
+                Assert.assertTrue("That took way too long at " + endFind, endFind < (5*60*1000));
+	}
+	
+	@Test @Override
+	public void samsyndicator() throws Exception {
+                Assume.assumeTrue(TckPublisher.isLoadTest());
+                logger.info("UDDI_040_BusinessServiceLoadIntegrationTest samsyndicator Servoce
Load test " + numberOfServices);
+                numberOfServices = TckPublisher.getMaxLoadServices();
+		tckTModelSam.saveSamSyndicatorTmodel(authInfoSam);
+		tckBusinessSam.saveSamSyndicatorBusiness(authInfoSam);
+		long startSave = System.currentTimeMillis();
+		tckBusinessServiceSam.saveSamSyndicatorServices(authInfoSam, 0, numberOfServices);
+		long saveDuration = System.currentTimeMillis() - startSave;
+		logger.info("****************** Save " + numberOfServices + " Sams Services Duration="
+ saveDuration);
+                
+                long startFind=System.currentTimeMillis();
+                FindService fs = new FindService();
+                fs.setAuthInfo(authInfoSam);
+                fs.getName().add(new Name(UDDIConstants.WILDCARD, null));
+                fs.setFindQualifiers(new FindQualifiers());
+                fs.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
+                inquirySam.findService(fs);
+                long endFind = System.currentTimeMillis() - startFind;
+                logger.info("****************** Find " + numberOfServices + " Sams Services
Duration= " + endFind);
+                
+		long startDelete = System.currentTimeMillis();
+		tckBusinessServiceSam.deleteSamSyndicatorServices(authInfoSam, 0, numberOfServices);
+		long deleteDuration = System.currentTimeMillis() - startDelete;
+		logger.info("****************** Delete " + numberOfServices + " Sams Services Duration=
" + deleteDuration);
+		tckBusinessSam.deleteSamSyndicatorBusiness(authInfoSam);
+		tckTModelSam.deleteSamSyndicatorTmodel(authInfoSam);
+                Assert.assertTrue("That took way too long at " + endFind, endFind < (5*60*1000));
+	}
+	
+}

Modified: juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_050_BindingTemplateIntegrationTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_050_BindingTemplateIntegrationTest.java?rev=1555648&r1=1555647&r2=1555648&view=diff
==============================================================================
--- juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_050_BindingTemplateIntegrationTest.java
(original)
+++ juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_050_BindingTemplateIntegrationTest.java
Mon Jan  6 02:18:37 2014
@@ -14,6 +14,7 @@
  */
 package org.apache.juddi.v3.tck;
 
+import javax.xml.ws.BindingProvider;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -30,91 +31,111 @@ import org.uddi.v3_service.UDDISecurityP
 /**
  * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
  * @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
+ * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
  */
-public class UDDI_050_BindingTemplateIntegrationTest 
-{
-	private static Log logger = LogFactory.getLog(UDDI_050_BindingTemplateIntegrationTest.class);
-	
-	private static TckTModel tckTModel                    = null;
-	private static TckBusiness tckBusiness                = null;
-	private static TckBusinessService tckBusinessService  = null;
-	private static TckBindingTemplate tckBindingTemplate  = null;
-	private static TckFindEntity tckFindEntity            = null;
-	private static String authInfoJoe                     = null;
-    private static UDDIClient manager;
-	
-	@AfterClass
-	public static void stopManager() throws ConfigurationException {
-		manager.stop();
-	}
-	
-	@BeforeClass
-	public static void startManager() throws ConfigurationException {
-		manager  = new UDDIClient();
-		manager.start();
-		
-		logger.debug("Getting auth tokens..");
-		try {
-			 Transport transport = manager.getTransport();
-        	 UDDISecurityPortType security = transport.getUDDISecurityService();
-        	 authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(),
 TckPublisher.getJoePassword());
-        	 Assert.assertNotNull(authInfoJoe);
-        	 
-        	 UDDIPublicationPortType publication = transport.getUDDIPublishService();
-        	 UDDIInquiryPortType inquiry = transport.getUDDIInquiryService();
-        	 tckTModel  = new TckTModel(publication, inquiry);
-        	 tckBusiness = new TckBusiness(publication, inquiry);
-        	 tckBusinessService = new TckBusinessService(publication, inquiry);
-        	 tckBindingTemplate = new TckBindingTemplate(publication, inquiry);
-        	 tckFindEntity      = new TckFindEntity(inquiry);
- 			 String authInfoUDDI  = TckSecurity.getAuthToken(security, TckPublisher.getUDDIPublisherId(),
 TckPublisher.getUDDIPassword());
- 			 tckTModel.saveUDDIPublisherTmodel(authInfoUDDI);
- 			 tckTModel.saveTModels(authInfoUDDI, TckTModel.TMODELS_XML);
-	     } catch (Exception e) {
-	    	 logger.error(e.getMessage(), e);
-				Assert.fail("Could not obtain authInfo token.");
-	     } 
-	}
-	
-	@Test
-	public void joepublisher() {
-		try {
-			tckTModel.saveJoePublisherTmodel(authInfoJoe);
-			tckBusiness.saveJoePublisherBusiness(authInfoJoe);
-			tckBusinessService.saveJoePublisherService(authInfoJoe);
-			tckBindingTemplate.saveJoePublisherBinding(authInfoJoe);
-			tckBindingTemplate.deleteJoePublisherBinding(authInfoJoe);
-		} finally {
-			tckBusinessService.deleteJoePublisherService(authInfoJoe);
-			tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
-			tckTModel.deleteJoePublisherTmodel(authInfoJoe);
-		}
-	}
-	
-	@Test
-	public void findService() {
-		try {
-			tckTModel.saveJoePublisherTmodel(authInfoJoe);
-			tckBusiness.saveJoePublisherBusiness(authInfoJoe);
-			tckBusinessService.saveJoePublisherService(authInfoJoe);
-			tckBindingTemplate.saveJoePublisherBinding(authInfoJoe);
-			tckBindingTemplate.deleteBinding(authInfoJoe, "uddi:uddi.joepublisher.com:bindingone");
-			String serviceKey = tckFindEntity.findService(null);
-			tckFindEntity.findServiceDetail(serviceKey);
-			
-			tckBindingTemplate.saveJoePublisherBinding(authInfoJoe);
-			
-			serviceKey = tckFindEntity.findService(null);
-			tckFindEntity.findServiceDetail(serviceKey);
-			
-			tckBindingTemplate.deleteJoePublisherBinding(authInfoJoe);
-			
-			tckFindEntity.findService(null);
-			tckFindEntity.findServiceDetail(serviceKey);
-		} finally {
-			tckBusinessService.deleteJoePublisherService(authInfoJoe);
-			tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
-			tckTModel.deleteJoePublisherTmodel(authInfoJoe);
-		}
-	}
+public class UDDI_050_BindingTemplateIntegrationTest {
+
+        private static Log logger = LogFactory.getLog(UDDI_050_BindingTemplateIntegrationTest.class);
+        private static TckTModel tckTModel = null;
+        private static TckBusiness tckBusiness = null;
+        private static TckBusinessService tckBusinessService = null;
+        private static TckBindingTemplate tckBindingTemplate = null;
+        private static TckFindEntity tckFindEntity = null;
+        private static String authInfoJoe = null;
+        private static UDDIClient manager;
+
+        @AfterClass
+        public static void stopManager() throws ConfigurationException {
+                tckTModel.deleteCreatedTModels(authInfoJoe);
+                
+                manager.stop();
+        }
+
+        @BeforeClass
+        public static void startManager() throws ConfigurationException {
+                manager = new UDDIClient();
+                manager.start();
+
+                logger.debug("Getting auth tokens..");
+                try {
+                        Transport transport = manager.getTransport();
+                        UDDISecurityPortType security = transport.getUDDISecurityService();
+                        UDDIPublicationPortType publication = transport.getUDDIPublishService();
+                        UDDIInquiryPortType inquiry = transport.getUDDIInquiryService();
+                        authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(),
TckPublisher.getJoePassword());
+                        //Assert.assertNotNull(authInfoJoe);
+                        if (!TckPublisher.isUDDIAuthMode()) {
+                                TckSecurity.setCredentials((BindingProvider) publication,
TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
+                                TckSecurity.setCredentials((BindingProvider) inquiry, TckPublisher.getJoePublisherId(),
TckPublisher.getJoePassword());
+                        }
+
+
+                        tckTModel = new TckTModel(publication, inquiry);
+                        tckBusiness = new TckBusiness(publication, inquiry);
+                        tckBusinessService = new TckBusinessService(publication, inquiry);
+                        tckBindingTemplate = new TckBindingTemplate(publication, inquiry);
+                        tckFindEntity = new TckFindEntity(inquiry);
+
+
+                        transport = manager.getTransport();
+                        security = transport.getUDDISecurityService();
+                        publication = transport.getUDDIPublishService();
+                        inquiry = transport.getUDDIInquiryService();
+                        String authInfoUDDI = TckSecurity.getAuthToken(security, TckPublisher.getUDDIPublisherId(),
TckPublisher.getUDDIPassword());
+                        //Assert.assertNotNull(authInfoJoe);
+                        if (!TckPublisher.isUDDIAuthMode()) {
+                                TckSecurity.setCredentials((BindingProvider) publication,
TckPublisher.getUDDIPublisherId(), TckPublisher.getUDDIPassword());
+                                TckSecurity.setCredentials((BindingProvider) inquiry, TckPublisher.getUDDIPublisherId(),
TckPublisher.getUDDIPassword());
+                        }
+
+
+                        tckTModel.saveUDDIPublisherTmodel(authInfoUDDI);
+                        tckTModel.saveTModels(authInfoUDDI, TckTModel.TMODELS_XML);
+                } catch (Exception e) {
+                        logger.error(e.getMessage(), e);
+                        Assert.fail("Could not obtain authInfo token.");
+                }
+        }
+
+        @Test
+        public void joepublisher() {
+                try {
+                        tckTModel.saveJoePublisherTmodel(authInfoJoe);
+                        tckBusiness.saveJoePublisherBusiness(authInfoJoe);
+                        tckBusinessService.saveJoePublisherService(authInfoJoe);
+                        tckBindingTemplate.saveJoePublisherBinding(authInfoJoe);
+                        tckBindingTemplate.deleteJoePublisherBinding(authInfoJoe);
+                } finally {
+                        tckBusinessService.deleteJoePublisherService(authInfoJoe);
+                        tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
+                        tckTModel.deleteJoePublisherTmodel(authInfoJoe);
+                }
+        }
+
+        @Test
+        public void findService() {
+                try {
+                        tckTModel.saveJoePublisherTmodel(authInfoJoe);
+                        tckBusiness.saveJoePublisherBusiness(authInfoJoe);
+                        tckBusinessService.saveJoePublisherService(authInfoJoe);
+                        tckBindingTemplate.saveJoePublisherBinding(authInfoJoe);
+                        tckBindingTemplate.deleteBinding(authInfoJoe, "uddi:uddi.joepublisher.com:bindingone");
+                        String serviceKey = tckFindEntity.findService(null);
+                        tckFindEntity.findServiceDetail(serviceKey);
+
+                        tckBindingTemplate.saveJoePublisherBinding(authInfoJoe);
+
+                        serviceKey = tckFindEntity.findService(null);
+                        tckFindEntity.findServiceDetail(serviceKey);
+
+                        tckBindingTemplate.deleteJoePublisherBinding(authInfoJoe);
+
+                        tckFindEntity.findService(null);
+                        tckFindEntity.findServiceDetail(serviceKey);
+                } finally {
+                        tckBusinessService.deleteJoePublisherService(authInfoJoe);
+                        tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
+                        tckTModel.deleteJoePublisherTmodel(authInfoJoe);
+                }
+        }
 }

Modified: juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_060_PublisherAssertionIntegrationTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_060_PublisherAssertionIntegrationTest.java?rev=1555648&r1=1555647&r2=1555648&view=diff
==============================================================================
--- juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_060_PublisherAssertionIntegrationTest.java
(original)
+++ juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_060_PublisherAssertionIntegrationTest.java
Mon Jan  6 02:18:37 2014
@@ -17,7 +17,9 @@ package org.apache.juddi.v3.tck;
 /**
  * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
  * @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
+ * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
  */
+import javax.xml.ws.BindingProvider;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -32,131 +34,169 @@ import org.uddi.v3_service.UDDIPublicati
 import org.uddi.v3_service.UDDISecurityPortType;
 
 public class UDDI_060_PublisherAssertionIntegrationTest {
-	
-	private static Log logger = LogFactory.getLog(UDDI_060_PublisherAssertionIntegrationTest.class);
-    
-	private static TckTModel tckTModel                = null;
-	private static TckBusiness tckBusiness            = null;
-	private static TckPublisherAssertion tckAssertion = null;
-	private static TckFindEntity tckFindEntity        = null;
-	private static String authInfoJoe                 = null;
-	private static String authInfoSam                 = null;
-	private static String authInfoMary                = null;
-	
-    private static UDDIClient manager;
-	
-	@AfterClass
-	public static void stopManager() throws ConfigurationException {
-		manager.stop();
-	}
-	
-	@BeforeClass
-	public static void startManager() throws ConfigurationException {
-		manager  = new UDDIClient();
-		manager.start();
-		
-		logger.debug("Getting auth tokens..");
-		try {
-			 Transport transport = manager.getTransport();
-        	 UDDISecurityPortType security = transport.getUDDISecurityService();
-        	 authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(),
 TckPublisher.getJoePassword());
-        	 authInfoSam = TckSecurity.getAuthToken(security, TckPublisher.getSamPublisherId(),
 TckPublisher.getSamPassword());
-        	 authInfoMary = TckSecurity.getAuthToken(security, TckPublisher.getMaryPublisherId(),
 TckPublisher.getMaryPassword());
-        	 Assert.assertNotNull(authInfoJoe);
-        	 
-        	 UDDIPublicationPortType publication = transport.getUDDIPublishService();
-        	 UDDIInquiryPortType inquiry = transport.getUDDIInquiryService();
-        	 tckTModel  = new TckTModel(publication, inquiry);
-        	 tckBusiness = new TckBusiness(publication, inquiry);
-        	 tckAssertion = new TckPublisherAssertion(publication);
-        	 tckFindEntity = new TckFindEntity(inquiry);
-        	  
-	     } catch (Exception e) {
-	    	 logger.error(e.getMessage(), e);
-				Assert.fail("Could not obtain authInfo token.");
-	     } 
-	}
-	
-	@Test
-	public void testJoepublisherToSamSyndicator() {
-		try {
-			tckTModel.saveJoePublisherTmodel(authInfoJoe);
-			tckTModel.saveSamSyndicatorTmodel(authInfoSam);
-			tckBusiness.saveJoePublisherBusiness(authInfoJoe);
-			tckBusiness.saveSamSyndicatorBusiness(authInfoSam);
-			tckAssertion.saveJoePublisherPublisherAssertion(authInfoJoe);
-			tckAssertion.deleteJoePublisherPublisherAssertion(authInfoJoe);
-		} finally {
-			tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
-			tckBusiness.deleteSamSyndicatorBusiness(authInfoSam);
-			tckTModel.deleteJoePublisherTmodel(authInfoJoe);
-			tckTModel.deleteSamSyndicatorTmodel(authInfoSam);
-		}
-	}
-	
-	/**
-	 * This test should find no publisher assertions because we only save them
-	 * from the joe publisher side.
-	 */
-	@Test
-	public void testFindNoAssertions() {
-		try {
-			tckTModel.saveJoePublisherTmodel(authInfoJoe);
-			tckTModel.saveSamSyndicatorTmodel(authInfoSam);
-			tckTModel.saveMaryPublisherTmodel(authInfoMary);
-			tckBusiness.saveJoePublisherBusiness(authInfoJoe);
-			tckBusiness.saveSamSyndicatorBusiness(authInfoSam);
-			tckBusiness.saveMaryPublisherBusiness(authInfoMary);
-			tckAssertion.saveJoePublisherPublisherAssertion(authInfoJoe);
-			tckAssertion.saveJoePublisherPublisherAssertion2(authInfoJoe);
-			
-			tckFindEntity.findRelatedBusiness_sortByName(true);
-			tckFindEntity.findRelatedBusinessToKey(true);
-			tckFindEntity.findRelatedBusinessFromKey(true);
-			
-			tckAssertion.deleteJoePublisherPublisherAssertion(authInfoJoe);
-			tckAssertion.deleteJoePublisherPublisherAssertion2(authInfoJoe);
-		} finally {
-			tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
-			tckBusiness.deleteMaryPublisherBusiness(authInfoMary);
-			tckBusiness.deleteSamSyndicatorBusiness(authInfoSam);
-			tckTModel.deleteJoePublisherTmodel(authInfoJoe);
-			tckTModel.deleteSamSyndicatorTmodel(authInfoSam);
-			tckTModel.deleteMaryPublisherTmodel(authInfoMary);
-		}
-	}
-	
-	/**
-	 * This test should find 2 publisher assertions.
-	 */
-	@Test
-	public void testFindAssertions() {
-		try {
-			tckTModel.saveJoePublisherTmodel(authInfoJoe);
-			tckTModel.saveSamSyndicatorTmodel(authInfoSam);
-			tckTModel.saveMaryPublisherTmodel(authInfoMary);
-			tckBusiness.saveJoePublisherBusiness(authInfoJoe);
-			tckBusiness.saveSamSyndicatorBusiness(authInfoSam);
-			tckBusiness.saveMaryPublisherBusiness(authInfoMary);
-			tckAssertion.saveJoePublisherPublisherAssertion(authInfoJoe);
-			tckAssertion.saveJoePublisherPublisherAssertion2(authInfoJoe);
-			tckAssertion.saveSamPublisherPublisherAssertion(authInfoSam);
-			tckAssertion.saveMaryPublisherPublisherAssertion(authInfoMary);
-			
-			tckFindEntity.findRelatedBusiness_sortByName(false);
-			tckFindEntity.findRelatedBusinessToKey(false);
-			tckFindEntity.findRelatedBusinessFromKey(false);
-			
-			tckAssertion.deleteJoePublisherPublisherAssertion(authInfoJoe);
-			tckAssertion.deleteJoePublisherPublisherAssertion2(authInfoJoe);
-			
-		} finally {
-			tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
-			tckBusiness.deleteMaryPublisherBusiness(authInfoMary);
-			tckBusiness.deleteSamSyndicatorBusiness(authInfoSam);
-			tckTModel.deleteJoePublisherTmodel(authInfoJoe);
-			tckTModel.deleteSamSyndicatorTmodel(authInfoSam);
-			tckTModel.deleteMaryPublisherTmodel(authInfoMary);
-		}
-	}
+
+        private static Log logger = LogFactory.getLog(UDDI_060_PublisherAssertionIntegrationTest.class);
+        private static TckTModel tckTModelJoe = null;
+        private static TckBusiness tckBusinessJoe = null;
+        private static TckPublisherAssertion tckAssertionJoe = null;
+        private static TckFindEntity tckFindEntityJoe = null;
+        private static TckTModel tckTModelSam = null;
+        private static TckBusiness tckBusinessSam = null;
+        private static TckPublisherAssertion tckAssertionSam = null;
+        private static TckFindEntity tckFindEntitySam = null;
+        private static TckTModel tckTModelMary = null;
+        private static TckBusiness tckBusinessMary = null;
+        private static TckPublisherAssertion tckAssertionMary = null;
+        private static TckFindEntity tckFindEntityMary = null;
+        private static String authInfoJoe = null;
+        private static String authInfoSam = null;
+        private static String authInfoMary = null;
+        private static UDDIClient manager;
+
+        @AfterClass
+        public static void stopManager() throws ConfigurationException {
+                tckTModelJoe.deleteCreatedTModels(authInfoJoe);
+                tckTModelSam.deleteCreatedTModels(authInfoSam);
+                tckTModelMary.deleteCreatedTModels(authInfoMary);
+                manager.stop();
+        }
+
+        @BeforeClass
+        public static void startManager() throws ConfigurationException {
+                manager = new UDDIClient();
+                manager.start();
+
+                logger.debug("Getting auth tokens..");
+                try {
+                        Transport transport = manager.getTransport();
+                        UDDISecurityPortType security = transport.getUDDISecurityService();
+                        authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(),
TckPublisher.getJoePassword());
+                        authInfoSam = TckSecurity.getAuthToken(security, TckPublisher.getSamPublisherId(),
TckPublisher.getSamPassword());
+                        authInfoMary = TckSecurity.getAuthToken(security, TckPublisher.getMaryPublisherId(),
TckPublisher.getMaryPassword());
+                        //Assert.assertNotNull(authInfoJoe);
+
+                        UDDIPublicationPortType publication = transport.getUDDIPublishService();
+                        UDDIInquiryPortType inquiry = transport.getUDDIInquiryService();
+                        if (!TckPublisher.isUDDIAuthMode()) {
+                                TckSecurity.setCredentials((BindingProvider) publication,
TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
+                                TckSecurity.setCredentials((BindingProvider) inquiry, TckPublisher.getJoePublisherId(),
TckPublisher.getJoePassword());
+                        }
+                        tckTModelJoe = new TckTModel(publication, inquiry);
+                        tckBusinessJoe = new TckBusiness(publication, inquiry);
+                        tckAssertionJoe = new TckPublisherAssertion(publication);
+                        tckFindEntityJoe = new TckFindEntity(inquiry);
+
+                        transport = manager.getTransport();
+                        publication = transport.getUDDIPublishService();
+                        inquiry = transport.getUDDIInquiryService();
+                        if (!TckPublisher.isUDDIAuthMode()) {
+                                TckSecurity.setCredentials((BindingProvider) publication,
TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
+                                TckSecurity.setCredentials((BindingProvider) inquiry, TckPublisher.getSamPublisherId(),
TckPublisher.getSamPassword());
+                        }
+                        tckTModelSam = new TckTModel(publication, inquiry);
+                        tckBusinessSam = new TckBusiness(publication, inquiry);
+                        tckAssertionSam = new TckPublisherAssertion(publication);
+                        tckFindEntitySam = new TckFindEntity(inquiry);
+                        
+                        
+                        transport = manager.getTransport();
+                        publication = transport.getUDDIPublishService();
+                        inquiry = transport.getUDDIInquiryService();
+                        if (!TckPublisher.isUDDIAuthMode()) {
+                                TckSecurity.setCredentials((BindingProvider) publication,
TckPublisher.getMaryPublisherId(), TckPublisher.getMaryPassword());
+                                TckSecurity.setCredentials((BindingProvider) inquiry, TckPublisher.getMaryPublisherId(),
TckPublisher.getMaryPassword());
+                        }
+                        tckTModelMary = new TckTModel(publication, inquiry);
+                        tckBusinessMary = new TckBusiness(publication, inquiry);
+                        tckAssertionMary = new TckPublisherAssertion(publication);
+                        tckFindEntityMary = new TckFindEntity(inquiry);
+
+                } catch (Exception e) {
+                        logger.error(e.getMessage(), e);
+                        Assert.fail("Could not obtain authInfo token.");
+                }
+        }
+
+        @Test
+        public void testJoepublisherToSamSyndicator() {
+                try {
+                        tckTModelJoe.saveJoePublisherTmodel(authInfoJoe);
+                        tckTModelSam.saveSamSyndicatorTmodel(authInfoSam);
+                        tckBusinessJoe.saveJoePublisherBusiness(authInfoJoe);
+                        tckBusinessSam.saveSamSyndicatorBusiness(authInfoSam);
+                        tckAssertionJoe.saveJoePublisherPublisherAssertion(authInfoJoe);
+                        tckAssertionJoe.deleteJoePublisherPublisherAssertion(authInfoJoe);
+                } finally {
+                        tckBusinessJoe.deleteJoePublisherBusiness(authInfoJoe);
+                        tckBusinessSam.deleteSamSyndicatorBusiness(authInfoSam);
+                        tckTModelJoe.deleteJoePublisherTmodel(authInfoJoe);
+                        tckTModelSam.deleteSamSyndicatorTmodel(authInfoSam);
+                }
+        }
+
+        /**
+         * This test should find no publisher assertions because we only save
+         * them from the joe publisher side.
+         */
+        @Test
+        public void testFindNoAssertions() {
+                try {
+                        tckTModelJoe.saveJoePublisherTmodel(authInfoJoe);
+                        tckTModelSam.saveSamSyndicatorTmodel(authInfoSam);
+                        tckTModelMary.saveMaryPublisherTmodel(authInfoMary);
+                        tckBusinessJoe.saveJoePublisherBusiness(authInfoJoe);
+                        tckBusinessSam.saveSamSyndicatorBusiness(authInfoSam);
+                        tckBusinessMary.saveMaryPublisherBusiness(authInfoMary);
+                        tckAssertionJoe.saveJoePublisherPublisherAssertion(authInfoJoe);
+                        tckAssertionJoe.saveJoePublisherPublisherAssertion2(authInfoJoe);
+
+                        tckFindEntityJoe.findRelatedBusiness_sortByName(true);
+                        tckFindEntityJoe.findRelatedBusinessToKey(true);
+                        tckFindEntityJoe.findRelatedBusinessFromKey(true);
+
+                        tckAssertionJoe.deleteJoePublisherPublisherAssertion(authInfoJoe);
+                        tckAssertionJoe.deleteJoePublisherPublisherAssertion2(authInfoJoe);
+                } finally {
+                        tckBusinessJoe.deleteJoePublisherBusiness(authInfoJoe);
+                        tckBusinessMary.deleteMaryPublisherBusiness(authInfoMary);
+                        tckBusinessSam.deleteSamSyndicatorBusiness(authInfoSam);
+                        tckTModelJoe.deleteJoePublisherTmodel(authInfoJoe);
+                        tckTModelSam.deleteSamSyndicatorTmodel(authInfoSam);
+                        tckTModelMary.deleteMaryPublisherTmodel(authInfoMary);
+                }
+        }
+
+        /**
+         * This test should find 2 publisher assertions.
+         */
+        @Test
+        public void testFindAssertions() {
+                try {
+                        tckTModelJoe.saveJoePublisherTmodel(authInfoJoe);
+                        tckTModelSam.saveSamSyndicatorTmodel(authInfoSam);
+                        tckTModelMary.saveMaryPublisherTmodel(authInfoMary);
+                        tckBusinessJoe.saveJoePublisherBusiness(authInfoJoe);
+                        tckBusinessSam.saveSamSyndicatorBusiness(authInfoSam);
+                        tckBusinessMary.saveMaryPublisherBusiness(authInfoMary);
+                        tckAssertionJoe.saveJoePublisherPublisherAssertion(authInfoJoe);
+                        tckAssertionSam.saveJoePublisherPublisherAssertion2(authInfoJoe);
+                        tckAssertionSam.saveSamPublisherPublisherAssertion(authInfoSam);
+                        tckAssertionMary.saveMaryPublisherPublisherAssertion(authInfoMary);
+
+                        tckFindEntityJoe.findRelatedBusiness_sortByName(false);
+                        tckFindEntityJoe.findRelatedBusinessToKey(false);
+                        tckFindEntityJoe.findRelatedBusinessFromKey(false);
+
+                        tckAssertionJoe.deleteJoePublisherPublisherAssertion(authInfoJoe);
+                        tckAssertionJoe.deleteJoePublisherPublisherAssertion2(authInfoJoe);
+
+                } finally {
+                        tckBusinessJoe.deleteJoePublisherBusiness(authInfoJoe);
+                        tckBusinessMary.deleteMaryPublisherBusiness(authInfoMary);
+                        tckBusinessSam.deleteSamSyndicatorBusiness(authInfoSam);
+                        tckTModelJoe.deleteJoePublisherTmodel(authInfoJoe);
+                        tckTModelSam.deleteSamSyndicatorTmodel(authInfoSam);
+                        tckTModelMary.deleteMaryPublisherTmodel(authInfoMary);
+                }
+        }
 }

Modified: juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_070_FindEntityIntegrationTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_070_FindEntityIntegrationTest.java?rev=1555648&r1=1555647&r2=1555648&view=diff
==============================================================================
--- juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_070_FindEntityIntegrationTest.java
(original)
+++ juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_070_FindEntityIntegrationTest.java
Mon Jan  6 02:18:37 2014
@@ -14,6 +14,7 @@
  */
 package org.apache.juddi.v3.tck;
 
+import javax.xml.ws.BindingProvider;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -31,100 +32,106 @@ import org.uddi.v3_service.UDDISecurityP
 /**
  * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
  * @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
+ * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
  */
-public class UDDI_070_FindEntityIntegrationTest 
-{
-  
-	private static Log logger = LogFactory.getLog(UDDI_070_FindEntityIntegrationTest.class);
-	
-	private static TckTModel tckTModel                    = null;
-	private static TckBusiness tckBusiness                = null;
-	private static TckBusinessService tckBusinessService  = null;
-	private static TckBindingTemplate tckBindingTemplate  = null;
-	private static TckFindEntity tckFindEntity            = null;
-	private static String authInfoJoe                     = null;
-    private static UDDIClient manager;
-	
-	@AfterClass
-	public static void stopManager() throws ConfigurationException {
-		manager.stop();
-	}
-	
-	@BeforeClass
-	public static void startManager() throws ConfigurationException {
-		manager  = new UDDIClient();
-		manager.start();
-		
-		logger.debug("Getting auth tokens..");
-		try {
-			 Transport transport = manager.getTransport();
-        	 UDDISecurityPortType security = transport.getUDDISecurityService();
-        	 authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(),
 TckPublisher.getJoePassword());
-        	 Assert.assertNotNull(authInfoJoe);
-        	 
-        	 UDDIPublicationPortType publication = transport.getUDDIPublishService();
-        	 UDDIInquiryPortType inquiry = transport.getUDDIInquiryService();
-        	 tckTModel  = new TckTModel(publication, inquiry);
-        	 tckBusiness = new TckBusiness(publication, inquiry);
-        	 tckBusinessService = new TckBusinessService(publication, inquiry);
-        	 tckBindingTemplate = new TckBindingTemplate(publication, inquiry);
-        	 tckFindEntity = new TckFindEntity(inquiry);
-	         
-	     } catch (Exception e) {
-	    	 logger.error(e.getMessage(), e);
-				Assert.fail("Could not obtain authInfo token.");
-	     } 
-	}
-	
-	@Test
-	public void findEntities() {
-		try {
-			tckTModel.saveJoePublisherTmodel(authInfoJoe);
-			tckBusiness.saveJoePublisherBusiness(authInfoJoe);
-			tckBusinessService.saveJoePublisherService(authInfoJoe);
-			tckBindingTemplate.saveJoePublisherBinding(authInfoJoe);
-			tckFindEntity.findBusiness();
-			tckFindEntity.findService(null);
-			tckFindEntity.findBinding(null);
-			tckFindEntity.findTModel(null);
-			tckFindEntity.getNonExitingBusiness();
-		} catch (Exception e) {
-			e.printStackTrace();
-			Assert.fail();
-		} catch (Throwable t) {
-			t.printStackTrace();
-			Assert.fail();
-		} finally {
-			tckBindingTemplate.deleteJoePublisherBinding(authInfoJoe);
-			tckBusinessService.deleteJoePublisherService(authInfoJoe);
-			tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
-			tckTModel.deleteJoePublisherTmodel(authInfoJoe);
-		}
-	}
-
-	@Test
-	public void findSignedEntities() {
-		try {
-			tckTModel.saveJoePublisherTmodel(authInfoJoe);
-			tckBusiness.saveJoePublisherBusinessX509Signature(authInfoJoe);
-			tckBusinessService.saveJoePublisherService(authInfoJoe);
-			tckBindingTemplate.saveJoePublisherBinding(authInfoJoe);
-			
-			tckFindEntity.findAllSignedBusiness();
-			tckFindEntity.findService(UDDIConstants.SIGNATURE_PRESENT);
-			tckFindEntity.findBinding(UDDIConstants.SIGNATURE_PRESENT);
-			//tckFindEntity.findTModel(UDDIConstants.SIGNATURE_PRESENT);
-			
-			tckFindEntity.findAllBusiness();
-			tckFindEntity.getNonExitingBusiness();
-		} finally {
-			tckBindingTemplate.deleteJoePublisherBinding(authInfoJoe);
-			tckBusinessService.deleteJoePublisherService(authInfoJoe);
-			tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
-			tckTModel.deleteJoePublisherTmodel(authInfoJoe);
-		}
-		
-	}
-	
+public class UDDI_070_FindEntityIntegrationTest {
 
+        private static Log logger = LogFactory.getLog(UDDI_070_FindEntityIntegrationTest.class);
+        private static TckTModel tckTModel = null;
+        private static TckBusiness tckBusiness = null;
+        private static TckBusinessService tckBusinessService = null;
+        private static TckBindingTemplate tckBindingTemplate = null;
+        private static TckFindEntity tckFindEntity = null;
+        private static String authInfoJoe = null;
+        private static UDDIClient manager;
+
+        @AfterClass
+        public static void stopManager() throws ConfigurationException {
+                tckTModel.deleteCreatedTModels(authInfoJoe);
+                manager.stop();
+        }
+
+        @BeforeClass
+        public static void startManager() throws ConfigurationException {
+                manager = new UDDIClient();
+                manager.start();
+
+                logger.debug("Getting auth tokens..");
+                try {
+                        Transport transport = manager.getTransport();
+                        UDDISecurityPortType security = transport.getUDDISecurityService();
+                        authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(),
TckPublisher.getJoePassword());
+                        //Assert.assertNotNull(authInfoJoe);
+                        
+
+                        UDDIPublicationPortType publication = transport.getUDDIPublishService();
+                        UDDIInquiryPortType inquiry = transport.getUDDIInquiryService();
+                        
+                        if (!TckPublisher.isUDDIAuthMode()) {
+                                TckSecurity.setCredentials((BindingProvider) publication,
TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
+                                TckSecurity.setCredentials((BindingProvider) inquiry, TckPublisher.getJoePublisherId(),
TckPublisher.getJoePassword());
+                        }
+                        
+                        
+                        tckTModel = new TckTModel(publication, inquiry);
+                        tckBusiness = new TckBusiness(publication, inquiry);
+                        tckBusinessService = new TckBusinessService(publication, inquiry);
+                        tckBindingTemplate = new TckBindingTemplate(publication, inquiry);
+                        tckFindEntity = new TckFindEntity(inquiry);
+
+                } catch (Exception e) {
+                        logger.error(e.getMessage(), e);
+                        Assert.fail("Could not obtain authInfo token.");
+                }
+        }
+
+        @Test
+        public void findEntities() {
+                try {
+                        tckTModel.saveJoePublisherTmodel(authInfoJoe, true);
+                        tckBusiness.saveJoePublisherBusiness(authInfoJoe);
+                        tckBusinessService.saveJoePublisherService(authInfoJoe);
+                        tckBindingTemplate.saveJoePublisherBinding(authInfoJoe);
+                        tckFindEntity.findBusiness();
+                        tckFindEntity.findService(null);
+                        tckFindEntity.findBinding(null);
+                        tckFindEntity.findTModel(null);
+                        tckFindEntity.getNonExitingBusiness();
+                } catch (Exception e) {
+                        e.printStackTrace();
+                        Assert.fail();
+                } catch (Throwable t) {
+                        t.printStackTrace();
+                        Assert.fail();
+                } finally {
+                        tckBindingTemplate.deleteJoePublisherBinding(authInfoJoe);
+                        tckBusinessService.deleteJoePublisherService(authInfoJoe);
+                        tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
+                        tckTModel.deleteJoePublisherTmodel(authInfoJoe);
+                }
+        }
+
+        @Test
+        public void findSignedEntities() {
+                try {
+                        tckTModel.saveJoePublisherTmodel(authInfoJoe);
+                        tckBusiness.saveJoePublisherBusinessX509Signature(authInfoJoe);
+                        tckBusinessService.saveJoePublisherService(authInfoJoe);
+                        tckBindingTemplate.saveJoePublisherBinding(authInfoJoe);
+
+                        tckFindEntity.findAllSignedBusiness();
+                        tckFindEntity.findService(UDDIConstants.SIGNATURE_PRESENT);
+                        tckFindEntity.findBinding(UDDIConstants.SIGNATURE_PRESENT);
+                        //tckFindEntity.findTModel(UDDIConstants.SIGNATURE_PRESENT);
+
+                        tckFindEntity.findAllBusiness();
+                        tckFindEntity.getNonExitingBusiness();
+                } finally {
+                        tckBindingTemplate.deleteJoePublisherBinding(authInfoJoe);
+                        tckBusinessService.deleteJoePublisherService(authInfoJoe);
+                        tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
+                        tckTModel.deleteJoePublisherTmodel(authInfoJoe);
+                }
+
+        }
 }



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


Mime
View raw message