Пример #1
0
  @org.junit.Test
  public void testCheckAllLayer3OperatingMode() throws Exception {

    when(subNode.getNodeId()).thenReturn(nodeId);
    NodeId otherid;
    otherid = mock(NodeId.class);
    when(node.getNodeId()).thenReturn(otherid);
    Assert.assertEquals(
        intentResolverUtils.checkAllLayer3OperatingMode(subNodeList, nodeList), false);

    when(node.getNodeId()).thenReturn(nodeId);
    when(subNode.getNodeId()).thenReturn(nodeId);
    // into getNodeProperty
    when(node.getProperty()).thenReturn(propertyList);
    propertyName = new PropertyName("operating-other");
    when(property.getPropertyName()).thenReturn(propertyName);
    Assert.assertEquals(
        intentResolverUtils.checkAllLayer3OperatingMode(subNodeList, nodeList), false);

    when(node.getNodeId()).thenReturn(nodeId);
    when(subNode.getNodeId()).thenReturn(nodeId);
    when(node.getProperty()).thenReturn(propertyList);
    propertyName = new PropertyName("operating-mode");
    when(property.getPropertyName()).thenReturn(propertyName);
    when(property.getPropertyValues()).thenReturn(propertyValues);
    when(property.getPropertyValues().getStringValue()).thenReturn(stringValueList);
    when(property.getPropertyValues().getStringValue().get(0).getValue())
        .thenReturn(new String("layer3"));

    Assert.assertEquals(
        intentResolverUtils.checkAllLayer3OperatingMode(subNodeList, nodeList), true);
  }
Пример #2
0
  @org.junit.Test
  public void testCheckExternalLayer3Group() throws Exception {
    when(node.getProperty()).thenReturn(propertyList);
    // into getNodeProperty
    propertyName = new PropertyName("ac-info-network");
    when(property.getPropertyName()).thenReturn(propertyName);
    when(property.getPropertyValues()).thenReturn(propertyValues);
    when(property.getPropertyValues().getStringValue()).thenReturn(stringValueList);
    when(property.getPropertyValues().getStringValue().get(0).getValue())
        .thenReturn(new String("layer3"));

    Assert.assertEquals(intentResolverUtils.checkExternalLayer3Group(node), true);
  }