From a0b8ad98c9633db9b11f43929324771187775835 Mon Sep 17 00:00:00 2001 From: Dan Caseley Date: Wed, 16 Jun 2021 16:33:41 +0100 Subject: [PATCH 1/3] [doc] Add debugging section to sinttest doc --- documentation/developer/integrationtest.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/documentation/developer/integrationtest.md b/documentation/developer/integrationtest.md index 30595353c..60f3142b8 100644 --- a/documentation/developer/integrationtest.md +++ b/documentation/developer/integrationtest.md @@ -162,6 +162,19 @@ The test methods can declare as many parameters as they need to, but every param The framework will automatically create, register and login the connections. After the test is finished, the connections will be unregistered with the XMPP service and terminated. +Debugging Integration Tests +------------------------------ + +A test, like any other code, may not be perfect on the first attempt, and you may require more information in order to ascertain quite what's wrong. + +### Smack Debugger options + +As listed in the main Smack [Debugging](../debugging.md) doc, there are two built-in debuggers that could surface you more information. Using the 'enhanced' debugger config option listed above, you'll get the Smack Debug Window launching when your tests launch, and you'll get a stanza-by-stanza account of what happened on each connection, hopefully enough to diagnose what went wrong. + +### Debugging in the IDE + +If the output isn't enough, you may need to debug and inspect running code within the IDE. Depending on the IDE, in order to get execution to pause at your breakpoints, you may need to switch your configuration. Instead of running `gradle integrationTest`, instead run the `SmackIntegrationTestFramework` class directly with the same command-line options. + Running your own integration tests ---------------------------------- From 7b3bd6ff963d9a4d5f328baa2572625c0a34296e Mon Sep 17 00:00:00 2001 From: Dan Caseley Date: Wed, 16 Jun 2021 16:34:11 +0100 Subject: [PATCH 2/3] [doc] Fix config example in MUC doc --- documentation/extensions/muc.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/extensions/muc.md b/documentation/extensions/muc.md index a89f2b22f..40d7e2024 100644 --- a/documentation/extensions/muc.md +++ b/documentation/extensions/muc.md @@ -472,7 +472,7 @@ muc = manager.getMultiUserChat("myroom@conference.jabber.org"); muc.create("testbot"); // User1 (which is the room owner) configures the room as a moderated room Form form = muc.getConfigurationForm(); -Form answerForm = form.createAnswerForm(); +FillableForm answerForm = configForm.getFillableForm(); answerForm.setAnswer("muc#roomconfig_moderatedroom", "1"); muc.sendConfigurationForm(answerForm); @@ -612,7 +612,7 @@ muc = manager.getMultiUserChat("myroom@conference.jabber.org"); muc.create("testbot"); // User1 (which is the room owner) configures the room as a moderated room Form form = muc.getConfigurationForm(); -Form answerForm = form.createAnswerForm(); +FillableForm answerForm = configForm.getFillableForm(); answerForm.setAnswer("muc#roomconfig_moderatedroom", "1"); muc.sendConfigurationForm(answerForm); From e0754df0438c8dedc40ff58826dc2588c5f0897e Mon Sep 17 00:00:00 2001 From: Dan Caseley Date: Wed, 16 Jun 2021 17:48:59 +0100 Subject: [PATCH 3/3] [doc] Initial IDE config guide --- documentation/developer/building.md | 13 ++++++ resources/intellij/Smack Import Order.xml | 18 -------- resources/intellij/smack_formatter.xml | 51 +++++++++++++++++++++++ 3 files changed, 64 insertions(+), 18 deletions(-) delete mode 100644 resources/intellij/Smack Import Order.xml create mode 100644 resources/intellij/smack_formatter.xml diff --git a/documentation/developer/building.md b/documentation/developer/building.md index 84163fc7f..2e35e634b 100644 --- a/documentation/developer/building.md +++ b/documentation/developer/building.md @@ -48,3 +48,16 @@ git clone git@github.com:igniterealtime/Smack.git cd Smack gradle assemble ``` + +IDE Config +---------- + +### Eclipse + +Import IDE settings from `./resources/eclipse/` to configure proper ordering of imports and correct formatting that should pass the CheckStyle rules. + +### IntelliJ IDEA + +Import Java Code Style settings from `./resources/intellij/smack_formatter.xml` to configure import optimisation and code formatting to pass the CheckStyle rules when building or submitting PRs. + +_We've noticed, at time of writing, that IntelliJ often requires a restart when applying new rules - no amount of OK/Apply will do the trick._ diff --git a/resources/intellij/Smack Import Order.xml b/resources/intellij/Smack Import Order.xml deleted file mode 100644 index 3209e4f5f..000000000 --- a/resources/intellij/Smack Import Order.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - diff --git a/resources/intellij/smack_formatter.xml b/resources/intellij/smack_formatter.xml new file mode 100644 index 000000000..961dda2b6 --- /dev/null +++ b/resources/intellij/smack_formatter.xml @@ -0,0 +1,51 @@ + + \ No newline at end of file