Merge "BUG-4326: Eliminate dependency to org.apache.mina"
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / registry / flow / FlowDescriptorDtoTest.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.registry.flow;
10
11 import org.junit.Assert;
12 import org.junit.Test;
13 import org.opendaylight.openflowplugin.api.openflow.registry.flow.FlowDescriptor;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
15
16 /**
17  * Test for {@link FlowDescriptorFactory.FlowDescriptorDto}.
18  */
19 public class FlowDescriptorDtoTest {
20
21     @Test
22     public void testCreate() throws Exception {
23         final FlowDescriptor flowDescriptor = FlowDescriptorFactory.create((short) 1, new FlowId("unit:1"));
24         Assert.assertNotNull(flowDescriptor);
25         Assert.assertNotNull(flowDescriptor.getFlowId());
26         Assert.assertNotNull(flowDescriptor.getTableKey());
27     }
28
29     @Test(expected = NullPointerException.class)
30     public void testCreateNegative1() throws Exception {
31         FlowDescriptorFactory.create((short) 1, null);
32     }
33 }