Commit Graph

124 Commits

Author SHA1 Message Date
Dan Caseley cd6ff363c6 [sinttest] Refactor MUC tests ready to add more 2021-06-15 13:03:46 +01:00
Florian Schmaus 64db6e3ebc [openpgp] Remove INFO log sites
INFO log sites should be used sparingly and carefully. Those are a
good examples for an unnecessary INFO log sites.
2021-05-02 18:45:25 +02:00
Dan Caseley fc191e4e19 [sinttest] Add XEP reference for muc destroy test 2021-04-26 13:28:00 +01:00
Dan Caseley b541397119 [sinttest] Fix typo in muc XEP reference for test 2021-04-26 13:26:29 +01:00
Florian Schmaus 6a78e4ad09 [sinttest] Do not catch exceptions when destroying a MUC
If something goes wrong when destroying a MUC, we want to be notified
about it immediately, as further results of the integration test run
are unreliable anyway.
2021-04-26 09:42:20 +02:00
Florian Schmaus a36251ff7d Merge remote-tracking branch 'github/pr/469' into muc 2021-04-26 09:08:44 +02:00
Florian Schmaus 0c397294e1 Merge remote-tracking branch 'github/pr/468' into muc 2021-04-26 09:00:50 +02:00
Dan Caseley 920b686f29 Add kick presence tests
Inspired by OF-2240. Used to validate the problem, then test the fix.
2021-04-25 14:32:58 +01:00
Dan Caseley 642f5bde61 [sinttest] Fix ordering of parameters in muc assertEquals checks 2021-04-23 16:50:33 +01:00
Florian Schmaus 8a91021a0e [sinttest] Improve MultiUserChatIntegrationTest.tryDestroy(MultiUserChat) 2021-04-18 21:35:34 +02:00
Dan Caseley aff6283798 Add MUC tests for presence & self-presence for role & affiliation changes 2021-04-07 10:33:38 +01:00
Guus der Kinderen 252cea1149 SINT: MAM test does not require XEP-0441
The MAM integration test setup attepts to set MAM preferences (XEP-0441).
When a server does not support this XEP, the setup phase errors out, preventing
the tests from being executed.

There is no functional reason why tests shouldn't be run when XEP-0441 is not
supported: the tests can run against the default configuration of the MAM
service.

This commit ignores feature-not-implemented errors when MAM
preferences are set.

[Ignore only feature-not-implemented errors, log ignored errors)
Modified-by: Florian Schmaus <flo@geekplace.eu>
2021-04-01 13:13:42 +02:00
Florian Schmaus 4fefa92e40 Merge branch '4.4' 2021-03-19 09:47:07 +01:00
Florian Schmaus 73941629f3 [sinttest] Call OutgoingFiletransfer.getException() in case of error 2021-03-14 17:57:13 +01:00
Guus der Kinderen a809f181f5 In tests, use specific assertion implementation
These generate more helpful error messages when assertions fail and
help to show intent.
2020-10-27 11:30:44 +01:00
Paul Schaub 6e57ea0873
Allow user-supplied secret key backup passphrases
Instead of passing the passphrase back to the user via a
DisplayBackupCodeCallback, we directly return the passphrase
which is now represented by a class.

Also we now allow the user to provide the passphrase.
2020-07-15 22:22:42 +02:00
Florian Schmaus 6266f04682
Merge pull request #397 from vanitasvitae/oxProviderImprov
Remove constructor dependency on XMPPConnection from OpenPgpProvider
2020-06-15 17:52:54 +02:00
Paul Schaub 4a878ff175
Remove constructor dependency on XMPPConnection from OpenPgpProvider 2020-06-15 14:02:18 +02:00
adiaholic 1d49de6b60 Add integration test for MultiUserChat
SMACK-888 has a mention of unreachable code and is now solved
under commit 0f7b7df.
This integration test tests those class entities which were to
be set by previously stated unreachable code.
2020-06-04 22:46:52 +02:00
Florian Schmaus f5448c5faa [core] Rework TLS logic
This moves the logic in AbstractXMPPConnection.getSmackTlsContext()
into the ConnectionConfiguration constructor.

Also introduce SslContextFactory and use it in
ConnectionConfiguration.
2020-05-25 15:41:57 +02:00
Florian Schmaus d65f2c932e Bump Error Prone version to 2.3.4 and fix new bug patterns 2020-05-24 21:10:01 +02:00
Florian Schmaus ebe5c49e92 [checkstyle] Tighten JavadocMethod checkstyle rule 2020-05-23 22:43:29 +02:00
Florian Schmaus 5bfe789e08 [sinttest] Add unreliable workaround for XEP-0030 based operations 2020-05-22 15:44:23 +02:00
Aditya Borikar 17ca4c541b Add support for XEP-0232: Software Information
By making use of an extended data format, service discovery responses
can be used to constitute software information.
Solves SMACK-853.
2020-05-16 14:02:25 +05:30
Florian Schmaus 77e26fc575 Re-work data form API
Apply builder pattern to form fields and replace getVariable() with
getFieldName(). Refer to the field name as "field name" instead of
"variable" everyone, just as XEP-0004 does.

Improve the high-level form API: introduce FilledForm and FillableForm
which perform stronger validation and consistency checks.

Also add FormFieldRegistry to enable processing of 'submit' forms
where the form field types are omitted.

Smack also now does omit the form field type declaration on 'submit'
type forms, as it is allowed by XEP-0004.
2020-05-13 20:14:41 +02:00
Florian Schmaus 9b20e2efd8 sinttest: signal failure if geoloc element does not match 2020-04-13 15:28:17 +02:00
Florian Schmaus 6d9936a0a6 geoloc: do not set error in integration test
As error is deprecated. And should be marked as such.
2020-04-13 15:27:43 +02:00
Florian Schmaus 340bcb2d12 pep: improve API, add PepEventListener
The geoloc, mood and usertune PEP users showed a pattern. Instead of
repeating this pattern every time, let PepManager do the hard work
2020-04-13 15:26:46 +02:00
Florian Schmaus 7c2f9e3603 pep: cleanup pep users API
Use EntityBareJid just as its done within PepManager. There is no need
for AsyncButOrdered in the PEP user managers, as PepManager already
takes care of that. Also the message carrying the PEP event should
always be the last parameter of the callbacks, as it is the least
important piece of information.
2020-04-13 12:14:32 +02:00
Florian Schmaus e8fef260e6 sinttest: migrate to JUnit5, drop JUnit4
The before/after class annotations are now no longer borrowed from
JUnit.

Also some integration tests used @After and/or @Before from JUnit,
which was never supported nor had any effected. Those methods got
deleted. But since there appears to be a desire for such a
functionality in sinttest, we should consider adding one.
2020-04-12 22:21:30 +02:00
adiaholic 340e186cf6 Make use of `pep` instead of `pubsub` in GeoLocationManager
This mini assignment kicked-off with replacing `pubsub` with `pep`,
but later transformed into something more.

The alterations and additions in this commit:
 a) GeoLocation.
    1) Add Documentation.
    2) Add `EMPTY_GEO_LOCATION` to be used while
       `stopPublishingGeoLocation()` is called.
 b) Add GeoLocation IntegrationTest.
 c) Add GeoLocation Listener.
 d) GeoLocationManager.
    1) Add Documentation.
    2) Replace `pubsub` with `pep`.
    3) Add methods to add-and-remove GeoLocationListeners.
    4) Enable GeoLocation by default.
 e) Add `package.info` for GeoLocation Integration Test.
2020-04-08 23:05:09 +05:30
Florian Schmaus cc636fff21 Introduce Smack's Modular Connection Architecture
This is a complete redesign of what was previously
XmppNioTcpConnection. The new architecture allows to extend an XMPP
client to server (c2s) connection with new transport bindings and
other extensions.
2020-04-04 13:03:31 +02:00
Florian Schmaus 5db6191110 Introduce StanzaBuilder
As first step to immutable Stanza types.
2019-10-25 21:41:55 +02:00
adiaholic 260c5539b5 Add support for XEP-0118: UserTune
This commit will enable user to communicate
information about music to which user is listening.
This feature is less of a requirement and more like fun to me.
An attempt at solving SMACK-257.

Incase you see any chances of improvement,
please let me know :)
2019-10-17 12:24:30 +02:00
Florian Schmaus e23babf147 Add Stanza.setNewStanzaId() and ensureStanzaIdSet()
Also deprecate setStanzaId() since it was not clear if this would
create a new stanza ID or just ensure that one is set.
2019-10-05 23:16:15 +02:00
Florian Schmaus 2f667f95a8 gradle: Remove archives configuration
and FileTestUtil in favor of commons-io. This is required because
Eclipse won't put src/test code into the classpath of src/main
code (even though gradle was configured with an according
dependency).
2019-09-16 00:04:47 +02:00
Florian Schmaus 75625283ef Make "duplicate" package-info.java files symbolic links
This is needed for javadocAll since otherwhise there will be

smack-core/src/main/java/org/jivesoftware/smack/package-info.java:21:
	warning: a package-info.java file has already been seen for
	package org.jivesoftware.smack

warnings.
2019-09-01 23:13:20 +02:00
Florian Schmaus 1a3067c89b Enable werror for javadoc and fix javadoc issues 2019-08-30 12:08:30 +02:00
Florian Schmaus 9923268391 Remove LOCK in OmemoManager and use Manager instance instead 2019-08-06 12:48:31 +02:00
Florian Schmaus 1bce378e6d smack-omemo*: Do not swallow IOException deep within the library
Those exception are caused by I/O operations in the OmemoStore, which
is now declaring that it throws those (since it is not uncommon for
I/O operations to cause IOExceptions). After all, this is nicely
demonstrated as this change is caused by switching with this commit to
the Android API 19 compatible methods in FileBasedOmemoStore, which
throw.

The library can not decide what to do in case of those exceptions,
hence it is sensible to expose them to the user.
2019-08-05 09:31:48 +02:00
Florian Schmaus aec648c34b Improve PubSubIntegrationTest
Ensuring that the node has no items in
transientNotificationOnlyNodeWithoutItemTest() is not right. An
implementation is free to create an item with an ID and return it. The
item is just not guaranteed to be persistent.

Also add a dummy payload to
transientNotificationOnlyNodeWithItemTest().
2019-07-04 16:48:35 +02:00
Florian Schmaus 4d36e3b521 Introduce FormFieldChildElement and make FormField immutable 2019-06-11 12:47:39 +02:00
Florian Schmaus f7762c5db7 Add "whitespace after comma" checkstyle rule 2019-05-17 21:56:46 +02:00
Florian Schmaus d2f5efcb20 Use StandardCharsets.(UTF_8|US_ASCII)
This also gets rid of a ton of UnsupportedEncodingException s.
2019-05-08 12:44:48 +02:00
Guus der Kinderen fc70484cf6 More specific Pubsub integration tests.
XEP-0060 prohibits publishing a request that contains an item to a node that
is both 'notification-only' and 'transient' (section 7.1.3.6)

In commit 8ed872ca63 the existing pubsub publication
test was modified (to resolve a different issue) to operate on a node that's both
'notification-only' and 'transient'. This resulted in a test that should return
an error, even though the test implementation didn't expect one.

This commit explicitly verifies that publishing an item to such a node causes
an error to be returned. A new test is added that verifies that publishing an
event notification does succeed.
2019-04-17 21:52:01 +02:00
Florian Schmaus d97fb126a1 Add PubSubManager.getInstanceFor() just like all other Managers
and deprecate PubSubManager.getInstance().
2019-04-16 11:21:22 +02:00
Florian Schmaus a619135960 MoodIntegrationTest: Ensure that listener is removed 2019-03-16 22:41:01 +01:00
Florian Schmaus 8ed872ca63 PubSubIntegrationTest: Add workaround for ejabberd issue #2799 2019-02-17 17:51:37 +01:00
Florian Schmaus 7fce6b5a98 Introduce SmackMessageException 2019-02-10 21:50:39 +01:00
Florian Schmaus fee3ed81ca Introduce XmlEnvironment 2019-02-05 13:18:03 +01:00