001/*
002 * Copyright (C) 2015 The Guava Authors
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package com.google.common.collect.testing;
018
019import static com.google.common.collect.testing.Helpers.copyToList;
020
021import com.google.common.annotations.GwtIncompatible;
022import java.util.List;
023
024/**
025 * Creates, based on your criteria, a JUnit test suite that exhaustively tests a
026 * ConcurrentNavigableMap implementation.
027 *
028 * @author Louis Wasserman
029 */
030@GwtIncompatible
031public class ConcurrentNavigableMapTestSuiteBuilder<K, V>
032    extends NavigableMapTestSuiteBuilder<K, V> {
033
034  public static <K, V> ConcurrentNavigableMapTestSuiteBuilder<K, V> using(
035      TestSortedMapGenerator<K, V> generator) {
036    ConcurrentNavigableMapTestSuiteBuilder<K, V> result =
037        new ConcurrentNavigableMapTestSuiteBuilder<>();
038    result.usingGenerator(generator);
039    return result;
040  }
041
042  @SuppressWarnings("rawtypes") // class literals
043  @Override
044  protected List<Class<? extends AbstractTester>> getTesters() {
045    List<Class<? extends AbstractTester>> testers = copyToList(super.getTesters());
046    testers.addAll(ConcurrentMapTestSuiteBuilder.TESTERS);
047    return testers;
048  }
049
050  @Override
051  NavigableMapTestSuiteBuilder<K, V> subSuiteUsing(TestSortedMapGenerator<K, V> generator) {
052    return using(generator);
053  }
054}