Issue#215 fixed tests dependencies
This commit is contained in:
parent
817dabe873
commit
687561e1c9
|
@ -20,6 +20,7 @@ package org.eclipse.jetty.alpn.client;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.ServiceLoader;
|
import java.util.ServiceLoader;
|
||||||
|
@ -54,8 +55,23 @@ public class ALPNClientConnectionFactory extends NegotiatingClientConnectionFact
|
||||||
this.protocols = protocols;
|
this.protocols = protocols;
|
||||||
|
|
||||||
IllegalStateException failure = new IllegalStateException("No Client ALPNProcessors!");
|
IllegalStateException failure = new IllegalStateException("No Client ALPNProcessors!");
|
||||||
for (Client processor : ServiceLoader.load(Client.class))
|
|
||||||
|
// Use a for loop on iterator so load exceptions can be caught and ignored
|
||||||
|
for (Iterator<Client> i = ServiceLoader.load(Client.class).iterator(); i.hasNext();)
|
||||||
{
|
{
|
||||||
|
Client processor;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
processor = i.next();
|
||||||
|
}
|
||||||
|
catch(Throwable x)
|
||||||
|
{
|
||||||
|
if (LOG.isDebugEnabled())
|
||||||
|
LOG.debug(x);
|
||||||
|
failure.addSuppressed(x);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
processor.init();
|
processor.init();
|
||||||
|
|
|
@ -20,6 +20,7 @@ package org.eclipse.jetty.alpn.server;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.ServiceLoader;
|
import java.util.ServiceLoader;
|
||||||
|
|
||||||
|
@ -50,8 +51,22 @@ public class ALPNServerConnectionFactory extends NegotiatingServerConnectionFact
|
||||||
super("alpn", protocols);
|
super("alpn", protocols);
|
||||||
|
|
||||||
IllegalStateException failure = new IllegalStateException("No Server ALPNProcessors!");
|
IllegalStateException failure = new IllegalStateException("No Server ALPNProcessors!");
|
||||||
for (Server processor : ServiceLoader.load(Server.class))
|
// Use a for loop on iterator so load exceptions can be caught and ignored
|
||||||
|
for (Iterator<Server> i = ServiceLoader.load(Server.class).iterator(); i.hasNext();)
|
||||||
{
|
{
|
||||||
|
Server processor;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
processor = i.next();
|
||||||
|
}
|
||||||
|
catch(Throwable x)
|
||||||
|
{
|
||||||
|
if (LOG.isDebugEnabled())
|
||||||
|
LOG.debug(x);
|
||||||
|
failure.addSuppressed(x);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
processor.init();
|
processor.init();
|
||||||
|
|
|
@ -50,12 +50,6 @@
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
|
||||||
<groupId>org.eclipse.jetty</groupId>
|
|
||||||
<artifactId>jetty-alpn-java-server</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty</groupId>
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
<artifactId>jetty-alpn-openjdk8-server</artifactId>
|
<artifactId>jetty-alpn-openjdk8-server</artifactId>
|
||||||
|
@ -86,4 +80,21 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>jdk9</id>
|
||||||
|
<activation>
|
||||||
|
<jdk>[1.9,)</jdk>
|
||||||
|
</activation>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
|
<artifactId>jetty-alpn-java-server</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
</project>
|
</project>
|
||||||
|
|
Loading…
Reference in New Issue