Search in sources :

Example 1 with LocalCache

use of org.talend.sdk.component.api.service.cache.LocalCache in project component-runtime by Talend.

the class LocalCacheServiceTest method serialize.

@Test
void serialize() throws IOException, ClassNotFoundException {
    DynamicContainerFinder.LOADERS.put("LocalCacheServiceTest", Thread.currentThread().getContextClassLoader());
    DynamicContainerFinder.SERVICES.put(LocalCache.class, new LocalCacheService("tmp"));
    try {
        final LocalCache cache = new LocalCacheService("LocalCacheServiceTest");
        final LocalCache copy = roundTrip(cache);
        assertNotNull(copy);
    } finally {
        DynamicContainerFinder.LOADERS.remove("LocalCacheServiceTest");
        DynamicContainerFinder.SERVICES.remove(LocalCache.class);
    }
}
Also used : LocalCache(org.talend.sdk.component.api.service.cache.LocalCache) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 LocalCache (org.talend.sdk.component.api.service.cache.LocalCache)1