WDM hop count setter was used both for WDM and OTN constraints
- use OTN hop count setter for OTN constraints
Junit was only testing WDM hop count and TE metrics but not OTN ones.
- add OTN parameters to tests constraints util class
- add OTN Hop Count Junit tests
JIRA: TRNSPRTPCE-611
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I1eb1057fb85d10da359670f0607985d77f89dd6b
hcBldr.setMaxWdmHopCount(Uint8.valueOf(maxWdmHc));
}
if (maxOtnHc != null) {
hcBldr.setMaxWdmHopCount(Uint8.valueOf(maxWdmHc));
}
if (maxOtnHc != null) {
- hcBldr.setMaxWdmHopCount(Uint8.valueOf(maxOtnHc));
+ hcBldr.setMaxOtnHopCount(Uint8.valueOf(maxOtnHc));
}
return hcBldr.build();
}
}
return hcBldr.build();
}
initialSoftConstraints.getHopCount(), generatedSoftConstraints.getHopCount());
assertEquals("updated soft constraints max-wdm-hop-count should be '3'",
3, generatedSoftConstraints.getHopCount().getMaxWdmHopCount().intValue());
initialSoftConstraints.getHopCount(), generatedSoftConstraints.getHopCount());
assertEquals("updated soft constraints max-wdm-hop-count should be '3'",
3, generatedSoftConstraints.getHopCount().getMaxWdmHopCount().intValue());
- assertNull("updated soft constraints max-otn-hop-count should be null",
- generatedSoftConstraints.getHopCount().getMaxOtnHopCount());
+ assertEquals("updated soft constraints max-otn-hop-count should be '5'",
+ 5, generatedSoftConstraints.getHopCount().getMaxOtnHopCount().intValue());
// test addition of hard hop-count when no soft hop-count
initialHardConstraints = buildHardConstraint(null, false, null, null, null, null, true, false, null, null);
// test addition of hard hop-count when no soft hop-count
initialHardConstraints = buildHardConstraint(null, false, null, null, null, null, true, false, null, null);
initialHardConstraints.getHopCount(), generatedSoftConstraints.getHopCount());
assertEquals("updated soft constraints max-wdm-hop-count should be '3'",
3, generatedSoftConstraints.getHopCount().getMaxWdmHopCount().intValue());
initialHardConstraints.getHopCount(), generatedSoftConstraints.getHopCount());
assertEquals("updated soft constraints max-wdm-hop-count should be '3'",
3, generatedSoftConstraints.getHopCount().getMaxWdmHopCount().intValue());
- assertNull("updated soft constraints max-otn-hop-count should be null",
- generatedSoftConstraints.getHopCount().getMaxOtnHopCount());
+ assertEquals("updated soft constraints max-otn-hop-count should be '5'",
+ 5, generatedSoftConstraints.getHopCount().getMaxOtnHopCount().intValue());
// test addition of hard hop-count when existing soft hop-count
initialSoftConstraints = buildSoftConstraint(null, false, null, null, null, null, true, false, null, null);
// test addition of hard hop-count when existing soft hop-count
initialSoftConstraints = buildSoftConstraint(null, false, null, null, null, null, true, false, null, null);
initialHardConstraints, initialSoftConstraints);
assertEquals("updated soft constraints max-wdm-hop-count should be '3'",
3, generatedSoftConstraints.getHopCount().getMaxWdmHopCount().intValue());
initialHardConstraints, initialSoftConstraints);
assertEquals("updated soft constraints max-wdm-hop-count should be '3'",
3, generatedSoftConstraints.getHopCount().getMaxWdmHopCount().intValue());
- assertNull("updated soft constraints max-otn-hop-count should be null",
- generatedSoftConstraints.getHopCount().getMaxOtnHopCount());
+ assertEquals("updated soft constraints max-otn-hop-count should be '5'",
+ 5, generatedSoftConstraints.getHopCount().getMaxOtnHopCount().intValue());
if (hopCount) {
hc = new HopCountBuilder()
.setMaxWdmHopCount(Uint8.valueOf(3))
if (hopCount) {
hc = new HopCountBuilder()
.setMaxWdmHopCount(Uint8.valueOf(3))
+ .setMaxOtnHopCount(Uint8.valueOf(5))
.build();
}
Map<String, Exclude> excludeMap = initialiseExcludeMap();
.build();
}
Map<String, Exclude> excludeMap = initialiseExcludeMap();
if (teMetric) {
tem = new TEMetricBuilder()
.setMaxWdmTEMetric(Uint32.valueOf(8))
if (teMetric) {
tem = new TEMetricBuilder()
.setMaxWdmTEMetric(Uint32.valueOf(8))
+ .setMaxOtnTEMetric(Uint32.valueOf(11))
.build();
}
Distance distance = null;
.build();
}
Distance distance = null;