fix(moxxmpp): Somewhat fix (and break) moxxmpp_socket_tcp integration tests

This commit is contained in:
PapaTutuWawa 2023-06-25 12:47:47 +02:00
parent 05e3d804a4
commit 77a1acb0e7
3 changed files with 22 additions and 46 deletions

View File

@ -17,25 +17,15 @@ Future<void> _runTest(String domain) async {
final connection = XmppConnection( final connection = XmppConnection(
TestingReconnectionPolicy(), TestingReconnectionPolicy(),
AlwaysConnectedConnectivityManager(), AlwaysConnectedConnectivityManager(),
ClientToServerNegotiator(),
socket, socket,
)..connectionSettings = ConnectionSettings(
jid: JID.fromString('testuser@$domain'),
password: 'abc123',
); );
await connection.registerFeatureNegotiators([ await connection.registerFeatureNegotiators([
StartTlsNegotiator(), StartTlsNegotiator(),
]); ]);
await connection.registerManagers([
DiscoManager([]),
RosterManager(TestingRosterStateManager('', [])),
MessageManager(),
PresenceManager(),
]);
connection.setConnectionSettings(
ConnectionSettings(
jid: JID.fromString('testuser@$domain'),
password: 'abc123',
useDirectTLS: true,
),
);
final result = await connection.connect( final result = await connection.connect(
shouldReconnect: false, shouldReconnect: false,

View File

@ -18,17 +18,15 @@ void main() {
final connection = XmppConnection( final connection = XmppConnection(
TestingSleepReconnectionPolicy(10), TestingSleepReconnectionPolicy(10),
AlwaysConnectedConnectivityManager(), AlwaysConnectedConnectivityManager(),
ClientToServerNegotiator(),
TCPSocketWrapper(), TCPSocketWrapper(),
)..connectionSettings = ConnectionSettings(
jid: JID.fromString('testuser@no-sasl.badxmpp.eu'),
password: 'abc123',
); );
await connection.registerFeatureNegotiators([ await connection.registerFeatureNegotiators([
StartTlsNegotiator(), StartTlsNegotiator(),
]); ]);
await connection.registerManagers([
DiscoManager([]),
RosterManager(TestingRosterStateManager('', [])),
MessageManager(),
PresenceManager(),
]);
connection.asBroadcastStream().listen((event) { connection.asBroadcastStream().listen((event) {
if (event is ConnectionStateChangedEvent) { if (event is ConnectionStateChangedEvent) {
if (event.state == XmppConnectionState.error) { if (event.state == XmppConnectionState.error) {
@ -37,14 +35,6 @@ void main() {
} }
}); });
connection.setConnectionSettings(
ConnectionSettings(
jid: JID.fromString('testuser@no-sasl.badxmpp.eu'),
password: 'abc123',
useDirectTLS: true,
),
);
final result = await connection.connect( final result = await connection.connect(
shouldReconnect: false, shouldReconnect: false,
waitUntilLogin: true, waitUntilLogin: true,
@ -68,17 +58,15 @@ void main() {
final connection = XmppConnection( final connection = XmppConnection(
TestingReconnectionPolicy(), TestingReconnectionPolicy(),
AlwaysConnectedConnectivityManager(), AlwaysConnectedConnectivityManager(),
ClientToServerNegotiator(),
TCPSocketWrapper(), TCPSocketWrapper(),
)..connectionSettings = ConnectionSettings(
jid: JID.fromString('testuser@no-sasl.badxmpp.eu'),
password: 'abc123',
); );
await connection.registerFeatureNegotiators([ await connection.registerFeatureNegotiators([
StartTlsNegotiator(), StartTlsNegotiator(),
]); ]);
await connection.registerManagers([
DiscoManager([]),
RosterManager(TestingRosterStateManager('', [])),
MessageManager(),
PresenceManager(),
]);
connection.asBroadcastStream().listen((event) { connection.asBroadcastStream().listen((event) {
if (event is ConnectionStateChangedEvent) { if (event is ConnectionStateChangedEvent) {
if (event.state == XmppConnectionState.error) { if (event.state == XmppConnectionState.error) {
@ -87,14 +75,6 @@ void main() {
} }
}); });
connection.setConnectionSettings(
ConnectionSettings(
jid: JID.fromString('testuser@no-sasl.badxmpp.eu'),
password: 'abc123',
useDirectTLS: true,
),
);
final result = await connection.connect( final result = await connection.connect(
shouldReconnect: false, shouldReconnect: false,
waitUntilLogin: true, waitUntilLogin: true,

View File

@ -12,7 +12,13 @@ dependencies:
meta: ^1.6.0 meta: ^1.6.0
moxxmpp: moxxmpp:
hosted: https://git.polynom.me/api/packages/Moxxy/pub hosted: https://git.polynom.me/api/packages/Moxxy/pub
version: ^0.3.0 version: ^0.4.0
dependency_overrides:
moxxmpp:
git:
url: https://codeberg.org/moxxy/moxxmpp.git
rev: 05e3d804a4036e9cd93fd27473a1e970fda3c3fc
dev_dependencies: dev_dependencies:
lints: ^2.0.0 lints: ^2.0.0