ARTEMIS-3947 fix merging for expiry address-settings
This commit is contained in:
parent
86db53da9a
commit
f1c9e3df14
|
@ -175,11 +175,11 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
|
|||
|
||||
private SimpleString expiryAddress = null;
|
||||
|
||||
private Long expiryDelay = AddressSettings.DEFAULT_EXPIRY_DELAY;
|
||||
private Long expiryDelay = null;
|
||||
|
||||
private Long minExpiryDelay = AddressSettings.DEFAULT_MIN_EXPIRY_DELAY;
|
||||
private Long minExpiryDelay = null;
|
||||
|
||||
private Long maxExpiryDelay = AddressSettings.DEFAULT_MAX_EXPIRY_DELAY;
|
||||
private Long maxExpiryDelay = null;
|
||||
|
||||
private Boolean defaultLastValueQueue = null;
|
||||
|
||||
|
@ -769,7 +769,7 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
|
|||
}
|
||||
|
||||
public Long getExpiryDelay() {
|
||||
return expiryDelay;
|
||||
return expiryDelay != null ? expiryDelay : AddressSettings.DEFAULT_EXPIRY_DELAY;
|
||||
}
|
||||
|
||||
public AddressSettings setExpiryDelay(final Long expiryDelay) {
|
||||
|
@ -778,7 +778,7 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
|
|||
}
|
||||
|
||||
public Long getMinExpiryDelay() {
|
||||
return minExpiryDelay;
|
||||
return minExpiryDelay != null ? minExpiryDelay : AddressSettings.DEFAULT_MIN_EXPIRY_DELAY;
|
||||
}
|
||||
|
||||
public AddressSettings setMinExpiryDelay(final Long minExpiryDelay) {
|
||||
|
@ -787,7 +787,7 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
|
|||
}
|
||||
|
||||
public Long getMaxExpiryDelay() {
|
||||
return maxExpiryDelay;
|
||||
return maxExpiryDelay != null ? maxExpiryDelay : AddressSettings.DEFAULT_MAX_EXPIRY_DELAY;
|
||||
}
|
||||
|
||||
public AddressSettings setMaxExpiryDelay(final Long maxExpiryDelay) {
|
||||
|
|
|
@ -71,6 +71,9 @@ public class AddressSettingsTest extends ActiveMQTestBase {
|
|||
addressSettingsToMerge.setPageSizeBytes(1004);
|
||||
addressSettingsToMerge.setMaxSizeBytesRejectThreshold(10 * 1024);
|
||||
addressSettingsToMerge.setConfigDeleteDiverts(DeletionPolicy.FORCE);
|
||||
addressSettingsToMerge.setExpiryDelay(999L);
|
||||
addressSettingsToMerge.setMinExpiryDelay(888L);
|
||||
addressSettingsToMerge.setMaxExpiryDelay(777L);
|
||||
|
||||
addressSettings.merge(addressSettingsToMerge);
|
||||
Assert.assertEquals(addressSettings.getDeadLetterAddress(), DLQ);
|
||||
|
@ -84,6 +87,9 @@ public class AddressSettingsTest extends ActiveMQTestBase {
|
|||
Assert.assertEquals(AddressFullMessagePolicy.DROP, addressSettings.getAddressFullMessagePolicy());
|
||||
Assert.assertEquals(addressSettings.getMaxSizeBytesRejectThreshold(), 10 * 1024);
|
||||
Assert.assertEquals(DeletionPolicy.FORCE, addressSettings.getConfigDeleteDiverts());
|
||||
Assert.assertEquals(Long.valueOf(999), addressSettings.getExpiryDelay());
|
||||
Assert.assertEquals(Long.valueOf(888), addressSettings.getMinExpiryDelay());
|
||||
Assert.assertEquals(Long.valueOf(777), addressSettings.getMaxExpiryDelay());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue