[jboss-svn-commits] JBoss Portal SVN: r5114 - in trunk/wsrp: . src/main/org/jboss/portal/test/wsrp/deployment src/main/org/jboss/portal/wsrp/consumer src/resources/portal-wsrp-sar src/resources/test-deployment-lib-jar

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Aug 29 19:08:04 EDT 2006


Author: chris.laprun at jboss.com
Date: 2006-08-29 19:08:02 -0400 (Tue, 29 Aug 2006)
New Revision: 5114

Modified:
   trunk/wsrp/build.xml
   trunk/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java
   trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
   trunk/wsrp/src/resources/portal-wsrp-sar/default-wsrp.xml
   trunk/wsrp/src/resources/test-deployment-lib-jar/test-wsrp.xml
Log:
JBPORTAL-1003: fixed improper handling of producer with empty registration properties.

Modified: trunk/wsrp/build.xml
===================================================================
--- trunk/wsrp/build.xml	2006-08-29 22:30:46 UTC (rev 5113)
+++ trunk/wsrp/build.xml	2006-08-29 23:08:02 UTC (rev 5114)
@@ -458,10 +458,10 @@
    <target name="tests-local" depends="clean, output, clean-test">
       <server:start name="default"/>
       <antcall target="agent-deploy"/>
-      <antcall target="producer-test"/>
-      <antcall target="consumer-test"/>
+      <!--<antcall target="producer-test"/>-->
+      <!--<antcall target="consumer-test"/>-->
       <antcall target="deployment-test"/>
-      <antcall target="other-test"/>
+      <!--<antcall target="other-test"/>-->
       <antcall target="agent-undeploy"/>
       <server:stop name="default"/>
       <antcall target="reports"/>
@@ -533,6 +533,10 @@
             <test todir="${test.reports}" name="org.jboss.portal.test.wsrp.deployment.DeploymentTestCase"/>
          </x-test>
          <x-sysproperty>
+            <jvmarg value="-Xdebug"/>
+            <jvmarg value="-Xnoagent"/>
+            <jvmarg value="-Djava.compiler=NONE"/>
+            <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787"/>
             <sysproperty key="test.root" value="${build.lib}"/>
          </x-sysproperty>
          <x-classpath>

Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java	2006-08-29 22:30:46 UTC (rev 5113)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java	2006-08-29 23:08:02 UTC (rev 5114)
@@ -59,7 +59,7 @@
       WSRPDeployment deployment = (WSRPDeployment)o;
       List services = deployment.getServices();
       assertNotNull(services);
-      assertEquals(3, services.size());
+      assertEquals(4, services.size());
 
       //
       Object service = services.get(0);
@@ -114,6 +114,14 @@
       assertEquals("name", property.getName());
       assertEquals("en-US", property.getLang());
       assertEquals("value", property.getStringValue());
+
+      service = services.get(3);
+      service3 = (WSRPConsumerService) service;
+      assertEquals("oracle", service3.getId());
+      consumer3 = service3.getConsumer();
+      assertNotNull(consumer3.getRegistrationData());
+      assertEquals("JBoss Portal 2.4 Test", registrationData.getConsumerName());
+      assertEquals("JBoss Portal.2.4", registrationData.getConsumerAgent());
    }
 
 }

Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java	2006-08-29 22:30:46 UTC (rev 5113)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java	2006-08-29 23:08:02 UTC (rev 5114)
@@ -23,7 +23,6 @@
 
 import org.jboss.portal.common.invocation.InvocationException;
 import org.jboss.portal.common.system.AbstractJBossService;
-import org.jboss.portal.common.util.ParameterValidation;
 import org.jboss.portal.portlet.InvokerUnavailableException;
 import org.jboss.portal.portlet.NoSuchPortletException;
 import org.jboss.portal.portlet.Portlet;
@@ -512,9 +511,6 @@
          {
             if (serviceDescription.isRequiresRegistration())
             {
-               ModelDescription registrationProperties = serviceDescription.getRegistrationPropertyDescription();
-               ParameterValidation.throwIllegalArgExceptionIfNull(registrationProperties, "registration properties");
-
                // try to register with the registration data provided at deployment time
                if (registrationData != null)
                {
@@ -529,25 +525,32 @@
                }
                else
                {
-                  PropertyDescription[] propertyDescriptions = registrationProperties.getPropertyDescriptions();
-                  if (propertyDescriptions != null)
+                  ModelDescription registrationProperties = serviceDescription.getRegistrationPropertyDescription();
+                  log.info("Producer " + producerId + " requires registration yet configuration of this producer " +
+                     "does not provide any registration data. You must at least provide a consumer-name in the " +
+                     "configuration for this producer. Please refer to the documentation.");
+
+                  if (registrationProperties != null)
                   {
-                     log.info("Producer " + producerId + " requires registration yet configuration of this producer " +
-                        "does not provide any registration data. The required registration information is: ");
-                     for (int i = 0; i < propertyDescriptions.length; i++)
+                     PropertyDescription[] propertyDescriptions = registrationProperties.getPropertyDescriptions();
+                     if (propertyDescriptions != null)
                      {
-                        PropertyDescription propertyDescription = propertyDescriptions[i];
-                        String name = propertyDescription.getName();
-                        String type = propertyDescription.getType().toString();
-                        LocalizedString nillableLabel = propertyDescription.getLabel();
-                        String label = nillableLabel == null ? null : nillableLabel.getValue();
-                        LocalizedString nillableHint = propertyDescription.getHint();
-                        String hint = nillableHint == null ? null : nillableHint.getValue();
-                        log.info("propertyDescription =\n"
-                           + "- name:\t" + name + "\n"
-                           + "- type:\t" + type + "\n"
-                           + "- label:\t" + label + "\n"
-                           + "- hint:\t" + hint + "\n");
+                        log.info("Additionally, the producer required the following registration information: ");
+                        for (int i = 0; i < propertyDescriptions.length; i++)
+                        {
+                           PropertyDescription propertyDescription = propertyDescriptions[i];
+                           String name = propertyDescription.getName();
+                           String type = propertyDescription.getType().toString();
+                           LocalizedString nillableLabel = propertyDescription.getLabel();
+                           String label = nillableLabel == null ? null : nillableLabel.getValue();
+                           LocalizedString nillableHint = propertyDescription.getHint();
+                           String hint = nillableHint == null ? null : nillableHint.getValue();
+                           log.info("propertyDescription =\n"
+                              + "- name:\t" + name + "\n"
+                              + "- type:\t" + type + "\n"
+                              + "- label:\t" + label + "\n"
+                              + "- hint:\t" + hint + "\n");
+                        }
                      }
                   }
                }

Modified: trunk/wsrp/src/resources/portal-wsrp-sar/default-wsrp.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-sar/default-wsrp.xml	2006-08-29 22:30:46 UTC (rev 5113)
+++ trunk/wsrp/src/resources/portal-wsrp-sar/default-wsrp.xml	2006-08-29 23:08:02 UTC (rev 5114)
@@ -46,4 +46,14 @@
          </registration-data>
       </wsrp-producer>
    </deployment>-->
+   <!--<deployment>
+      <wsrp-producer>
+         <producer-id>oracle</producer-id>
+         <expiration-cache>120</expiration-cache>
+         <endpoint-wsdl-url>http://portalstandards.oracle.com/portletapp/portlets?WSDL</endpoint-wsdl-url>
+         <registration-data>
+            <consumer-name>JBoss Portal 2.4 Test</consumer-name>
+         </registration-data>
+      </wsrp-producer>
+   </deployment>-->
 </deployments>
\ No newline at end of file

Modified: trunk/wsrp/src/resources/test-deployment-lib-jar/test-wsrp.xml
===================================================================
--- trunk/wsrp/src/resources/test-deployment-lib-jar/test-wsrp.xml	2006-08-29 22:30:46 UTC (rev 5113)
+++ trunk/wsrp/src/resources/test-deployment-lib-jar/test-wsrp.xml	2006-08-29 23:08:02 UTC (rev 5114)
@@ -1,38 +1,53 @@
 <deployments>
-   <wsrp-producer>
-      <producer-id>endpoint1</producer-id>
-      <endpoint-config>
-         <service-description-url>service-description-1</service-description-url>
-         <markup-url>markup-1</markup-url>
-         <registration-url>registration-1</registration-url>
-         <portlet-management-url>portlet-management-1</portlet-management-url>
-      </endpoint-config>
-   </wsrp-producer>
-   <wsrp-producer>
-      <producer-id>endpoint2</producer-id>
-      <endpoint-config>
-         <service-description-url>service-description-2</service-description-url>
-         <markup-url>markup-2</markup-url>
-         <registration-url>registration-2</registration-url>
-         <portlet-management-url>portlet-management-2</portlet-management-url>
-      </endpoint-config>
-   </wsrp-producer>
-    <wsrp-producer>
-      <producer-id>bea</producer-id>
-      <expiration-cache>120</expiration-cache>
-      <endpoint-wsdl-url>http://wsrp.bea.com:7001/producer/producer?WSDL</endpoint-wsdl-url>
-      <registration-data>
-         <consumer-name>JBoss Portal 2.4 Test</consumer-name>
-         <property>
-            <name>registration/consumerRole</name>
-            <lang>en</lang>
-            <value>public</value>
-         </property>
-         <property>
-            <name>name</name>
-            <lang>en-US</lang>
-            <value>value</value>
-         </property>
-      </registration-data>
-   </wsrp-producer>
+   <deployment>
+      <wsrp-producer>
+         <producer-id>endpoint1</producer-id>
+         <endpoint-config>
+            <service-description-url>service-description-1</service-description-url>
+            <markup-url>markup-1</markup-url>
+            <registration-url>registration-1</registration-url>
+            <portlet-management-url>portlet-management-1</portlet-management-url>
+         </endpoint-config>
+      </wsrp-producer>
+   </deployment>
+   <deployment>
+      <wsrp-producer>
+         <producer-id>endpoint2</producer-id>
+         <endpoint-config>
+            <service-description-url>service-description-2</service-description-url>
+            <markup-url>markup-2</markup-url>
+            <registration-url>registration-2</registration-url>
+            <portlet-management-url>portlet-management-2</portlet-management-url>
+         </endpoint-config>
+      </wsrp-producer>
+   </deployment>
+   <deployment>
+      <wsrp-producer>
+         <producer-id>bea</producer-id>
+         <expiration-cache>120</expiration-cache>
+         <endpoint-wsdl-url>http://wsrp.bea.com:7001/producer/producer?WSDL</endpoint-wsdl-url>
+         <registration-data>
+            <consumer-name>JBoss Portal 2.4 Test</consumer-name>
+            <property>
+               <name>registration/consumerRole</name>
+               <lang>en</lang>
+               <value>public</value>
+            </property>
+            <property>
+               <name>name</name>
+               <lang>en-US</lang>
+               <value>value</value>
+            </property>
+         </registration-data>
+      </wsrp-producer>
+   </deployment>
+   <deployment>
+      <wsrp-producer>
+         <producer-id>oracle</producer-id>
+         <endpoint-wsdl-url>http://portalstandards.oracle.com/portletapp/portlets?WSDL</endpoint-wsdl-url>
+         <registration-data>
+            <consumer-name>JBoss Portal 2.4 Test</consumer-name>
+         </registration-data>
+      </wsrp-producer>
+   </deployment>
 </deployments>
\ No newline at end of file




More information about the jboss-svn-commits mailing list