use of org.batfish.datamodel.questions.Question.InstanceData.Variable in project batfish by batfish.
the class ClientTest method testValidComparatorValue.
@Test
public void testValidComparatorValue() throws IOException {
JsonNode comparatorNode = _mapper.readTree("\">=\"");
Question.InstanceData.Variable variable = new Question.InstanceData.Variable();
variable.setType(COMPARATOR);
Client.validateType(comparatorNode, variable);
}
use of org.batfish.datamodel.questions.Question.InstanceData.Variable in project batfish by batfish.
the class ClientTest method testValidateInvalidNode.
@Test
public void testValidateInvalidNode() throws IOException {
String parameterName = "boolean";
JsonNode invalidNode = _mapper.readTree("\"I am string\"");
Question.InstanceData.Variable variable = new Question.InstanceData.Variable();
variable.setType(BOOLEAN);
_thrown.expect(BatfishException.class);
_thrown.expectMessage(equalTo(String.format("Invalid value for parameter %s: %s", parameterName, invalidNode)));
Client.validateNode(invalidNode, variable, parameterName);
}
use of org.batfish.datamodel.questions.Question.InstanceData.Variable in project batfish by batfish.
the class ClientTest method testValidIPValue.
@Test
public void testValidIPValue() throws IOException {
JsonNode ipNode = _mapper.readTree("\"0.0.0.0\"");
Question.InstanceData.Variable variable = new Question.InstanceData.Variable();
variable.setType(IP);
Client.validateType(ipNode, variable);
}
use of org.batfish.datamodel.questions.Question.InstanceData.Variable in project batfish by batfish.
the class ClientTest method testValidPrefixRangeValue.
@Test
public void testValidPrefixRangeValue() throws IOException {
JsonNode prefixRangeNode = _mapper.readTree("\"10.168.5.5/30:10-50\"");
Question.InstanceData.Variable variable = new Question.InstanceData.Variable();
variable.setType(PREFIX_RANGE);
Client.validateType(prefixRangeNode, variable);
}
use of org.batfish.datamodel.questions.Question.InstanceData.Variable in project batfish by batfish.
the class ClientTest method testValidIpWildcardValue.
@Test
public void testValidIpWildcardValue() throws IOException {
JsonNode ipWildcardNode = _mapper.readTree("\"10.168.5.5:10.168.100.100\"");
Question.InstanceData.Variable variable = new Question.InstanceData.Variable();
variable.setType(IP_WILDCARD);
Client.validateType(ipWildcardNode, variable);
}
Aggregations