5170dd75d64d088b0ace332bd524ef9f36e966c4
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / device / DeviceStateImplTest.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.openflowplugin.impl.device;
10
11 import org.junit.Assert;
12 import org.junit.Before;
13 import org.junit.Test;
14 import org.junit.runner.RunWith;
15 import org.mockito.Mock;
16 import org.mockito.runners.MockitoJUnitRunner;
17 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
18
19 /**
20  * openflowplugin-impl
21  * org.opendaylight.openflowplugin.impl.device
22  *
23  * test of {@link DeviceStateImpl} - lightweight version, using basic ways (TDD)
24  */
25 @RunWith(MockitoJUnitRunner.class)
26 public class DeviceStateImplTest {
27
28     @Mock
29     private DeviceInfo deviceInfo;
30
31     private DeviceStateImpl deviceState;
32
33     @Before
34     public void initialization() {
35         deviceState = new DeviceStateImpl(deviceInfo);
36     }
37
38     @Test
39     public void testIsValid_initialValue(){
40         Assert.assertFalse(deviceState.isValid());
41     }
42
43     @Test
44     public void testDeviceSynchronized_initialValue(){
45         Assert.assertFalse(deviceState.deviceSynchronized());
46     }
47
48     @Test
49     public void testStatPollEnabled_initialValue(){
50         Assert.assertFalse(deviceState.isStatisticsPollingEnabled());
51     }
52
53     @Test
54     public void testStatistics_initialValue(){
55         Assert.assertFalse(deviceState.isFlowStatisticsAvailable());
56         Assert.assertFalse(deviceState.isPortStatisticsAvailable());
57         Assert.assertFalse(deviceState.isQueueStatisticsAvailable());
58         Assert.assertFalse(deviceState.isTableStatisticsAvailable());
59     }
60
61     @Test
62     public void testMeterAndGroupAvailable_initialValue(){
63         Assert.assertFalse(deviceState.isGroupAvailable());
64         Assert.assertFalse(deviceState.isMetersAvailable());
65     }
66
67 }