Ray Milkey
Committed by Gerrit Code Review

Move unit tests to a directory structure that follows the classes under test

Change-Id: Ibfa840e4aab4100125b4ead0f864f5ad1bea18b6
Showing 27 changed files with 79 additions and 155 deletions
/*
* Copyright 2014-2015 Open Networking Laboratory
*
* 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.bgp;
import org.junit.Test;
import org.onosproject.bgpio.types.IsIsNonPseudonode;
import com.google.common.testing.EqualsTester;
/**
* Test for IsIsNonPseudonode Tlv.
*/
public class IsIsNonPseudonodeTest {
private final byte[] value1 = new byte[] {0x19, 0x00, (byte) 0x95, 0x01, (byte) 0x90, 0x58};
private final byte[] value2 = new byte[] {0x19, 0x00, (byte) 0x95, 0x01, (byte) 0x90, 0x59};
private final IsIsNonPseudonode tlv1 = IsIsNonPseudonode.of(value1);
private final IsIsNonPseudonode sameAsTlv1 = IsIsNonPseudonode.of(value1);
private final IsIsNonPseudonode tlv2 = IsIsNonPseudonode.of(value2);
@Test
public void basics() {
new EqualsTester()
.addEqualityGroup(tlv1, sameAsTlv1)
.addEqualityGroup(tlv2)
.testEquals();
}
}
\ No newline at end of file
/*
* Copyright 2014-2015 Open Networking Laboratory
*
* 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.bgp;
import org.junit.Test;
import org.onosproject.bgpio.types.OSPFNonPseudonode;
import com.google.common.testing.EqualsTester;
/**
* Test for OSPFNonPseudonode Tlv.
*/
public class OspfNonPseudonodeTest {
private final int value1 = 0x12121212;
private final int value2 = 0x12121211;
private final OSPFNonPseudonode tlv1 = OSPFNonPseudonode.of(value1);
private final OSPFNonPseudonode sameAsTlv1 = OSPFNonPseudonode.of(value1);
private final OSPFNonPseudonode tlv2 = OSPFNonPseudonode.of(value2);
@Test
public void basics() {
new EqualsTester()
.addEqualityGroup(tlv1, sameAsTlv1)
.addEqualityGroup(tlv2)
.testEquals();
}
}
......@@ -13,22 +13,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.core.Is.is;
package org.onosproject.bgpio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.Test;
import org.onosproject.bgpio.exceptions.BGPParseException;
import org.onosproject.bgpio.protocol.BGPFactories;
import org.onosproject.bgpio.protocol.BGPKeepaliveMsg;
import org.onosproject.bgpio.protocol.BGPMessage;
import org.onosproject.bgpio.protocol.BGPMessageReader;
import org.onosproject.bgpio.types.BGPHeader;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.core.Is.is;
/**
* Test case for BGP KEEPALIVE Message.
*/
......
......@@ -13,22 +13,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.core.Is.is;
package org.onosproject.bgpio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.Test;
import org.onosproject.bgpio.exceptions.BGPParseException;
import org.onosproject.bgpio.protocol.BGPFactories;
import org.onosproject.bgpio.protocol.BGPMessage;
import org.onosproject.bgpio.protocol.BGPMessageReader;
import org.onosproject.bgpio.protocol.BGPOpenMsg;
import org.onosproject.bgpio.types.BGPHeader;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.core.Is.is;
/**
* Test cases for BGP Open Message.
*/
......
......@@ -13,22 +13,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.core.Is.is;
package org.onosproject.bgpio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.Test;
import org.onosproject.bgpio.exceptions.BGPParseException;
import org.onosproject.bgpio.protocol.BGPFactories;
import org.onosproject.bgpio.protocol.BGPMessage;
import org.onosproject.bgpio.protocol.BGPMessageReader;
import org.onosproject.bgpio.protocol.BGPNotificationMsg;
import org.onosproject.bgpio.types.BGPHeader;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.core.Is.is;
/**
* Test for Notification message.
*/
......
......@@ -13,12 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
import com.google.common.testing.EqualsTester;
package org.onosproject.bgpio.types;
import org.junit.Test;
import org.onosproject.bgpio.types.AreaIDTlv;
import com.google.common.testing.EqualsTester;
/**
* Test for AreaID Tlv.
......@@ -37,4 +36,42 @@ public class AreaIdTest {
.addEqualityGroup(tlv2)
.testEquals();
}
/**
* Test for OSPFNonPseudonode Tlv.
*/
public static class OspfNonPseudonodeTest {
private final int value1 = 0x12121212;
private final int value2 = 0x12121211;
private final OSPFNonPseudonode tlv1 = OSPFNonPseudonode.of(value1);
private final OSPFNonPseudonode sameAsTlv1 = OSPFNonPseudonode.of(value1);
private final OSPFNonPseudonode tlv2 = OSPFNonPseudonode.of(value2);
@Test
public void basics() {
new EqualsTester()
.addEqualityGroup(tlv1, sameAsTlv1)
.addEqualityGroup(tlv2)
.testEquals();
}
}
/**
* Test for IsIsNonPseudonode Tlv.
*/
public static class IsIsNonPseudonodeTest {
private final byte[] value1 = new byte[] {0x19, 0x00, (byte) 0x95, 0x01, (byte) 0x90, 0x58};
private final byte[] value2 = new byte[] {0x19, 0x00, (byte) 0x95, 0x01, (byte) 0x90, 0x59};
private final IsIsNonPseudonode tlv1 = IsIsNonPseudonode.of(value1);
private final IsIsNonPseudonode sameAsTlv1 = IsIsNonPseudonode.of(value1);
private final IsIsNonPseudonode tlv2 = IsIsNonPseudonode.of(value2);
@Test
public void basics() {
new EqualsTester()
.addEqualityGroup(tlv1, sameAsTlv1)
.addEqualityGroup(tlv2)
.testEquals();
}
}
}
......
......@@ -13,13 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
package org.onosproject.bgpio.types;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.onosproject.bgpio.types.As4Path;
import com.google.common.testing.EqualsTester;
......
......@@ -13,13 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
package org.onosproject.bgpio.types;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.onosproject.bgpio.types.AsPath;
import com.google.common.testing.EqualsTester;
......
......@@ -13,12 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
import com.google.common.testing.EqualsTester;
package org.onosproject.bgpio.types;
import org.junit.Test;
import org.onosproject.bgpio.types.AutonomousSystemTlv;
import com.google.common.testing.EqualsTester;
/**
* Test for AutonomousSystem Tlv.
......
......@@ -13,10 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
package org.onosproject.bgpio.types;
import org.junit.Test;
import org.onosproject.bgpio.types.BGPLSIdentifierTlv;
import com.google.common.testing.EqualsTester;
......
......@@ -13,10 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
package org.onosproject.bgpio.types;
import org.junit.Test;
import org.onosproject.bgpio.types.IPReachabilityInformationTlv;
import com.google.common.testing.EqualsTester;
......
......@@ -13,11 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
package org.onosproject.bgpio.types;
import org.junit.Test;
import org.onlab.packet.Ip4Address;
import org.onosproject.bgpio.types.IPv4AddressTlv;
import com.google.common.testing.EqualsTester;
......
......@@ -13,11 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
package org.onosproject.bgpio.types;
import org.junit.Test;
import org.onlab.packet.Ip6Address;
import org.onosproject.bgpio.types.IPv6AddressTlv;
import com.google.common.testing.EqualsTester;
......
......@@ -13,10 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
package org.onosproject.bgpio.types;
import org.junit.Test;
import org.onosproject.bgpio.types.IsIsPseudonode;
import com.google.common.testing.EqualsTester;
......
......@@ -13,10 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
package org.onosproject.bgpio.types;
import org.junit.Test;
import org.onosproject.bgpio.types.LinkLocalRemoteIdentifiersTlv;
import com.google.common.testing.EqualsTester;
......
......@@ -13,11 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
package org.onosproject.bgpio.types;
import org.junit.Test;
import org.onlab.packet.Ip4Address;
import org.onosproject.bgpio.types.NextHop;
import com.google.common.testing.EqualsTester;
......
......@@ -13,10 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
package org.onosproject.bgpio.types;
import org.junit.Test;
import org.onosproject.bgpio.types.Origin;
import com.google.common.testing.EqualsTester;
......
......@@ -13,11 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
package org.onosproject.bgpio.types;
import org.junit.Test;
import org.onlab.packet.Ip4Address;
import org.onosproject.bgpio.types.OSPFPseudonode;
import com.google.common.testing.EqualsTester;
......
......@@ -13,10 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
package org.onosproject.bgpio.types;
import org.junit.Test;
import org.onosproject.bgpio.types.OSPFRouteTypeTlv;
import com.google.common.testing.EqualsTester;
......
......@@ -13,10 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
package org.onosproject.bgpio.types.attr;
import org.junit.Test;
import org.onosproject.bgpio.types.attr.BgpAttrNodeFlagBitTlv;
import com.google.common.testing.EqualsTester;
......
......@@ -13,11 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
package org.onosproject.bgpio.types.attr;
import org.junit.Test;
import org.onlab.packet.Ip6Address;
import org.onosproject.bgpio.types.attr.BgpAttrRouterIdV6;
import com.google.common.testing.EqualsTester;
......
......@@ -13,10 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
package org.onosproject.bgpio.types.attr;
import org.junit.Test;
import org.onosproject.bgpio.types.attr.BgpLinkAttrIgpMetric;
import com.google.common.testing.EqualsTester;
......
......@@ -13,10 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
package org.onosproject.bgpio.types.attr;
import org.junit.Test;
import org.onosproject.bgpio.types.attr.BgpLinkAttrMplsProtocolMask;
import com.google.common.testing.EqualsTester;
......
......@@ -13,10 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
package org.onosproject.bgpio.types.attr;
import org.junit.Test;
import org.onosproject.bgpio.types.attr.BgpLinkAttrProtectionType;
import com.google.common.testing.EqualsTester;
......
......@@ -13,10 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
package org.onosproject.bgpio.types.attr;
import org.junit.Test;
import org.onosproject.bgpio.types.attr.BgpPrefixAttrIgpFlags;
import com.google.common.testing.EqualsTester;
......
......@@ -13,10 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
package org.onosproject.bgpio.types.attr;
import org.junit.Test;
import org.onosproject.bgpio.types.attr.BgpPrefixAttrMetric;
import com.google.common.testing.EqualsTester;
......
......@@ -13,12 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.bgp;
package org.onosproject.bgpio.types.attr;
import org.junit.Test;
import org.onlab.packet.Ip4Address;
import org.onlab.packet.Ip6Address;
import org.onosproject.bgpio.types.attr.BgpPrefixAttrOspfFwdAddr;
import com.google.common.testing.EqualsTester;
......