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