Author: chris.laprun(a)jboss.com
Date: 2007-10-30 01:52:15 -0400 (Tue, 30 Oct 2007)
New Revision: 8802
Removed:
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/tests/test-wsrp-consumer-war/WEB-INF/jboss-web.xml
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/tests/test-wsrp-producer-war/WEB-INF/jboss-web.xml
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestCase.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ReleaseSessionTestCase.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java
Log:
- Make registration operations fail if no registration is required and added associated
test cases.
- Modified configuration of registration in V1ProducerBaseTest to allow for proper wiring
of policy associated objects which is normally done during producer startup.
Might want to consider wiring a rejecting policy for added safety if none is set-up
(which is the case when the producer doesn't require registration) as the policy
will be null in that case... This was causing a bunch of tests to fail.
- Adapted ReleaseSessionTestCase to work properly as it's not possible to call
registerConsumer any time any more (it will fail if registration is not required).
- Removed unneeded jboss-web.xml files.
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestCase.java 2007-10-29
23:07:31 UTC (rev 8801)
+++
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestCase.java 2007-10-30
05:52:15 UTC (rev 8802)
@@ -35,6 +35,7 @@
import org.jboss.portal.wsrp.core.PropertyDescription;
import org.jboss.portal.wsrp.core.RegistrationContext;
import org.jboss.portal.wsrp.core.RegistrationData;
+import org.jboss.portal.wsrp.core.MissingParametersFault;
import org.jboss.portal.wsrp.registration.RegistrationPropertyDescription;
import javax.xml.namespace.QName;
@@ -47,8 +48,7 @@
*/
public class RegistrationTestCase extends V1ProducerBaseTest
{
- public RegistrationTestCase()
- throws Exception
+ public RegistrationTestCase() throws Exception
{
super("RegistrationTestCase");
}
@@ -75,7 +75,7 @@
*/
public void testConsumerAgent() throws Exception
{
- configureRegistrationSettings(false);
+ configureRegistrationSettings(true, false);
RegistrationData regData = createBaseRegData();
regData.setConsumerAgent("invalid consumer agent");
@@ -96,7 +96,7 @@
public void testDeregister() throws Exception
{
// initiate registration
- configureRegistrationSettings(false);
+ configureRegistrationSettings(true, false);
RegistrationContext rc = registerConsumer();
// deregister
@@ -117,10 +117,10 @@
checkException(e, WSRPExceptionFactory.INVALID_REGISTRATION);
}
// reactivate check for exception once tests go through WS stack see:
JBPORTAL-1712
- /*catch (InvalidRegistrationFault invalidRegistrationFault)
+ //catch (InvalidRegistrationFault invalidRegistrationFault)
{
// expected
- }*/
+ }
// Get description with old registration context should fail
GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
@@ -137,10 +137,10 @@
checkException(e, WSRPExceptionFactory.INVALID_REGISTRATION);
}
// reactivate check for exception once tests go through WS stack see:
JBPORTAL-1712
- /*catch (InvalidRegistrationFault invalidRegistrationFault)
+ //catch (InvalidRegistrationFault invalidRegistrationFault)
{
// expected
- }*/
+ }
// Get description should still work without registration context
gs = getNoRegistrationServiceDescriptionRequest();
@@ -151,7 +151,7 @@
public void testModifyRegistration() throws Exception
{
// initiate registration
- configureRegistrationSettings(false);
+ configureRegistrationSettings(true, false);
RegistrationContext rc = registerConsumer();
// now modify Producer's set of required registration info
@@ -177,12 +177,12 @@
checkException(e, WSRPExceptionFactory.INVALID_REGISTRATION);
}
// reactivate check for exception once tests go through WS stack see:
JBPORTAL-1712
- /*catch (InvalidRegistrationFault invalidRegistrationFault)
+ //catch (InvalidRegistrationFault invalidRegistrationFault)
{
// expected
// WSRP primer recommends returning OperationFailedFault and NOT
InvalidRegistrationFault
// kinda weird... will be replaced by ModifyRegistrationRequiredFault in WSRP
2.0
- }*/
+ }
// Get description should return information just as if consumer wasn't
registered
GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
@@ -199,12 +199,12 @@
checkException(e, WSRPExceptionFactory.INVALID_REGISTRATION);
}
// reactivate check for exception once tests go through WS stack see:
JBPORTAL-1712
- /*catch (InvalidRegistrationFault invalidRegistrationFault)
+ //catch (InvalidRegistrationFault invalidRegistrationFault)
{
// expected
// WSRP primer recommends returning OperationFailedFault and NOT
InvalidRegistrationFault
// kinda weird... will be replaced by ModifyRegistrationRequiredFault in WSRP
2.0
- }*/
+ }
// remove registration context, try again and check that we get new registration
info
gs.setRegistrationContext(null);
@@ -228,7 +228,7 @@
public void testRegister() throws Exception
{
- configureRegistrationSettings(false);
+ configureRegistrationSettings(true, false);
// service description request without registration info
GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
@@ -242,6 +242,66 @@
checkServiceDescriptionWithOnlyBasicPortlet(gs);
}
+ public void testRegisterWhenRegistrationNotRequired() throws Exception
+ {
+ configureRegistrationSettings(false, false);
+
+ try
+ {
+ registerConsumer();
+ ExtendedAssert.fail("Shouldn't be possible to register if no
registration is required.");
+ }
+ catch (RemoteException e)
+ {
+ checkException(e, WSRPExceptionFactory.OPERATION_FAILED); // expected
+ }
+ // reactivate check for exception once tests go through WS stack see:
JBPORTAL-1712
+ //catch (OperationFailedFault operationFailedFault)
+ {
+ // expected
+ }
+ }
+
+ public void testDeregisterWhenRegistrationNotRequired() throws Exception
+ {
+ configureRegistrationSettings(false, false);
+
+ try
+ {
+ registrationService.deregister(null);
+ ExtendedAssert.fail("Shouldn't be possible to deregister if no
registration is required.");
+ }
+ catch (RemoteException e)
+ {
+ checkException(e, WSRPExceptionFactory.OPERATION_FAILED); // expected
+ }
+ // reactivate check for exception once tests go through WS stack see:
JBPORTAL-1712
+ //catch (OperationFailedFault operationFailedFault)
+ {
+ // expected
+ }
+ }
+
+ public void testModifyRegistrationWhenRegistrationNotRequired() throws Exception
+ {
+ configureRegistrationSettings(false, false);
+
+ try
+ {
+ registrationService.modifyRegistration(null);
+ ExtendedAssert.fail("Shouldn't be possible to modify registration if no
registration is required.");
+ }
+ catch (RemoteException e)
+ {
+ checkException(e, WSRPExceptionFactory.OPERATION_FAILED); // expected
+ }
+ // reactivate check for exception once tests go through WS stack see:
JBPORTAL-1712
+ //catch (OperationFailedFault operationFailedFault)
+ {
+ // expected
+ }
+ }
+
public void tearDown() throws Exception
{
producer.getProducerRegistrationRequirements().clearRegistrationProperties();
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ReleaseSessionTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ReleaseSessionTestCase.java 2007-10-29
23:07:31 UTC (rev 8801)
+++
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ReleaseSessionTestCase.java 2007-10-30
05:52:15 UTC (rev 8802)
@@ -69,7 +69,7 @@
{
// possible registration contexts are: actual RegistrationContext, null, and a made
up value
RegistrationContext fakeRegContext =
WSRPTypeFactory.createRegistrationContext("Fake Registration Handle");
- RegistrationContext[] regContexts = new
RegistrationContext[]{getRegistrationContext(), null, fakeRegContext};
+ RegistrationContext[] regContexts = new RegistrationContext[]{null, null,
fakeRegContext};
// possible types of sessionIDs include null and a made up value.
// Note: a valid session id cannot be used since the sessionID should never be sent
to the consumer
@@ -88,27 +88,30 @@
for (int j = 0; j < sessionIDs.length; j++)
{
ReleaseSessions releaseSession = new ReleaseSessions(regContexts[i],
sessionIDs[j]);
- releaseSessions(releaseSession, false);
- releaseSessions(releaseSession, true);
+ releaseSessions(releaseSession, false, i);
+ releaseSessions(releaseSession, true, i);
}
}
}
- private RegistrationContext getRegistrationContext() throws Exception
+ private void releaseSessions(ReleaseSessions releaseSessions, boolean useRegistration,
int index) throws Exception
{
- return registerConsumer();
- }
-
- private void releaseSessions(ReleaseSessions releaseSessions, boolean useRegistration)
throws Exception
- {
setUp();
try
{
- log.info(getSetupString(releaseSessions));
if (useRegistration)
{
- configureRegistrationSettings(false);
+ configureRegistrationSettings(true, false);
+
+ // faking correct registration context when we're supposed to have one...
previous impl registered consumer
+ // all the time but this cannot be done anymore since we prevent registering
if no registration is required
+ // so we need to wait for the proper case to init the registration context...
Hackish! :(
+ if (index == 0)
+ {
+ releaseSessions.setRegistrationContext(registerConsumer());
+ }
}
+ log.info(getSetupString(releaseSessions));
markupService.releaseSessions(releaseSessions);
ExtendedAssert.fail("ReleaseSessions did not thrown an OperationFailed
Fault." + getSetupString(releaseSessions));
}
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java 2007-10-29
23:07:31 UTC (rev 8801)
+++
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java 2007-10-30
05:52:15 UTC (rev 8802)
@@ -70,7 +70,7 @@
public void testGetServiceDescriptionRequiringRegistrationNoOfferedPortlets() throws
Throwable
{
- RegistrationPropertyDescription regProp = configureRegistrationSettings(false);
+ RegistrationPropertyDescription regProp = configureRegistrationSettings(true,
false);
// service description request without registration info
GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
@@ -90,7 +90,7 @@
public void testGetServiceDescriptionRequiringRegistrationOfferedPortlets() throws
Throwable
{
- RegistrationPropertyDescription regProp = configureRegistrationSettings(true);
+ RegistrationPropertyDescription regProp = configureRegistrationSettings(true,
true);
// service description request without registration info
GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java 2007-10-29
23:07:31 UTC (rev 8801)
+++
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java 2007-10-30
05:52:15 UTC (rev 8802)
@@ -24,9 +24,13 @@
package org.jboss.portal.test.wsrp.v1.producer;
import org.jboss.portal.common.junit.ExtendedAssert;
+import org.jboss.portal.registration.policies.DefaultRegistrationPolicy;
+import org.jboss.portal.registration.policies.DefaultRegistrationPropertyValidator;
+import org.jboss.portal.registration.RegistrationManager;
import org.jboss.portal.test.wsrp.WSRPProducerBaseTest;
import org.jboss.portal.wsrp.WSRPConstants;
import org.jboss.portal.wsrp.WSRPTypeFactory;
+import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
import org.jboss.portal.wsrp.core.GetServiceDescription;
import org.jboss.portal.wsrp.core.LocalizedString;
import org.jboss.portal.wsrp.core.MarkupType;
@@ -159,25 +163,43 @@
return regData;
}
- protected RegistrationPropertyDescription configureRegistrationSettings(boolean
provideUnregisteredFullDescription)
+ protected RegistrationPropertyDescription configureRegistrationSettings(boolean
requiresRegistration, boolean provideUnregisteredFullDescription)
{
// define expected registration infos
- producer.getProducerRegistrationRequirements().setRegistrationRequired(true);
+
producer.getProducerRegistrationRequirements().setRegistrationRequired(requiresRegistration);
producer.getProducerRegistrationRequirements().setRegistrationRequiredForFullDescription(provideUnregisteredFullDescription);
- // fix-me:
http://jira.jboss.com/jira/browse/JBPORTAL-821
- RegistrationPropertyDescription regProp = new
RegistrationPropertyDescription("regProp",
- new QName("urn:oasis:names:tc:wsrp:v1:types",
"LocalizedString", "ns1"));
- regProp.setDefaultLabel("Registration Property");
- producer.getProducerRegistrationRequirements().addRegistrationProperty(regProp);
+ if (requiresRegistration)
+ {
+ // fix-me:
http://jira.jboss.com/jira/browse/JBPORTAL-821
+ RegistrationPropertyDescription regProp = new
RegistrationPropertyDescription("regProp",
+ new QName("urn:oasis:names:tc:wsrp:v1:types",
"LocalizedString", "ns1"));
+ regProp.setDefaultLabel("Registration Property");
+
producer.getProducerRegistrationRequirements().addRegistrationProperty(regProp);
- return regProp;
+ // Use default registration policy: this wiring is normally handled at the
producer start, should maybe use a
+ // registration policy that is automatically configured when none is provided to
avoid having a null one?
+ DefaultRegistrationPolicy defaultRegistrationPolicy = new
DefaultRegistrationPolicy();
+ defaultRegistrationPolicy.setValidator(new
DefaultRegistrationPropertyValidator());
+
producer.getProducerRegistrationRequirements().setPolicy(defaultRegistrationPolicy);
+ RegistrationManager registrationManager = producer.getRegistrationManager();
+ registrationManager.setPolicy(defaultRegistrationPolicy);
+
producer.getProducerRegistrationRequirements().addRegistrationPropertyChangeListeners(registrationManager);
+
+ return regProp;
+ }
+ else
+ {
+ return null;
+ }
}
protected void resetRegistrationInfo()
{
- producer.getProducerRegistrationRequirements().setRegistrationRequired(false);
- producer.getProducerRegistrationRequirements().clearRegistrationProperties();
+ ProducerRegistrationRequirements registrationRequirements =
producer.getProducerRegistrationRequirements();
+ registrationRequirements.setRegistrationRequired(false);
+ registrationRequirements.clearRegistrationProperties();
+ registrationRequirements.clearRegistrationPropertyChangeListeners();
}
protected GetServiceDescription getNoRegistrationServiceDescriptionRequest()
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java 2007-10-29
23:07:31 UTC (rev 8801)
+++
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java 2007-10-30
05:52:15 UTC (rev 8802)
@@ -69,34 +69,40 @@
public RegistrationContext register(RegistrationData registrationData) throws
MissingParametersFault, OperationFailedFault,
RemoteException
{
- WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(registrationData,
"RegistrationData");
- String consumerName = registrationData.getConsumerName();
- WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(consumerName,
"consumer name", "RegistrationData");
+ if (producer.getProducerRegistrationRequirements().isRegistrationRequired())
+ {
+ WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(registrationData,
"RegistrationData");
+ String consumerName = registrationData.getConsumerName();
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(consumerName,
"consumer name", "RegistrationData");
- String consumerAgent = registrationData.getConsumerAgent();
- WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(consumerAgent,
"consumer agent", "RegistrationData");
+ String consumerAgent = registrationData.getConsumerAgent();
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(consumerAgent,
"consumer agent", "RegistrationData");
- Registration registration;
- try
- {
- log.debug("Attempting to register consumer named '" + consumerName
+ "', agent '" + consumerAgent + "'.");
+ Registration registration;
+ try
+ {
+ log.debug("Attempting to register consumer named '" +
consumerName + "', agent '" + consumerAgent + "'.");
- // check that the consumer agent is valid before trying to register
- RegistrationUtils.validateConsumerAgent(consumerAgent);
+ // check that the consumer agent is valid before trying to register
+ RegistrationUtils.validateConsumerAgent(consumerAgent);
- registration = producer.getRegistrationManager().addRegistrationTo(consumerName,
createRegistrationProperties(registrationData), true);
- updateRegistrationInformation(registration, registrationData);
+ registration =
producer.getRegistrationManager().addRegistrationTo(consumerName,
createRegistrationProperties(registrationData), true);
+ updateRegistrationInformation(registration, registrationData);
+ }
+ catch (Exception e)
+ {
+ log.debug(e);
+ throw
WSRPExceptionFactory.throwSOAPFaultException(WSRPExceptionFactory.OPERATION_FAILED,
+ "Could not register consumer named '" + consumerName +
"'", e);
+ }
+
+ RegistrationContext registrationContext =
WSRPTypeFactory.createRegistrationContext(registration.getId());
+ log.debug("Registration completed without error.");
+ return registrationContext;
}
- catch (Exception e)
- {
- log.debug(e);
- throw
WSRPExceptionFactory.throwSOAPFaultException(WSRPExceptionFactory.OPERATION_FAILED,
- "Could not register consumer named '" + consumerName +
"'", e);
- }
- RegistrationContext registrationContext =
WSRPTypeFactory.createRegistrationContext(registration.getId());
- log.debug("Registration completed without error.");
- return registrationContext;
+ throw
WSRPExceptionFactory.throwSOAPFaultException(WSRPExceptionFactory.OPERATION_FAILED,
+ "Registration shouldn't be attempted if registration is not
required", null);
}
private void updateRegistrationInformation(Registration registration, RegistrationData
registrationData)
@@ -142,78 +148,90 @@
public ReturnAny deregister(RegistrationContext deregister) throws
OperationFailedFault, InvalidRegistrationFault,
RemoteException
{
- WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(deregister,
"RegistrationContext");
-
- String registrationHandle = deregister.getRegistrationHandle();
- if (ParameterValidation.isNullOrEmpty(registrationHandle))
+ if (producer.getProducerRegistrationRequirements().isRegistrationRequired())
{
- throwInvalidRegistrationFault("Null or empty registration handle");
- }
+ WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(deregister,
"RegistrationContext");
- log.debug("Attempting to deregister registration with handle '" +
registrationHandle + "'");
+ String registrationHandle = deregister.getRegistrationHandle();
+ if (ParameterValidation.isNullOrEmpty(registrationHandle))
+ {
+ throwInvalidRegistrationFault("Null or empty registration
handle");
+ }
- try
- {
- producer.getRegistrationManager().removeRegistration(registrationHandle);
+ log.debug("Attempting to deregister registration with handle '" +
registrationHandle + "'");
+
+ try
+ {
+ producer.getRegistrationManager().removeRegistration(registrationHandle);
+ }
+ catch (NoSuchRegistrationException e)
+ {
+ log.debug(e);
+ throwInvalidRegistrationFault(e.getLocalizedMessage());
+ }
+ catch (RegistrationException e)
+ {
+ log.debug(e);
+ throw
WSRPExceptionFactory.throwSOAPFaultException(WSRPExceptionFactory.OPERATION_FAILED,
+ "Could not deregister registration with handle '" +
registrationHandle + "'", e);
+ }
+
+ return new ReturnAny();
}
- catch (NoSuchRegistrationException e)
- {
- log.debug(e);
- throwInvalidRegistrationFault(e.getLocalizedMessage());
- }
- catch (RegistrationException e)
- {
- log.debug(e);
- throw
WSRPExceptionFactory.throwSOAPFaultException(WSRPExceptionFactory.OPERATION_FAILED,
- "Could not deregister registration with handle '" +
registrationHandle + "'", e);
- }
- return new ReturnAny();
+ throw
WSRPExceptionFactory.throwSOAPFaultException(WSRPExceptionFactory.OPERATION_FAILED,
+ "Deregistration shouldn't be attempted if registration is not
required", null);
}
public RegistrationState modifyRegistration(ModifyRegistration modifyRegistration)
throws MissingParametersFault,
OperationFailedFault, InvalidRegistrationFault, RemoteException
{
- WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(modifyRegistration,
"ModifyRegistration");
-
- RegistrationContext registrationContext =
modifyRegistration.getRegistrationContext();
-
WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(registrationContext,
"RegistrationContext", "ModifyRegistration");
- String registrationHandle = registrationContext.getRegistrationHandle();
- if (ParameterValidation.isNullOrEmpty(registrationHandle))
+ if (producer.getProducerRegistrationRequirements().isRegistrationRequired())
{
- throwInvalidRegistrationFault("Null or empty registration handle");
- }
+
WSRPExceptionFactory.throwOperationFailedFaultIfValueIsMissing(modifyRegistration,
"ModifyRegistration");
- RegistrationData registrationData = modifyRegistration.getRegistrationData();
- WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(registrationData,
"RegistrationData", "ModifyRegistration");
+ RegistrationContext registrationContext =
modifyRegistration.getRegistrationContext();
+
WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(registrationContext,
"RegistrationContext", "ModifyRegistration");
+ String registrationHandle = registrationContext.getRegistrationHandle();
+ if (ParameterValidation.isNullOrEmpty(registrationHandle))
+ {
+ throwInvalidRegistrationFault("Null or empty registration
handle");
+ }
- String consumerName = registrationData.getConsumerName();
- WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(consumerName,
"consumer name", "RegistrationData");
+ RegistrationData registrationData = modifyRegistration.getRegistrationData();
+
WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(registrationData,
"RegistrationData", "ModifyRegistration");
- String consumerAgent = registrationData.getConsumerAgent();
- WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(consumerAgent,
"consumer agent", "RegistrationData");
+ String consumerName = registrationData.getConsumerName();
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(consumerName,
"consumer name", "RegistrationData");
- log.debug("Attempting to modify registration with handle '" +
registrationHandle + "'");
- try
- {
- Registration registration =
producer.getRegistrationManager().getRegistration(registrationHandle);
- registration.updateProperties(createRegistrationProperties(registrationData));
- updateRegistrationInformation(registration, registrationData);
+ String consumerAgent = registrationData.getConsumerAgent();
+ WSRPExceptionFactory.throwMissingParametersFaultIfValueIsMissing(consumerAgent,
"consumer agent", "RegistrationData");
+
+ log.debug("Attempting to modify registration with handle '" +
registrationHandle + "'");
+ try
+ {
+ Registration registration =
producer.getRegistrationManager().getRegistration(registrationHandle);
+
registration.updateProperties(createRegistrationProperties(registrationData));
+ updateRegistrationInformation(registration, registrationData);
+ }
+ catch (NoSuchRegistrationException e)
+ {
+ log.debug(e);
+ throwInvalidRegistrationFault(e.getLocalizedMessage());
+ }
+ catch (RegistrationException e)
+ {
+ log.debug(e);
+ throw
WSRPExceptionFactory.throwSOAPFaultException(WSRPExceptionFactory.OPERATION_FAILED,
+ "Could not modify registration with handle '" +
registrationHandle + "'", e);
+ }
+
+
+ return null;
}
- catch (NoSuchRegistrationException e)
- {
- log.debug(e);
- throwInvalidRegistrationFault(e.getLocalizedMessage());
- }
- catch (RegistrationException e)
- {
- log.debug(e);
- throw
WSRPExceptionFactory.throwSOAPFaultException(WSRPExceptionFactory.OPERATION_FAILED,
- "Could not modify registration with handle '" +
registrationHandle + "'", e);
- }
-
- return null;
+ throw
WSRPExceptionFactory.throwSOAPFaultException(WSRPExceptionFactory.OPERATION_FAILED,
+ "Modifying a registration shouldn't be attempted if registration is not
required", null);
}
/**
Deleted:
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/tests/test-wsrp-consumer-war/WEB-INF/jboss-web.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/tests/test-wsrp-consumer-war/WEB-INF/jboss-web.xml 2007-10-29
23:07:31 UTC (rev 8801)
+++
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/tests/test-wsrp-consumer-war/WEB-INF/jboss-web.xml 2007-10-30
05:52:15 UTC (rev 8802)
@@ -1,26 +0,0 @@
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ 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-web>
- <depends>jboss.ws:service=WebServiceDeployerJSE</depends>
-</jboss-web>
\ No newline at end of file
Deleted:
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/tests/test-wsrp-producer-war/WEB-INF/jboss-web.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/tests/test-wsrp-producer-war/WEB-INF/jboss-web.xml 2007-10-29
23:07:31 UTC (rev 8801)
+++
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/tests/test-wsrp-producer-war/WEB-INF/jboss-web.xml 2007-10-30
05:52:15 UTC (rev 8802)
@@ -1,26 +0,0 @@
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ 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-web>
- <depends>jboss.ws:service=WebServiceDeployerJSE</depends>
-</jboss-web>
\ No newline at end of file