@Override
    public Collection<DelayMeasurementEntry> getAllDms(
            MdId mdName, MaIdShort maName, MepId mepId)
                    throws CfmConfigException, SoamConfigException {
        MepEntry mep = cfmMepService.getMep(mdName, maName, mepId);
        if (mep == null || mep.deviceId() == null) {
            throw new CfmConfigException("MEP :"
                    + mdName + "/" + maName + "/" + mepId + " does not exist");
        } else if (deviceService.getDevice(mep.deviceId()) == null) {
            throw new CfmConfigException("Device " + mep.deviceId() + " from MEP :"
                    + mdName + "/" + maName + "/" + mepId + " does not exist");
        } else if (!deviceService.getDevice(mep.deviceId()).is(SoamDmProgrammable.class)) {
            throw new CfmConfigException("Device " + mep.deviceId() + " from MEP :"
                    + mdName + "/" + maName + "/" + mepId +
                    " does not implement SoamDmProgrammable");
        }
        log.debug("Retrieving DMs for MD {}, MA {}, MEP {} on Device {}",
                mdName, maName, mepId, mep.deviceId());

        return deviceService.getDevice(mep.deviceId())
                .as(SoamDmProgrammable.class).getAllDms(mdName, maName, mepId);
    }
@Test
    public void testGetAllDms() throws CfmConfigException, SoamConfigException {
        expect(deviceService.getDevice(DEVICE_ID1)).andReturn(device1).anyTimes();
        replay(deviceService);

        expect(mepService.getMep(MDNAME1, MANAME1, MEPID1)).andReturn(mep1).anyTimes();
        replay(mepService);

        expect(driverService.getDriver(DEVICE_ID1)).andReturn(testDriver).anyTimes();
        replay(driverService);

        Collection<DelayMeasurementEntry> dmEntries =
                soamManager.getAllDms(MDNAME1, MANAME1, MEPID1);
        assertNotNull(dmEntries);
        assertEquals(1, dmEntries.size());
    }