![JAR search and dependency download from the Maven repository](/logo.png)
redis.embedded.ports.PredefinedPortProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of embedded-redis Show documentation
Show all versions of embedded-redis Show documentation
Redis embedded server for Java integration testing.
Project forked from https://github.com/kstyrc/embedded-redis
The newest version!
package redis.embedded.ports;
import redis.embedded.PortProvider;
import redis.embedded.exceptions.RedisBuildingException;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
public class PredefinedPortProvider implements PortProvider {
private final List ports = new LinkedList();
private final Iterator current;
public PredefinedPortProvider(Collection ports) {
this.ports.addAll(ports);
this.current = this.ports.iterator();
}
@Override
public synchronized int next() {
if (!current.hasNext()) {
throw new RedisBuildingException("Run out of Redis ports!");
}
return current.next();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy