ws-scout-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ks...@apache.org
Subject svn commit: r742195 - in /webservices/scout/trunk: jaxr-api/src/main/java/javax/xml/registry/infomodel/ scout/src/main/java/org/apache/ws/scout/registry/infomodel/ scout/src/main/java/org/apache/ws/scout/util/ scout/src/test/java/org/apache/ws/scout/re...
Date Sun, 08 Feb 2009 22:59:05 GMT
Author: kstam
Date: Sun Feb  8 22:59:04 2009
New Revision: 742195

URL: http://svn.apache.org/viewvc?rev=742195&view=rev
Log:
SCOUT-67 fixing classcast exception, adding ExternalLinks, instead of ExternalIdentifier.
Adding more generics types to some Collections to prevent these types of bugs.

Modified:
    webservices/scout/trunk/jaxr-api/src/main/java/javax/xml/registry/infomodel/ServiceBinding.java
    webservices/scout/trunk/jaxr-api/src/main/java/javax/xml/registry/infomodel/User.java
    webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/registry/infomodel/RegistryObjectImpl.java
    webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/util/ScoutJaxrUddiHelper.java
    webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/util/ScoutUddiJaxrHelper.java
    webservices/scout/trunk/scout/src/test/java/org/apache/ws/scout/registry/qa/JAXR050ServiceBindingTest.java

Modified: webservices/scout/trunk/jaxr-api/src/main/java/javax/xml/registry/infomodel/ServiceBinding.java
URL: http://svn.apache.org/viewvc/webservices/scout/trunk/jaxr-api/src/main/java/javax/xml/registry/infomodel/ServiceBinding.java?rev=742195&r1=742194&r2=742195&view=diff
==============================================================================
--- webservices/scout/trunk/jaxr-api/src/main/java/javax/xml/registry/infomodel/ServiceBinding.java
(original)
+++ webservices/scout/trunk/jaxr-api/src/main/java/javax/xml/registry/infomodel/ServiceBinding.java
Sun Feb  8 22:59:04 2009
@@ -32,13 +32,13 @@
 public interface ServiceBinding extends RegistryObject, URIValidator {
     void addSpecificationLink(SpecificationLink specificationLink) throws JAXRException;
 
-    void addSpecificationLinks(Collection specificationLinks) throws JAXRException;
+    void addSpecificationLinks(Collection<SpecificationLink> specificationLinks) throws
JAXRException;
 
     String getAccessURI() throws JAXRException;
 
     Service getService() throws JAXRException;
 
-    Collection getSpecificationLinks() throws JAXRException;
+    Collection<SpecificationLink> getSpecificationLinks() throws JAXRException;
 
     ServiceBinding getTargetBinding() throws JAXRException;
 

Modified: webservices/scout/trunk/jaxr-api/src/main/java/javax/xml/registry/infomodel/User.java
URL: http://svn.apache.org/viewvc/webservices/scout/trunk/jaxr-api/src/main/java/javax/xml/registry/infomodel/User.java?rev=742195&r1=742194&r2=742195&view=diff
==============================================================================
--- webservices/scout/trunk/jaxr-api/src/main/java/javax/xml/registry/infomodel/User.java
(original)
+++ webservices/scout/trunk/jaxr-api/src/main/java/javax/xml/registry/infomodel/User.java
Sun Feb  8 22:59:04 2009
@@ -31,25 +31,25 @@
  * @version $Revision$ $Date$
  */
 public interface User extends RegistryObject {
-    Collection getEmailAddresses() throws JAXRException;
+    Collection<EmailAddress> getEmailAddresses() throws JAXRException;
 
     Organization getOrganization() throws JAXRException;
 
     PersonName getPersonName() throws JAXRException;
 
-    Collection getPostalAddresses() throws JAXRException;
+    Collection<PostalAddress> getPostalAddresses() throws JAXRException;
 
-    Collection getTelephoneNumbers(String phoneType) throws JAXRException;
+    Collection<TelephoneNumber> getTelephoneNumbers(String phoneType) throws JAXRException;
 
     String getType() throws JAXRException;
 
     URL getUrl() throws JAXRException;
 
-    void setEmailAddresses(Collection addresses) throws JAXRException;
+    void setEmailAddresses(Collection<EmailAddress> addresses) throws JAXRException;
 
     void setPersonName(PersonName personName) throws JAXRException;
 
-    void setPostalAddresses(Collection addresses) throws JAXRException;
+    void setPostalAddresses(Collection<PostalAddress> addresses) throws JAXRException;
 
     void setTelephoneNumbers(Collection<TelephoneNumber> phoneNumbers) throws JAXRException;
 

Modified: webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/registry/infomodel/RegistryObjectImpl.java
URL: http://svn.apache.org/viewvc/webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/registry/infomodel/RegistryObjectImpl.java?rev=742195&r1=742194&r2=742195&view=diff
==============================================================================
--- webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/registry/infomodel/RegistryObjectImpl.java
(original)
+++ webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/registry/infomodel/RegistryObjectImpl.java
Sun Feb  8 22:59:04 2009
@@ -203,7 +203,7 @@
         ((ExternalIdentifierImpl) externalIdentifier).setRegistryObject(this);
     }
 
-    public void addExternalIdentifiers(Collection collection)
+    public void addExternalIdentifiers(Collection<ExternalIdentifier> collection)
     {
         if (collection!=null) {
             for (Iterator i = collection.iterator(); i.hasNext();)

Modified: webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/util/ScoutJaxrUddiHelper.java
URL: http://svn.apache.org/viewvc/webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/util/ScoutJaxrUddiHelper.java?rev=742195&r1=742194&r2=742195&view=diff
==============================================================================
--- webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/util/ScoutJaxrUddiHelper.java
(original)
+++ webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/util/ScoutJaxrUddiHelper.java
Sun Feb  8 22:59:04 2009
@@ -197,11 +197,11 @@
             }
 
 			// SpecificationLink
-           Collection slcol = serve.getSpecificationLinks();
+           Collection<SpecificationLink> slcol = serve.getSpecificationLinks();
 			TModelInstanceDetails tid = TModelInstanceDetails.Factory
 					.newInstance();
 			if (slcol != null && !slcol.isEmpty()) {
-              Iterator iter = slcol.iterator();
+              Iterator<SpecificationLink> iter = slcol.iterator();
 				while (iter.hasNext()) {
 					SpecificationLink slink = (SpecificationLink) iter.next();
 
@@ -482,7 +482,7 @@
                 }
             }
 //          External Links 
-            Collection externalLinks = scheme.getExternalLinks(); 
+            Collection<ExternalLink> externalLinks = scheme.getExternalLinks(); 
             if(externalLinks != null && externalLinks.size() > 0)
             {
                 tm.setOverviewDoc(getOverviewDocFromExternalLink((ExternalLink)externalLinks.iterator().next()));
@@ -547,12 +547,12 @@
 						.getFullName());
 			}
 
-            Collection s = org.getServices();
+            Collection<Service> s = org.getServices();
             log.debug("?Org has services=" + s.isEmpty());
 
 			barr = new BusinessService[s.size()];
 
-            Iterator iter = s.iterator();
+            Iterator<Service> iter = s.iterator();
 			int barrPos = 0;
 			while (iter.hasNext()) {
 				BusinessService bs = ScoutJaxrUddiHelper
@@ -572,7 +572,7 @@
 			Contact[] carr = new Contact[0];
 
             User primaryContact = org.getPrimaryContact();
-            Collection users = org.getUsers();
+            Collection<User> users = org.getUsers();
 
             // Expand array to necessary size only (xmlbeans does not like
             // null items in cases like this)
@@ -584,7 +584,7 @@
             }
 
             // TODO: Clean this up and make it more efficient
-            Iterator it = users.iterator();
+            Iterator<User> it = users.iterator();
             while (it.hasNext()) {
                 User u = (User) it.next();
                 if (u != primaryContact) {
@@ -622,7 +622,7 @@
             biz.setBusinessServices(bss);
 
             // External Links
-            Iterator exiter = org.getExternalLinks().iterator();
+            Iterator<ExternalLink> exiter = org.getExternalLinks().iterator();
             DiscoveryURLs emptyDUs = null;
             boolean first = true;
             while (exiter.hasNext()) {
@@ -680,11 +680,11 @@
             ct.setUseType(user.getType());
 			}
 			// Postal Address
-            Collection postc = user.getPostalAddresses();
+            Collection<PostalAddress> postc = user.getPostalAddresses();
 
 			addarr = new Address[postc.size()];
 
-            Iterator iterator = postc.iterator();
+            Iterator<PostalAddress> iterator = postc.iterator();
 			int addarrPos = 0;
 			while (iterator.hasNext()) {
                 PostalAddress post = (PostalAddress) iterator.next();

Modified: webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/util/ScoutUddiJaxrHelper.java
URL: http://svn.apache.org/viewvc/webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/util/ScoutUddiJaxrHelper.java?rev=742195&r1=742194&r2=742195&view=diff
==============================================================================
--- webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/util/ScoutUddiJaxrHelper.java
(original)
+++ webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/util/ScoutUddiJaxrHelper.java
Sun Feb  8 22:59:04 2009
@@ -36,6 +36,7 @@
 import javax.xml.registry.infomodel.RegistryObject;
 import javax.xml.registry.infomodel.Service;
 import javax.xml.registry.infomodel.ServiceBinding;
+import javax.xml.registry.infomodel.SpecificationLink;
 import javax.xml.registry.infomodel.TelephoneNumber;
 import javax.xml.registry.infomodel.User;
 
@@ -433,10 +434,10 @@
       for (int i = 0; tmodelInstanceInfoArray != null && i < tmodelInstanceInfoArray.length;
i++)
       {
          TModelInstanceInfo info = (TModelInstanceInfo)tmodelInstanceInfoArray[i];
-         InstanceDetails idetails = info.getInstanceDetails(); 
+         InstanceDetails idetails = info.getInstanceDetails();
          Collection<ExternalLink> elinks = getExternalLinks(idetails.getOverviewDoc(),lcm);
-         SpecificationLinkImpl slink = new SpecificationLinkImpl(lcm);
-         slink.addExternalIdentifiers(elinks);
+         SpecificationLink slink = new SpecificationLinkImpl(lcm);
+         slink.addExternalLinks(elinks);
          serviceBinding.addSpecificationLink(slink); 
          
          ConceptImpl c = new ConceptImpl(lcm);

Modified: webservices/scout/trunk/scout/src/test/java/org/apache/ws/scout/registry/qa/JAXR050ServiceBindingTest.java
URL: http://svn.apache.org/viewvc/webservices/scout/trunk/scout/src/test/java/org/apache/ws/scout/registry/qa/JAXR050ServiceBindingTest.java?rev=742195&r1=742194&r2=742195&view=diff
==============================================================================
--- webservices/scout/trunk/scout/src/test/java/org/apache/ws/scout/registry/qa/JAXR050ServiceBindingTest.java
(original)
+++ webservices/scout/trunk/scout/src/test/java/org/apache/ws/scout/registry/qa/JAXR050ServiceBindingTest.java
Sun Feb  8 22:59:04 2009
@@ -39,6 +39,7 @@
 import junit.framework.JUnit4TestAdapter;
 
 import org.apache.ws.scout.BaseTestCase;
+import org.apache.ws.scout.Finder;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -92,6 +93,8 @@
         {
             RegistryService rs = connection.getRegistryService();
             blm = rs.getBusinessLifeCycleManager();
+            bqm = rs.getBusinessQueryManager();
+            Finder finder = new Finder(bqm);
 
             System.out.println("\nCreating temporary organization...\n");
             Organization tmpOrg = createTempOrg();
@@ -104,6 +107,10 @@
             System.out.println("\nCreating service binding...\n");
             Key sbKey = createServiceBinding(tmpSvc);
             
+            //find serviceBinding
+            Collection<ServiceBinding> serviceBindings2 = finder.findServiceBindings(tmpSvcKey
);
+            ServiceBinding serviceBinding2 = serviceBindings2.iterator().next();
+            
             // All created ... now try to delete.
             deleteServiceBinding(sbKey);
             deleteTempService(tmpSvcKey);



---------------------------------------------------------------------
To unsubscribe, e-mail: scout-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: scout-dev-help@ws.apache.org


Mime
View raw message