use of org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.TestRunResult in project Smack by igniterealtime.
the class SmackIntegrationTestFrameworkUnitTest method logsNonFatalExceptionTest.
@Test
public void logsNonFatalExceptionTest() throws KeyManagementException, NoSuchAlgorithmException, SmackException, IOException, XMPPException, InterruptedException {
DummySmackIntegrationTestFramework sinttest = getFrameworkForUnitTest(ThrowsNonFatalExceptionDummyTest.class);
TestRunResult testRunResult = sinttest.run();
List<FailedTest> failedTests = testRunResult.getFailedTests();
assertEquals(1, failedTests.size());
FailedTest failedTest = failedTests.get(0);
assertTrue(failedTest.failureReason instanceof XMPPErrorException);
XMPPErrorException ex = (XMPPErrorException) failedTest.failureReason;
assertEquals(XMPPError.Condition.bad_request, ex.getXMPPError().getCondition());
assertEquals(ThrowsNonFatalExceptionDummyTest.DESCRIPTIVE_TEXT, ex.getXMPPError().getDescriptiveText());
}
Aggregations