Author: chris.laprun(a)jboss.com
Date: 2010-04-15 06:02:11 -0400 (Thu, 15 Apr 2010)
New Revision: 2649
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/RegistrationPolicyWrapper.java
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerConfigurationTestCase.java
Log:
- GTNWSRP-26: Updated test case.
- Added getDelegate method on RegistrationPolicyWrapper for access to the wrapped policy
if needed.
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/RegistrationPolicyWrapper.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/RegistrationPolicyWrapper.java 2010-04-15
08:11:28 UTC (rev 2648)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/RegistrationPolicyWrapper.java 2010-04-15
10:02:11 UTC (rev 2649)
@@ -47,6 +47,11 @@
this.delegate = delegate;
}
+ public RegistrationPolicy getDelegate()
+ {
+ return delegate;
+ }
+
public void validateRegistrationDataFor(Map<QName, Object>
registrationProperties, String consumerIdentity)
throws IllegalArgumentException, RegistrationException
{
Modified:
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerConfigurationTestCase.java
===================================================================
---
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerConfigurationTestCase.java 2010-04-15
08:11:28 UTC (rev 2648)
+++
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerConfigurationTestCase.java 2010-04-15
10:02:11 UTC (rev 2649)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.gatein.wsrp.producer.config;
@@ -27,6 +27,7 @@
import org.gatein.registration.RegistrationPolicy;
import org.gatein.registration.policies.DefaultRegistrationPolicy;
import org.gatein.registration.policies.DefaultRegistrationPropertyValidator;
+import org.gatein.registration.policies.RegistrationPolicyWrapper;
import org.gatein.registration.policies.RegistrationPropertyValidator;
import org.gatein.wsrp.WSRPConstants;
import org.gatein.wsrp.producer.config.impl.ProducerConfigurationImpl;
@@ -93,7 +94,13 @@
ProducerRegistrationRequirements requirements =
producerConfiguration.getRegistrationRequirements();
assertNotNull(requirements);
RegistrationPolicy policy = requirements.getPolicy();
- assertTrue(policy instanceof TestRegistrationPolicy);
+
+ // check that the policy is properly wrapped
+ assertTrue(policy instanceof RegistrationPolicyWrapper);
+
+ // and that the delegate is indeed the expected policy
+ RegistrationPolicyWrapper wrapper = (RegistrationPolicyWrapper)policy;
+ assertTrue(wrapper.getDelegate() instanceof TestRegistrationPolicy);
}
public void testExtendedUnmarshalling() throws Exception