1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-23 04:22:05 +01:00
Commit graph

137 commits

Author SHA1 Message Date
Guus der Kinderen
e79934938c [sinttest] Add optional version to specification reference
Some specifications are versioned. XEPs, for example, typically are. It is useful to annotate an implementation with the specific version of the specification that is being tested.
2024-04-30 22:04:20 +02:00
Florian Schmaus
36d6ff2995
Merge pull request #482 from Fishbowler/xep-0045-coverage-part4
[sinttest] Additional tests covering s7 of XEP-0045
2024-04-30 10:08:39 +02:00
Dan Caseley
855f01e6b2 [sinttest] Additional tests for s7 of XEP-0045 2024-04-30 09:44:58 +02:00
Florian Schmaus
5fcd0b56dd
Merge pull request #590 from guusdk/sint_add-ignite-to-default-scanner
[sinttest] Expand list of default test packages
2024-04-29 17:22:35 +00:00
Guus der Kinderen
8efa4bd732 [sinttest] Expand list of default test packages
The default set of packages that is scanned for integration tests are referencing jivesoftware. This commit adds igniterealtime-oriented package names.
2024-04-26 17:16:03 +02:00
Florian Schmaus
8a71029fbc
Merge pull request #588 from guusdk/sint_configurable-testresultprocessor
[sinttest] Allow custom processing of test run result
2024-04-17 15:35:50 +00:00
Guus der Kinderen
77dc527a63 [sinttest] Carry over assertion message when sync point times out
`AbstractSmackIntTest#assertResult()` takes an argument that is an assertion message. When the sync point times out, that message should be logged.

The following illustrates the change, as a result of this assertion failing:

```
assertResult(resultSyncPoint, "Expected " + conTwo.getUser() + " to receive message that was sent by " + conOne.getUser() + " in room " + mucAddress + " (but it did not).");
```

Prior to this change, this is logged:

```
SEVERE: MultiUserChatIntegrationTest.mucTest (Normal) failed: java.util.concurrent.TimeoutException: Timeout expired
java.util.concurrent.TimeoutException: Timeout expired
	at org.igniterealtime.smack.inttest.util.ResultSyncPoint.waitForResult(ResultSyncPoint.java:49)
	at org.igniterealtime.smack.inttest.AbstractSmackIntTest.assertResult(AbstractSmackIntTest.java:104)
	at org.igniterealtime.smack.inttest.AbstractSmackIntTest.assertResult(AbstractSmackIntTest.java:99)
	at org.jivesoftware.smackx.muc.MultiUserChatIntegrationTest.mucTest(MultiUserChatIntegrationTest.java:132)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	(snip)
```

With the change in this commit, that becomes:

```
SEVERE: MultiUserChatIntegrationTest.mucTest (Normal) failed: java.util.concurrent.TimeoutException: Expected smack-inttest-two-jskr4@example.org/two-jskr4 to receive message that was sent by smack-inttest-one-jskr4@example.org/one-jskr4 in room smack-inttest-message-jskr4-aud43i@conference.example.org (but it did not).
java.util.concurrent.TimeoutException: Expected smack-inttest-two-jskr4@example.org/two-jskr4 to receive message that was sent by smack-inttest-one-jskr4@example.org/one-jskr4 in room smack-inttest-message-jskr4-aud43i@conference.example.org (but it did not).
	at org.igniterealtime.smack.inttest.util.ResultSyncPoint.waitForResult(ResultSyncPoint.java:53)
	at org.igniterealtime.smack.inttest.AbstractSmackIntTest.assertResult(AbstractSmackIntTest.java:104)
	at org.igniterealtime.smack.inttest.AbstractSmackIntTest.assertResult(AbstractSmackIntTest.java:99)
	at org.jivesoftware.smackx.muc.MultiUserChatIntegrationTest.mucTest(MultiUserChatIntegrationTest.java:132)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	(snip)
```
2024-04-17 10:10:00 +02:00
Guus der Kinderen
5622bb07d1 [sinttest] Allow custom processing of test run result
This adds a new configuration option, `testRunResultProcessors`, that allows a user to customize the way the results of a test run is processed.

By default, the pre-exising printing-to-stderr is used.
2024-04-17 09:40:17 +02:00
Guus der Kinderen
d515a24e1c [sinttest] Fix processing of SpecificationReference
When refactoring the original implementation, this annotation was expected to be present on methods. It later was changed to be a type-based annotation. This particular usage of the annotation was not properly modified to account for that change.
2024-04-11 15:07:10 +02:00
Florian Schmaus
211cf342a4
Merge pull request #579 from guusdk/sint_tagging
Sint tagging
2024-04-09 14:17:48 +00:00
Guus der Kinderen
f76f0791e6 [sinttest] Add tagging of tests with references to (XMPP) specifications
A new annotation is introduced (`SpecificationReference`) that can be used to annotate a SINT test class

The properties are available in the annotation:
- `document`: Identifier for a specification document, such as 'RFC 6120' or 'XEP-0485'

The pre-existing `SmackIntegrationTest` annotation has now received two new properties:
- `section`: Identifier for a section (or paragraph), such as '6.2.1'
- `quote`: A quotation of relevant text from the section
These are expected to be used in context of the `SpecificationReference` annotation.

The SINT execution framework is modified so that two new configuration options are available:
- `enabledSpecifications`
- `disabledSpecifications`

These operate on the value of the `document` property of the annotation. Their usage is comparable
to that of the pre-existing `enabledTests` and `disabledTest` configuration options.

Execution output now includes the document, section and quote that's on the annotated test, when
the test fails. This allows an end-user to easily correspond a test failure with a particular
specification.
2024-04-09 15:25:21 +02:00
Florian Schmaus
dc96484d2b [sinttest] Add AbstractSmackIntTest.assertResult() 2024-04-04 21:04:21 +02:00
Florian Schmaus
7139a43291
Merge pull request #580 from guusdk/debugger-context
Debugger context
2024-04-03 15:10:32 +00:00
Guus der Kinderen
d92fef432e SINT: Expose the test that's being executed 2024-04-03 17:07:20 +02:00
Florian Schmaus
d24767c6a4
Merge pull request #578 from guusdk/typo
SINT: fix typo in output for disabled test
2024-04-02 16:51:59 +00:00
Guus der Kinderen
92c45e0d29 sint: Allow use of custom SmackDebugger
Refactors the Smack Integration Test configuration to allow for a classname for a SmackDebugger(Factory) to be
provided.
2024-03-21 16:32:20 +01:00
Guus der Kinderen
84a55fa57e fix typos in package-info 2024-03-14 16:17:24 +01:00
Guus der Kinderen
806106534d SINT: fix various typos in javadoc and comment 2024-03-14 13:18:52 +01:00
Guus der Kinderen
ec4caf6663 SINT: fix typo in validation of accountTwoPassword argument 2024-03-14 13:15:21 +01:00
Guus der Kinderen
449ea73239 SINT: fix typo in output when using deprecated 'debug' option 2024-03-14 13:14:52 +01:00
Guus der Kinderen
f4110ec388 SINT: fix typo in output for disabled test 2024-03-14 10:56:29 +01:00
Florian Schmaus
1e666197a3 [sinttest] Display Java version on startup 2023-12-07 11:20:37 +01:00
Florian Schmaus
688c06020b [sinttest] Improve message ouf XmppConnectionStressTest 2023-12-06 20:55:02 +01:00
Florian Schmaus
7fcc8a9bd3 [sinttest] Set default timeout to 47 seconds
Using 60 seconds makes it sometimes easy to miss that the some action
was 1 minute after the timeout, because only a single digit in the
timestamp changes. Using a prime number as timeout makes this more
obvious.
2023-12-06 20:53:23 +01:00
Florian Schmaus
9203907e66
Merge pull request #567 from guusdk/sint_trim-config
[sinttest] Trim externally-provided configuration
2023-11-26 17:12:39 +00:00
Florian Schmaus
472bee8497 [sinttest] drop empty line 2023-11-26 13:58:09 +01:00
Florian Schmaus
915626123d [sinttest] Fix IBR-based account registration
When performing IBR-based account registration, we do not need to
login nor are the admin credentials typically available.

Suggested-by: Guus der Kinderen <guus@goodbytes.nl>
2023-11-26 13:55:35 +01:00
Guus der Kinderen
9055878748 [sinttest] Fix typos in log and exception messages 2023-11-25 20:08:51 +01:00
Guus der Kinderen
92d4cf5c77 [sinttest] Trim externally-provided configuration
Smack integration test configuration is provided externally. Guard against accidental whitespace inclusion by trimming values.
2023-09-29 20:37:03 +02:00
Florian Schmaus
24782558d6 [sinttest] Properly handle AbstractSmackSpecificLowLevelIntegrationTest
Subclasses of AbstractSmackSpecificLowLevelIntegrationTest have test
methods with no parameters. This was, after the refactoring in
c5bb15c631 ("[sinttest] Add UnconnectedConnectionSource for
low-level tests") not handled properly.

Fixes: c5bb15c631 ("[sinttest] Add UnconnectedConnectionSource for low-level tests")
2023-03-17 20:28:14 +01:00
Florian Schmaus
c5bb15c631 [sinttest] Add UnconnectedConnectionSource for low-level tests
Previously low-level tests where run, potentially multiple times, with
the default connection descriptor.

Reported-by: Guus der Kinderen <guus@goodbytes.nl>
2023-02-11 13:02:23 +01:00
Florian Schmaus
c9a9982cef Migrate markdown documentation to javadoc
While markdown is easier to write, Smack's markdown documentation was
never tightly coupled with the source. For example, the markdown
documentation never provided links to the actual Java classes and
methods. This poses the risk that the documentation and the code
diverge over time. Furthermore, javadoc is constantly improving (for
example @snippet annotations) and I expect that one will be able to
write javadoc in markdown.

Fixes SMACK-928.
2023-02-03 09:50:35 +01:00
Florian Schmaus
10a2687ff1 [sinttest] Allow the selection of individual test *methods* 2021-12-13 21:08:45 +01:00
Florian Schmaus
69a55aaa84 [sinttest] Evaluate compatibilityMode property 2021-12-13 21:04:32 +01:00
Florian Schmaus
def7c91e6a [sinttest] Introduce dirty hack in performActionAndWaitForPresence() 2021-12-13 21:03:40 +01:00
Florian Schmaus
f611941dcf
Merge pull request #480 from guusdk/sint_improve-notinroster
[sint] increase stability
2021-11-04 09:46:18 +01:00
Florian Schmaus
a0b9279441 [sinttest] Add "compatibility mode" setting 2021-08-22 16:16:03 +02:00
Florian Schmaus
f64288ba6d [sinttest] Treat NPE as test failure not as abort condition 2021-07-16 08:56:48 +02:00
Guus der Kinderen
5e203086b3 [sint] increase stability
Some roster-based tests depend on there not being any prior subscription state beteween entities. The utility method that
tries to guarantee that, acts on the state of the roster that's cached in memory, but acts on the one that's stored on the
server. This occasionally causes issues, as both representations might be different.

Stability is added in this commit by:
- refreshing the roster from the server prior to evaluating it
- ignoring an 'item-not-found' as returned by the server, when the code tries to remove that item.
2021-06-25 16:08:31 +02:00
Florian Schmaus
138725a22f [sinttest] Log testPackages to ISE's message
This means we the reason for the LOGGER.info() call is now gone.
2021-04-05 15:02:58 +02:00
Florian Schmaus
c484b72fb7 [sinttest] Fix buildWebsocketDescriptor() 2021-04-01 17:22:23 +02:00
Florian Schmaus
0c4b5d3ff9 [sinttest] Log if sinttest packages are provided via command line 2021-04-01 17:22:06 +02:00
Florian Schmaus
4fefa92e40 Merge branch '4.4' 2021-03-19 09:47:07 +01:00
Florian Schmaus
b276b89916 [sinttest] Add code comment and empty line 2021-03-18 21:32:37 +01:00
Florian Schmaus
ddf96828e4 [sinttest] Add fromMarkers array to exception message 2021-03-18 21:32:21 +01:00
Florian Schmaus
35cd1a8f88 [sinttest] Do not lazily create fromMarkers
If we do not create the fromMarkers initialized with 'false' at the
start, then it may appear like all messages are received, because we
only check for false markers. But if there is not even the fromMarkers
array, then we do not see those 'false' markers.
2021-03-18 21:32:10 +01:00
Florian Schmaus
9520aa7d90 [sinttest] Do not create myReceiveMarkers on demand 2021-03-15 19:24:19 +01:00
Florian Schmaus
11a486d84d [sinttest] Add header to NotAllMessagesReceivedException
This header maps the internal connection ID to the connection.
2021-03-15 19:22:57 +01:00
Florian Schmaus
f91598e10c [sinttest] Improve NotAllMessageReceivedException 2021-03-15 19:22:26 +01:00
Florian Schmaus
ad8eeebc0d [sinttest] Allow maxPayloadChunks == 0 2021-03-15 19:21:55 +01:00