Brian O'Connor

Moving pcep to protocols/ directory

Change-Id: I4a93f489af1b9e08dd0acc95faf55f76857c709b
Showing 288 changed files with 0 additions and 1024 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 -}
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 -}
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 -}
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 -}
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 -}
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 -}
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 -}
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 -}
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 -}
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 -}
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 -}
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 -}
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 -}
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 -}
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 -}
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 -}
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 -}
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 -}
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>
......
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.