use of org.batfish.common.BatfishException.BatfishStackTrace 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.BatfishStackTrace 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));
}
use of org.batfish.common.BatfishException.BatfishStackTrace in project batfish by batfish.
the class InitInfoAnswerElementTest method testSetErrors.
@Test
public void testSetErrors() {
BatfishException exception = new BatfishException("sample exception");
BatfishStackTrace stackTrace = new BatfishStackTrace(exception);
List<BatfishStackTrace> errors = new ArrayList<>();
errors.add(stackTrace);
SortedMap<String, List<BatfishStackTrace>> error = new TreeMap<>();
error.put("error", errors);
_element.setErrors(error);
assertThat(_element.getErrors().get("error"), is(errors));
}
use of org.batfish.common.BatfishException.BatfishStackTrace in project batfish by batfish.
the class ParseVendorConfigurationAnswerElementTest method testSetErrors.
@Test
public void testSetErrors() {
BatfishException exception = new BatfishException("sample exception");
BatfishStackTrace stackTrace = new BatfishStackTrace(exception);
SortedMap<String, BatfishStackTrace> errors = new TreeMap<>();
errors.put("error", stackTrace);
_element.setErrors(errors);
assertThat(_element.getErrors().get("error"), is(stackTrace));
}
use of org.batfish.common.BatfishException.BatfishStackTrace in project batfish by batfish.
the class ParseVendorConfigurationAnswerElementTest 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));
}
Aggregations