2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.protocol.bmp.spi.registry;
10 import java.util.ArrayList;
11 import java.util.List;
12 import org.junit.Test;
13 import org.opendaylight.protocol.bmp.spi.parser.BmpDeserializationException;
15 public class AbstractBmpExtensionProviderActivatorTest {
17 private final SimpleAbstractBmpExtensionProviderActivator activator = new SimpleAbstractBmpExtensionProviderActivator();
18 private static final SimpleBmpExtensionProviderContext context = new SimpleBmpExtensionProviderContext();
22 public void testStartActivator() throws BmpDeserializationException {
23 this.activator.start(context);
24 this.activator.close();
27 @Test(expected=IllegalStateException.class)
28 public void testStopActivator() {
29 this.activator.close();
32 private static class SimpleAbstractBmpExtensionProviderActivator extends AbstractBmpExtensionProviderActivator {
34 protected List<AutoCloseable> startImpl(final BmpExtensionProviderContext context) {
35 final List<AutoCloseable> reg = new ArrayList<AutoCloseable>();
36 reg.add(context.registerBmpMessageParser(1, new SimpleBmpMessageRegistry()));