• 大小: 6.5MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-01
  • 语言: 其他
  • 标签: guava  src  

资源简介

GUAVA源代码,可在开发工具中关联,实现随时查看代码的作用

资源截图

代码片段和文件信息

/*
 * Copyright (C) 2013 The Guava Authors
 *
 * 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.common.collect.testing.google;

import static com.google.common.collect.testing.Helpers.assertEmpty;
import static com.google.common.collect.testing.features.CollectionFeature.ALLOWS_NULL_QUERIES;
import static com.google.common.collect.testing.features.CollectionFeature.ALLOWS_NULL_VALUES;
import static com.google.common.collect.testing.features.CollectionFeature.SUPPORTS_REMOVE;
import static com.google.common.collect.testing.features.CollectionSize.SEVERAL;
import static com.google.common.collect.testing.features.CollectionSize.ZERO;

import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.collect.testing.Helpers;
import com.google.common.collect.testing.WrongType;
import com.google.common.collect.testing.features.CollectionFeature;
import com.google.common.collect.testing.features.CollectionSize;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.junit.Ignore;

/**
 * Tests for {@code Multiset#remove} {@code Multiset.removeAll} and {@code Multiset.retainAll} not
 * already covered by the corresponding Collection testers.
 *
 * @author Jared Levy
 */
@GwtCompatible(emulated = true)
@Ignore // Affects only Android test runner which respects JUnit 4 annotations on JUnit 3 tests.
public class MultisetRemoveTester extends AbstractMultisetTester {
  @CollectionFeature.Require(SUPPORTS_REMOVE)
  public void testRemoveNegative() {
    try {
      getMultiset().remove(e0() -1);
      fail(“Expected IllegalArgumentException“);
    } catch (IllegalArgumentException expected) {
    }
    expectUnchanged();
  }

  @CollectionFeature.Require(absent = SUPPORTS_REMOVE)
  public void testRemoveUnsupported() {
    try {
      getMultiset().remove(e0() 2);
      fail(“Expected UnsupportedOperationException“);
    } catch (UnsupportedOperationException expected) {
    }
  }

  @CollectionFeature.Require(SUPPORTS_REMOVE)
  public void testRemoveZeroNoOp() {
    int originalCount = getMultiset().count(e0());
    assertEquals(“old count“ originalCount getMultiset().remove(e0() 0));
    expectUnchanged();
  }

  @CollectionSize.Require(absent = ZERO)
  @CollectionFeature.Require(SUPPORTS_REMOVE)
  public void testRemove_occurrences_present() {
    assertEquals(
        “multiset.remove(present 2) di

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-08-27 10:04  guava-master\
     目录           0  2018-08-27 10:04  guava-master\guava-master\
     目录           0  2018-08-27 10:04  guava-master\guava-master\android\
     目录           0  2018-08-27 10:04  guava-master\guava-master\android\guava-testlib\
     目录           0  2018-08-27 10:04  guava-master\guava-master\android\guava-testlib\src\
     目录           0  2018-08-27 10:04  guava-master\guava-master\android\guava-testlib\src\com\
     目录           0  2018-08-27 10:04  guava-master\guava-master\android\guava-testlib\src\com\google\
     目录           0  2018-08-27 10:04  guava-master\guava-master\android\guava-testlib\src\com\google\common\
     目录           0  2018-08-27 10:04  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\
     目录           0  2018-08-27 10:04  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\
     目录           0  2018-08-27 10:04  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\google\
     文件        7079  2018-08-22 06:46  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\google\MultisetRemoveTester.java
     文件        1919  2018-08-22 06:46  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\google\MultisetSerializationTester.java
     文件        3866  2018-08-22 06:46  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\google\MultisetSetCountConditionallyTester.java
     文件        1579  2018-08-22 06:46  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\google\MultisetSetCountUnconditionallyTester.java
     文件       10385  2018-08-22 06:46  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\google\MultisetTestSuiteBuilder.java
     文件       15846  2018-08-22 06:46  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\google\SetGenerators.java
     文件        3830  2018-08-22 06:46  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\google\SetMultimapAsMapTester.java
     文件        1944  2018-08-22 06:46  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\google\SetMultimapEqualsTester.java
     文件        1780  2018-08-22 06:46  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\google\SetMultimapPutAllTester.java
     文件        2731  2018-08-22 06:46  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\google\SetMultimapPutTester.java
     文件        1701  2018-08-22 06:46  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\google\SetMultimapReplaceValuesTester.java
     文件        5628  2018-08-22 06:46  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\google\SetMultimapTestSuiteBuilder.java
     文件        4601  2018-08-22 06:46  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\google\SortedMapGenerators.java
     文件       12279  2018-08-22 06:46  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\google\SortedMultisetTestSuiteBuilder.java
     文件        2332  2018-08-22 06:46  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\google\SortedSetMultimapAsMapTester.java
     文件        1228  2018-08-22 06:46  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\google\SortedSetMultimapGetTester.java
     文件        3892  2018-08-22 06:46  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\google\SortedSetMultimapTestSuiteBuilder.java
     文件        1126  2018-08-22 06:46  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\google\TestBiMapGenerator.java
     文件        1883  2018-08-22 06:46  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\google\TestEnumMultisetGenerator.java
     文件         994  2018-08-22 06:46  guava-master\guava-master\android\guava-testlib\src\com\google\common\collect\testing\google\TestListMultimapGenerator.java
............此处省略2793个文件信息

评论

共有 条评论