}
@Test
- public void testUpdateSoftConstraintsForHopCount() {
+ public void testUpdateSoftConstraintsForHopCountAndTEmetric() {
HardConstraints initialHardConstraints =
buildHardConstraint(null, false, null, null, null, null, false, false, null, null);
SoftConstraints initialSoftConstraints =
assertNull("updated soft constraints should contain no hop-count constraint",
generatedSoftConstraints.getHopCount());
- initialSoftConstraints = buildSoftConstraint(null, false, null, null, null, null, true, false, null, null);
+ initialSoftConstraints = buildSoftConstraint(null, false, null, null, null, null, true, true, null, null);
generatedSoftConstraints = DowngradeConstraints.updateSoftConstraints(
initialHardConstraints, initialSoftConstraints);
assertEquals("updated soft constraints should not be changed",
3, generatedSoftConstraints.getHopCount().getMaxWdmHopCount().intValue());
assertEquals("updated soft constraints max-otn-hop-count should be '5'",
5, generatedSoftConstraints.getHopCount().getMaxOtnHopCount().intValue());
+ assertEquals("updated soft constraints max-wdm-TE-metric should be '8'",
+ 8, generatedSoftConstraints.getTEMetric().getMaxWdmTEMetric().intValue());
+ assertEquals("updated soft constraints max-otn-TE-metric should be '11'",
+ 11, generatedSoftConstraints.getTEMetric().getMaxOtnTEMetric().intValue());
// test addition of hard hop-count when no soft hop-count
- initialHardConstraints = buildHardConstraint(null, false, null, null, null, null, true, false, null, null);
+ initialHardConstraints = buildHardConstraint(null, false, null, null, null, null, true, true, null, null);
initialSoftConstraints = buildSoftConstraint(null, false, null, null, null, null, false, false, null, null);
generatedSoftConstraints = DowngradeConstraints.updateSoftConstraints(
initialHardConstraints, initialSoftConstraints);
3, generatedSoftConstraints.getHopCount().getMaxWdmHopCount().intValue());
assertEquals("updated soft constraints max-otn-hop-count should be '5'",
5, generatedSoftConstraints.getHopCount().getMaxOtnHopCount().intValue());
+ assertEquals("updated soft constraints max-wdm-TE-metric should be '8'",
+ 8, generatedSoftConstraints.getTEMetric().getMaxWdmTEMetric().intValue());
+ assertEquals("updated soft constraints max-otn-TE-metric should be '11'",
+ 11, generatedSoftConstraints.getTEMetric().getMaxOtnTEMetric().intValue());
// test addition of hard hop-count when existing soft hop-count
- initialSoftConstraints = buildSoftConstraint(null, false, null, null, null, null, true, false, null, null);
+ initialSoftConstraints = buildSoftConstraint(null, false, null, null, null, null, true, true, null, null);
generatedSoftConstraints = DowngradeConstraints.updateSoftConstraints(
initialHardConstraints, initialSoftConstraints);
assertEquals("updated soft constraints max-wdm-hop-count should be '3'",
3, generatedSoftConstraints.getHopCount().getMaxWdmHopCount().intValue());
assertEquals("updated soft constraints max-otn-hop-count should be '5'",
5, generatedSoftConstraints.getHopCount().getMaxOtnHopCount().intValue());
+ assertEquals("updated soft constraints max-wdm-TE-metric should be '8'",
+ 8, generatedSoftConstraints.getTEMetric().getMaxWdmTEMetric().intValue());
+ assertEquals("updated soft constraints max-otn-TE-metric should be '11'",
+ 11, generatedSoftConstraints.getTEMetric().getMaxOtnTEMetric().intValue());
}
@Test