use of org.batfish.common.BatfishException in project batfish by batfish.
the class ConvertConfigurationAnswerElementTest method testPrettyPrint.
@Test
public void testPrettyPrint() {
BatfishException exception = new BatfishException("sample exception");
BatfishStackTrace stackTrace = new BatfishStackTrace(exception);
_element.getErrors().put("sampleError", stackTrace);
StringBuilder expected = new StringBuilder();
expected.append("Results from converting vendor configurations\n");
expected.append("\n sampleError[Conversion errors]\n");
for (String line : _element.getErrors().get("sampleError").getLineMap()) {
expected.append(" " + line + "\n");
}
assertThat(_element.prettyPrint(), equalTo(expected.toString()));
}
use of org.batfish.common.BatfishException in project batfish by batfish.
the class ConvertConfigurationAnswerElementTest method testGetErrors.
@Test
public void testGetErrors() {
BatfishException exception = new BatfishException("sample exception");
BatfishStackTrace stackTrace = new BatfishStackTrace(exception);
_element.getErrors().put("error", stackTrace);
assertThat(_element.getErrors().get("error"), is(stackTrace));
}
use of org.batfish.common.BatfishException in project batfish by batfish.
the class ConvertConfigurationAnswerElementTest method checkNonEmptyErrors.
@Test
public void checkNonEmptyErrors() {
BatfishException exception = new BatfishException("sample exception");
_element.getErrors().put("error", new BatfishStackTrace(exception));
assertThat(_element.getErrors().size(), is(1));
}
use of org.batfish.common.BatfishException in project batfish by batfish.
the class InitInfoAnswerElementTest method testGetErrors.
@Test
public void testGetErrors() {
BatfishException exception = new BatfishException("sample exception");
BatfishStackTrace stackTrace = new BatfishStackTrace(exception);
List<BatfishStackTrace> errors = new ArrayList<>();
errors.add(stackTrace);
_element.getErrors().put("error", errors);
assertThat(_element.getErrors().get("error"), is(errors));
}
use of org.batfish.common.BatfishException in project batfish by batfish.
the class InitInfoAnswerElementTest method checkNonEmptyErrorsSet.
@Test
public void checkNonEmptyErrorsSet() {
BatfishException exception = new BatfishException("sample exception");
BatfishStackTrace stackTrace = new BatfishStackTrace(exception);
_element.getErrors().put("error", new ArrayList<>());
_element.getErrors().get("error").add(stackTrace);
assertThat(_element.getErrors().get("error").size(), is(1));
assertTrue(_element.getErrors().get("error").contains(stackTrace));
}
Aggregations