Skip to content

Commit

Permalink
SINT: Add the test that's being executed to the debugging context
Browse files Browse the repository at this point in the history
Allows (custom) debuggers to provide more context to data that is being logged by them.
  • Loading branch information
guusdk committed Mar 21, 2024
1 parent 195c9bf commit 99327d6
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import org.jivesoftware.smack.SmackException.NotConnectedException;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
import org.jivesoftware.smack.debugger.SmackDebugger;
import org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration;
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smack.util.TLSUtils;
Expand Down Expand Up @@ -676,15 +677,19 @@ private PreparedTest(AbstractSmackIntTest test, List<ConcreteTest> concreteTests

public void run() throws InterruptedException, XMPPException, IOException, SmackException {
try {
SmackDebugger.putInContext("sint.test", test.getClass().getSimpleName());

// Run the @BeforeClass methods (if any)
executeSinttestSpecialMethod(beforeClassMethod);

for (ConcreteTest concreteTest : concreteTests) {
SmackDebugger.putInContext("sint.concreteTest", concreteTest.toString());
runConcreteTest(concreteTest);
}
}
finally {
executeSinttestSpecialMethod(afterClassMethod);
SmackDebugger.clearContext();
}
}

Expand Down

0 comments on commit 99327d6

Please sign in to comment.