Updating reference to keystore to use MavenTestingUtils techniques instead.
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@2775 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
4aa2852e4a
commit
9aea1658df
|
@ -16,6 +16,8 @@ package org.eclipse.jetty.client;
|
|||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
||||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||
|
||||
public class ExternalKeyStoreAsyncSslHttpExchangeTest extends SslHttpExchangeTest
|
||||
{
|
||||
@Override
|
||||
|
@ -27,11 +29,7 @@ public class ExternalKeyStoreAsyncSslHttpExchangeTest extends SslHttpExchangeTes
|
|||
_httpClient.setConnectorType(HttpClient.CONNECTOR_SELECT_CHANNEL);
|
||||
_httpClient.setMaxConnectionsPerAddress(2);
|
||||
|
||||
String keystore = System.getProperty("user.dir") + File.separator +
|
||||
"src" + File.separator +
|
||||
"test" + File.separator +
|
||||
"resources" + File.separator
|
||||
+ "keystore";
|
||||
String keystore = MavenTestingUtils.getTestResourceFile("keystore").getAbsolutePath();
|
||||
|
||||
_httpClient.setKeyStoreInputStream(new FileInputStream(keystore));
|
||||
_httpClient.setKeyStorePassword("storepwd");
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.eclipse.jetty.server.handler.AbstractHandler;
|
|||
import org.eclipse.jetty.server.handler.ConnectHandler;
|
||||
import org.eclipse.jetty.server.nio.SelectChannelConnector;
|
||||
import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;
|
||||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -39,9 +40,7 @@ public class ProxyTunnellingTest
|
|||
private void startSSLServer(Handler handler) throws Exception
|
||||
{
|
||||
SslSelectChannelConnector connector = new SslSelectChannelConnector();
|
||||
String keyStorePath = System.getProperty("basedir");
|
||||
assertNotNull(keyStorePath);
|
||||
keyStorePath += File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "keystore";
|
||||
String keyStorePath = MavenTestingUtils.getTestResourceFile("keystore").getAbsolutePath();
|
||||
connector.setKeystore(keyStorePath);
|
||||
connector.setPassword("storepwd");
|
||||
connector.setKeyPassword("keypwd");
|
||||
|
|
|
@ -143,8 +143,7 @@ public class SslSecurityListenerTest extends TestCase
|
|||
//SslSelectChannelConnector connector = new SslSelectChannelConnector();
|
||||
SslSocketConnector connector = new SslSocketConnector();
|
||||
|
||||
String keystore = System.getProperty("user.dir") + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator
|
||||
+ "keystore";
|
||||
String keystore = MavenTestingUtils.getTestResourceFile("keystore").getAbsolutePath();
|
||||
|
||||
connector.setPort(0);
|
||||
connector.setKeystore(keystore);
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package org.eclipse.jetty.server.handler;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
@ -11,6 +13,7 @@ import java.net.Socket;
|
|||
import java.security.SecureRandom;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.X509Certificate;
|
||||
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.SSLSocket;
|
||||
import javax.net.ssl.SSLSocketFactory;
|
||||
|
@ -23,12 +26,10 @@ import javax.servlet.http.HttpServletResponse;
|
|||
|
||||
import org.eclipse.jetty.server.Request;
|
||||
import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;
|
||||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
||||
/**
|
||||
* @version $Revision$ $Date$
|
||||
*/
|
||||
|
@ -39,10 +40,7 @@ public class ConnectHandlerConnectSSLTest extends AbstractProxyHandlerTest
|
|||
{
|
||||
SslSelectChannelConnector connector = new SslSelectChannelConnector();
|
||||
|
||||
String keyStorePath = System.getProperty("basedir");
|
||||
if (keyStorePath==null)
|
||||
keyStorePath=".";
|
||||
keyStorePath += File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "keystore";
|
||||
String keyStorePath = MavenTestingUtils.getTestResourceFile("keystore").getAbsolutePath();
|
||||
connector.setKeystore(keyStorePath);
|
||||
connector.setPassword("storepwd");
|
||||
connector.setKeyPassword("keypwd");
|
||||
|
|
|
@ -23,7 +23,6 @@ import static org.junit.Assert.assertNotNull;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
@ -49,6 +48,7 @@ import org.eclipse.jetty.server.Connector;
|
|||
import org.eclipse.jetty.server.Request;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.handler.AbstractHandler;
|
||||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||
import org.eclipse.jetty.util.IO;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
|
@ -107,11 +107,7 @@ public class SSLEngineTest
|
|||
{
|
||||
server=new Server();
|
||||
connector=new SslSelectChannelConnector();
|
||||
String keystore = System.getProperty("user.dir") + File.separator +
|
||||
"src" + File.separator +
|
||||
"test" + File.separator +
|
||||
"resources" + File.separator +
|
||||
"keystore";
|
||||
String keystore = MavenTestingUtils.getTestResourceFile("keystore").getAbsolutePath();
|
||||
|
||||
connector.setPort(0);
|
||||
connector.setKeystore(keystore);
|
||||
|
|
|
@ -3,7 +3,6 @@ package org.eclipse.jetty.server.ssl;
|
|||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.SocketAddress;
|
||||
|
@ -13,11 +12,11 @@ import java.nio.channels.SocketChannel;
|
|||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.SSLEngine;
|
||||
import javax.net.ssl.SSLEngineResult;
|
||||
import javax.net.ssl.SSLEngineResult.HandshakeStatus;
|
||||
import javax.net.ssl.SSLProtocolException;
|
||||
import javax.net.ssl.SSLSession;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
import javax.net.ssl.SSLEngineResult.HandshakeStatus;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
@ -27,6 +26,7 @@ import org.eclipse.jetty.server.Connector;
|
|||
import org.eclipse.jetty.server.Request;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.handler.AbstractHandler;
|
||||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.junit.Test;
|
||||
|
@ -88,7 +88,7 @@ public class SslRenegotiateTest
|
|||
Server server=new Server();
|
||||
try
|
||||
{
|
||||
String keystore = System.getProperty("user.dir")+File.separator+"src"+File.separator+"test"+File.separator+"resources"+File.separator+"keystore";
|
||||
String keystore = MavenTestingUtils.getTestResourceFile("keystore").getAbsolutePath();
|
||||
connector.setPort(0);
|
||||
connector.setKeystore(keystore);
|
||||
connector.setPassword("storepwd");
|
||||
|
|
Loading…
Reference in New Issue