summaryrefslogtreecommitdiffstats
path: root/test
AgeCommit message (Collapse)Author
2016-09-13Rework JID class internal representation of resource presence.Alan Young
Remove explicit hasResource_ boolean and use non-null status of resource_ instead. Mostly test this with isBare(). Tidy up compare() method. A JID is valid by default. Remove extraneous setting of valid_ and centralize testing of validity to nameprepAndSetComponents(). Ensure that resource_ is initialized to null by default so that it is correct when a JID instance is restored using some sort of serialization, including com.google.gson.Gson which is used by Swift. All JID test cases pass, including ones using invalid "x@y/" test string representations. Change-Id: Ib77a7cde03e8390c405633cddea5939aa9e0b576
2016-03-22Don't allow JIDs with explicitly empty resourcesAlex Clayton
As per swiften patch of same name (6159c580884583bad0e17d4e96ea9ffc7e0be29a). A JID may have no resource, but may not have an empty resource. Mark such JIDs as invalid. Test-information: New unit test passes. Change-Id: I66ec7810ac29cb3963470b08f0d9f4901d2307f3
2016-03-16Support early IBB use in Jingle File TransferAlex Clayton
As per swiften patch of the same name (75703db2de5bbfb6622286600362016edb42dfb0). Previously Jingle File Transfer in Stroke only used IBB transport as fallback mechanism. With this patch Stroke will use IBB transport candidates directly in the first session-initate/session-accept message if the other party only supports IBB. Test-information: Unit tests all pass. Change-Id: Ice73a6028f10c63490bdb775a0a407fad48f587a
2016-03-16Add FileWriteBytestream class and test.Alex Clayton
Adds a FileWriteBytestream class plus a test for it. These had been missed out previously. Also as per patch 'Fix crash when saving a received file to non-writable location' changed WriteBytestream.write() method to return a boolean indicating success or failure. Test-information: Tests pass ok. Change-Id: I0c3676db8b67573142e8628f439cecf54f3f8f1a
2016-03-16Add JID.isValid() checks to the JIDTest unit tests.Alex Clayton
As per swiften patch 'Add more tests for JID validity' (59c64a11e0bceca4876ba69ef2f30519629b108c). Test-information: All unit tests pass. Change-Id: Iefb77fa089afd13c0f8b5f51f2a3115001a061e8
2016-03-15Add getRemoteAddress() method to Connection.Alex Clayton
Added a getRemoteAddress() method to connection as per patch 'Listen to IPv6 any address instead of only IPv4' (13801557b6664426cac26384441ab0b19ff9abb5). Also some modifications to SOCKS5BytestreamServerManager to use IPv6 address. Test-information: Unit tests pass ok. Change-Id: Ic0536745db9052ec1c5fc0832ed90eb5ec609429
2016-03-14Add methods to PresenceOracle.Alex Clayton
As per swiften patch 'Change bare JID presence lookup code to ignore priorities' (0f5ef716a50c8d9761cafda12aacf818cdfd6353) add a couple of methods and a test for PresenceOracle. Test-information: Unit tests still pass. Change-Id: If3961f29be821a065ffa854faeab7f20da666d25
2016-03-14Add roster to PresenceOracle.Alex Clayton
As per patch 'Mark removed contacts as unavailable in Swift' (9e6ee0f262e7dc663f4c706b16a346a268f425aa) added an XMPPRoster to the member variables and constructor arguments for PresenceOracle. Test-information: Unit tests pass. Change-Id: I062d256c088a968e061d864fbd1386f850b614a7
2016-03-14Do not flush VCard cache if IQ request returns an error.Alex Clayton
As per swiften patch of the same name (37aafcb4d693a0b4f5944a52e0c070e5aa384245) changes behaviour of VCard cache slightly, and updates test accordingly. Test-information: Unit tests pass. Change-Id: I933c8000b4cb73b43db28db94887a768d0272dd2
2016-03-14Add test for pre epoch dates in DateTimeTest.Alex Clayton
As per patch 'Stop throwing out of range exception from dateTimeToLocalStrin' (eed183fbd5d121049d5965d7c60abd65f44d0376). In swiften when DateTime.dateToLocalString was passed a pre 1970 date it could throw an out of range exception. Swiften code was fixed to return an empty string in this case. In java we do not see this error so no need to modify DateTime code. Instead I just added a test to verify we can cope with pre 1970 dates. Test-information: Unit tests pass. Change-Id: Ie1db328818d1457a17e68ab891f564d169912320
2016-03-10Fix BlockListImpl logic and add unit test.Alex Clayton
As per swiften patch 'Fix notification logic for signals in BlockListImpl' (4455c20085834098f6d9aa872db3115d466e7004). Fix the logic in the BlockListImpl class and add a unit test for it. Test-information: Unit tests pass ok. Change-Id: I739d1febb2cf728ff00c132a00adb2f7f144b739
2016-03-09Add Whiteboard FunctionalityAlex Clayton
Add the Whiteboard classes to stroke. Test-information: Unit tests all pass. Change-Id: Id409c09d0fc1f82864e5d706c413b9d984a7db82
2016-03-07Add missing TLS and Base classesAlex Clayton
Add missing methods and classes in the TLS and Base packages where possible. In the case of TLSContextFactory the methods could not be implemented in java so added a not saying they are not supported in java. Test-information: Unit tests still build and run ok. Change-Id: I9be2035f092875fcdc02644a3c0082739f26949a
2016-02-29Add Parser and Serializer classesAlex Clayton
Add classes to the parser and serializer packages, including some tests. Update PortingProgress with info on the classes that could not be imported in this patch. Test-information: Unit tests pass ok. Change-Id: If42af9c0cecb68151cf817f1839b86b4d7c8967c
2016-02-29Finish porting on Network PackageAlex Clayton
As per PortingProgress.txt finsh porting all the classes I can from the network package. This involved some updates as the tests and code had changed since they existing classes had been imported. I have added notes for the classes I did not port in PortingProgress explaining why they were not ported. Test-information: All unit tests pass. Change-Id: Ibb52ae409f1da9b72a4c1e590cd22835a1be95eb
2016-02-29Add sort method for ServiceQuery and add TestsAlex Clayton
Add the sortResult static method to the DomainNameServiceQuery class. This required adding a few equivalances for C++ std library methods to the class. And add a test for the new method too. Test-information: All unit tests pass ok. Change-Id: Idee0888f7ea140d35a971414fc2fd3cbcdfc337f
2016-02-29Add Network Bosh ClassesAlex Clayton
Add the missing Bosh classes to the network packages (BoshConnection and BoshConnectionPool), plus tests for the classes and any other classes required by the new classes. Test-information: Units tests all pass ok. Change-Id: I5c2e05bae9e678ac10d2601c7fdbdccd68d66b71
2016-02-16Add the FileTransfer testsAlex Clayton
Add the missing FileTransfer tests to stroke. When porting the tests I found some of them were failing and required changes to the classes being tested to fix. Had to add a DummyNetworkEnvironment as well for the OutgoingJingleFileTransferTest. Test-information: All unit tests pass. Change-Id: Id511a556ef3a5d66e0e107f36f736db3bbb3a437
2016-02-10Remove duplicate classes.Alex Clayton
There ware duplicate copies of DummyFileTransferManager and DummyFileTransferTransporterFactory in both stroke src and stroke test directories (but within the same package). This was confusing and could cause problems when we come to update the files. This patch removes the copies in the test directory, leaving only the the src directory ones. Test-information: Ran 'make test' everything still builds ok and all tests pass. Change-Id: I112d2b21e1217dcacd619393f81ba008a097e83a
2016-02-08Add IQTestAlex Clayton
Add the IQTest class. Test-information: All tests pass. Change-Id: I1fa14c275f9fbe19f4b21002b300024334d5a9da
2016-02-08Add CombinedAvatarProviderTestAlex Clayton
Adds the CombinedAvatarProviderTest class. When I was adding the test I noticed that testProviderUpdateWithAvatarDisappearingTriggersChange kept failing due to a bug in the CombinedAvatarProvider class and testRemoveProviderDisconnectsUpdates could not be implemented as the class was incomplete. I had to make some changes to CombinedAvatarProvider to fix these issues. Test-information: Ran unit tests they all pass. Change-Id: I0bfb68dd2b15df0f220f36c136aceadaf6545893
2016-02-04Add Block Parser and SerializerAlex Clayton
Add BlockParser and BlockSerializer for the block payload classes. This required slightly different approach to the Swiften code as C++ templates are different to Java generics. In short needed to add a type hierachy to the Block payload classes and to the Parsers and Serilaizers associated with them. Test-information: Ran unit tests everything passed ok. Change-Id: I3ea2d66afd7cb3b5c4c3515be3a1ef99d7dbb566
2016-01-21Completes FileTransfer according to Swiften.Tarun Gupta
S5BTransport Session still needs generic T. FileTransfer, OutgoingFileTransfer and IncomingFileTransfer are made an interface due to the need of multiple inheritance in IncomingJingleFileTransfer and OutgoingJingleFileTransfer. Corresponding documentation has been updated. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: None. Change-Id: If44cf387767865c37492d871c12d623f94ebaa3a
2016-01-14Minor changes to PubSubManagerImpl and StanzaAckRequester.Tarun Gupta
Small changes to PubSubManagerImpl and StanzaAckRequester making them equivalent with Swiften. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Added tests for StanzaAckResponder and StanzaAckRequester, which passes. Change-Id: I99878fc6552ed18e353848a0cea6584c26b2ba0c
2016-01-12Make Networks equivalent with Swiften.Tarun Gupta
Adds ProxyProviders, DomainNameResolvers and DummyConnection. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests added for ChainedConnector, Connector and HostAddress. Test also added for ComponentConnector, which needed bits of Network. Five assertions are commented in ConnectorTest, which fails and will be updated after review. Change-Id: I8a62841eb2f9c109bc3a94865b7a003b33493e11
2015-08-21Fix code to not throw StringPrepParseException that was part of ICU jarGurmeen Bindra
The IDNConverter interface now throws java strandard IllegalArg exception instead of the ICU specific StringPrepParseException. Users of stroke that are not using ICU will now be able to use it without the icu jar. Test-information: Sanity tested by connecting to an XMPP server using an XMPP client Change-Id: I6999ae0c690b70bc748f131908a758a01dac20b9
2015-08-17Remove unnecessary Crypto functions from StringCodecs.Tarun Gupta
Remove SHA1 and HMACSHA1 from StringCodecs as they are already provided by CryptoProvider, and is equivalent to Swiften. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Add tests for Base64 and PBKDF2, which passes. Change-Id: Ife05f185a10a79c9d69a12235f1b0397d022d992
2015-08-17Update Client.Tarun Gupta
Updates all bits of Client to be in parity with Swiften. Some part of code which depends on Network is commented. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests added for: ClientBlockListManager, ClientSession and NickResolver. All tests pass. Change-Id: I5b9b0e5ae5b2df58202e2349ba24e4544d9a4614
2015-08-17Updates Presence in accordance with Swiften.Tarun Gupta
Updates DirectedPresenceSender, PayloadAddingPresenceSender, PresenceOracle and SubscriptionManager. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests added for: DirectedPresenceSenderTest, PayloadAddingPresenceSenderTest and PresenceOracle. All tests pass. Change-Id: I9ad899965f5ac32c6f21805b530c234e391be6ba
2015-08-14Completes TLS & Session.Tarun Gupta
Adds TLSError and TLSOptions. Updates BasicSessionStream, SessionStream and Session. Updates Client and Components to accomodate changes in TLS. Also completes TLSLayer in StreamStack which was pending due to TLS port. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests added for Certificate and ServerIdentityVerifier. Test updated for ComponentSession. All tests pass. Change-Id: I34a8fe068c1e8af5348cc4ab49d3d1ed118ae833
2015-08-13Add default-parameter versions of invitePerson() to MUC.Alan Young
Clean up imports. Add @Override annotations as appropraiate to MUCImpl and MockMUC. Change-Id: Id34849364fe1e4cdd7709b2cc7b397d007c2868c
2015-08-03Make SASL equivalent with Swiften.Tarun Gupta
Adds DIGESTMD5ClientAuthenticator, DIGESTMD5Properties, ExternalClientAuthenticator, PLAINMessage. Updates Client, ClientSession, CoreClient, ConnectDisconnect, StrokeGUI to reflect changes made in SASL. Updates ClientAuthenticator, SCRAMSHA1ClientAuthenticator, PBKDF2. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Added tests for DIGESTMD5ClientAuthenticator, DIGESTMD5Properties, PLAINClientAuthenticator, PLAINMessage. Update test for SCRAMSHA1ClientAuthenticatorTest. All tests pass. Change-Id: I4fd38f922cab7e4c4548d9706f6ad3b9e1506e81
2015-08-03Add tests for EventLoop.Tarun Gupta
Adds SingleThreadedEventLoop. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests for EventLoop and SimpleEventLoop passes. Change-Id: Ifda63a328e0adfb2da0eb2a1038805042ed0f6fb
2015-07-29Reinstate "disconnect()" method for MUC classNick Hudson
A recent change (9ead0fdcca595df9dc3f4143122776b398dbe405) made MUC an abstract class, and moved all functionality into MUCImpl (to correspond with Swiften). The "disconnect()" method was moved to MUCImpl, which means that any existing application which used it would break. The disconnect() method is required in java (although it's not in Swiften) because it provides a way to disconnect signals that are connected in the MUC constructor (or MUCImpl constructor now). While the signals are connected, the MUC object will not be eligible to be garbage collected, and this can lead to growing memory usage for an application which creates lots of MUC objects for a given connection. Adding a call to "disconnect()" in the finalizer for the MUC would not be effective because the finalizer only gets called when the MUC is gc'd, and the MUC can't be gc'd until the disconnect() has happened. Test-information: Unit tests pass. Before this change, an application calling "MUC.disconnect()" fails to compile. After this change, the application compiles. Tested an app that creates lots of MUC objects, and checked, using the debugger, to see if the objects were being garbage collected when the application dropped its reference to the objects. When not calling "disconnect()", the MUC objects are not garbage collected until the owning StanzaChannel is closed. When a call to "disconnect()" was added, the MUC objects are garbage collected soon after the application finishes using them, even though the StanzaChannel is still in use. Change-Id: Icd6c354e34d2124c292ae5d44bc47725a6e73df5
2015-07-28Completes Components and AdHoc.Tarun Gupta
Adds Component, ComponentConnector, ComponentError, ComponentSession, ComponentXMLTracer, CoreComponent, ComponentSessionStanzaChannel, ComponentXMTracer, CoreComponent. Updates CoreClient, StrokeGUI, BasicSessionStream and SessionStream and Client, so that signal definition can be changed. Updates ComponentHandshake element, Entity. Updates OutgoingAdHocCommandSession to have feature parity with Swiften. This patch does not port Client or Session fully, which will be done in separate future patches. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Test added for ComponentSession, which passes. Test for ComponentConnector cannot be ported right now and will be done in future patches, as it requires some bits of Network to be ported. Change-Id: I7138a2041fe28a2be7ac57cb47b15365f9334b24
2015-07-28Complete StreamStack and add tests.Tarun Gupta
TLSLayer could not be updated because it requires TLS to be ported first. Updates other classes, only for having compatibility with SafeByteArray because of updates in Stream Stack. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests added for StreamStack and XMPPLayer, which passes. Change-Id: I8707fc1f16d622d2a90f6f39f671b7e7c46aa170
2015-07-28Update Serializers and Parsers.Tarun Gupta
Updates Serializers and Parsers along with one minor change in XMPPlayer. Update Non Payload Serializers to return SafeByteArray. Updates SafeByteArray to return SafeByteArray on append and plus method. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: None. Change-Id: I6fe665a26b10cac37b3e3acd9ec15c211ac9b8ab
2015-07-22Completes MUC in accordance with Swiften.Tarun Gupta
Updates MUC to be an abstract class. Updates MUCBookmark, MUCManager, DirectedPresenceSender. Adds MUCImpl. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Test updated for MUC, in accordance with Swiften, which passes. Added MockMUC too. Change-Id: If5aa672e8adc093162d3c9890c8437d3edadea68
2015-07-22Complete VCard functionalities.Tarun Gupta
Updates VCardManager, VCardMemoryStorage and VCardStorage. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Test added for VCardManager, which passes. Change-Id: I0d4f1dbb647f262ff2a8967807fb798a8181b0b5
2015-07-22Update Queries.Tarun Gupta
Updates RawXMLPayload Element, SoftwareVersion Element. Updates IQRouter, Request, Responder, SoftwareVersionResponder. Updates ErrorSerilaizer access. Adds RawRequest, GetInBandRegistrationFormRequest, GetSoftwareVersionRequest, and SetInBandRegistrationRequest. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests added for: IQRouter, Request and Responder. Rest, all tests passes. Change-Id: I22308cc05bd1a6c28f3937a44d997e1da47e2891
2015-07-22Update Roster functionalities.Tarun Gupta
Updates RosterPushResponder, XMPPRoster, XMPPRosterController. Also adds XMPPRosterSignalHandler. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Adds tests for XMPPRosterController, XMPPRosterImpl. All tests passes. Change-Id: Iee3530510342ea5977022237aaa6dfbffa390408
2015-07-21Adds Disco Features.Tarun Gupta
Adds DiscoServiceWalker, FeatureOracle, JIDDiscoInfoResponder. Updates CapsInfoGenerator, ClientDiscoManager, EntityCapsManager, EntityCapsProvider, IQ Element, Request. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests added for: CapsInfoGenerator, CapsManager, DiscoInfoResponder, EntityCapsManager, JIDDiscoInfoResponder. All tests pass. Change-Id: Ib7cd08ff6f72b7649e4819943b627459c69a1397
2015-07-07Update Avatar access model.Alan Young
Use the String avatar hash as the general handle for an avatar. AvatarManager.getAvatar(JID jid) will return null if no avatar is available. AvatarManager.getAvatarPath() and AvatarStorage.getAvatarPath() are deleted. Make AvatarProvider & AvatarManager abstract classes instead of interfaces so that their onAvatarChanged Signals are not static fields. Implement delete() for AvatarManagerImpl and AvatarProvider & subclasses so that signal connections can be released. Add @Override annotations as appropriate. Change-Id: Ia7c9d7607b642bb42c373f81dc6be9a60f0f2134
2015-07-07Update JingleFileTransferFileInfo in light of recent discussions related to ↵Tarun Gupta
Date. Updates VCard Element, JingleFileTransferFileInfo to allow dates to be null, as a indicator for not a valid date time. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Corresponding tests changed, which passes. Change-Id: I9c9b4a84b7bebc18e8ef8ba5050e45ac2f13aa65
2015-07-07Adds tests for Parser and Serializers.Tarun Gupta
Adds PubSubEvent Element. Adds StreamFeaturesSerializer. Adds ParserTester, ElementParserTester, StanzaParserTester, PayloadParserTester, PayloadsSerializer and EnumParser. Updates Error Payload, JingleFIleTransferHash Elements/ Updates StreamFeaturesParser, ParserElement. Updates Delay Serializer, Error Serializer. Updates AuthChallenge and AuthRequest Element. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Test are added for: AuthChallenge Serializer, AuthRequest Serializer, AuthResponse Serializer, AuthSuccess Serializer. GenericPayloadTreeParserTest. IQ Parser. Message Parser. Presence Parser. StanzaAck Parser. Stanza Parser. StreamFeatures Parser and Serializer. StreamManagementEnabled Parser. Private Storage Parser and Serializer. RawXMLPayload Parser. Storage Parser and Serializer. Error Serializer. Jingle Serializer. PubSubItem Serializer and PubSubItems Serializer. Serializing Parser. All tests passes. Change-Id: I79e00dc5b5c4f85e659bf88b1547dd7c17825805
2015-07-06Completes JID functionalities.Tarun Gupta
Completes JID by providing all features Swiften provides including Escaped and Unescaped Node. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Test added for JID, which passes. Change-Id: Ia61dad0ed93a153186b9f78e2669f675f51e3734
2015-07-06Add Internationalized Domain Name Features.Tarun Gupta
Adds IDNConverter interface, ICUConverter using ICU for Stringprep. Also updates Makefile and build.xml by adding path to icu4j to compile tests classpath, so that icu4j.jar can be used in the tests. IDNConverter tests need StringPrepParseException from icu4j jar. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Added test for IDNConverter, which passes. Change-Id: I56aacf080a10216a2455cf561de567f5666cd0c9
2015-07-06Add ChatStateNotifier.Tarun Gupta
Adds ChatStateNotifier, DummyEntityCapsProvider. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Test added for Chate State Notifier, which passes. Change-Id: Ie596d9c226526ab5ace334b7926389b61ca5540a
2015-06-30Add tests for Payloads Parsers and Payloads Serializers.Tarun Gupta
Updates DiscoInfoParser, DiscoItemsParser and VCard Element. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Test are added for: DeliveryReceipt Parser and Serializer. DiscoInfo Parser and Serializer, DiscoItemsParser. Replace Parser and Serializer. ResourceBind Parser and Serializer. SecurityLabel Parser and Serializer. SecurityLabelsCatalog Parser and Serializer. Status Parser and Serializer. StatusShow Parser and Serializer. SoftwareVersion Parser and Serializer. VCard Parser and Serializer. All tests passes. Change-Id: I8023372273e63813e1c8fe708fa6cdf39614e1f7
2015-06-30Adds Parser and Serializer for Priority Element.Tarun Gupta
Adds Priority Parser and Serializer. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests passes for Priority Parser and Serializer. Change-Id: I0077cd0a3d179590b6ea78fa445e91358ff8b623