X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fsal%2Fapi%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fpacket%2FUDPTest.java;h=a3a597a82d0fcb4524da02f174c9ca0419174c81;hb=e55942fd1fcc4748197146b81f7497256de22a94;hp=8d5be849a034d5a147998d7adcf5099481acb552;hpb=33ea0032f0837333a9181dd7556faa3266155080;p=controller.git diff --git a/opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/packet/UDPTest.java b/opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/packet/UDPTest.java index 8d5be849a0..a3a597a82d 100644 --- a/opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/packet/UDPTest.java +++ b/opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/packet/UDPTest.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * Copyright (c) 2013-2014 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, @@ -12,6 +12,8 @@ package org.opendaylight.controller.sal.packet; import junit.framework.Assert; import org.junit.Test; +import org.opendaylight.controller.sal.match.Match; +import org.opendaylight.controller.sal.match.MatchType; public class UDPTest { @@ -95,4 +97,19 @@ public class UDPTest { } + @Test + public void testGetMatch() throws Exception { + UDP udp = new UDP(); + short sport = (short) 33000; + short dport = (short) 843; + udp.setSourcePort(sport); + udp.setDestinationPort(dport); + + Match match = udp.getMatch(); + + Assert.assertEquals(sport, (short) match.getField(MatchType.TP_SRC).getValue()); + Assert.assertEquals(dport, (short) match.getField(MatchType.TP_DST).getValue()); + + } + }