juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ks...@apache.org
Subject svn commit: r1467686 [2/2] - in /juddi/trunk: juddi-core/src/main/java/org/apache/juddi/api/impl/ juddi-core/src/main/java/org/apache/juddi/query/ juddi-core/src/test/java/org/apache/juddi/api/impl/ uddi-tck-base/src/main/resources/uddi_data/tompublish...
Date Sat, 13 Apr 2013 20:02:28 GMT
Modified: juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_130_CombineCategoryBagsFindBusinessIntegrationTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_130_CombineCategoryBagsFindBusinessIntegrationTest.java?rev=1467686&r1=1467685&r2=1467686&view=diff
==============================================================================
--- juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_130_CombineCategoryBagsFindBusinessIntegrationTest.java
(original)
+++ juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_130_CombineCategoryBagsFindBusinessIntegrationTest.java
Sat Apr 13 20:02:27 2013
@@ -49,33 +49,33 @@ import org.uddi.v3_service.UDDISecurityP
  */
 public class UDDI_130_CombineCategoryBagsFindBusinessIntegrationTest 
 {
-    final static String TOM_PUBLISHER_TMODEL_XML      = "uddi_data/tompublisher/tModelKeyGen.xml";
-    final static String TOM_PUBLISHER_TMODEL01_XML 	  = "uddi_data/tompublisher/tModel01.xml";
-    final static String TOM_PUBLISHER_TMODEL02_XML 	  = "uddi_data/tompublisher/tModel02.xml";
-
-    final static String TOM_PUBLISHER_TMODEL_KEY      = "uddi:uddi.tompublisher.com:keygenerator";
-    final static String TOM_PUBLISHER_TMODEL01_KEY      = "uddi:uddi.tompublisher.com:tmodeltest01";
-    final static String TOM_PUBLISHER_TMODEL01_NAME 	= "tmodeltest01";
-    final static String TOM_PUBLISHER_TMODEL02_KEY      = "uddi:uddi.tompublisher.com:tmodeltest02";
-
-    final static String TOM_BUSINESS1_XML       = "uddi_data/tompublisher/juddi456-business3.xml";
-    final static String TOM_BUSINESS2_XML       = "uddi_data/tompublisher/juddi456-business4.xml";
-    
-    final static String TOM_BUSINESS1_KEY        = "uddi:uddi.tompublisher.com:businesstest03";
-    final static String TOM_BUSINESS2_KEY        = "uddi:uddi.tompublisher.com:businesstest04";
-
-    final static String BUSINESS_KEY = "uddi:uddi.tompublisher.com:businesstest04";
-        
-    private static Log logger = LogFactory.getLog(UDDI_040_BusinessServiceIntegrationTest.class);
-	
+	final static String TOM_PUBLISHER_TMODEL_XML      = "uddi_data/tompublisher/tModelKeyGen.xml";
+	final static String TOM_PUBLISHER_TMODEL01_XML 	  = "uddi_data/tompublisher/tModel01.xml";
+	final static String TOM_PUBLISHER_TMODEL02_XML 	  = "uddi_data/tompublisher/tModel02.xml";
+
+	final static String TOM_PUBLISHER_TMODEL_KEY      = "uddi:uddi.tompublisher.com:keygenerator";
+	final static String TOM_PUBLISHER_TMODEL01_KEY      = "uddi:uddi.tompublisher.com:tmodeltest01";
+	final static String TOM_PUBLISHER_TMODEL01_NAME 	= "tmodeltest01";
+	final static String TOM_PUBLISHER_TMODEL02_KEY      = "uddi:uddi.tompublisher.com:tmodeltest02";
+
+	final static String TOM_BUSINESS1_XML       = "uddi_data/tompublisher/juddi456-business3.xml";
+	final static String TOM_BUSINESS2_XML       = "uddi_data/tompublisher/juddi456-business4.xml";
+	final static String TOM_BUSINESS545_XML       = "uddi_data/tompublisher/juddi545-business.xml";
+
+	final static String TOM_BUSINESS1_KEY        = "uddi:uddi.tompublisher.com:businesstest03";
+	final static String TOM_BUSINESS2_KEY        = "uddi:uddi.tompublisher.com:businesstest04";
+	final static String TOM_BUSINESS545_KEY        = "uddi:uddi.tompublisher.com:businesstest545";
+
+	final static String BUSINESS_KEY    = "uddi:uddi.tompublisher.com:businesstest04";
+	final static String BUSINESS_KEY545 = "uddi:uddi.tompublisher.com:businesstest545";
+
+	private static Log logger = LogFactory.getLog(UDDI_040_BusinessServiceIntegrationTest.class);
+
 	protected static TckTModel tckTModel               = null;
-	protected static TckTModel tckTModel01             = null;
-	protected static TckTModel tckTModel02             = null;	
+	protected static TckBusiness tckBusiness           = null;
 	
-	protected static TckBusiness tckBusiness1          = null;
-	protected static TckBusiness tckBusiness2          = null;
 	protected static String authInfoJoe                = null;
-	
+
 	private static UDDIInquiryPortType inquiry = null;
 	private static UDDIClerkManager manager;
 
@@ -83,41 +83,101 @@ public class UDDI_130_CombineCategoryBag
 	public static void stopManager() throws ConfigurationException {
 		manager.stop();
 	}
-	
+
 	@BeforeClass
 	public static void startManager() throws ConfigurationException {
 		manager  = new UDDIClerkManager();
 		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();
-        	 inquiry = transport.getUDDIInquiryService();
-        	 
-        	 tckTModel  = new TckTModel(publication, inquiry);
-        	 tckTModel01 = new TckTModel(publication, inquiry);
-        	 tckTModel02 = new TckTModel(publication, inquiry);
-        	 tckBusiness1 = new TckBusiness(publication, inquiry);
-        	 tckBusiness2 = new TckBusiness(publication, inquiry); 
-	     } catch (Exception e) {
-	    	 logger.error(e.getMessage(), e);
-				Assert.fail("Could not obtain authInfo token.");
-	     } 
+			Transport transport = manager.getTransport();
+			UDDISecurityPortType security = transport.getUDDISecurityService();
+			authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(),  TckPublisher.getJoePassword());
+			Assert.assertNotNull(authInfoJoe);
+			UDDIPublicationPortType publication = transport.getUDDIPublishService();
+			inquiry = transport.getUDDIInquiryService();
+
+			tckTModel   = new TckTModel(publication, inquiry);
+			tckBusiness = new TckBusiness(publication, inquiry);
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+			Assert.fail("Could not obtain authInfo token.");
+		} 
+	}
+
+	@Test
+	public void findBusiness() {
+		try {
+			tckTModel.saveTModel(authInfoJoe, TOM_PUBLISHER_TMODEL_XML, TOM_PUBLISHER_TMODEL_KEY);
+			tckTModel.saveTModel(authInfoJoe, TOM_PUBLISHER_TMODEL01_XML, TOM_PUBLISHER_TMODEL01_KEY);
+			tckTModel.saveTModel(authInfoJoe, TOM_PUBLISHER_TMODEL02_XML, TOM_PUBLISHER_TMODEL02_KEY);
+
+			tckBusiness.saveBusiness(authInfoJoe, TOM_BUSINESS1_XML, TOM_BUSINESS1_KEY);
+			tckBusiness.saveBusiness(authInfoJoe, TOM_BUSINESS2_XML, TOM_BUSINESS2_KEY);
+			try {
+				int size = 0;
+				BusinessList bl = null;
+
+				FindBusiness fb = new FindBusiness();
+				FindQualifiers fqs = new FindQualifiers();
+				fqs.getFindQualifier().add("combineCategoryBags");
+				fb.setFindQualifiers(fqs);
+
+				KeyedReference keyRef1 = new KeyedReference();
+				keyRef1.setTModelKey(TOM_PUBLISHER_TMODEL01_KEY);
+				keyRef1.setKeyValue("value-z");
+
+				KeyedReference keyRef2 = new KeyedReference();
+				keyRef2.setTModelKey(TOM_PUBLISHER_TMODEL02_KEY);
+				keyRef2.setKeyValue("value-x");
+
+				CategoryBag cb = new CategoryBag();
+				cb.getKeyedReference().add(keyRef1);
+				cb.getKeyedReference().add(keyRef2);
+				fb.setCategoryBag(cb);
+
+				bl = inquiry.findBusiness(fb);
+				if (bl.getBusinessInfos() == null) {
+					Assert.fail("Should have found one entry on FindBusiness with TModelBag, "
+							+ "found " + size);
+				}
+				size = bl.getBusinessInfos().getBusinessInfo().size();
+				if (size != 1) {
+					Assert.fail("Should have found one entry on FindBusiness with TModelBag, "
+							+ "found " + size);
+				} else {
+					List<BusinessInfo> biList = bl.getBusinessInfos().getBusinessInfo();
+					String businessKey = biList.get(0).getBusinessKey();
+					if (!BUSINESS_KEY.equals(businessKey)) {
+						Assert.fail("Should have found business key " + BUSINESS_KEY
+								+ " but found [" + businessKey + "]");
+					}
+				}
+			} catch (Exception e) {
+				e.printStackTrace();
+				Assert.fail(e.getMessage());
+			}
+		} finally {
+			tckBusiness.deleteBusiness(authInfoJoe, TOM_BUSINESS1_XML, TOM_BUSINESS1_KEY);
+			tckBusiness.deleteBusiness(authInfoJoe, TOM_BUSINESS2_XML, TOM_BUSINESS2_KEY);
+
+			tckTModel.deleteTModel(authInfoJoe, TOM_PUBLISHER_TMODEL_XML, TOM_PUBLISHER_TMODEL_KEY);
+			tckTModel.deleteTModel(authInfoJoe, TOM_PUBLISHER_TMODEL01_XML, TOM_PUBLISHER_TMODEL01_KEY);
+			tckTModel.deleteTModel(authInfoJoe, TOM_PUBLISHER_TMODEL02_XML, TOM_PUBLISHER_TMODEL02_KEY);
+
+		}
 	}
 	
 	@Test
-	public void tompublisher() {
+	public void findBusinessJUDDI545() {
 		try {
 			tckTModel.saveTModel(authInfoJoe, TOM_PUBLISHER_TMODEL_XML, TOM_PUBLISHER_TMODEL_KEY);
-			tckTModel01.saveTModel(authInfoJoe, TOM_PUBLISHER_TMODEL01_XML, TOM_PUBLISHER_TMODEL01_KEY);
-			tckTModel02.saveTModel(authInfoJoe, TOM_PUBLISHER_TMODEL02_XML, TOM_PUBLISHER_TMODEL02_KEY);
+			tckTModel.saveTModel(authInfoJoe, TOM_PUBLISHER_TMODEL01_XML, TOM_PUBLISHER_TMODEL01_KEY);
+			tckTModel.saveTModel(authInfoJoe, TOM_PUBLISHER_TMODEL02_XML, TOM_PUBLISHER_TMODEL02_KEY);
+
+			tckBusiness.saveBusiness(authInfoJoe, TOM_BUSINESS545_XML, TOM_BUSINESS545_KEY);
 			
-			tckBusiness1.saveBusiness(authInfoJoe, TOM_BUSINESS1_XML, TOM_BUSINESS1_KEY);
-			tckBusiness2.saveBusiness(authInfoJoe, TOM_BUSINESS2_XML, TOM_BUSINESS2_KEY);
 			try {
 				int size = 0;
 				BusinessList bl = null;
@@ -127,34 +187,39 @@ public class UDDI_130_CombineCategoryBag
 				fqs.getFindQualifier().add("combineCategoryBags");
 				fb.setFindQualifiers(fqs);
 
-	                        KeyedReference keyRef1 = new KeyedReference();
-	                        keyRef1.setTModelKey(TOM_PUBLISHER_TMODEL01_KEY);
-	                        keyRef1.setKeyValue("value-z");
-	                        
-	                        KeyedReference keyRef2 = new KeyedReference();
-	                        keyRef2.setTModelKey(TOM_PUBLISHER_TMODEL02_KEY);
+				KeyedReference keyRef1 = new KeyedReference();
+				keyRef1.setTModelKey(TOM_PUBLISHER_TMODEL01_KEY);
+				keyRef1.setKeyValue("value-z");
+
+				KeyedReference keyRef2 = new KeyedReference();
+				keyRef2.setTModelKey(TOM_PUBLISHER_TMODEL02_KEY);
 				keyRef2.setKeyValue("value-x");
 				
+				KeyedReference keyRef3 = new KeyedReference();
+				keyRef3.setTModelKey(TOM_PUBLISHER_TMODEL01_KEY);
+				keyRef3.setKeyValue("value-y");
+
 				CategoryBag cb = new CategoryBag();
 				cb.getKeyedReference().add(keyRef1);
 				cb.getKeyedReference().add(keyRef2);
+				cb.getKeyedReference().add(keyRef3);
 				fb.setCategoryBag(cb);
-				
+
 				bl = inquiry.findBusiness(fb);
 				if (bl.getBusinessInfos() == null) {
-                                    Assert.fail("Should have found one entry on FindBusiness
with TModelBag, "
-                                            + "found " + size);
+					Assert.fail("Should have found one entry on FindBusiness with TModelBag, "
+							+ "found " + size);
 				}
 				size = bl.getBusinessInfos().getBusinessInfo().size();
 				if (size != 1) {
 					Assert.fail("Should have found one entry on FindBusiness with TModelBag, "
 							+ "found " + size);
 				} else {
-				        List<BusinessInfo> biList = bl.getBusinessInfos().getBusinessInfo();
+					List<BusinessInfo> biList = bl.getBusinessInfos().getBusinessInfo();
 					String businessKey = biList.get(0).getBusinessKey();
-					if (!BUSINESS_KEY.equals(businessKey)) {
-					    Assert.fail("Should have found business key " + BUSINESS_KEY
-					            + " but found [" + businessKey + "]");
+					if (!BUSINESS_KEY545.equals(businessKey)) {
+						Assert.fail("Should have found business key " + BUSINESS_KEY545
+								+ " but found [" + businessKey + "]");
 					}
 				}
 			} catch (Exception e) {
@@ -162,12 +227,11 @@ public class UDDI_130_CombineCategoryBag
 				Assert.fail(e.getMessage());
 			}
 		} finally {
-                        tckBusiness1.deleteBusiness(authInfoJoe, TOM_BUSINESS1_XML, TOM_BUSINESS1_KEY);
-                        tckBusiness2.deleteBusiness(authInfoJoe, TOM_BUSINESS2_XML, TOM_BUSINESS2_KEY);
-			
+			tckBusiness.deleteBusiness(authInfoJoe, TOM_BUSINESS545_XML, TOM_BUSINESS545_KEY);
+
 			tckTModel.deleteTModel(authInfoJoe, TOM_PUBLISHER_TMODEL_XML, TOM_PUBLISHER_TMODEL_KEY);
-			tckTModel01.deleteTModel(authInfoJoe, TOM_PUBLISHER_TMODEL01_XML, TOM_PUBLISHER_TMODEL01_KEY);
-			tckTModel02.deleteTModel(authInfoJoe, TOM_PUBLISHER_TMODEL02_XML, TOM_PUBLISHER_TMODEL02_KEY);
+			tckTModel.deleteTModel(authInfoJoe, TOM_PUBLISHER_TMODEL01_XML, TOM_PUBLISHER_TMODEL01_KEY);
+			tckTModel.deleteTModel(authInfoJoe, TOM_PUBLISHER_TMODEL02_XML, TOM_PUBLISHER_TMODEL02_KEY);
 
 		}
 	}	



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


Mime
View raw message