Author: chris.laprun(a)jboss.com
Date: 2011-03-03 15:15:38 -0500 (Thu, 03 Mar 2011)
New Revision: 5965
Modified:
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerRegistrationRequirementsTestCase.java
Log:
- GTNWSRP-204: Added test case.
Modified:
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerRegistrationRequirementsTestCase.java
===================================================================
---
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerRegistrationRequirementsTestCase.java 2011-03-03
20:10:13 UTC (rev 5964)
+++
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerRegistrationRequirementsTestCase.java 2011-03-03
20:15:38 UTC (rev 5965)
@@ -28,6 +28,8 @@
import org.gatein.registration.RegistrationPolicyChangeListener;
import org.gatein.registration.RegistrationPropertyChangeListener;
import org.gatein.registration.policies.DefaultRegistrationPolicy;
+import org.gatein.registration.policies.DefaultRegistrationPropertyValidator;
+import org.gatein.registration.policies.RegistrationPolicyWrapper;
import org.gatein.wsrp.WSRPConstants;
import org.gatein.wsrp.producer.config.impl.ProducerRegistrationRequirementsImpl;
import org.gatein.wsrp.registration.PropertyDescription;
@@ -89,6 +91,21 @@
assertNull(requirements.getValidatorClassName());
}
+ public void testChangeToDefaultPolicyWithEmptyValidatorName()
+ {
+ ProducerRegistrationRequirementsImpl requirements = new
ProducerRegistrationRequirementsImpl();
+ requirements.setRegistrationRequired(true); // so that we load the policy
+
+
requirements.reloadPolicyFrom(ProducerRegistrationRequirements.DEFAULT_POLICY_CLASS_NAME,
"");
+
+ RegistrationPolicy policy = requirements.getPolicy();
+ assertEquals(ProducerRegistrationRequirements.DEFAULT_POLICY_CLASS_NAME,
policy.getClassName());
+ assertEquals(ProducerRegistrationRequirements.DEFAULT_VALIDATOR_CLASS_NAME,
requirements.getValidatorClassName());
+
+ DefaultRegistrationPolicy unwrap =
(DefaultRegistrationPolicy)RegistrationPolicyWrapper.unwrap(policy);
+ assertTrue(unwrap.getValidator() instanceof DefaultRegistrationPropertyValidator);
+ }
+
public void testSetUnchangedRegistrationProperties()
{
ProducerRegistrationRequirements requirements = new
ProducerRegistrationRequirementsImpl();
Show replies by date