« Back to Technical Questions

CMEAddressActivatedEvent and CMEAddressDeactivatedEvent share Type value

Combination View Flat View Tree View
Threads [ Previous | Next ]
Hello,
 
I found an issue with the CMEAddressDeactivatedEvent.  I am using a CMECSTAListener to recieve CMEEvents.  I am using the events, if the event is of type CMENotification, to monitor calls and to keep a phone inventory of devices and thier statuses.  We can clearly see that CMENotification.Type.ADDRESS_ACTIVATED is 2004 and CMENotification.Type.ADDRESS_DEACTIVATED = 2005.  But the CMEAddressActivatedEvent object Type and the CMEAddressDeactivatedEvent object Type share the same Type.
 
I found this issue while writting unit tests using PowerMock and junit
Sample code:
    @Test
    public void testOnNotificationAddressEvent() throws Exception {

        CMECSTAAbstractSession session = new CMECSTASessionImpl();
        String phoneName = "SEP1234";

        CMEProvider provider = PowerMock.createNiceMock(CMEProvider.class);
        CMELocalAddress addr = new CMELocalAddress(provider, 5, phoneName);
        session.setAddress(addr);

        CMEAddressDeactivatedEvent deactivatedEvent = new CMEAddressDeactivatedEvent(new Object(), session);
        CMEAddressActivatedEvent activatedEvent = new CMEAddressActivatedEvent(new Object(), session);

        assertEquals(deactivatedEvent.getType(), activatedEvent.getType());
    }

Yes, it's a bug, Will raise a case.

Thanks