BUG-2218: Keep existing link augmentations during discovery process
[controller.git] / opendaylight / northbound / flowprogrammer / src / test / java / org / opendaylight / controller / flowprogrammer / northbound / FlowProgrammerNorthboundTest.java
1 /*
2  * Copyright (c) 2014 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 package org.opendaylight.controller.flowprogrammer.northbound;
9
10 import java.util.ArrayList;
11
12 import org.junit.Assert;
13 import org.junit.Test;
14 import org.opendaylight.controller.forwardingrulesmanager.FlowConfig;
15
16 public class FlowProgrammerNorthboundTest {
17
18     @Test
19     public void testFlowConfigs() {
20         FlowConfigs fc = new FlowConfigs(null);
21         Assert.assertNull(fc.getFlowConfig());
22
23         FlowConfig conf = new FlowConfig();
24         FlowConfig conf2 = new FlowConfig();
25         ArrayList<FlowConfig> list = new ArrayList<FlowConfig>();
26
27         list.add(conf);
28         list.add(conf2);
29         FlowConfigs fc2 = new FlowConfigs(list);
30         Assert.assertTrue(fc2.getFlowConfig().equals(list));
31
32         fc.setFlowConfig(list);
33         Assert.assertTrue(fc.getFlowConfig().equals(fc2.getFlowConfig()));
34
35         fc.setFlowConfig(null);
36         Assert.assertNull(fc.getFlowConfig());
37
38     }
39
40 }