blob: 13d78cc89ecea011bbc73a167cb46eedeffa7d02 [file] [log] [blame]
/*
* Copyright 2016-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.nemo.model.common;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* Unit tests for {@link ConnectionType}.
*/
public class ConnectionTypeTest {
private static final String NAME = "SomeName";
private static final String OTHER = "OtherName";
private ConnectionType name;
private ConnectionType copy;
private ConnectionType diff;
@Test
public void fromString() {
name = new ConnectionType(NAME);
assertEquals("name not set", NAME, name.getValue());
}
@Test
public void copyConstructor() {
name = new ConnectionType(NAME);
copy = new ConnectionType(name);
new EqualsTester()
.addEqualityGroup(name, copy)
.testEquals();
}
@Test
public void equality() {
name = new ConnectionType(NAME);
copy = new ConnectionType(NAME);
diff = new ConnectionType(OTHER);
new EqualsTester()
.addEqualityGroup(name, copy)
.addEqualityGroup(diff)
.testEquals();
}
}