17
17
18
18
extern crate couchbase_lite;
19
19
20
+ #[ cfg( feature = "enterprise" ) ]
20
21
use self :: couchbase_lite:: * ;
22
+ #[ cfg( feature = "enterprise" ) ]
21
23
use encryptable:: Encryptable ;
24
+ #[ cfg( feature = "enterprise" ) ]
22
25
use std:: { time:: Duration , thread} ;
23
26
24
27
pub mod utils;
25
28
26
29
//////// TESTS:
27
30
28
31
#[ test]
32
+ #[ cfg( feature = "enterprise" ) ]
29
33
fn push_replication ( ) {
30
34
let mut tester = utils:: ReplicationTwoDbsTester :: new (
31
35
utils:: ReplicationTestConfiguration :: default ( ) ,
@@ -45,6 +49,7 @@ fn push_replication() {
45
49
}
46
50
47
51
#[ test]
52
+ #[ cfg( feature = "enterprise" ) ]
48
53
fn pull_replication ( ) {
49
54
let mut tester = utils:: ReplicationTwoDbsTester :: new (
50
55
utils:: ReplicationTestConfiguration :: default ( ) ,
@@ -64,6 +69,7 @@ fn pull_replication() {
64
69
}
65
70
66
71
#[ test]
72
+ #[ cfg( feature = "enterprise" ) ]
67
73
fn push_pull_replication ( ) {
68
74
let mut tester = utils:: ReplicationThreeDbsTester :: new (
69
75
utils:: ReplicationTestConfiguration :: default ( ) ,
@@ -91,6 +97,7 @@ fn push_pull_replication() {
91
97
}
92
98
93
99
#[ test]
100
+ #[ cfg( feature = "enterprise" ) ]
94
101
fn pull_type_not_pushing ( ) {
95
102
let config = utils:: ReplicationTestConfiguration {
96
103
replicator_type : ReplicatorType :: Pull ,
@@ -115,6 +122,7 @@ fn pull_type_not_pushing() {
115
122
}
116
123
117
124
#[ test]
125
+ #[ cfg( feature = "enterprise" ) ]
118
126
fn push_type_not_pulling ( ) {
119
127
let config = utils:: ReplicationTestConfiguration {
120
128
replicator_type : ReplicatorType :: Push ,
@@ -139,6 +147,7 @@ fn push_type_not_pulling() {
139
147
}
140
148
141
149
#[ test]
150
+ #[ cfg( feature = "enterprise" ) ]
142
151
fn document_ids ( ) {
143
152
let mut document_ids = MutableArray :: new ( ) ;
144
153
document_ids. append ( ) . put_string ( "foo" ) ;
@@ -172,6 +181,7 @@ fn document_ids() {
172
181
}
173
182
174
183
#[ test]
184
+ #[ cfg( feature = "enterprise" ) ]
175
185
fn push_and_pull_filter ( ) {
176
186
let context1 = ReplicationConfigurationContext {
177
187
push_filter : Some ( Box :: new ( |document, _is_deleted, _is_access_removed| {
@@ -227,6 +237,7 @@ fn push_and_pull_filter() {
227
237
}
228
238
229
239
#[ test]
240
+ #[ cfg( feature = "enterprise" ) ]
230
241
fn conflict_resolver ( ) {
231
242
let ( sender, receiver) = std:: sync:: mpsc:: channel ( ) ;
232
243
@@ -316,6 +327,7 @@ fn conflict_resolver() {
316
327
}
317
328
318
329
#[ test]
330
+ #[ cfg( feature = "enterprise" ) ]
319
331
fn conflict_resolver_save_keep_local ( ) {
320
332
let mut tester = utils:: ReplicationTwoDbsTester :: new (
321
333
utils:: ReplicationTestConfiguration :: default ( ) ,
@@ -397,6 +409,7 @@ fn conflict_resolver_save_keep_local() {
397
409
}
398
410
399
411
#[ test]
412
+ #[ cfg( feature = "enterprise" ) ]
400
413
fn conflict_resolver_save_keep_remote ( ) {
401
414
let mut tester = utils:: ReplicationTwoDbsTester :: new (
402
415
utils:: ReplicationTestConfiguration :: default ( ) ,
@@ -479,6 +492,7 @@ fn conflict_resolver_save_keep_remote() {
479
492
480
493
// Encryption/Decryption
481
494
495
+ #[ cfg( feature = "enterprise" ) ]
482
496
fn encryptor (
483
497
_document_id : Option < String > ,
484
498
_properties : Dict ,
@@ -490,6 +504,7 @@ fn encryptor(
490
504
) -> std:: result:: Result < Vec < u8 > , EncryptionError > {
491
505
Ok ( input. iter ( ) . map ( |u| u ^ 48 ) . collect ( ) )
492
506
}
507
+ #[ cfg( feature = "enterprise" ) ]
493
508
fn decryptor (
494
509
_document_id : Option < String > ,
495
510
_properties : Dict ,
@@ -501,6 +516,7 @@ fn decryptor(
501
516
) -> std:: result:: Result < Vec < u8 > , EncryptionError > {
502
517
Ok ( input. iter ( ) . map ( |u| u ^ 48 ) . collect ( ) )
503
518
}
519
+ #[ cfg( feature = "enterprise" ) ]
504
520
fn encryptor_err_temporary (
505
521
_document_id : Option < String > ,
506
522
_properties : Dict ,
@@ -512,6 +528,7 @@ fn encryptor_err_temporary(
512
528
) -> std:: result:: Result < Vec < u8 > , EncryptionError > {
513
529
Err ( EncryptionError :: Temporary )
514
530
}
531
+ #[ cfg( feature = "enterprise" ) ]
515
532
fn decryptor_err_temporary (
516
533
_document_id : Option < String > ,
517
534
_properties : Dict ,
@@ -523,6 +540,7 @@ fn decryptor_err_temporary(
523
540
) -> std:: result:: Result < Vec < u8 > , EncryptionError > {
524
541
Err ( EncryptionError :: Temporary )
525
542
}
543
+ #[ cfg( feature = "enterprise" ) ]
526
544
fn encryptor_err_permanent (
527
545
_document_id : Option < String > ,
528
546
_properties : Dict ,
@@ -534,6 +552,7 @@ fn encryptor_err_permanent(
534
552
) -> std:: result:: Result < Vec < u8 > , EncryptionError > {
535
553
Err ( EncryptionError :: Permanent )
536
554
}
555
+ #[ cfg( feature = "enterprise" ) ]
537
556
fn decryptor_err_permanent (
538
557
_document_id : Option < String > ,
539
558
_properties : Dict ,
@@ -547,6 +566,7 @@ fn decryptor_err_permanent(
547
566
}
548
567
549
568
#[ test]
569
+ #[ cfg( feature = "enterprise" ) ]
550
570
fn encryption_ok_decryption_ok ( ) {
551
571
let context1 = ReplicationConfigurationContext {
552
572
default_collection_property_encryptor : Some ( encryptor) ,
@@ -612,6 +632,7 @@ fn encryption_ok_decryption_ok() {
612
632
}
613
633
614
634
#[ test]
635
+ #[ cfg( feature = "enterprise" ) ]
615
636
fn encryption_error_temporary ( ) {
616
637
let config = utils:: ReplicationTestConfiguration {
617
638
continuous : false ,
@@ -674,6 +695,7 @@ fn encryption_error_temporary() {
674
695
}
675
696
676
697
#[ test]
698
+ #[ cfg( feature = "enterprise" ) ]
677
699
fn decryption_error_temporary ( ) {
678
700
let config = utils:: ReplicationTestConfiguration {
679
701
continuous : false ,
@@ -736,6 +758,7 @@ fn decryption_error_temporary() {
736
758
}
737
759
738
760
#[ test]
761
+ #[ cfg( feature = "enterprise" ) ]
739
762
fn encryption_error_permanent ( ) {
740
763
let config = utils:: ReplicationTestConfiguration {
741
764
continuous : false ,
@@ -818,6 +841,7 @@ fn encryption_error_permanent() {
818
841
}
819
842
820
843
#[ test]
844
+ #[ cfg( feature = "enterprise" ) ]
821
845
fn decryption_error_permanent ( ) {
822
846
let config = utils:: ReplicationTestConfiguration {
823
847
continuous : false ,
@@ -904,6 +928,7 @@ mod unsafe_test {
904
928
use super :: * ;
905
929
906
930
#[ test]
931
+ #[ cfg( feature = "enterprise" ) ]
907
932
fn continuous ( ) {
908
933
let config = utils:: ReplicationTestConfiguration {
909
934
continuous : false ,
0 commit comments