-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgrade to apache commons collections' junit5 test suite
- Loading branch information
Showing
13 changed files
with
104 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 0 additions & 39 deletions
39
caffeine/src/test/java/com/github/benmanes/caffeine/apache/BoundedMapTest.java
This file was deleted.
Oops, something went wrong.
87 changes: 87 additions & 0 deletions
87
caffeine/src/test/java/com/github/benmanes/caffeine/apache/CaffeineMapTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* | ||
* Copyright 2022 Ben Manes. All Rights Reserved. | ||
* | ||
* 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.github.benmanes.caffeine.apache; | ||
|
||
import java.time.Duration; | ||
import java.util.concurrent.ConcurrentMap; | ||
|
||
import org.apache.commons.collections4.map.AbstractMapTest; | ||
import org.junit.jupiter.api.Nested; | ||
|
||
import com.github.benmanes.caffeine.cache.Cache; | ||
import com.github.benmanes.caffeine.cache.Caffeine; | ||
|
||
/** | ||
* Apache Commons Collections' map tests for the {@link Cache#asMap()} view. | ||
* | ||
* @author [email protected] (Ben Manes) | ||
*/ | ||
@SuppressWarnings("PMD.MissingStaticMethodInNonInstantiatableClass") | ||
public final class CaffeineMapTest { | ||
|
||
private CaffeineMapTest() {} | ||
|
||
@Nested | ||
static final class BoundedSyncMapTest extends AbstractConcurrentMapTest { | ||
@Override public ConcurrentMap<Object, Object> makeObject() { | ||
return Caffeine.newBuilder() | ||
.expireAfterWrite(Duration.ofNanos(Long.MAX_VALUE)) | ||
.maximumSize(Long.MAX_VALUE) | ||
.build().asMap(); | ||
} | ||
} | ||
|
||
@Nested | ||
static final class BoundedAsyncMapTest extends AbstractConcurrentMapTest { | ||
@Override public ConcurrentMap<Object, Object> makeObject() { | ||
return Caffeine.newBuilder() | ||
.expireAfterWrite(Duration.ofNanos(Long.MAX_VALUE)) | ||
.maximumSize(Long.MAX_VALUE) | ||
.buildAsync().synchronous().asMap(); | ||
} | ||
} | ||
|
||
@Nested | ||
static final class UnboundedSyncMapTest extends AbstractConcurrentMapTest { | ||
@Override public ConcurrentMap<Object, Object> makeObject() { | ||
return Caffeine.newBuilder().build().asMap(); | ||
} | ||
} | ||
|
||
@Nested | ||
static final class UnboundedAsyncMapTest extends AbstractConcurrentMapTest { | ||
@Override public ConcurrentMap<Object, Object> makeObject() { | ||
return Caffeine.newBuilder().buildAsync().synchronous().asMap(); | ||
} | ||
} | ||
|
||
abstract static class AbstractConcurrentMapTest | ||
extends AbstractMapTest<ConcurrentMap<Object, Object>, Object, Object> { | ||
|
||
@Override public boolean isAllowNullKey() { | ||
return false; | ||
} | ||
@Override public boolean isAllowNullValueGet() { | ||
return false; | ||
} | ||
@Override public boolean isAllowNullValuePut() { | ||
return false; | ||
} | ||
@Override public boolean isTestSerialization() { | ||
return false; | ||
} | ||
} | ||
} |
52 changes: 0 additions & 52 deletions
52
caffeine/src/test/java/com/github/benmanes/caffeine/apache/CaffeineMapTestCase.java
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
caffeine/src/test/java/com/github/benmanes/caffeine/apache/UnboundedMapTest.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters