}
public void testSecurityRoleRefs()
{
// Override
SecurityRoleRefsMetaData overrideSecurity = new SecurityRoleRefsMetaData();
overrideSecurity.setId("override");
SecurityRoleRefMetaData overrideSecurityRoleRef = new SecurityRoleRefMetaData();
overrideSecurityRoleRef.setDescriptions(new DescriptionsImpl());
overrideSecurityRoleRef.setId("overrideId");
overrideSecurityRoleRef.setRoleLink("overrideLink");
overrideSecurityRoleRef.setRoleName("overrideRoleName");
overrideSecurity.add(overrideSecurityRoleRef);
JBossSessionBeanMetaData override = new JBossSessionBeanMetaData();
override.setSecurityRoleRefs(overrideSecurity);
// Original
SecurityRoleRefMetaData originalSecurityRoleRef = new SecurityRoleRefMetaData();
originalSecurityRoleRef.setDescriptions(new DescriptionsImpl());
originalSecurityRoleRef.setId("originalId");
originalSecurityRoleRef.setName("originalName");
originalSecurityRoleRef.setRoleLink("originalLink");
originalSecurityRoleRef.setRoleName("originalRoleName");
SecurityRoleRefsMetaData originalSecurityRoleRefsMetaData = new SecurityRoleRefsMetaData();
originalSecurityRoleRefsMetaData.setId("originalId");
originalSecurityRoleRefsMetaData.add(originalSecurityRoleRef);
JBossSessionBeanMetaData original = new JBossSessionBeanMetaData();
original.setSecurityRoleRefs(originalSecurityRoleRefsMetaData);
original.setName("original");
// Merged
JBossSessionBeanMetaData merged = new JBossSessionBeanMetaData();
merged.merge(override, original);
SecurityRoleRefsMetaData securityRoleRefs = merged.getSecurityRoleRefs();
assertNotNull(securityRoleRefs);
assertEquals(1, securityRoleRefs.size());
assertEquals("override", securityRoleRefs.getId());
SecurityRoleRefMetaData securityRoleRef = securityRoleRefs.get(overrideSecurityRoleRef.getKey());
assertNotNull(securityRoleRef);
assertEquals("overrideId", securityRoleRef.getId());
assertEquals("overrideLink", securityRoleRef.getRoleLink());
assertEquals("overrideRoleName", securityRoleRef.getRoleName());
}