Provide Add Path support for all AFI/SAFI
[bgpcep.git] / config-loader / bmp-monitors-config-loader / src / test / java / org / opendaylight / bgpcep / config / loader / bmp / BmpMonitorConfigFileProcessorTest.java
1 /*
2  * Copyright (c) 2017 AT&T Intellectual Property. 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.bgpcep.config.loader.bmp;
10
11 import static org.junit.Assert.assertEquals;
12 import static org.junit.Assert.assertNotNull;
13 import static org.opendaylight.bgpcep.config.loader.bmp.BmpMonitorConfigFileProcessor.ODL_BMP_MONITORS_IID;
14 import static org.opendaylight.protocol.util.CheckUtil.checkNotPresentConfiguration;
15 import static org.opendaylight.protocol.util.CheckUtil.checkPresentConfiguration;
16
17 import org.junit.Before;
18 import org.junit.Test;
19 import org.opendaylight.bgpcep.config.loader.impl.AbstractConfigLoader;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.monitor.config.rev180329.OdlBmpMonitors;
21 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
22
23 public class BmpMonitorConfigFileProcessorTest extends AbstractConfigLoader {
24
25     @Override
26     @Before
27     public void setUp() throws Exception {
28         super.setUp();
29     }
30
31     @Test
32     public void configFileTest() throws Exception {
33         checkNotPresentConfiguration(getDataBroker(), ODL_BMP_MONITORS_IID);
34
35         assertNotNull(ClassLoader.getSystemClassLoader().getResource("initial/odl-bmp-monitors-config.xml"));
36         final BmpMonitorConfigFileProcessor processor = new BmpMonitorConfigFileProcessor(this.configLoader,
37                 getDataBroker());
38         processor.init();
39         checkPresentConfiguration(getDataBroker(), ODL_BMP_MONITORS_IID);
40
41         assertEquals(SchemaPath.create(true, OdlBmpMonitors.QNAME),
42                 processor.getSchemaPath());
43         processor.close();
44     }
45 }