diff options
Diffstat (limited to 'framework/src/onos/bgp')
-rwxr-xr-x | framework/src/onos/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/attr/BgpPrefixAttrIgpFlags.java (renamed from framework/src/onos/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/attr/BgpPrefixAttrIGPFlags.java) | 70 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/AreaIdTest.java | 40 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/IsIsNonPseudonodeTest.java | 40 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/OspfNonPseudonodeTest.java | 40 | ||||
-rwxr-xr-x | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/protocol/BGPKeepaliveMsgTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BGPKeepaliveMsgTest.java) | 14 | ||||
-rwxr-xr-x | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/protocol/BGPOpenMsgTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BGPOpenMsgTest.java) | 14 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/protocol/BgpNotificationMsgTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpNotificationMsgTest.java) | 16 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/AreaIdTest.java | 77 | ||||
-rwxr-xr-x | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/As4PathTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/As4PathTest.java) | 5 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/AsPathTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/AsPathTest.java) | 5 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/AutonomousSystemTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/AutonomousSystemTest.java) | 9 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/BGPLSIdentifierTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BGPLSIdentifierTest.java) | 5 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/IPReachabilityInformationTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/IPReachabilityInformationTest.java) | 5 | ||||
-rwxr-xr-x | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/IPv4AddressTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/IPv4AddressTest.java) | 5 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/IPv6AddressTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/IPv6AddressTest.java) | 5 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/IsIsPseudonodeTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/IsIsPseudonodeTest.java) | 5 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/LinkLocalRemoteIdentifiersTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/LinkLocalRemoteIdentifiersTest.java) | 5 | ||||
-rwxr-xr-x | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/NextHopTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/NextHopTest.java) | 5 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/OriginTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/OriginTest.java) | 3 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/OspfPseudonodeTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/OspfPseudonodeTest.java) | 5 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/OspfRouteTypeTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/OspfRouteTypeTest.java) | 5 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpAttrNodeFlagBitTlvTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpAttrNodeFlagBitTlvTest.java) | 5 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpAttrRouterIdV6Test.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpAttrRouterIdV6Test.java) | 5 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpLinkAttrIgpMetricTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrIgpMetricTest.java) | 5 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpLinkAttrMplsProtocolMaskTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrMplsProtocolMaskTest.java) | 5 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpLinkAttrProtectionTypeTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrProtectionTypeTest.java) | 5 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpPrefixAttrIgpFlagsTest.java | 53 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpPrefixAttrMetricTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpPrefixAttrMetricTest.java) | 5 | ||||
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpPrefixAttrOspfFwdAddrTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpPrefixAttrOspfFwdAddrTest.java) | 5 |
29 files changed, 231 insertions, 235 deletions
diff --git a/framework/src/onos/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/attr/BgpPrefixAttrIGPFlags.java b/framework/src/onos/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/attr/BgpPrefixAttrIgpFlags.java index 035d706c..a215e6f1 100755 --- a/framework/src/onos/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/attr/BgpPrefixAttrIGPFlags.java +++ b/framework/src/onos/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/attr/BgpPrefixAttrIgpFlags.java @@ -30,24 +30,24 @@ import com.google.common.base.MoreObjects; /** * Implements BGP prefix IGP Flag attribute. */ -public class BgpPrefixAttrIGPFlags implements BGPValueType { +public final class BgpPrefixAttrIgpFlags implements BGPValueType { protected static final Logger log = LoggerFactory - .getLogger(BgpPrefixAttrIGPFlags.class); + .getLogger(BgpPrefixAttrIgpFlags.class); public static final int ATTR_PREFIX_FLAGBIT = 1152; public static final int ATTR_PREFIX_FLAG_LEN = 1; - public static final int FIRST_BIT = 0x80; - public static final int SECOND_BIT = 0x40; - public static final int THIRD_BIT = 0x20; - public static final int FOURTH_BIT = 0x01; + public static final byte FIRST_BIT = (byte) 0x80; + public static final byte SECOND_BIT = 0x40; + public static final byte THIRD_BIT = 0x20; + public static final byte FOURTH_BIT = 0x01; /* Prefix IGP flag bit TLV */ - private boolean bisisUpDownBit = false; - private boolean bOspfNoUnicastBit = false; - private boolean bOspfLclAddrBit = false; - private boolean bOspfNSSABit = false; + private final boolean bisisUpDownBit; + private final boolean bOspfNoUnicastBit; + private final boolean bOspfLclAddrBit; + private final boolean bOspfNSSABit; /** * Constructor to initialize the value. @@ -57,7 +57,8 @@ public class BgpPrefixAttrIGPFlags implements BGPValueType { * @param bOspfLclAddrBit OSPF local address Bit * @param bOspfNSSABit OSPF propagate NSSA Bit */ - BgpPrefixAttrIGPFlags(boolean bisisUpDownBit, boolean bOspfNoUnicastBit, + BgpPrefixAttrIgpFlags(boolean bisisUpDownBit, + boolean bOspfNoUnicastBit, boolean bOspfLclAddrBit, boolean bOspfNSSABit) { this.bisisUpDownBit = bisisUpDownBit; this.bOspfNoUnicastBit = bOspfNoUnicastBit; @@ -66,13 +67,30 @@ public class BgpPrefixAttrIGPFlags implements BGPValueType { } /** + * Returns object of this class with specified values. + * + * @param bisisUpDownBit IS-IS Up/Down Bit + * @param bOspfNoUnicastBit OSPF no unicast Bit + * @param bOspfLclAddrBit OSPF local address Bit + * @param bOspfNSSABit OSPF propagate NSSA Bit + * @return object of BgpPrefixAttrIGPFlags + */ + public static BgpPrefixAttrIgpFlags of(final boolean bisisUpDownBit, + final boolean bOspfNoUnicastBit, + final boolean bOspfLclAddrBit, + final boolean bOspfNSSABit) { + return new BgpPrefixAttrIgpFlags(bisisUpDownBit, bOspfNoUnicastBit, + bOspfLclAddrBit, bOspfNSSABit); + } + + /** * Reads the IGP Flags. * * @param cb ChannelBuffer * @return object of BgpPrefixAttrIGPFlags * @throws BGPParseException while parsing BgpPrefixAttrIGPFlags */ - public static BgpPrefixAttrIGPFlags read(ChannelBuffer cb) + public static BgpPrefixAttrIgpFlags read(ChannelBuffer cb) throws BGPParseException { boolean bisisUpDownBit = false; boolean bOspfNoUnicastBit = false; @@ -90,13 +108,13 @@ public class BgpPrefixAttrIGPFlags implements BGPValueType { byte nodeFlagBits = cb.readByte(); - bisisUpDownBit = ((nodeFlagBits & (byte) FIRST_BIT) == FIRST_BIT); - bOspfNoUnicastBit = ((nodeFlagBits & (byte) SECOND_BIT) == SECOND_BIT); - bOspfLclAddrBit = ((nodeFlagBits & (byte) THIRD_BIT) == THIRD_BIT); - bOspfNSSABit = ((nodeFlagBits & (byte) FOURTH_BIT) == FOURTH_BIT); + bisisUpDownBit = ((nodeFlagBits & FIRST_BIT) == FIRST_BIT); + bOspfNoUnicastBit = ((nodeFlagBits & SECOND_BIT) == SECOND_BIT); + bOspfLclAddrBit = ((nodeFlagBits & THIRD_BIT) == THIRD_BIT); + bOspfNSSABit = ((nodeFlagBits & FOURTH_BIT) == FOURTH_BIT); - return new BgpPrefixAttrIGPFlags(bisisUpDownBit, bOspfNoUnicastBit, - bOspfLclAddrBit, bOspfNSSABit); + return BgpPrefixAttrIgpFlags.of(bisisUpDownBit, bOspfNoUnicastBit, + bOspfLclAddrBit, bOspfNSSABit); } /** @@ -104,7 +122,7 @@ public class BgpPrefixAttrIGPFlags implements BGPValueType { * * @return IS-IS Up/Down Bit set or not */ - boolean getisisUpDownBit() { + public boolean isisUpDownBit() { return bisisUpDownBit; } @@ -113,7 +131,7 @@ public class BgpPrefixAttrIGPFlags implements BGPValueType { * * @return OSPF no unicast Bit set or not */ - boolean getOspfNoUnicastBit() { + public boolean ospfNoUnicastBit() { return bOspfNoUnicastBit; } @@ -122,7 +140,7 @@ public class BgpPrefixAttrIGPFlags implements BGPValueType { * * @return OSPF local address Bit set or not */ - boolean getOspfLclAddrBit() { + public boolean ospfLclAddrBit() { return bOspfLclAddrBit; } @@ -131,7 +149,7 @@ public class BgpPrefixAttrIGPFlags implements BGPValueType { * * @return OSPF propagate NSSA Bit set or not */ - boolean getOspfNSSABit() { + public boolean ospfNSSABit() { return bOspfNSSABit; } @@ -158,13 +176,13 @@ public class BgpPrefixAttrIGPFlags implements BGPValueType { return true; } - if (obj instanceof BgpPrefixAttrIGPFlags) { - BgpPrefixAttrIGPFlags other = (BgpPrefixAttrIGPFlags) obj; + if (obj instanceof BgpPrefixAttrIgpFlags) { + BgpPrefixAttrIgpFlags other = (BgpPrefixAttrIgpFlags) obj; return Objects.equals(bisisUpDownBit, other.bisisUpDownBit) && Objects.equals(bOspfNoUnicastBit, other.bOspfNoUnicastBit) - && Objects.equals(bOspfLclAddrBit, other.bOspfLclAddrBit) - && Objects.equals(bOspfNSSABit, other.bOspfNSSABit); + && Objects.equals(bOspfLclAddrBit, other.bOspfLclAddrBit) + && Objects.equals(bOspfNSSABit, other.bOspfNSSABit); } return false; } diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/AreaIdTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/AreaIdTest.java deleted file mode 100644 index 3e7c654e..00000000 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/AreaIdTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 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 com.google.common.testing.EqualsTester; - -import org.junit.Test; -import org.onosproject.bgpio.types.AreaIDTlv; - -/** - * Test for AreaID Tlv. - */ -public class AreaIdTest { - private final int value1 = 10; - private final int value2 = 20; - private final AreaIDTlv tlv1 = AreaIDTlv.of(value1); - private final AreaIDTlv sameAsTlv1 = AreaIDTlv.of(value1); - private final AreaIDTlv tlv2 = AreaIDTlv.of(value2); - - @Test - public void testEquality() { - new EqualsTester() - .addEqualityGroup(tlv1, sameAsTlv1) - .addEqualityGroup(tlv2) - .testEquals(); - } -}
\ No newline at end of file diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/IsIsNonPseudonodeTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/IsIsNonPseudonodeTest.java deleted file mode 100644 index 8112b51c..00000000 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/IsIsNonPseudonodeTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/OspfNonPseudonodeTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/OspfNonPseudonodeTest.java deleted file mode 100644 index 19002913..00000000 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/OspfNonPseudonodeTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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(); - } -} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BGPKeepaliveMsgTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/protocol/BGPKeepaliveMsgTest.java index 57ab9d90..68ce3070 100755 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BGPKeepaliveMsgTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/protocol/BGPKeepaliveMsgTest.java @@ -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. */ diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BGPOpenMsgTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/protocol/BGPOpenMsgTest.java index d010857e..d5210177 100755 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BGPOpenMsgTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/protocol/BGPOpenMsgTest.java @@ -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. */ diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpNotificationMsgTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/protocol/BgpNotificationMsgTest.java index d3e6e49c..78edf133 100644 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpNotificationMsgTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/protocol/BgpNotificationMsgTest.java @@ -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. */ @@ -225,4 +221,4 @@ public class BgpNotificationMsgTest { buf.readBytes(testNotificationMsg, 0, iReadLen); assertThat(testNotificationMsg, is(notificationMsg)); } -}
\ No newline at end of file +} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/AreaIdTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/AreaIdTest.java new file mode 100644 index 00000000..6a9e2ec5 --- /dev/null +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/AreaIdTest.java @@ -0,0 +1,77 @@ +/* + * Copyright 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.bgpio.types; + +import org.junit.Test; + +import com.google.common.testing.EqualsTester; + +/** + * Test for AreaID Tlv. + */ +public class AreaIdTest { + private final int value1 = 10; + private final int value2 = 20; + private final AreaIDTlv tlv1 = AreaIDTlv.of(value1); + private final AreaIDTlv sameAsTlv1 = AreaIDTlv.of(value1); + private final AreaIDTlv tlv2 = AreaIDTlv.of(value2); + + @Test + public void testEquality() { + new EqualsTester() + .addEqualityGroup(tlv1, sameAsTlv1) + .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(); + } + } +} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/As4PathTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/As4PathTest.java index 96d05bf3..3ea56b64 100755 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/As4PathTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/As4PathTest.java @@ -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; @@ -53,4 +52,4 @@ public class As4PathTest { .addEqualityGroup(attr4) .testEquals(); } -}
\ No newline at end of file +} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/AsPathTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/AsPathTest.java index 792164ea..e56ec5a5 100644 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/AsPathTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/AsPathTest.java @@ -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; @@ -53,4 +52,4 @@ public class AsPathTest { .addEqualityGroup(attr4) .testEquals(); } -}
\ No newline at end of file +} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/AutonomousSystemTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/AutonomousSystemTest.java index c41408de..1695583b 100644 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/AutonomousSystemTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/AutonomousSystemTest.java @@ -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. @@ -37,4 +36,4 @@ public class AutonomousSystemTest { .addEqualityGroup(tlv2) .testEquals(); } -}
\ No newline at end of file +} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BGPLSIdentifierTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/BGPLSIdentifierTest.java index 5f357815..f3355d35 100644 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BGPLSIdentifierTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/BGPLSIdentifierTest.java @@ -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; @@ -37,4 +36,4 @@ public class BGPLSIdentifierTest { .addEqualityGroup(tlv2) .testEquals(); } -}
\ No newline at end of file +} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/IPReachabilityInformationTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/IPReachabilityInformationTest.java index 81f4b725..7bea518a 100644 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/IPReachabilityInformationTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/IPReachabilityInformationTest.java @@ -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; @@ -38,4 +37,4 @@ public class IPReachabilityInformationTest { .addEqualityGroup(tlv2) .testEquals(); } -}
\ No newline at end of file +} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/IPv4AddressTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/IPv4AddressTest.java index f3a0469c..fdb71189 100755 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/IPv4AddressTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/IPv4AddressTest.java @@ -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; @@ -38,4 +37,4 @@ public class IPv4AddressTest { .addEqualityGroup(tlv2) .testEquals(); } -}
\ No newline at end of file +} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/IPv6AddressTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/IPv6AddressTest.java index 2023093f..781935b4 100644 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/IPv6AddressTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/IPv6AddressTest.java @@ -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; @@ -38,4 +37,4 @@ public class IPv6AddressTest { .addEqualityGroup(tlv2) .testEquals(); } -}
\ No newline at end of file +} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/IsIsPseudonodeTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/IsIsPseudonodeTest.java index bbc9e6a2..a2a7c2b5 100644 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/IsIsPseudonodeTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/IsIsPseudonodeTest.java @@ -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; @@ -37,4 +36,4 @@ public class IsIsPseudonodeTest { .addEqualityGroup(tlv2) .testEquals(); } -}
\ No newline at end of file +} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/LinkLocalRemoteIdentifiersTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/LinkLocalRemoteIdentifiersTest.java index 22b9aba3..f1510b17 100644 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/LinkLocalRemoteIdentifiersTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/LinkLocalRemoteIdentifiersTest.java @@ -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; @@ -37,4 +36,4 @@ public class LinkLocalRemoteIdentifiersTest { .addEqualityGroup(tlv2) .testEquals(); } -}
\ No newline at end of file +} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/NextHopTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/NextHopTest.java index 109197bb..799419a1 100755 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/NextHopTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/NextHopTest.java @@ -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; @@ -38,4 +37,4 @@ public class NextHopTest { .addEqualityGroup(attr2) .testEquals(); } -}
\ No newline at end of file +} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/OriginTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/OriginTest.java index 88261ad5..da7b5570 100644 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/OriginTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/OriginTest.java @@ -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; diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/OspfPseudonodeTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/OspfPseudonodeTest.java index 55b1190b..a8002311 100644 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/OspfPseudonodeTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/OspfPseudonodeTest.java @@ -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; @@ -40,4 +39,4 @@ public class OspfPseudonodeTest { .addEqualityGroup(tlv2) .testEquals(); } -}
\ No newline at end of file +} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/OspfRouteTypeTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/OspfRouteTypeTest.java index e2fd1eaf..859bdbe5 100644 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/OspfRouteTypeTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/OspfRouteTypeTest.java @@ -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; @@ -37,4 +36,4 @@ public class OspfRouteTypeTest { .addEqualityGroup(tlv2) .testEquals(); } -}
\ No newline at end of file +} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpAttrNodeFlagBitTlvTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpAttrNodeFlagBitTlvTest.java index 5f1411ff..4efb7f5b 100644 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpAttrNodeFlagBitTlvTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpAttrNodeFlagBitTlvTest.java @@ -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; @@ -48,4 +47,4 @@ public class BgpAttrNodeFlagBitTlvTest { new EqualsTester().addEqualityGroup(data, sameAsData) .addEqualityGroup(diffData).testEquals(); } -}
\ No newline at end of file +} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpAttrRouterIdV6Test.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpAttrRouterIdV6Test.java index 72ca5dbf..16ca58ee 100644 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpAttrRouterIdV6Test.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpAttrRouterIdV6Test.java @@ -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; @@ -47,4 +46,4 @@ public class BgpAttrRouterIdV6Test { new EqualsTester().addEqualityGroup(data, sameAsData) .addEqualityGroup(diffData).testEquals(); } -}
\ No newline at end of file +} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrIgpMetricTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpLinkAttrIgpMetricTest.java index 32280a79..ef1cfcea 100644 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrIgpMetricTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpLinkAttrIgpMetricTest.java @@ -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; @@ -41,4 +40,4 @@ public class BgpLinkAttrIgpMetricTest { new EqualsTester().addEqualityGroup(data, sameAsData) .addEqualityGroup(diffData).testEquals(); } -}
\ No newline at end of file +} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrMplsProtocolMaskTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpLinkAttrMplsProtocolMaskTest.java index d218334b..c0d7f986 100644 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrMplsProtocolMaskTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpLinkAttrMplsProtocolMaskTest.java @@ -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; @@ -40,4 +39,4 @@ public class BgpLinkAttrMplsProtocolMaskTest { new EqualsTester().addEqualityGroup(data, sameAsData) .addEqualityGroup(diffData).testEquals(); } -}
\ No newline at end of file +} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrProtectionTypeTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpLinkAttrProtectionTypeTest.java index 89f97a83..2fb76352 100644 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrProtectionTypeTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpLinkAttrProtectionTypeTest.java @@ -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; @@ -54,4 +53,4 @@ public class BgpLinkAttrProtectionTypeTest { new EqualsTester().addEqualityGroup(data, sameAsData) .addEqualityGroup(diffData).testEquals(); } -}
\ No newline at end of file +} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpPrefixAttrIgpFlagsTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpPrefixAttrIgpFlagsTest.java new file mode 100644 index 00000000..535518f8 --- /dev/null +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpPrefixAttrIgpFlagsTest.java @@ -0,0 +1,53 @@ +/* + * Copyright 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.bgpio.types.attr; + +import org.junit.Test; + +import com.google.common.testing.EqualsTester; + +/** + * Test for BGP prefix IGP Flag attribute. + */ +public class BgpPrefixAttrIgpFlagsTest { + + private final boolean bisisUpDownBit = true; + private final boolean bOspfNoUnicastBit = true; + private final boolean bOspfLclAddrBit = true; + private final boolean bOspfNSSABit = true; + + private final boolean bisisUpDownBit1 = false; + private final boolean bOspfNoUnicastBit1 = false; + private final boolean bOspfLclAddrBit1 = false; + private final boolean bOspfNSSABit1 = false; + + private final BgpPrefixAttrIgpFlags data = BgpPrefixAttrIgpFlags + .of(bisisUpDownBit, bOspfNoUnicastBit, bOspfLclAddrBit, + bOspfNSSABit); + private final BgpPrefixAttrIgpFlags sameAsData = BgpPrefixAttrIgpFlags + .of(bisisUpDownBit, bOspfNoUnicastBit, bOspfLclAddrBit, + bOspfNSSABit); + private final BgpPrefixAttrIgpFlags diffData = BgpPrefixAttrIgpFlags + .of(bisisUpDownBit1, bOspfNoUnicastBit1, bOspfLclAddrBit1, + bOspfNSSABit1); + + @Test + public void basics() { + + new EqualsTester().addEqualityGroup(data, sameAsData) + .addEqualityGroup(diffData).testEquals(); + } +} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpPrefixAttrMetricTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpPrefixAttrMetricTest.java index 5a3662be..fe6079fd 100644 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpPrefixAttrMetricTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpPrefixAttrMetricTest.java @@ -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; @@ -37,4 +36,4 @@ public class BgpPrefixAttrMetricTest { new EqualsTester().addEqualityGroup(data, sameAsData) .addEqualityGroup(diffData).testEquals(); } -}
\ No newline at end of file +} diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpPrefixAttrOspfFwdAddrTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpPrefixAttrOspfFwdAddrTest.java index f736bead..f6fe39f8 100644 --- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpPrefixAttrOspfFwdAddrTest.java +++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgpio/types/attr/BgpPrefixAttrOspfFwdAddrTest.java @@ -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; @@ -49,4 +48,4 @@ public class BgpPrefixAttrOspfFwdAddrTest { new EqualsTester().addEqualityGroup(data, sameAsData) .addEqualityGroup(diffData).testEquals(); } -}
\ No newline at end of file +} |