2 * Copyright 2018 ZTE Corporation.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.onap.sfc.entity;
19 import org.junit.Before;
20 import org.junit.Test;
22 import static org.junit.Assert.*;
24 public class FlowClassfierReq4NTest {
25 FlowClassfierReq4N flowClassfierReq4N;
28 public void setUp() throws Exception {
29 flowClassfierReq4N = new FlowClassfierReq4N();
33 public void getAndSetUrl() throws Exception {
34 String url = "http://0.0.0.0:8080";
35 flowClassfierReq4N.setUrl(url);
36 assert flowClassfierReq4N.getUrl().equals(url);
40 public void getAndSetSdnControllerId() throws Exception {
41 String sdnControllerId = "123-456-789";
42 flowClassfierReq4N.setSdnControllerId(sdnControllerId);
43 assert flowClassfierReq4N.getSdnControllerId().equals(sdnControllerId);
47 public void getAndSetName() throws Exception {
49 flowClassfierReq4N.setName(name);
50 assert flowClassfierReq4N.getName().equals(name);
54 public void getAndSetDescription() throws Exception {
55 String description = "description";
56 flowClassfierReq4N.setDescription(description);
57 assert flowClassfierReq4N.getDescription().equals(description);
61 public void getAndSetDscp() throws Exception {
63 flowClassfierReq4N.setDscp(dscp);
64 assert flowClassfierReq4N.getDscp() == dscp;
68 public void getAndSetIpProto() throws Exception {
69 String ipProto = "ISIS";
70 flowClassfierReq4N.setIpProto(ipProto);
71 assert flowClassfierReq4N.getIpProto().equals(ipProto);
75 public void getAndSetSourcePortRange() throws Exception {
76 String sourcePortRange = "1-400";
77 flowClassfierReq4N.setSourcePortRange(sourcePortRange);
78 assert flowClassfierReq4N.getSourcePortRange().equals(sourcePortRange);
82 public void getAndSetDestPortRange() throws Exception {
83 String destPortRange = "1-400";
84 flowClassfierReq4N.setDestPortRange(destPortRange);
85 assert flowClassfierReq4N.getDestPortRange().equals(destPortRange);
89 public void getAndSetSourceIpRange() throws Exception {
90 String sourceIpRange = "0.0.0.0-1.1.1.1";
91 flowClassfierReq4N.setSourceIpRange(sourceIpRange);
92 assert flowClassfierReq4N.getSourceIpRange().equals(sourceIpRange);
96 public void getAndSetDestIpRange() throws Exception {
97 String destIpRange = "0.0.0.0-1.1.1.1";
98 flowClassfierReq4N.setDestIpRange(destIpRange);
99 assert flowClassfierReq4N.getDestIpRange().equals(destIpRange);