Brian O'Connor

Moving pcep to protocols/ directory

Change-Id: I4a93f489af1b9e08dd0acc95faf55f76857c709b
Showing 288 changed files with 1110 additions and 1111 deletions
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test of the PathSetupTypeTlv.
*/
public class PathSetupTypeTlvTest {
private final PathSetupTypeTlv tlv1 = PathSetupTypeTlv.of(0x0A);
private final PathSetupTypeTlv sameAsTlv1 = PathSetupTypeTlv.of(0x0A);
private final PathSetupTypeTlv tlv2 = PathSetupTypeTlv.of(0x0B);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test of the PceccCapabilityTlv.
*/
public class PceccCapabilityTlvTest {
private final int rawValue1 = 0x0A;
private final int rawValue2 = 0x0B;
private final PceccCapabilityTlv tlv1 = new PceccCapabilityTlv(rawValue1);
private final PceccCapabilityTlv sameAsTlv1 = new PceccCapabilityTlv(rawValue1);
private final PceccCapabilityTlv tlv2 = PceccCapabilityTlv.of(rawValue2);
@Test
public void basics() {
new EqualsTester()
.addEqualityGroup(tlv1, sameAsTlv1)
.addEqualityGroup(tlv2)
.testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Equality test for PcepNaiIpv4Adjacency.
*/
public class PcepNaiIpv4AdjacencyTest {
private final PcepNaiIpv4Adjacency obj1 = PcepNaiIpv4Adjacency.of(2, 16);
private final PcepNaiIpv4Adjacency sameAsObj1 = PcepNaiIpv4Adjacency.of(2, 16);
private final PcepNaiIpv4Adjacency obj2 = PcepNaiIpv4Adjacency.of(3, 16);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(obj1, sameAsObj1).addEqualityGroup(obj2).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
public class PcepNaiIpv4NodeIdTest {
private final PcepNaiIpv4NodeId tlv1 = PcepNaiIpv4NodeId.of(1);
private final PcepNaiIpv4NodeId tlv2 = PcepNaiIpv4NodeId.of(1);
private final PcepNaiIpv4NodeId tlv3 = PcepNaiIpv4NodeId.of(3);
@Test
public void basics() {
new EqualsTester()
.addEqualityGroup(tlv1, tlv2)
.addEqualityGroup(tlv3)
.testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
public class PcepNaiIpv6AdjacencyTest {
private final byte[] localIpv6Addr1 = {(byte) 0x01010101 };
private final byte[] remoteIpv6Addr1 = {(byte) 0x02020202 };
private final byte[] localIpv6Addr2 = {(byte) 0x01010101 };
private final byte[] remoteIpv6Addr2 = {(byte) 0x02020202 };
private final byte[] localIpv6Addr3 = {(byte) 0x05050505 };
private final byte[] remoteIpv6Addr3 = {(byte) 0x06060606 };
private final PcepNaiIpv6Adjacency tlv1 = PcepNaiIpv6Adjacency.of(localIpv6Addr1, remoteIpv6Addr1);
private final PcepNaiIpv6Adjacency tlv2 = PcepNaiIpv6Adjacency.of(localIpv6Addr1, remoteIpv6Addr1);
private final PcepNaiIpv6Adjacency tlv3 = PcepNaiIpv6Adjacency.of(localIpv6Addr3, remoteIpv6Addr3);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Equality test for PcepNaiIpv6NodeId.
*/
public class PcepNaiIpv6NodeIdTest {
private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02,
0x00, 0x00 };
private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02,
0x00, 0x00 };
private final PcepNaiIpv6NodeId tlv1 = PcepNaiIpv6NodeId.of(b1);
private final PcepNaiIpv6NodeId sameAsTlv1 = PcepNaiIpv6NodeId.of(b1);
private final PcepNaiIpv6NodeId tlv2 = PcepNaiIpv6NodeId.of(b2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
public class PcepNaiUnnumberedAdjacencyIpv4Test {
private final int localNodeId1 = 1;
private final int localInterfaceId1 = 1;
private final int remoteNodeId1 = 1;
private final int remoteInterfaceId1 = 1;
private final PcepNaiUnnumberedAdjacencyIpv4 tlv1 = PcepNaiUnnumberedAdjacencyIpv4.of(localNodeId1,
localInterfaceId1, remoteNodeId1, remoteInterfaceId1);
private final int localNodeId2 = 1;
private final int localInterfaceId2 = 1;
private final int remoteNodeId2 = 1;
private final int remoteInterfaceId2 = 1;
private final PcepNaiUnnumberedAdjacencyIpv4 tlv2 = PcepNaiUnnumberedAdjacencyIpv4.of(localNodeId2,
localInterfaceId2, remoteNodeId2, remoteInterfaceId2);
private final int localNodeId3 = 2;
private final int localInterfaceId3 = 2;
private final int remoteNodeId3 = 2;
private final int remoteInterfaceId3 = 2;
private final PcepNaiUnnumberedAdjacencyIpv4 tlv3 = PcepNaiUnnumberedAdjacencyIpv4.of(localNodeId3,
localInterfaceId3, remoteNodeId3, remoteInterfaceId3);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
import java.util.LinkedList;
/**
* Test case for Remote TE Node Descriptors tlv.
*/
public class RemoteTENodeDescriptorsTlvTest {
private final AutonomousSystemTlv autonomousSystemTlv1 = new AutonomousSystemTlv(10);
private final BGPLSidentifierTlv bGPLSidentifierTlv1 = new BGPLSidentifierTlv(20);
private final AutonomousSystemTlv autonomousSystemTlv2 = new AutonomousSystemTlv(20);
private final BGPLSidentifierTlv bGPLSidentifierTlv2 = new BGPLSidentifierTlv(30);
private final LinkedList<PcepValueType> llRemoteTENodeDescriptorSubTLV1 = new LinkedList<>();
private final boolean a = llRemoteTENodeDescriptorSubTLV1.add(autonomousSystemTlv1);
private final boolean b = llRemoteTENodeDescriptorSubTLV1.add(bGPLSidentifierTlv1);
private final LinkedList<PcepValueType> llRemoteTENodeDescriptorSubTLV2 = new LinkedList<>();
private final boolean c = llRemoteTENodeDescriptorSubTLV2.add(autonomousSystemTlv2);
private final boolean d = llRemoteTENodeDescriptorSubTLV2.add(bGPLSidentifierTlv2);
private final RemoteTENodeDescriptorsTlv tlv1 = RemoteTENodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV1);
private final RemoteTENodeDescriptorsTlv sameAsTlv1 =
RemoteTENodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV1);
private final RemoteTENodeDescriptorsTlv tlv2 = RemoteTENodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test case for Router ID Sub tlv.
*/
public class RouterIDSubTlvTest {
private final byte[] value1 = {1, 2 };
private final Short length1 = 2;
private final RouterIDSubTlv tlv1 = RouterIDSubTlv.of(value1, length1);
private final Short length2 = 2;
private final RouterIDSubTlv tlv2 = RouterIDSubTlv.of(value1, length2);
private final byte[] value3 = {1, 2, 3 };
private final Short length3 = 3;
private final RouterIDSubTlv tlv3 = RouterIDSubTlv.of(value3, length3);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Equality test for RoutingUniverseTlv.
*/
public class RoutingUniverseTlvTest {
private final RoutingUniverseTlv tlv1 = RoutingUniverseTlv.of(2);
private final RoutingUniverseTlv tlv2 = RoutingUniverseTlv.of(2);
private final RoutingUniverseTlv tlv3 = RoutingUniverseTlv.of(3);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test case for Shared Risk Link Group tlv.
*/
public class SharedRiskLinkGroupTlvTest {
private final int[] raw = {1 };
private final Short hLength = 2;
private final SharedRiskLinkGroupTlv tlv1 = SharedRiskLinkGroupTlv.of(raw, hLength);
private final SharedRiskLinkGroupTlv sameAsTlv1 = SharedRiskLinkGroupTlv.of(raw, hLength);
private final int[] raw2 = {2 };
private final Short hLength2 = 3;
private final SharedRiskLinkGroupTlv tlv2 = SharedRiskLinkGroupTlv.of(raw2, hLength2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
import org.onosproject.pcepio.protocol.PcepNai;
public class SrEroSubObjectTest {
private final boolean bFFlag = false;
private final boolean bSFlag = false;
private final boolean bCFlag = false;
private final boolean bMFlag = false;
private final byte st = 1;
private final int sID = 1;
private final PcepNai nai = null;
private final SrEroSubObject tlv1 = SrEroSubObject.of(st, bFFlag, bSFlag, bCFlag, bMFlag, sID, nai);
private final boolean bFFlag1 = false;
private final boolean bSFlag1 = false;
private final boolean bCFlag1 = false;
private final boolean bMFlag1 = false;
private final byte st1 = 1;
private final int sID1 = 1;
private final PcepNai nai1 = null;
private final SrEroSubObject tlv2 = SrEroSubObject.of(st1, bFFlag1, bSFlag1, bCFlag1, bMFlag1, sID1, nai1);
private final boolean bFFlag2 = true;
private final boolean bSFlag2 = true;
private final boolean bCFlag2 = true;
private final boolean bMFlag2 = true;
private final byte st2 = 2;
private final int sID2 = 2;
private final PcepNai nai2 = null;
private final SrEroSubObject tlv3 = SrEroSubObject.of(st2, bFFlag2, bSFlag2, bCFlag2, bMFlag2, sID2, nai2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
public class StatefulIPv4LspIdentidiersTlvTest {
private final int ipv4IngressAddress = 1;
private final short lspId = 1;
private final short tunnelId = 1;
private final int extendedTunnelId = 1;
private final int ipv4EgressAddress = 1;
private final StatefulIPv4LspIdentidiersTlv tlv1 = StatefulIPv4LspIdentidiersTlv.of(ipv4IngressAddress, lspId,
tunnelId, extendedTunnelId, ipv4EgressAddress);
private final int ipv4IngressAddress1 = 1;
private final short lspId1 = 1;
private final short tunnelId1 = 1;
private final int extendedTunnelId1 = 1;
private final int ipv4EgressAddress1 = 1;
private final StatefulIPv4LspIdentidiersTlv tlv2 = StatefulIPv4LspIdentidiersTlv.of(ipv4IngressAddress1, lspId1,
tunnelId1, extendedTunnelId1, ipv4EgressAddress1);
private final int ipv4IngressAddress2 = 2;
private final short lspId2 = 2;
private final short tunnelId2 = 2;
private final int extendedTunnelId2 = 2;
private final int ipv4EgressAddress2 = 2;
private final StatefulIPv4LspIdentidiersTlv tlv3 = StatefulIPv4LspIdentidiersTlv.of(ipv4IngressAddress2, lspId2,
tunnelId2, extendedTunnelId2, ipv4EgressAddress2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test case for Stateful Lsp Db Ver tlv.
*/
public class StatefulLspDbVerTlvTest {
private final StatefulLspDbVerTlv tlv1 = StatefulLspDbVerTlv.of(1);
private final StatefulLspDbVerTlv tlv2 = StatefulLspDbVerTlv.of(1);
private final StatefulLspDbVerTlv tlv3 = StatefulLspDbVerTlv.of(2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
public class StatefulLspErrorCodeTlvTest {
private final StatefulLspErrorCodeTlv tlv1 = StatefulLspErrorCodeTlv.of(1);
private final StatefulLspErrorCodeTlv tlv2 = StatefulLspErrorCodeTlv.of(1);
private final StatefulLspErrorCodeTlv tlv3 = StatefulLspErrorCodeTlv.of(2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test case for Stateful Pce Capability tlv.
*/
public class StatefulPceCapabilityTlvTest {
private final StatefulPceCapabilityTlv tlv1 = StatefulPceCapabilityTlv.of(1);
private final StatefulPceCapabilityTlv tlv2 = StatefulPceCapabilityTlv.of(1);
private final StatefulPceCapabilityTlv tlv3 = StatefulPceCapabilityTlv.of(2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test case for Symbolic path tlv.
*/
public class SymbolicPathNameTlvTest {
private final byte[] value1 = {0x41 };
private final Short length1 = 2;
private final SymbolicPathNameTlv tlv1 = SymbolicPathNameTlv.of(value1, length1);
private final byte[] value2 = {0x41 };
private final Short length2 = 2;
private final SymbolicPathNameTlv tlv2 = SymbolicPathNameTlv.of(value1, length2);
private final byte[] value3 = {0x41, 0x43 };
private final Short length3 = 3;
private final SymbolicPathNameTlv tlv3 = SymbolicPathNameTlv.of(value3, length3);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test case for TE Default Metric tlv.
*/
public class TEDefaultMetricTlvTest {
private final TEDefaultMetricTlv tlv1 = TEDefaultMetricTlv.of(1);
private final TEDefaultMetricTlv tlv2 = TEDefaultMetricTlv.of(1);
private final TEDefaultMetricTlv tlv3 = TEDefaultMetricTlv.of(2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
import java.util.LinkedList;
/**
* Test case for TE Link Attribute Tlv.
*/
public class TELinkAttributesTlvTest {
private final AdministrativeGroupTlv administrativeGroupTlv1 = new AdministrativeGroupTlv(10);
private final MaximumReservableLinkBandwidthTlv maximumReservableLinkBandwidthTlv1 =
new MaximumReservableLinkBandwidthTlv(20);
private final AdministrativeGroupTlv administrativeGroupTlv2 = new AdministrativeGroupTlv(20);
private final MaximumReservableLinkBandwidthTlv maximumReservableLinkBandwidthTlv2 =
new MaximumReservableLinkBandwidthTlv(30);
private final LinkedList<PcepValueType> llLinkAttributesSubTLV1 = new LinkedList<>();
private final boolean a = llLinkAttributesSubTLV1.add(administrativeGroupTlv1);
private final boolean b = llLinkAttributesSubTLV1.add(maximumReservableLinkBandwidthTlv1);
private final LinkedList<PcepValueType> llLinkAttributesSubTLV2 = new LinkedList<>();
private final boolean c = llLinkAttributesSubTLV2.add(administrativeGroupTlv2);
private final boolean d = llLinkAttributesSubTLV2.add(maximumReservableLinkBandwidthTlv2);
private final TELinkAttributesTlv tlv1 = TELinkAttributesTlv.of(llLinkAttributesSubTLV1);
private final TELinkAttributesTlv sameAsTlv1 = TELinkAttributesTlv.of(llLinkAttributesSubTLV1);
private final TELinkAttributesTlv tlv2 = TELinkAttributesTlv.of(llLinkAttributesSubTLV2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
import java.util.LinkedList;
/**
* Test case for TE link descriptors Tlv.
*/
public class TELinkDescriptorsTlvTest {
private final LinkLocalRemoteIdentifiersTlv linkLocalRemoteIdentifiersTlv1 = new
LinkLocalRemoteIdentifiersTlv(10, 10);
private final IPv4InterfaceAddressTlv iPv4InterfaceAddressTlv1 = new IPv4InterfaceAddressTlv(0x01010101);
private final LinkLocalRemoteIdentifiersTlv linkLocalRemoteIdentifiersTlv2 = new
LinkLocalRemoteIdentifiersTlv(20, 20);
private final IPv4InterfaceAddressTlv iPv4InterfaceAddressTlv2 = new IPv4InterfaceAddressTlv(0x02020202);
private final LinkedList<PcepValueType> llLinkDescriptorsSubTLVs1 = new LinkedList<>();
private final boolean a = llLinkDescriptorsSubTLVs1.add(linkLocalRemoteIdentifiersTlv1);
private final boolean b = llLinkDescriptorsSubTLVs1.add(iPv4InterfaceAddressTlv1);
private final LinkedList<PcepValueType> llLinkDescriptorsSubTLVs2 = new LinkedList<>();
private final boolean c = llLinkDescriptorsSubTLVs2.add(linkLocalRemoteIdentifiersTlv2);
private final boolean d = llLinkDescriptorsSubTLVs2.add(iPv4InterfaceAddressTlv2);
private final TELinkDescriptorsTlv tlv1 = TELinkDescriptorsTlv.of(llLinkDescriptorsSubTLVs1);
private final TELinkDescriptorsTlv sameAstlv1 = TELinkDescriptorsTlv.of(llLinkDescriptorsSubTLVs1);
private final TELinkDescriptorsTlv tlv2 = TELinkDescriptorsTlv.of(llLinkDescriptorsSubTLVs2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, sameAstlv1).addEqualityGroup(tlv2).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
import java.util.LinkedList;
/**
* Test case for TE Node Attribute tlv.
*/
public class TENodeAttributesTlvTest {
private final NodeFlagBitsTlv nodeFlagBitsTlv1 = new NodeFlagBitsTlv((byte) 10);
private final IPv4TERouterIdOfLocalNodeTlv iPv4TERouterIdOfLocalNodeTlv1 = new
IPv4TERouterIdOfLocalNodeTlv(0x01010101);
private final NodeFlagBitsTlv nodeFlagBitsTlv2 = new NodeFlagBitsTlv((byte) 20);
private final IPv4TERouterIdOfLocalNodeTlv iPv4TERouterIdOfLocalNodeTlv2 = new
IPv4TERouterIdOfLocalNodeTlv(0x02020202);
private final LinkedList<PcepValueType> llNodeAttributesSubTLV1 = new LinkedList<>();
private final boolean a = llNodeAttributesSubTLV1.add(nodeFlagBitsTlv1);
private final boolean b = llNodeAttributesSubTLV1.add(iPv4TERouterIdOfLocalNodeTlv1);
private final LinkedList<PcepValueType> llNodeAttributesSubTLV2 = new LinkedList<>();
private final boolean c = llNodeAttributesSubTLV2.add(nodeFlagBitsTlv2);
private final boolean d = llNodeAttributesSubTLV2.add(iPv4TERouterIdOfLocalNodeTlv2);
private final TENodeAttributesTlv tlv1 = TENodeAttributesTlv.of(llNodeAttributesSubTLV1);
private final TENodeAttributesTlv sameAsTlv1 = TENodeAttributesTlv.of(llNodeAttributesSubTLV1);
private final TENodeAttributesTlv tlv2 = TENodeAttributesTlv.of(llNodeAttributesSubTLV2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test case for TED Capability tlv.
*/
public class TedCapabilityTlvTest {
private final TedCapabilityTlv tlv1 = TedCapabilityTlv.of(1);
private final TedCapabilityTlv tlv2 = TedCapabilityTlv.of(1);
private final TedCapabilityTlv tlv3 = TedCapabilityTlv.of(2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Unit Test case for Unreserved Bandwidth Tlv.
*/
public class UnreservedBandwidthTlvTest {
// Objects of unreserved bandwidth tlv
private final UnreservedBandwidthTlv tlv1 = UnreservedBandwidthTlv.of(100);
private final UnreservedBandwidthTlv tlv2 = UnreservedBandwidthTlv.of(100);
private final UnreservedBandwidthTlv tlv3 = UnreservedBandwidthTlv.of(200);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2014 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onosproject</groupId>
<artifactId>onos</artifactId>
<version>1.4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>onos-pcep-controller</artifactId>
<packaging>pom</packaging>
<description>ONOS Pcep Protocol subsystem</description>
<modules>
<module>api</module>
<module>ctl</module>
<module>pcepio</module>
</modules>
<dependencies>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onlab-misc</artifactId>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onlab-junit</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
......@@ -48,7 +48,6 @@
<module>protocols</module>
<module>ovsdb</module>
<module>netconf</module>
<module>pcep</module>
<module>bgp</module>
<module>providers</module>
......
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test of the IPv6TERouterIdofLocalNodeTlv.
*/
public class IPv6TERouterIdofLocalNodeTlvTest {
private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00};
private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x00 };
private final IPv6TERouterIdofLocalNodeTlv tlv1 = IPv6TERouterIdofLocalNodeTlv.of(b1);
private final IPv6TERouterIdofLocalNodeTlv sameAsTlv1 = IPv6TERouterIdofLocalNodeTlv.of(b1);
private final IPv6TERouterIdofLocalNodeTlv tlv2 = IPv6TERouterIdofLocalNodeTlv.of(b2);
@Test
public void basics() {
new EqualsTester()
.addEqualityGroup(tlv1, sameAsTlv1)
.addEqualityGroup(tlv2)
.testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test of the IPv6TERouterIdofRemoteNodeTlv.
*/
public class IPv6TERouterIdofRemoteNodeTlvTest {
private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00};
private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x00 };
private final IPv6TERouterIdofRemoteNodeTlv tlv1 = IPv6TERouterIdofRemoteNodeTlv.of(b1);
private final IPv6TERouterIdofRemoteNodeTlv sameAsTlv1 = IPv6TERouterIdofRemoteNodeTlv.of(b1);
private final IPv6TERouterIdofRemoteNodeTlv tlv2 = IPv6TERouterIdofRemoteNodeTlv.of(b2);
@Test
public void basics() {
new EqualsTester()
.addEqualityGroup(tlv1, sameAsTlv1)
.addEqualityGroup(tlv2)
.testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
import java.util.LinkedList;
/**
* Test of the LocalTENodeDescriptorsTlv.
*/
public class LocalTENodeDescriptorsTlvTest {
private final AutonomousSystemTlv baAutoSysTlvRawValue1 = new AutonomousSystemTlv(1);
private final BGPLSidentifierTlv baBgplsIdRawValue1 = new BGPLSidentifierTlv(1);
private final AutonomousSystemTlv baAutoSysTlvRawValue2 = new AutonomousSystemTlv(2);
private final BGPLSidentifierTlv baBgplsIdRawValue2 = new BGPLSidentifierTlv(2);
private final LinkedList<PcepValueType> llNodeDescriptorSubTLVs1 = new LinkedList<PcepValueType>();
private final boolean a = llNodeDescriptorSubTLVs1.add(baAutoSysTlvRawValue1);
private final boolean b = llNodeDescriptorSubTLVs1.add(baBgplsIdRawValue1);
private final LinkedList<PcepValueType> llNodeDescriptorSubTLVs2 = new LinkedList<PcepValueType>();
private final boolean c = llNodeDescriptorSubTLVs2.add(baAutoSysTlvRawValue2);
private final boolean d = llNodeDescriptorSubTLVs2.add(baBgplsIdRawValue2);
private final LocalTENodeDescriptorsTlv tlv1 = LocalTENodeDescriptorsTlv.of(llNodeDescriptorSubTLVs1);
private final LocalTENodeDescriptorsTlv sameAstlv1 = LocalTENodeDescriptorsTlv.of(llNodeDescriptorSubTLVs1);
private final LocalTENodeDescriptorsTlv tlv2 = LocalTENodeDescriptorsTlv.of(llNodeDescriptorSubTLVs2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, sameAstlv1).addEqualityGroup(tlv2).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test of the MaximumReservableLinkBandwidthTlv.
*/
public class MaximumReservableLinkBandwidthTlvTest {
private final int rawValue1 = 0x0A;
private final int rawValue2 = 0x0B;
private final MaximumReservableLinkBandwidthTlv tlv1 = new MaximumReservableLinkBandwidthTlv(rawValue1);
private final MaximumReservableLinkBandwidthTlv sameAsTlv1 = new MaximumReservableLinkBandwidthTlv(rawValue1);
private final MaximumReservableLinkBandwidthTlv tlv2 = MaximumReservableLinkBandwidthTlv.of(rawValue2);
@Test
public void basics() {
new EqualsTester()
.addEqualityGroup(tlv1, sameAsTlv1)
.addEqualityGroup(tlv2)
.testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Equality test for NexthopIPv6addressTlv.
*/
public class NexthopIPv6addressTlvTest {
private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00 };
private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x00 };
private final NexthopIPv6addressTlv tlv1 = NexthopIPv6addressTlv.of(b1);
private final NexthopIPv6addressTlv sameAsTlv1 = NexthopIPv6addressTlv.of(b1);
private final NexthopIPv6addressTlv tlv2 = NexthopIPv6addressTlv.of(b2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
}
}
......@@ -19,18 +19,15 @@ import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test of the IPv6TERouterIdofLocalNodeTlv.
* Test of the NodeNameTlv.
*/
public class IPv6TERouterIdofLocalNodeTlvTest {
public class NodeNameTlvTest {
private final byte[] rawValue1 = new byte[] {0x01, 0x02};
private final byte[] rawValue2 = new byte[] {0x14, 0x15};
private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00};
private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x00 };
private final IPv6TERouterIdofLocalNodeTlv tlv1 = IPv6TERouterIdofLocalNodeTlv.of(b1);
private final IPv6TERouterIdofLocalNodeTlv sameAsTlv1 = IPv6TERouterIdofLocalNodeTlv.of(b1);
private final IPv6TERouterIdofLocalNodeTlv tlv2 = IPv6TERouterIdofLocalNodeTlv.of(b2);
private final NodeNameTlv tlv1 = new NodeNameTlv(rawValue1, (short) rawValue1.length);
private final NodeNameTlv sameAsTlv1 = NodeNameTlv.of(tlv1.getValue(), tlv1.getLength());
private final NodeNameTlv tlv2 = new NodeNameTlv(rawValue2, (short) 0);
@Test
public void basics() {
......
......@@ -19,18 +19,15 @@ import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test of the IPv6TERouterIdofRemoteNodeTlv.
* Test of the OpaqueLinkAttributeTlv.
*/
public class IPv6TERouterIdofRemoteNodeTlvTest {
public class OpaqueLinkAttributeTlvTest {
private final byte[] rawValue1 = new byte[] {0x01, 0x02};
private final byte[] rawValue2 = new byte[] {0x14, 0x15};
private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00};
private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x00 };
private final IPv6TERouterIdofRemoteNodeTlv tlv1 = IPv6TERouterIdofRemoteNodeTlv.of(b1);
private final IPv6TERouterIdofRemoteNodeTlv sameAsTlv1 = IPv6TERouterIdofRemoteNodeTlv.of(b1);
private final IPv6TERouterIdofRemoteNodeTlv tlv2 = IPv6TERouterIdofRemoteNodeTlv.of(b2);
private final OpaqueLinkAttributeTlv tlv1 = new OpaqueLinkAttributeTlv(rawValue1, (short) rawValue1.length);
private final OpaqueLinkAttributeTlv sameAsTlv1 = OpaqueLinkAttributeTlv.of(tlv1.getValue(), tlv1.getLength());
private final OpaqueLinkAttributeTlv tlv2 = new OpaqueLinkAttributeTlv(rawValue2, (short) 0);
@Test
public void basics() {
......
......@@ -19,15 +19,13 @@ import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test of the NodeNameTlv.
* Test of the PathKeySubObject.
*/
public class NodeNameTlvTest {
private final byte[] rawValue1 = new byte[] {0x01, 0x02};
private final byte[] rawValue2 = new byte[] {0x14, 0x15};
public class PathKeySubObjectTest {
private final NodeNameTlv tlv1 = new NodeNameTlv(rawValue1, (short) rawValue1.length);
private final NodeNameTlv sameAsTlv1 = NodeNameTlv.of(tlv1.getValue(), tlv1.getLength());
private final NodeNameTlv tlv2 = new NodeNameTlv(rawValue2, (short) 0);
private final PathKeySubObject tlv1 = new PathKeySubObject((short) 0x0A, 0x0A);
private final PathKeySubObject sameAsTlv1 = PathKeySubObject.of((short) 0x0A, 0x0A);
private final PathKeySubObject tlv2 = new PathKeySubObject((short) 0x0B, 0x0B);
@Test
public void basics() {
......
......@@ -13,29 +13,22 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Equality test for NexthopIPv6addressTlv.
* Test of the PathSetupTypeTlv.
*/
public class NexthopIPv6addressTlvTest {
private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00 };
private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x00 };
public class PathSetupTypeTlvTest {
private final NexthopIPv6addressTlv tlv1 = NexthopIPv6addressTlv.of(b1);
private final NexthopIPv6addressTlv sameAsTlv1 = NexthopIPv6addressTlv.of(b1);
private final NexthopIPv6addressTlv tlv2 = NexthopIPv6addressTlv.of(b2);
private final PathSetupTypeTlv tlv1 = PathSetupTypeTlv.of(0x0A);
private final PathSetupTypeTlv sameAsTlv1 = PathSetupTypeTlv.of(0x0A);
private final PathSetupTypeTlv tlv2 = PathSetupTypeTlv.of(0x0B);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
}
}
......
......@@ -19,15 +19,15 @@ import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test of the MaximumReservableLinkBandwidthTlv.
* Test of the PceccCapabilityTlv.
*/
public class MaximumReservableLinkBandwidthTlvTest {
public class PceccCapabilityTlvTest {
private final int rawValue1 = 0x0A;
private final int rawValue2 = 0x0B;
private final MaximumReservableLinkBandwidthTlv tlv1 = new MaximumReservableLinkBandwidthTlv(rawValue1);
private final MaximumReservableLinkBandwidthTlv sameAsTlv1 = new MaximumReservableLinkBandwidthTlv(rawValue1);
private final MaximumReservableLinkBandwidthTlv tlv2 = MaximumReservableLinkBandwidthTlv.of(rawValue2);
private final PceccCapabilityTlv tlv1 = new PceccCapabilityTlv(rawValue1);
private final PceccCapabilityTlv sameAsTlv1 = new PceccCapabilityTlv(rawValue1);
private final PceccCapabilityTlv tlv2 = PceccCapabilityTlv.of(rawValue2);
@Test
public void basics() {
......
......@@ -13,38 +13,24 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
import java.util.LinkedList;
/**
* Test of the LocalTENodeDescriptorsTlv.
* Equality test for PcepNaiIpv4Adjacency.
*/
public class LocalTENodeDescriptorsTlvTest {
private final AutonomousSystemTlv baAutoSysTlvRawValue1 = new AutonomousSystemTlv(1);
private final BGPLSidentifierTlv baBgplsIdRawValue1 = new BGPLSidentifierTlv(1);
private final AutonomousSystemTlv baAutoSysTlvRawValue2 = new AutonomousSystemTlv(2);
private final BGPLSidentifierTlv baBgplsIdRawValue2 = new BGPLSidentifierTlv(2);
public class PcepNaiIpv4AdjacencyTest {
private final LinkedList<PcepValueType> llNodeDescriptorSubTLVs1 = new LinkedList<PcepValueType>();
private final boolean a = llNodeDescriptorSubTLVs1.add(baAutoSysTlvRawValue1);
private final boolean b = llNodeDescriptorSubTLVs1.add(baBgplsIdRawValue1);
private final LinkedList<PcepValueType> llNodeDescriptorSubTLVs2 = new LinkedList<PcepValueType>();
private final boolean c = llNodeDescriptorSubTLVs2.add(baAutoSysTlvRawValue2);
private final boolean d = llNodeDescriptorSubTLVs2.add(baBgplsIdRawValue2);
private final LocalTENodeDescriptorsTlv tlv1 = LocalTENodeDescriptorsTlv.of(llNodeDescriptorSubTLVs1);
private final LocalTENodeDescriptorsTlv sameAstlv1 = LocalTENodeDescriptorsTlv.of(llNodeDescriptorSubTLVs1);
private final LocalTENodeDescriptorsTlv tlv2 = LocalTENodeDescriptorsTlv.of(llNodeDescriptorSubTLVs2);
private final PcepNaiIpv4Adjacency obj1 = PcepNaiIpv4Adjacency.of(2, 16);
private final PcepNaiIpv4Adjacency sameAsObj1 = PcepNaiIpv4Adjacency.of(2, 16);
private final PcepNaiIpv4Adjacency obj2 = PcepNaiIpv4Adjacency.of(3, 16);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, sameAstlv1).addEqualityGroup(tlv2).testEquals();
new EqualsTester().addEqualityGroup(obj1, sameAsObj1).addEqualityGroup(obj2).testEquals();
}
}
......
......@@ -18,20 +18,17 @@ package org.onosproject.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test of the PathKeySubObject.
*/
public class PathKeySubObjectTest {
public class PcepNaiIpv4NodeIdTest {
private final PathKeySubObject tlv1 = new PathKeySubObject((short) 0x0A, 0x0A);
private final PathKeySubObject sameAsTlv1 = PathKeySubObject.of((short) 0x0A, 0x0A);
private final PathKeySubObject tlv2 = new PathKeySubObject((short) 0x0B, 0x0B);
private final PcepNaiIpv4NodeId tlv1 = PcepNaiIpv4NodeId.of(1);
private final PcepNaiIpv4NodeId tlv2 = PcepNaiIpv4NodeId.of(1);
private final PcepNaiIpv4NodeId tlv3 = PcepNaiIpv4NodeId.of(3);
@Test
public void basics() {
new EqualsTester()
.addEqualityGroup(tlv1, sameAsTlv1)
.addEqualityGroup(tlv2)
.addEqualityGroup(tlv1, tlv2)
.addEqualityGroup(tlv3)
.testEquals();
}
}
......
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
public class PcepNaiIpv6AdjacencyTest {
private final byte[] localIpv6Addr1 = {(byte) 0x01010101 };
private final byte[] remoteIpv6Addr1 = {(byte) 0x02020202 };
private final byte[] localIpv6Addr2 = {(byte) 0x01010101 };
private final byte[] remoteIpv6Addr2 = {(byte) 0x02020202 };
private final byte[] localIpv6Addr3 = {(byte) 0x05050505 };
private final byte[] remoteIpv6Addr3 = {(byte) 0x06060606 };
private final PcepNaiIpv6Adjacency tlv1 = PcepNaiIpv6Adjacency.of(localIpv6Addr1, remoteIpv6Addr1);
private final PcepNaiIpv6Adjacency tlv2 = PcepNaiIpv6Adjacency.of(localIpv6Addr1, remoteIpv6Addr1);
private final PcepNaiIpv6Adjacency tlv3 = PcepNaiIpv6Adjacency.of(localIpv6Addr3, remoteIpv6Addr3);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Equality test for PcepNaiIpv6NodeId.
*/
public class PcepNaiIpv6NodeIdTest {
private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02,
0x00, 0x00 };
private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02,
0x00, 0x00 };
private final PcepNaiIpv6NodeId tlv1 = PcepNaiIpv6NodeId.of(b1);
private final PcepNaiIpv6NodeId sameAsTlv1 = PcepNaiIpv6NodeId.of(b1);
private final PcepNaiIpv6NodeId tlv2 = PcepNaiIpv6NodeId.of(b2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
public class PcepNaiUnnumberedAdjacencyIpv4Test {
private final int localNodeId1 = 1;
private final int localInterfaceId1 = 1;
private final int remoteNodeId1 = 1;
private final int remoteInterfaceId1 = 1;
private final PcepNaiUnnumberedAdjacencyIpv4 tlv1 = PcepNaiUnnumberedAdjacencyIpv4.of(localNodeId1,
localInterfaceId1, remoteNodeId1, remoteInterfaceId1);
private final int localNodeId2 = 1;
private final int localInterfaceId2 = 1;
private final int remoteNodeId2 = 1;
private final int remoteInterfaceId2 = 1;
private final PcepNaiUnnumberedAdjacencyIpv4 tlv2 = PcepNaiUnnumberedAdjacencyIpv4.of(localNodeId2,
localInterfaceId2, remoteNodeId2, remoteInterfaceId2);
private final int localNodeId3 = 2;
private final int localInterfaceId3 = 2;
private final int remoteNodeId3 = 2;
private final int remoteInterfaceId3 = 2;
private final PcepNaiUnnumberedAdjacencyIpv4 tlv3 = PcepNaiUnnumberedAdjacencyIpv4.of(localNodeId3,
localInterfaceId3, remoteNodeId3, remoteInterfaceId3);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
import java.util.LinkedList;
/**
* Test case for Remote TE Node Descriptors tlv.
*/
public class RemoteTENodeDescriptorsTlvTest {
private final AutonomousSystemTlv autonomousSystemTlv1 = new AutonomousSystemTlv(10);
private final BGPLSidentifierTlv bGPLSidentifierTlv1 = new BGPLSidentifierTlv(20);
private final AutonomousSystemTlv autonomousSystemTlv2 = new AutonomousSystemTlv(20);
private final BGPLSidentifierTlv bGPLSidentifierTlv2 = new BGPLSidentifierTlv(30);
private final LinkedList<PcepValueType> llRemoteTENodeDescriptorSubTLV1 = new LinkedList<>();
private final boolean a = llRemoteTENodeDescriptorSubTLV1.add(autonomousSystemTlv1);
private final boolean b = llRemoteTENodeDescriptorSubTLV1.add(bGPLSidentifierTlv1);
private final LinkedList<PcepValueType> llRemoteTENodeDescriptorSubTLV2 = new LinkedList<>();
private final boolean c = llRemoteTENodeDescriptorSubTLV2.add(autonomousSystemTlv2);
private final boolean d = llRemoteTENodeDescriptorSubTLV2.add(bGPLSidentifierTlv2);
private final RemoteTENodeDescriptorsTlv tlv1 = RemoteTENodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV1);
private final RemoteTENodeDescriptorsTlv sameAsTlv1 =
RemoteTENodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV1);
private final RemoteTENodeDescriptorsTlv tlv2 = RemoteTENodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test case for Router ID Sub tlv.
*/
public class RouterIDSubTlvTest {
private final byte[] value1 = {1, 2 };
private final Short length1 = 2;
private final RouterIDSubTlv tlv1 = RouterIDSubTlv.of(value1, length1);
private final Short length2 = 2;
private final RouterIDSubTlv tlv2 = RouterIDSubTlv.of(value1, length2);
private final byte[] value3 = {1, 2, 3 };
private final Short length3 = 3;
private final RouterIDSubTlv tlv3 = RouterIDSubTlv.of(value3, length3);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
......@@ -13,27 +13,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test of the OpaqueLinkAttributeTlv.
* Equality test for RoutingUniverseTlv.
*/
public class OpaqueLinkAttributeTlvTest {
private final byte[] rawValue1 = new byte[] {0x01, 0x02};
private final byte[] rawValue2 = new byte[] {0x14, 0x15};
public class RoutingUniverseTlvTest {
private final OpaqueLinkAttributeTlv tlv1 = new OpaqueLinkAttributeTlv(rawValue1, (short) rawValue1.length);
private final OpaqueLinkAttributeTlv sameAsTlv1 = OpaqueLinkAttributeTlv.of(tlv1.getValue(), tlv1.getLength());
private final OpaqueLinkAttributeTlv tlv2 = new OpaqueLinkAttributeTlv(rawValue2, (short) 0);
private final RoutingUniverseTlv tlv1 = RoutingUniverseTlv.of(2);
private final RoutingUniverseTlv tlv2 = RoutingUniverseTlv.of(2);
private final RoutingUniverseTlv tlv3 = RoutingUniverseTlv.of(3);
@Test
public void basics() {
new EqualsTester()
.addEqualityGroup(tlv1, sameAsTlv1)
.addEqualityGroup(tlv2)
.testEquals();
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
......
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test case for Shared Risk Link Group tlv.
*/
public class SharedRiskLinkGroupTlvTest {
private final int[] raw = {1 };
private final Short hLength = 2;
private final SharedRiskLinkGroupTlv tlv1 = SharedRiskLinkGroupTlv.of(raw, hLength);
private final SharedRiskLinkGroupTlv sameAsTlv1 = SharedRiskLinkGroupTlv.of(raw, hLength);
private final int[] raw2 = {2 };
private final Short hLength2 = 3;
private final SharedRiskLinkGroupTlv tlv2 = SharedRiskLinkGroupTlv.of(raw2, hLength2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
import org.onosproject.pcepio.protocol.PcepNai;
public class SrEroSubObjectTest {
private final boolean bFFlag = false;
private final boolean bSFlag = false;
private final boolean bCFlag = false;
private final boolean bMFlag = false;
private final byte st = 1;
private final int sID = 1;
private final PcepNai nai = null;
private final SrEroSubObject tlv1 = SrEroSubObject.of(st, bFFlag, bSFlag, bCFlag, bMFlag, sID, nai);
private final boolean bFFlag1 = false;
private final boolean bSFlag1 = false;
private final boolean bCFlag1 = false;
private final boolean bMFlag1 = false;
private final byte st1 = 1;
private final int sID1 = 1;
private final PcepNai nai1 = null;
private final SrEroSubObject tlv2 = SrEroSubObject.of(st1, bFFlag1, bSFlag1, bCFlag1, bMFlag1, sID1, nai1);
private final boolean bFFlag2 = true;
private final boolean bSFlag2 = true;
private final boolean bCFlag2 = true;
private final boolean bMFlag2 = true;
private final byte st2 = 2;
private final int sID2 = 2;
private final PcepNai nai2 = null;
private final SrEroSubObject tlv3 = SrEroSubObject.of(st2, bFFlag2, bSFlag2, bCFlag2, bMFlag2, sID2, nai2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
public class StatefulIPv4LspIdentidiersTlvTest {
private final int ipv4IngressAddress = 1;
private final short lspId = 1;
private final short tunnelId = 1;
private final int extendedTunnelId = 1;
private final int ipv4EgressAddress = 1;
private final StatefulIPv4LspIdentidiersTlv tlv1 = StatefulIPv4LspIdentidiersTlv.of(ipv4IngressAddress, lspId,
tunnelId, extendedTunnelId, ipv4EgressAddress);
private final int ipv4IngressAddress1 = 1;
private final short lspId1 = 1;
private final short tunnelId1 = 1;
private final int extendedTunnelId1 = 1;
private final int ipv4EgressAddress1 = 1;
private final StatefulIPv4LspIdentidiersTlv tlv2 = StatefulIPv4LspIdentidiersTlv.of(ipv4IngressAddress1, lspId1,
tunnelId1, extendedTunnelId1, ipv4EgressAddress1);
private final int ipv4IngressAddress2 = 2;
private final short lspId2 = 2;
private final short tunnelId2 = 2;
private final int extendedTunnelId2 = 2;
private final int ipv4EgressAddress2 = 2;
private final StatefulIPv4LspIdentidiersTlv tlv3 = StatefulIPv4LspIdentidiersTlv.of(ipv4IngressAddress2, lspId2,
tunnelId2, extendedTunnelId2, ipv4EgressAddress2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test case for Stateful Lsp Db Ver tlv.
*/
public class StatefulLspDbVerTlvTest {
private final StatefulLspDbVerTlv tlv1 = StatefulLspDbVerTlv.of(1);
private final StatefulLspDbVerTlv tlv2 = StatefulLspDbVerTlv.of(1);
private final StatefulLspDbVerTlv tlv3 = StatefulLspDbVerTlv.of(2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
public class StatefulLspErrorCodeTlvTest {
private final StatefulLspErrorCodeTlv tlv1 = StatefulLspErrorCodeTlv.of(1);
private final StatefulLspErrorCodeTlv tlv2 = StatefulLspErrorCodeTlv.of(1);
private final StatefulLspErrorCodeTlv tlv3 = StatefulLspErrorCodeTlv.of(2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test case for Stateful Pce Capability tlv.
*/
public class StatefulPceCapabilityTlvTest {
private final StatefulPceCapabilityTlv tlv1 = StatefulPceCapabilityTlv.of(1);
private final StatefulPceCapabilityTlv tlv2 = StatefulPceCapabilityTlv.of(1);
private final StatefulPceCapabilityTlv tlv3 = StatefulPceCapabilityTlv.of(2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test case for Symbolic path tlv.
*/
public class SymbolicPathNameTlvTest {
private final byte[] value1 = {0x41 };
private final Short length1 = 2;
private final SymbolicPathNameTlv tlv1 = SymbolicPathNameTlv.of(value1, length1);
private final byte[] value2 = {0x41 };
private final Short length2 = 2;
private final SymbolicPathNameTlv tlv2 = SymbolicPathNameTlv.of(value1, length2);
private final byte[] value3 = {0x41, 0x43 };
private final Short length3 = 3;
private final SymbolicPathNameTlv tlv3 = SymbolicPathNameTlv.of(value3, length3);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test case for TE Default Metric tlv.
*/
public class TEDefaultMetricTlvTest {
private final TEDefaultMetricTlv tlv1 = TEDefaultMetricTlv.of(1);
private final TEDefaultMetricTlv tlv2 = TEDefaultMetricTlv.of(1);
private final TEDefaultMetricTlv tlv3 = TEDefaultMetricTlv.of(2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
import java.util.LinkedList;
/**
* Test case for TE Link Attribute Tlv.
*/
public class TELinkAttributesTlvTest {
private final AdministrativeGroupTlv administrativeGroupTlv1 = new AdministrativeGroupTlv(10);
private final MaximumReservableLinkBandwidthTlv maximumReservableLinkBandwidthTlv1 =
new MaximumReservableLinkBandwidthTlv(20);
private final AdministrativeGroupTlv administrativeGroupTlv2 = new AdministrativeGroupTlv(20);
private final MaximumReservableLinkBandwidthTlv maximumReservableLinkBandwidthTlv2 =
new MaximumReservableLinkBandwidthTlv(30);
private final LinkedList<PcepValueType> llLinkAttributesSubTLV1 = new LinkedList<>();
private final boolean a = llLinkAttributesSubTLV1.add(administrativeGroupTlv1);
private final boolean b = llLinkAttributesSubTLV1.add(maximumReservableLinkBandwidthTlv1);
private final LinkedList<PcepValueType> llLinkAttributesSubTLV2 = new LinkedList<>();
private final boolean c = llLinkAttributesSubTLV2.add(administrativeGroupTlv2);
private final boolean d = llLinkAttributesSubTLV2.add(maximumReservableLinkBandwidthTlv2);
private final TELinkAttributesTlv tlv1 = TELinkAttributesTlv.of(llLinkAttributesSubTLV1);
private final TELinkAttributesTlv sameAsTlv1 = TELinkAttributesTlv.of(llLinkAttributesSubTLV1);
private final TELinkAttributesTlv tlv2 = TELinkAttributesTlv.of(llLinkAttributesSubTLV2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
import java.util.LinkedList;
/**
* Test case for TE link descriptors Tlv.
*/
public class TELinkDescriptorsTlvTest {
private final LinkLocalRemoteIdentifiersTlv linkLocalRemoteIdentifiersTlv1 = new
LinkLocalRemoteIdentifiersTlv(10, 10);
private final IPv4InterfaceAddressTlv iPv4InterfaceAddressTlv1 = new IPv4InterfaceAddressTlv(0x01010101);
private final LinkLocalRemoteIdentifiersTlv linkLocalRemoteIdentifiersTlv2 = new
LinkLocalRemoteIdentifiersTlv(20, 20);
private final IPv4InterfaceAddressTlv iPv4InterfaceAddressTlv2 = new IPv4InterfaceAddressTlv(0x02020202);
private final LinkedList<PcepValueType> llLinkDescriptorsSubTLVs1 = new LinkedList<>();
private final boolean a = llLinkDescriptorsSubTLVs1.add(linkLocalRemoteIdentifiersTlv1);
private final boolean b = llLinkDescriptorsSubTLVs1.add(iPv4InterfaceAddressTlv1);
private final LinkedList<PcepValueType> llLinkDescriptorsSubTLVs2 = new LinkedList<>();
private final boolean c = llLinkDescriptorsSubTLVs2.add(linkLocalRemoteIdentifiersTlv2);
private final boolean d = llLinkDescriptorsSubTLVs2.add(iPv4InterfaceAddressTlv2);
private final TELinkDescriptorsTlv tlv1 = TELinkDescriptorsTlv.of(llLinkDescriptorsSubTLVs1);
private final TELinkDescriptorsTlv sameAstlv1 = TELinkDescriptorsTlv.of(llLinkDescriptorsSubTLVs1);
private final TELinkDescriptorsTlv tlv2 = TELinkDescriptorsTlv.of(llLinkDescriptorsSubTLVs2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, sameAstlv1).addEqualityGroup(tlv2).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
import java.util.LinkedList;
/**
* Test case for TE Node Attribute tlv.
*/
public class TENodeAttributesTlvTest {
private final NodeFlagBitsTlv nodeFlagBitsTlv1 = new NodeFlagBitsTlv((byte) 10);
private final IPv4TERouterIdOfLocalNodeTlv iPv4TERouterIdOfLocalNodeTlv1 = new
IPv4TERouterIdOfLocalNodeTlv(0x01010101);
private final NodeFlagBitsTlv nodeFlagBitsTlv2 = new NodeFlagBitsTlv((byte) 20);
private final IPv4TERouterIdOfLocalNodeTlv iPv4TERouterIdOfLocalNodeTlv2 = new
IPv4TERouterIdOfLocalNodeTlv(0x02020202);
private final LinkedList<PcepValueType> llNodeAttributesSubTLV1 = new LinkedList<>();
private final boolean a = llNodeAttributesSubTLV1.add(nodeFlagBitsTlv1);
private final boolean b = llNodeAttributesSubTLV1.add(iPv4TERouterIdOfLocalNodeTlv1);
private final LinkedList<PcepValueType> llNodeAttributesSubTLV2 = new LinkedList<>();
private final boolean c = llNodeAttributesSubTLV2.add(nodeFlagBitsTlv2);
private final boolean d = llNodeAttributesSubTLV2.add(iPv4TERouterIdOfLocalNodeTlv2);
private final TENodeAttributesTlv tlv1 = TENodeAttributesTlv.of(llNodeAttributesSubTLV1);
private final TENodeAttributesTlv sameAsTlv1 = TENodeAttributesTlv.of(llNodeAttributesSubTLV1);
private final TENodeAttributesTlv tlv2 = TENodeAttributesTlv.of(llNodeAttributesSubTLV2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Test case for TED Capability tlv.
*/
public class TedCapabilityTlvTest {
private final TedCapabilityTlv tlv1 = TedCapabilityTlv.of(1);
private final TedCapabilityTlv tlv2 = TedCapabilityTlv.of(1);
private final TedCapabilityTlv tlv3 = TedCapabilityTlv.of(2);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
/*
* 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.pcepio.types;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
/**
* Unit Test case for Unreserved Bandwidth Tlv.
*/
public class UnreservedBandwidthTlvTest {
// Objects of unreserved bandwidth tlv
private final UnreservedBandwidthTlv tlv1 = UnreservedBandwidthTlv.of(100);
private final UnreservedBandwidthTlv tlv2 = UnreservedBandwidthTlv.of(100);
private final UnreservedBandwidthTlv tlv3 = UnreservedBandwidthTlv.of(200);
@Test
public void basics() {
new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2014 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onosproject</groupId>
<artifactId>onos</artifactId>
<version>1.4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>onos-pcep-controller</artifactId>
<packaging>pom</packaging>
<description>ONOS Pcep Protocol subsystem</description>
<modules>
<module>api</module>
<module>ctl</module>
<module>pcepio</module>
</modules>
<dependencies>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onlab-misc</artifactId>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onlab-junit</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
......@@ -33,10 +33,10 @@
<modules>
<module>openflow</module>
<module>pcep</module>
<!--
<module>ovsdb</module>
<module>netconf</module>
<module>pcep</module>
<module>bgp</module>
-->
</modules>
......