-
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.
Fix bad pom being generated (fix #22)
The tracing-api test artifact was being consumed by caffeine and the tracing-async projects in order to share a test utility. Due to Gradle generating the Maven pom dependencies in a non-deterministic order, this resulted in Maven resolving the dependencies incorrectly. Instead of allowing both a test and compile scope, Maven ignored the compile scope and did not consume the transitive dependency in downstream projects. The utility class was moved to caffeine/test and the async usage was rewritted to be ad hoc. Verified the pom generated only includes the compile scoped dependency.
- Loading branch information
Showing
27 changed files
with
88 additions
and
51 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
|
||
import org.testng.annotations.Test; | ||
|
||
import com.github.benmanes.caffeine.ConcurrentTestHarness; | ||
import com.github.benmanes.caffeine.testing.ConcurrentTestHarness; | ||
|
||
/** | ||
* @author [email protected] (Ben Manes) | ||
|
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
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 |
---|---|---|
|
@@ -17,25 +17,25 @@ | |
|
||
import java.lang.reflect.Constructor; | ||
|
||
import junit.framework.TestCase; | ||
|
||
import com.github.benmanes.caffeine.cache.Caffeine; | ||
import com.github.benmanes.caffeine.cache.testing.CacheSpec.Loader; | ||
import com.github.benmanes.caffeine.guava.CaffeinatedGuavaCache.CacheLoaderException; | ||
import com.google.common.cache.CacheLoader; | ||
import com.google.common.cache.LoadingCache; | ||
import com.google.common.cache.TestingCacheLoaders; | ||
import com.google.common.testing.SerializableTester; | ||
import com.google.common.util.concurrent.MoreExecutors; | ||
|
||
import junit.framework.TestCase; | ||
|
||
/** | ||
* @author [email protected] (Ben Manes) | ||
*/ | ||
public final class CaffeinatedGuavaTest extends TestCase { | ||
|
||
public void testSerializable() { | ||
SerializableTester.reserialize(CaffeinatedGuava.build(Caffeine.newBuilder())); | ||
SerializableTester.reserialize(CaffeinatedGuava.build(Caffeine.newBuilder(), Loader.IDENTITY)); | ||
SerializableTester.reserialize(CaffeinatedGuava.build( | ||
Caffeine.newBuilder(), IdentityLoader.INSTANCE)); | ||
SerializableTester.reserialize(CaffeinatedGuava.build( | ||
Caffeine.newBuilder(), TestingCacheLoaders.identityLoader())); | ||
} | ||
|
@@ -81,4 +81,13 @@ public void testReload_throwable() { | |
assertTrue(Thread.currentThread().isInterrupted()); | ||
} | ||
} | ||
|
||
enum IdentityLoader implements com.github.benmanes.caffeine.cache.CacheLoader<Object, Object> { | ||
INSTANCE; | ||
|
||
@Override | ||
public Object load(Object key) { | ||
return key; | ||
} | ||
} | ||
} |
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
28 changes: 28 additions & 0 deletions
28
guava/src/test/java/com/google/common/cache/FakeTicker.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,28 @@ | ||
/* | ||
* Copyright 2014 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.google.common.cache; | ||
|
||
import java.io.Serializable; | ||
|
||
import com.github.benmanes.caffeine.cache.Ticker; | ||
|
||
/** | ||
* @author [email protected] (Ben Manes) | ||
*/ | ||
final class FakeTicker extends com.google.common.testing.FakeTicker | ||
implements Ticker, Serializable { | ||
private static final long serialVersionUID = 1L; | ||
} |
Oops, something went wrong.