veilid/veilid-flutter/example/integration_test/app_test.dart

84 lines
3.2 KiB
Dart
Raw Normal View History

2024-05-02 14:15:42 -04:00
@Timeout(Duration(seconds: 120))
2024-03-17 16:19:52 -04:00
library veilid_flutter_integration_test;
2024-03-02 17:45:26 -05:00
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:veilid_test/veilid_test.dart';
2024-03-02 17:45:26 -05:00
2024-03-16 23:57:46 -04:00
import 'test_crypto.dart';
2024-05-02 14:15:42 -04:00
import 'test_dht.dart';
2024-03-16 23:57:46 -04:00
import 'test_routing_context.dart';
import 'test_table_db.dart';
2024-03-02 17:45:26 -05:00
import 'test_veilid_config.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
final fixture =
DefaultVeilidFixture(programName: 'veilid_flutter integration test');
2024-03-02 17:45:26 -05:00
2024-03-16 23:57:46 -04:00
group('Unstarted Tests', () {
test('veilid config defaults', testVeilidConfigDefaults);
2024-03-02 17:45:26 -05:00
});
2024-03-16 23:57:46 -04:00
group('Started Tests', () {
setUpAll(fixture.setUp);
tearDownAll(fixture.tearDown);
2024-03-02 17:45:26 -05:00
2024-03-16 23:57:46 -04:00
group('Crypto Tests', () {
test('best cryptosystem', testBestCryptoSystem);
test('get cryptosystem', testGetCryptoSystem);
test('get cryptosystem invalid', testGetCryptoSystemInvalid);
test('hash and verify password', testHashAndVerifyPassword);
test('sign and verify signature', testSignAndVerifySignature);
test('sign and verify signatures', testSignAndVerifySignatures);
2024-03-16 23:57:46 -04:00
});
2024-03-02 17:45:26 -05:00
2024-03-16 23:57:46 -04:00
group('Table DB Tests', () {
test('delete table db nonexistent', testDeleteTableDbNonExistent);
test('open delete table db', testOpenDeleteTableDb);
test('open twice table db', testOpenTwiceTableDb);
test('open twice table db store load', testOpenTwiceTableDbStoreLoad);
test('open twice table db store delete load',
testOpenTwiceTableDbStoreDeleteLoad);
test('resize table db', testResizeTableDb);
});
2024-03-02 17:45:26 -05:00
2024-03-16 23:57:46 -04:00
group('Attached Tests', () {
setUpAll(fixture.attach);
tearDownAll(fixture.detach);
2024-03-02 17:45:26 -05:00
2024-03-16 23:57:46 -04:00
group('Routing Contexts', () {
test('routing contexts', testRoutingContexts);
test('app message loopback',
2024-05-02 14:15:42 -04:00
() async => testAppMessageLoopback(fixture.updateStream));
2024-03-16 23:57:46 -04:00
test('app call loopback',
2024-05-02 14:15:42 -04:00
() async => testAppCallLoopback(fixture.updateStream));
2024-03-16 23:57:46 -04:00
test('app message loopback big packets',
2024-05-02 14:15:42 -04:00
() async => testAppMessageLoopbackBigPackets(fixture.updateStream));
2024-03-16 23:57:46 -04:00
test('app call loopback big packets',
2024-05-02 14:15:42 -04:00
() async => testAppCallLoopbackBigPackets(fixture.updateStream));
2024-03-16 23:57:46 -04:00
});
2024-03-02 17:45:26 -05:00
2024-03-16 23:57:46 -04:00
group('Veilid DHT', () {
test('get dht value unopened', testGetDHTValueUnopened);
test('open dht record nonexistent no writer',
testOpenDHTRecordNonexistentNoWriter);
test('close dht record nonexistent', testCloseDHTRecordNonexistent);
test('delete dht record nonexistent', testDeleteDHTRecordNonexistent);
test(
'create delete dht record simple', testCreateDeleteDHTRecordSimple);
test('create delete dht record no close',
testCreateDeleteDHTRecordNoClose);
test('get dht value nonexistent', testGetDHTValueNonexistent);
test('set get dht value', testSetGetDHTValue);
test('open writer dht value', testOpenWriterDHTValue);
// xxx: needs to be a multi-server integration test
// test('watch dht values',
// () async => testWatchDHTValues(fixture.updateStream));
2024-03-16 23:57:46 -04:00
test('inspect dht record', testInspectDHTRecord);
});
});
});
2024-03-02 17:45:26 -05:00
}