1+ // Licensed to the Apache Software Foundation (ASF) under one
2+ // or more contributor license agreements. See the NOTICE file
3+ // distributed with this work for additional information
4+ // regarding copyright ownership. The ASF licenses this file
5+ // to you under the Apache License, Version 2.0 (the
6+ // "License"); you may not use this file except in compliance
7+ // with the License. You may obtain a copy of the License at
8+ //
9+ // http://www.apache.org/licenses/LICENSE-2.0
10+ //
11+ // Unless required by applicable law or agreed to in writing,
12+ // software distributed under the License is distributed on an
13+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+ // KIND, either express or implied. See the License for the
15+ // specific language governing permissions and limitations
16+ // under the License.
17+ package com .cloud .network .nicira ;
18+
19+ import org .junit .Test ;
20+ import static org .junit .Assert .*;
21+
22+ public class NiciraTagTest {
23+ @ Test
24+ public void testCreateTag () {
25+ NiciraNvpTag tag = new NiciraNvpTag ("scope" ,"tag" );
26+ assertEquals ("scope part set" , "scope" , tag .getScope ());
27+ assertEquals ("tag part set" , "tag" , tag .getTag ());
28+ }
29+
30+ @ Test
31+ public void testCreateLongTag () {
32+ NiciraNvpTag tag = new NiciraNvpTag ("scope" ,"verylongtagthatshouldattheminimumexceedthefortycharacterlenght" );
33+ assertEquals ("scope part set" , "scope" , tag .getScope ());
34+ assertEquals ("tag part set" , "verylongtagthatshouldattheminimumexceedt" , tag .getTag ());
35+ }
36+
37+ @ Test
38+ public void testSetTag () {
39+ NiciraNvpTag tag = new NiciraNvpTag ();
40+ tag .setScope ("scope" );
41+ tag .setTag ("tag" );
42+ assertEquals ("scope part set" , "scope" , tag .getScope ());
43+ assertEquals ("tag part set" , "tag" , tag .getTag ());
44+ }
45+
46+ @ Test
47+ public void testSetLongTag () {
48+ NiciraNvpTag tag = new NiciraNvpTag ();
49+ tag .setScope ("scope" );
50+ tag .setTag ("verylongtagthatshouldattheminimumexceedthefortycharacterlenght" );
51+ assertEquals ("scope part set" , "scope" , tag .getScope ());
52+ assertEquals ("tag part set" , "verylongtagthatshouldattheminimumexceedt" , tag .getTag ());
53+ }
54+ }
0 commit comments