YANG revision dates mass-update
[bgpcep.git] / bmp / bmp-parser-impl / src / test / java / org / opendaylight / protocol / bmp / parser / message / AbstractBmpMessageTest.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.protocol.bmp.parser.message;
10
11 import org.junit.After;
12 import org.junit.Before;
13 import org.opendaylight.protocol.bgp.parser.impl.BGPActivator;
14 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
15 import org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext;
16 import org.opendaylight.protocol.bmp.parser.BmpActivator;
17 import org.opendaylight.protocol.bmp.spi.registry.BmpMessageRegistry;
18 import org.opendaylight.protocol.bmp.spi.registry.SimpleBmpExtensionProviderContext;
19
20 public abstract class AbstractBmpMessageTest {
21
22     private BmpMessageRegistry messageRegistry;
23     private BGPActivator bgpActivator;
24     private BmpActivator bmpActivator;
25
26     @Before
27     public final void setUp() {
28         this.bgpActivator = new BGPActivator();
29         final BGPExtensionProviderContext context = new SimpleBGPExtensionProviderContext();
30         this.bgpActivator.start(context);
31         final SimpleBmpExtensionProviderContext ctx = new SimpleBmpExtensionProviderContext();
32         this.bmpActivator = new BmpActivator(context);
33         this.bmpActivator.start(ctx);
34         this.messageRegistry = ctx.getBmpMessageRegistry();
35     }
36
37     @After
38     public final void tearDown() {
39         this.bgpActivator.close();
40         this.bmpActivator.close();
41     }
42
43     protected final BmpMessageRegistry getBmpMessageRegistry() {
44         return this.messageRegistry;
45     }
46
47 }