aboutsummaryrefslogtreecommitdiff
path: root/junit4/src/test/java/com/google/testing/junit/testparameterinjector/TestParametersMethodProcessorTest.java
blob: 562833092c8b8b3709d3864264adb9b745796671 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
/*
 * Copyright 2021 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */

package com.google.testing.junit.testparameterinjector;

import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.TruthJUnit.assume;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static org.junit.Assert.assertThrows;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.testing.junit.testparameterinjector.SharedTestUtilitiesJUnit4.SuccessfulTestCaseBase;
import com.google.testing.junit.testparameterinjector.TestParameters.TestParametersValues;
import com.google.testing.junit.testparameterinjector.TestParameters.TestParametersValuesProvider;
import java.lang.annotation.Retention;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

@RunWith(Parameterized.class)
public class TestParametersMethodProcessorTest {

  @Retention(RUNTIME)
  @interface RunAsTest {
    String failsWithMessage() default "";
  }

  public enum TestEnum {
    ONE,
    TWO,
    THREE;
  }

  private static final class TestEnumValuesProvider implements TestParametersValuesProvider {
    @Override
    public List<TestParametersValues> provideValues() {
      return ImmutableList.of(
          TestParametersValues.builder().name("one").addParameter("testEnum", TestEnum.ONE).build(),
          TestParametersValues.builder().addParameter("testEnum", TestEnum.TWO).build(),
          TestParametersValues.builder().name("null-case").addParameter("testEnum", null).build());
    }
  }

  @RunAsTest
  public static class SimpleMethodAnnotation extends SuccessfulTestCaseBase {

    @Test
    @TestParameters("{testEnum: ONE, testLong: 11, testBoolean: false, testString: ABC}")
    @TestParameters("{testEnum: TWO,\ntestLong: 22,\ntestBoolean: true,\r\n\r\n testString: 'DEF'}")
    @TestParameters("{testEnum: null, testLong: 33, testBoolean: false, testString: null}")
    public void test(TestEnum testEnum, long testLong, boolean testBoolean, String testString) {
      storeTestParametersForThisTest(testEnum, testLong, testBoolean, testString);
    }

    @Test
    @TestParameters({
      "{testEnum: ONE, testLong: 11, testBoolean: false, testString: ABC}",
      "{testEnum: TWO,\ntestLong: 22,\ntestBoolean: true,\r\n\r\n testString: 'DEF'}",
      "{testEnum: null, testLong: 33, testBoolean: false, testString: null}",
    })
    public void test_singleAnnotation(
        TestEnum testEnum, long testLong, boolean testBoolean, String testString) {
      storeTestParametersForThisTest(testEnum, testLong, testBoolean, testString);
    }

    @Test
    @TestParameters("{testString: ABC}")
    @TestParameters(
        "{testString: 'This is a very long string (240 characters) that would normally cause"
            + " Sponge+Tin to exceed the filename limit of 255 characters."
            + " ================================================================================="
            + "=============='}")
    public void test2_withLongNames(String testString) {
      storeTestParametersForThisTest(testString);
    }

    @Test
    @TestParameters(
        "{testEnums: [ONE, TWO, THREE], testLongs: [11, 4], testBooleans: [false, true],"
            + " testStrings: [ABC, '123']}")
    @TestParameters(
        "{testEnums: [TWO],\ntestLongs: [22],\ntestBooleans: [true],\r\n\r\n testStrings: ['DEF']}")
    @TestParameters("{testEnums: [], testLongs: [], testBooleans: [], testStrings: []}")
    public void test3_withRepeatedParams(
        List<TestEnum> testEnums,
        List<Long> testLongs,
        List<Boolean> testBooleans,
        List<String> testStrings) {
      storeTestParametersForThisTest(testEnums, testLongs, testBooleans, testStrings);
    }

    @Test
    @TestParameters(customName = "custom1", value = "{testEnum: ONE}")
    @TestParameters("{testEnum: TWO}")
    @TestParameters(customName = "custom3", value = "{testEnum: THREE}")
    public void test4_withCustomName(TestEnum testEnum) {
      storeTestParametersForThisTest(testEnum);
    }

    @Override
    ImmutableMap<String, String> expectedTestNameToStringifiedParameters() {
      return ImmutableMap.<String, String>builder()
          .put(
              "test[{testEnum: ONE, testLong: 11, testBoolean: false, testString: ABC}]",
              "ONE:11:false:ABC")
          .put(
              "test[{testEnum: TWO, testLong: 22, testBoolean: true, testString: 'DEF'}]",
              "TWO:22:true:DEF")
          .put(
              "test[{testEnum: null, testLong: 33, testBoolean: false, testString: null}]",
              "null:33:false:null")
          .put(
              "test_singleAnnotation[{testEnum: ONE, testLong: 11, testBoolean: false, testString:"
                  + " ABC}]",
              "ONE:11:false:ABC")
          .put(
              "test_singleAnnotation[{testEnum: TWO, testLong: 22, testBoolean: true, testString:"
                  + " 'DEF'}]",
              "TWO:22:true:DEF")
          .put(
              "test_singleAnnotation[{testEnum: null, testLong: 33, testBoolean: false, testString:"
                  + " null}]",
              "null:33:false:null")
          .put("test2_withLongNames[1.{testString: ABC}]", "ABC")
          .put(
              "test2_withLongNames[2.{testString: 'This is a very long string (240 characters) that"
                  + " would normally cause Sponge+Tin to exceed the filename limit of 255"
                  + " characters. =============================...]",
              "This is a very long string (240 characters) that would normally cause Sponge+Tin to"
                  + " exceed the filename limit of 255 characters."
                  + " ===============================================================================================")
          .put(
              "test3_withRepeatedParams[{testEnums: [ONE, TWO, THREE], testLongs: [11, 4],"
                  + " testBooleans: [false, true], testStrings: [ABC, '123']}]",
              "[ONE, TWO, THREE]:[11, 4]:[false, true]:[ABC, 123]")
          .put(
              "test3_withRepeatedParams[{testEnums: [TWO], testLongs: [22], testBooleans: [true],"
                  + " testStrings: ['DEF']}]",
              "[TWO]:[22]:[true]:[DEF]")
          .put(
              "test3_withRepeatedParams[{testEnums: [], testLongs: [], testBooleans: [],"
                  + " testStrings: []}]",
              "[]:[]:[]:[]")
          .put("test4_withCustomName[custom1]", "ONE")
          .put("test4_withCustomName[{testEnum: TWO}]", "TWO")
          .put("test4_withCustomName[custom3]", "THREE")
          .build();
    }
  }

  @RunAsTest
  public static class SimpleConstructorAnnotation extends SuccessfulTestCaseBase {

    private final TestEnum testEnum;
    private final long testLong;
    private final boolean testBoolean;
    private final String testString;

    @TestParameters({
      "{testEnum: ONE, testLong: 11, testBoolean: false, testString: ABC}",
      "{testEnum: TWO, testLong: 22, testBoolean: true, testString: DEF}",
      "{testEnum: null, testLong: 33, testBoolean: false, testString: null}",
    })
    public SimpleConstructorAnnotation(
        TestEnum testEnum, long testLong, boolean testBoolean, String testString) {
      this.testEnum = testEnum;
      this.testLong = testLong;
      this.testBoolean = testBoolean;
      this.testString = testString;
    }

    @Test
    public void test1() {
      storeTestParametersForThisTest(testEnum, testLong, testBoolean, testString);
    }

    @Test
    public void test2() {
      storeTestParametersForThisTest(testEnum, testLong, testBoolean, testString);
    }

    @Override
    ImmutableMap<String, String> expectedTestNameToStringifiedParameters() {
      return ImmutableMap.<String, String>builder()
          .put(
              "test1[{testEnum: ONE, testLong: 11, testBoolean: false, testString: ABC}]",
              "ONE:11:false:ABC")
          .put(
              "test1[{testEnum: TWO, testLong: 22, testBoolean: true, testString: DEF}]",
              "TWO:22:true:DEF")
          .put(
              "test1[{testEnum: null, testLong: 33, testBoolean: false, testString: null}]",
              "null:33:false:null")
          .put(
              "test2[{testEnum: ONE, testLong: 11, testBoolean: false, testString: ABC}]",
              "ONE:11:false:ABC")
          .put(
              "test2[{testEnum: TWO, testLong: 22, testBoolean: true, testString: DEF}]",
              "TWO:22:true:DEF")
          .put(
              "test2[{testEnum: null, testLong: 33, testBoolean: false, testString: null}]",
              "null:33:false:null")
          .build();
    }
  }

  @RunAsTest
  public static class ConstructorAnnotationWithProvider extends SuccessfulTestCaseBase {

    private final TestEnum testEnum;

    @TestParameters(valuesProvider = TestEnumValuesProvider.class)
    public ConstructorAnnotationWithProvider(TestEnum testEnum) {
      this.testEnum = testEnum;
    }

    @Test
    public void test() {
      storeTestParametersForThisTest(testEnum);
    }

    @Override
    ImmutableMap<String, String> expectedTestNameToStringifiedParameters() {
      return ImmutableMap.<String, String>builder()
          .put("test[one]", "ONE")
          .put("test[{TWO}]", "TWO")
          .put("test[null-case]", "null")
          .build();
    }
  }

  @RunAsTest
  public static class MethodAnnotationWithProvider extends SuccessfulTestCaseBase {

    @TestParameters(valuesProvider = CustomProvider.class)
    @Test
    public void test(int testInt, TestEnum testEnum) {
      storeTestParametersForThisTest(testInt, testEnum);
    }

    @Override
    ImmutableMap<String, String> expectedTestNameToStringifiedParameters() {
      return ImmutableMap.<String, String>builder()
          .put("test[{testInt=5, ONE}]", "5:ONE")
          .put("test[{testInt=10, TWO}]", "10:TWO")
          .build();
    }

    private static final class CustomProvider implements TestParametersValuesProvider {
      @Override
      public List<TestParametersValues> provideValues() {
        return ImmutableList.of(
            TestParametersValues.builder()
                .addParameter("testInt", 5)
                .addParameter("testEnum", TestEnum.ONE)
                .build(),
            TestParametersValues.builder()
                .addParameter("testInt", 10)
                .addParameter("testEnum", TestEnum.TWO)
                .build());
      }
    }
  }

  public abstract static class BaseClassWithMethodAnnotation extends SuccessfulTestCaseBase {

    @Test
    @TestParameters("{testEnum: ONE}")
    @TestParameters("{testEnum: TWO}")
    public void testInBase(TestEnum testEnum) {
      storeTestParametersForThisTest(testEnum);
    }
  }

  @RunAsTest
  public static class AnnotationInheritedFromBaseClass extends BaseClassWithMethodAnnotation {

    @Test
    @TestParameters({"{testEnum: TWO}", "{testEnum: THREE}"})
    public void testInChild(TestEnum testEnum) {
      storeTestParametersForThisTest(testEnum);
    }

    @Override
    ImmutableMap<String, String> expectedTestNameToStringifiedParameters() {
      return ImmutableMap.<String, String>builder()
          .put("testInChild[{testEnum: TWO}]", "TWO")
          .put("testInChild[{testEnum: THREE}]", "THREE")
          .put("testInBase[{testEnum: ONE}]", "ONE")
          .put("testInBase[{testEnum: TWO}]", "TWO")
          .build();
    }
  }

  @RunAsTest
  public static class MixedWithTestParameterMethodAnnotation extends SuccessfulTestCaseBase {

    private final TestEnum testEnumFromConstructor;

    @TestParameters("{testEnum: ONE}")
    @TestParameters("{testEnum: TWO}")
    public MixedWithTestParameterMethodAnnotation(TestEnum testEnum) {
      this.testEnumFromConstructor = testEnum;
    }

    @Test
    public void test1(@TestParameter TestEnum testEnum) {
      storeTestParametersForThisTest(testEnumFromConstructor, testEnum);
    }

    @Test
    @TestParameters("{testString: ABC}")
    @TestParameters("{testString: DEF}")
    public void test2(String testString) {
      storeTestParametersForThisTest(testEnumFromConstructor, testString);
    }

    @Test
    @TestParameters("{testString: ABC}")
    @TestParameters(
        "{testString: 'This is a very long string (240 characters) that would normally cause"
            + " Sponge+Tin to exceed the filename limit of 255 characters."
            + " ================================================================================="
            + "=============='}")
    public void test3_withLongNames(String testString) {
      storeTestParametersForThisTest(testEnumFromConstructor, testString);
    }

    @Override
    ImmutableMap<String, String> expectedTestNameToStringifiedParameters() {
      return ImmutableMap.<String, String>builder()
          .put("test1[{testEnum: ONE},ONE]", "ONE:ONE")
          .put("test1[{testEnum: ONE},TWO]", "ONE:TWO")
          .put("test1[{testEnum: ONE},THREE]", "ONE:THREE")
          .put("test1[{testEnum: TWO},ONE]", "TWO:ONE")
          .put("test1[{testEnum: TWO},TWO]", "TWO:TWO")
          .put("test1[{testEnum: TWO},THREE]", "TWO:THREE")
          .put("test2[{testEnum: ONE},{testString: ABC}]", "ONE:ABC")
          .put("test2[{testEnum: ONE},{testString: DEF}]", "ONE:DEF")
          .put("test2[{testEnum: TWO},{testString: ABC}]", "TWO:ABC")
          .put("test2[{testEnum: TWO},{testString: DEF}]", "TWO:DEF")
          .put("test3_withLongNames[{testEnum: ONE},1.{testString: ABC}]", "ONE:ABC")
          .put(
              "test3_withLongNames[{testEnum: ONE},2.{testString: 'This is a very long string (240"
                  + " characters) that would normally caus...]",
              "ONE:This is a very long string (240 characters) that would normally cause Sponge+Tin"
                  + " to exceed the filename limit of 255 characters."
                  + " ==================================================================="
                  + "============================")
          .put("test3_withLongNames[{testEnum: TWO},1.{testString: ABC}]", "TWO:ABC")
          .put(
              "test3_withLongNames[{testEnum: TWO},2.{testString: 'This is a very long string (240"
                  + " characters) that would normally caus...]",
              "TWO:This is a very long string (240 characters) that would normally cause Sponge+Tin"
                  + " to exceed the filename limit of 255 characters."
                  + " ======================================================================"
                  + "=========================")
          .build();
    }
  }

  @RunAsTest
  public static class MixedWithTestParameterFieldAnnotation extends SuccessfulTestCaseBase {

    private final TestEnum testEnumB;

    @TestParameter TestEnum testEnumA;

    @TestParameters("{testEnumB: ONE}")
    @TestParameters("{testEnumB: TWO}")
    public MixedWithTestParameterFieldAnnotation(TestEnum testEnumB) {
      this.testEnumB = testEnumB;
    }

    @Test
    @TestParameters({"{testString: ABC}", "{testString: DEF}"})
    public void test1(String testString) {
      storeTestParametersForThisTest(testEnumA, testEnumB, testString);
    }

    @Override
    ImmutableMap<String, String> expectedTestNameToStringifiedParameters() {
      return ImmutableMap.<String, String>builder()
          .put("test1[{testEnumB: ONE},{testString: ABC},ONE]", "ONE:ONE:ABC")
          .put("test1[{testEnumB: ONE},{testString: ABC},TWO]", "TWO:ONE:ABC")
          .put("test1[{testEnumB: ONE},{testString: ABC},THREE]", "THREE:ONE:ABC")
          .put("test1[{testEnumB: ONE},{testString: DEF},ONE]", "ONE:ONE:DEF")
          .put("test1[{testEnumB: ONE},{testString: DEF},TWO]", "TWO:ONE:DEF")
          .put("test1[{testEnumB: ONE},{testString: DEF},THREE]", "THREE:ONE:DEF")
          .put("test1[{testEnumB: TWO},{testString: ABC},ONE]", "ONE:TWO:ABC")
          .put("test1[{testEnumB: TWO},{testString: ABC},TWO]", "TWO:TWO:ABC")
          .put("test1[{testEnumB: TWO},{testString: ABC},THREE]", "THREE:TWO:ABC")
          .put("test1[{testEnumB: TWO},{testString: DEF},ONE]", "ONE:TWO:DEF")
          .put("test1[{testEnumB: TWO},{testString: DEF},TWO]", "TWO:TWO:DEF")
          .put("test1[{testEnumB: TWO},{testString: DEF},THREE]", "THREE:TWO:DEF")
          .build();
    }
  }

  @RunAsTest(
      failsWithMessage =
          "Either a value or a valuesProvider must be set in @TestParameters on test1()")
  public static class InvalidTestBecauseEmptyAnnotation {
    @Test
    @TestParameters
    public void test1() {}
  }

  @RunAsTest(
      failsWithMessage =
          "Either a value or a valuesProvider must be set in @TestParameters on"
              + " com.google.testing.junit.testparameterinjector.TestParametersMethodProcessorTest"
              + "$InvalidTestBecauseEmptyAnnotationOnConstructor()")
  public static class InvalidTestBecauseEmptyAnnotationOnConstructor {
    @TestParameters
    public InvalidTestBecauseEmptyAnnotationOnConstructor() {}

    @Test
    public void test1() {}
  }

  @RunAsTest(
      failsWithMessage =
          "It is not allowed to specify both value and valuesProvider in"
              + " @TestParameters(value=[{testEnum: ONE}], valuesProvider=TestEnumValuesProvider)"
              + " on test1()")
  public static class InvalidTestBecauseCombiningValueWithProvider {

    @Test
    @TestParameters(value = "{testEnum: ONE}", valuesProvider = TestEnumValuesProvider.class)
    public void test1(TestEnum testEnum) {}
  }

  @RunAsTest(
      failsWithMessage =
          "Either a value or a valuesProvider must be set in @TestParameters on test1()")
  public static class InvalidTestBecauseRepeatedAnnotationIsEmpty {
    @Test
    @TestParameters(value = "{testEnum: ONE}")
    @TestParameters
    public void test1(TestEnum testEnum) {}
  }

  @RunAsTest(
      failsWithMessage =
          "When specifying more than one @TestParameter for a method/constructor, each annotation"
              + " must have exactly one value. Instead, got 2 values on test1(): [{testEnum: TWO},"
              + " {testEnum: THREE}]")
  public static class InvalidTestBecauseRepeatedAnnotationHasMultipleValues {
    @Test
    @TestParameters(value = "{testEnum: ONE}")
    @TestParameters(value = {"{testEnum: TWO}", "{testEnum: THREE}"})
    public void test1(TestEnum testEnum) {}
  }

  @RunAsTest(
      failsWithMessage =
          "Setting a valuesProvider is not supported for methods/constructors with"
              + " multiple @TestParameters annotations on test1()")
  public static class InvalidTestBecauseRepeatedAnnotationHasProvider {
    @Test
    @TestParameters(valuesProvider = TestEnumValuesProvider.class)
    @TestParameters(valuesProvider = TestEnumValuesProvider.class)
    public void test1(TestEnum testEnum) {}
  }

  @RunAsTest(
      failsWithMessage =
          "Setting @TestParameters.customName is only allowed if there is exactly one YAML string"
              + " in @TestParameters.value (on test1())")
  public static class InvalidTestBecauseNamedAnnotationHasMultipleValues {
    @Test
    @TestParameters(
        customName = "custom",
        value = {"{testEnum: TWO}", "{testEnum: THREE}"})
    public void test1(TestEnum testEnum) {}
  }

  @RunAsTest(failsWithMessage = "Test class should have exactly one public constructor")
  public static class InvalidTestBecausePackagePrivateConstructor {
    InvalidTestBecausePackagePrivateConstructor() {}

    @Test
    public void test1() {}
  }

  @Parameters(name = "{0}")
  public static Collection<Object[]> parameters() {
    return Arrays.stream(TestParametersMethodProcessorTest.class.getClasses())
        .filter(cls -> cls.isAnnotationPresent(RunAsTest.class))
        .map(
            cls ->
                new Object[] {
                  cls.getSimpleName(), cls, cls.getAnnotation(RunAsTest.class).failsWithMessage()
                })
        .collect(toImmutableList());
  }

  private final Class<?> testClass;
  private final Optional<String> maybeFailureMessage;

  public TestParametersMethodProcessorTest(
      String name, Class<?> testClass, String failsWithMessage) {
    this.testClass = testClass;
    this.maybeFailureMessage =
        failsWithMessage.isEmpty() ? Optional.empty() : Optional.of(failsWithMessage);
  }

  @Test
  public void test_success() throws Exception {
    assume().that(maybeFailureMessage.isPresent()).isFalse();

    SharedTestUtilitiesJUnit4.runTestsAndAssertNoFailures(newTestRunner());
  }

  @Test
  public void test_failure() throws Exception {
    assume().that(maybeFailureMessage.isPresent()).isTrue();

    Exception exception =
        assertThrows(
            Exception.class,
            () -> SharedTestUtilitiesJUnit4.runTestsAndGetFailures(newTestRunner()));

    assertThat(exception).hasMessageThat().contains(maybeFailureMessage.get());
  }

  private PluggableTestRunner newTestRunner() throws Exception {
    return new PluggableTestRunner(testClass) {
      @Override
      protected TestMethodProcessorList createTestMethodProcessorList() {
        return TestMethodProcessorList.createNewParameterizedProcessors();
      }
    };
  }
}