2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.openflowplugin.impl.registry.flow;
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;
17 * Test for {@link FlowDescriptorFactory.FlowDescriptorDto}.
19 public class FlowDescriptorDtoTest {
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());
29 @Test(expected = NullPointerException.class)
30 public void testCreateNegative1() throws Exception {
31 FlowDescriptorFactory.create((short) 1, null);