Java

Форк
0
/
ConcurrentMapTestSuiteBuilder.java 
54 строки · 2.1 Кб
1
/*
2
 * Copyright (C) 2015 The Guava Authors
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5
 * in compliance with the License. You may obtain a copy of the License at
6
 *
7
 * http://www.apache.org/licenses/LICENSE-2.0
8
 *
9
 * Unless required by applicable law or agreed to in writing, software distributed under the License
10
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11
 * or implied. See the License for the specific language governing permissions and limitations under
12
 * the License.
13
 */
14

15
package com.google.common.collect.testing;
16

17
import com.google.common.annotations.GwtIncompatible;
18
import com.google.common.collect.testing.testers.ConcurrentMapPutIfAbsentTester;
19
import com.google.common.collect.testing.testers.ConcurrentMapRemoveTester;
20
import com.google.common.collect.testing.testers.ConcurrentMapReplaceEntryTester;
21
import com.google.common.collect.testing.testers.ConcurrentMapReplaceTester;
22
import java.util.Arrays;
23
import java.util.List;
24

25
/**
26
 * Creates, based on your criteria, a JUnit test suite that exhaustively tests a ConcurrentMap
27
 * implementation.
28
 *
29
 * @author Louis Wasserman
30
 */
31
@GwtIncompatible
32
public class ConcurrentMapTestSuiteBuilder<K, V> extends MapTestSuiteBuilder<K, V> {
33
  public static <K, V> ConcurrentMapTestSuiteBuilder<K, V> using(TestMapGenerator<K, V> generator) {
34
    ConcurrentMapTestSuiteBuilder<K, V> result = new ConcurrentMapTestSuiteBuilder<>();
35
    result.usingGenerator(generator);
36
    return result;
37
  }
38

39
  @SuppressWarnings("rawtypes") // class literals
40
  static final List<? extends Class<? extends AbstractTester>> TESTERS =
41
      Arrays.asList(
42
          ConcurrentMapPutIfAbsentTester.class,
43
          ConcurrentMapRemoveTester.class,
44
          ConcurrentMapReplaceTester.class,
45
          ConcurrentMapReplaceEntryTester.class);
46

47
  @SuppressWarnings("rawtypes") // class literals
48
  @Override
49
  protected List<Class<? extends AbstractTester>> getTesters() {
50
    List<Class<? extends AbstractTester>> testers = Helpers.copyToList(super.getTesters());
51
    testers.addAll(TESTERS);
52
    return testers;
53
  }
54
}
55

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.