BAEL-1712 Fix tests in libraries project (#4630)

* BAEL-1712 Fix tests in libraries project

-Renamed 45 test files to standard naming conventions.
-Updated maven dependencies in libraries/pom.xml
-Fixed assertion errors in some tests.
-Included libraries project back into parent pom.xml

* BAEL-1712 Fix tests in libraries project

-Downgraded apache maven pmd plugin from 3.9.0 to 3.8 because pmd 6.0.1 present in pmd plugin 3.9.0 was unable to resolve classes having static final inner classes and was resulting into build failure.

* BAEL-1712 Fix libraries

-Fixed JodaTimeUnitTest
This commit is contained in:
Dhawal Kapil
2018-07-06 21:03:23 +05:30
committed by Grzegorz Piwowarek
parent f086ae7814
commit 11edaaf4bc
54 changed files with 76 additions and 70 deletions

View File

@@ -0,0 +1,57 @@
package com.baeldung.infinispan;
import com.baeldung.infinispan.listener.CacheListener;
import com.baeldung.infinispan.repository.HelloWorldRepository;
import com.baeldung.infinispan.service.HelloWorldService;
import com.baeldung.infinispan.service.TransactionalService;
import org.infinispan.Cache;
import org.infinispan.manager.DefaultCacheManager;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import java.util.function.Supplier;
@Ignore
public abstract class AbstractIntegrationTest {
private DefaultCacheManager cacheManager;
private HelloWorldRepository repository = new HelloWorldRepository();
protected HelloWorldService helloWorldService;
protected TransactionalService transactionalService;
@Before
public void setup() {
CacheConfiguration configuration = new CacheConfiguration();
CacheListener listener = new CacheListener();
cacheManager = configuration.cacheManager();
Cache<String, Integer> transactionalCache = configuration.transactionalCache(cacheManager, listener);
Cache<String, String> simpleHelloWorldCache = configuration.simpleHelloWorldCache(cacheManager, listener);
Cache<String, String> expiringHelloWorldCache = configuration.expiringHelloWorldCache(cacheManager, listener);
Cache<String, String> evictingHelloWorldCache = configuration.evictingHelloWorldCache(cacheManager, listener);
Cache<String, String> passivatingHelloWorldCache = configuration.passivatingHelloWorldCache(cacheManager, listener);
this.helloWorldService = new HelloWorldService(repository, listener, simpleHelloWorldCache, expiringHelloWorldCache, evictingHelloWorldCache, passivatingHelloWorldCache);
this.transactionalService = new TransactionalService(transactionalCache);
}
@After
public void tearDown() {
cacheManager.stop();
}
protected <T> long timeThis(Supplier<T> supplier) {
long millis = System.currentTimeMillis();
supplier.get();
return System.currentTimeMillis() - millis;
}
}