@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(StanzaError.Condition.bad_request, ex.getStanzaError().getCondition()); assertEquals(ThrowsNonFatalExceptionDummyTest.DESCRIPTIVE_TEXT, ex.getStanzaError().getDescriptiveText()); }
triggerTransportClosed(null); throw new JingleException(iq.getError().getDescriptiveText()); } else if (iq.getType().equals(IQ.Type.result)) {
triggerMediaClosed(getBestCommonAudioPt()); throw new JingleException(iq.getError().getDescriptiveText()); } else if (iq.getType().equals(IQ.Type.result)) {
assertTrue(e.getStanzaError().getDescriptiveText("en").contains("Could not establish socket with any provided host"));
assertTrue(e.getStanzaError().getDescriptiveText("en").contains("Could not establish socket with any provided host"));
@Test public void ensureNoNullLangInParsedDescriptiveTexts() throws Exception { final String text = "Dummy descriptive text"; final String errorXml = XMLBuilder .create(StanzaError.ERROR).a("type", "cancel").up() .element("internal-server-error", StanzaError.ERROR_CONDITION_AND_TEXT_NAMESPACE).up() .element("text", StanzaError.ERROR_CONDITION_AND_TEXT_NAMESPACE).t(text).up() .asString(); XmlPullParser parser = TestUtils.getParser(errorXml); StanzaError error = PacketParserUtils.parseError(parser).build(); assertEquals(text, error.getDescriptiveText()); } }
assertTrue(e.getStanzaError().getDescriptiveText("en").contains( "Could not establish socket with any provided host"));
assertTrue(e.getStanzaError().getDescriptiveText("en").contains( "Could not establish socket with any provided host"));