ARTEMIS-157 fixing isHA on connectionFactory

This commit is contained in:
Clebert Suconic 2015-07-22 17:17:37 +01:00
parent 0bd784df43
commit d5dde68f0c
3 changed files with 13 additions and 1 deletions

View File

@ -234,7 +234,7 @@ public abstract class URISchema<T, P>
PropertyDescriptor[] descriptors = beanUtils.getPropertyUtils().getPropertyDescriptors(bean);
for (PropertyDescriptor descriptor : descriptors)
{
if (descriptor.getReadMethod() != null && descriptor.getWriteMethod() != null && isWriteable(descriptor, ignored))
if (descriptor.getReadMethod() != null && isWriteable(descriptor, ignored))
{
String value = beanUtils.getProperty(bean, descriptor.getName());
if (value != null)

View File

@ -63,6 +63,17 @@ public class ConnectionOptions
this.ha = ha;
}
/** Se need both options (ha / HA in case of typos on the URI) */
public boolean isHA()
{
return ha;
}
public void setHA(boolean ha)
{
this.ha = ha;
}
@Override
public String toString()
{

View File

@ -144,6 +144,7 @@ public class ConnectionFactorySerializationTest extends JMSTestBase
byte[] x = serialize(cf);
ActiveMQConnectionFactory y = deserialize(x, ActiveMQConnectionFactory.class);
checkEquals(cf, y);
Assert.assertEquals(cf.isHA(), y.isHA());
TransportConfiguration[] staticConnectors = y.getStaticConnectors();
Assert.assertEquals(staticConnectors.length, 2);
TransportConfiguration tc0 = cf.getStaticConnectors()[0];