Bug 1029: Remove dead code: samples/clustersession
[controller.git] / opendaylight / northbound / staticrouting / src / test / java / org / opendaylight / controller / forwarding / staticrouting / northbound / StaticRoutingNorthboundTest.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.forwarding.staticrouting.northbound;
9
10 import java.util.ArrayList;
11 import java.util.List;
12
13 import org.junit.Assert;
14 import org.junit.Test;
15
16 public class StaticRoutingNorthboundTest {
17
18     @Test
19     public void testStaticRoute() {
20         StaticRoute sr = new StaticRoute();
21         Assert.assertTrue(sr.getName() == null);
22         Assert.assertTrue(sr.getPrefix() == null);
23         Assert.assertTrue(sr.getNextHop() == null);
24
25         sr = new StaticRoute("Static Route 1", "192.168.100.0/24", "170.0.0.1");
26         Assert.assertTrue(sr.getName().equals("Static Route 1"));
27         Assert.assertTrue(sr.getPrefix().equals("192.168.100.0/24"));
28         Assert.assertTrue(sr.getNextHop().equals("170.0.0.1"));
29
30         sr.setName("Static Route 2");
31         Assert.assertTrue(sr.getName().equals("Static Route 2"));
32         sr.setPrefix("192.168.100.0/26");
33         Assert.assertTrue(sr.getPrefix().equals("192.168.100.0/26"));
34         sr.setNextHop("170.0.2.1");
35         Assert.assertTrue(sr.getNextHop().equals("170.0.2.1"));
36     }
37
38     @Test
39     public void testStaticRoutes() {
40         StaticRoutes srs = new StaticRoutes(null);
41         Assert.assertTrue(srs.getFlowConfig() == null);
42
43         List<StaticRoute> srl = new ArrayList<StaticRoute>();
44         srs.setFlowConfig(srl);
45         Assert.assertTrue(srs.getFlowConfig().equals(srl));
46     }
47
48 }