3
* JBoss, Home of Professional Open Source
4
* Copyright 2005, JBoss Inc., and individual contributors as indicated
5
* by the @authors tag. See the copyright.txt in the distribution for a
6
* full listing of individual contributors.
8
* This is free software; you can redistribute it and/or modify it
9
* under the terms of the GNU Lesser General Public License as
10
* published by the Free Software Foundation; either version 2.1 of
11
* the License, or (at your option) any later version.
13
* This software is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with this software; if not, write to the Free
20
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
23
package org.jboss.test.remoting.socketfactory;
25
import java.io.IOException;
26
import java.net.InetAddress;
27
import java.net.Socket;
28
import java.net.UnknownHostException;
30
import javax.net.SocketFactory;
31
import javax.net.ssl.SSLSocketFactory;
33
import org.jboss.test.remoting.socketfactory.SocketFactoryClassNameTestRoot.TestSocketFactory;
38
* Unit test for JBREM-1014.
40
* @author <a href="ron.sigal@jboss.com">Ron Sigal</a>
41
* @version $Revision: 1.1 $
43
* Copyright Jul 18, 2008
46
public abstract class SSLSocketFactoryClassNameTestRoot extends SocketFactoryClassNameTestRoot
48
public void setUp() throws Exception
51
String trustStoreFilePath = this.getClass().getResource("../.truststore").getFile();
52
System.setProperty("javax.net.ssl.trustStore", trustStoreFilePath);
53
System.setProperty("javax.net.ssl.trustStorePassword", "unit-tests-client");
54
String keyStoreFilePath = this.getClass().getResource("../.keystore").getFile();
55
System.setProperty("javax.net.ssl.keyStore", keyStoreFilePath);
56
System.setProperty("javax.net.ssl.keyStorePassword", "unit-tests-server");
57
System.setProperty("org.jboss.security.ignoreHttpsHost", "true");
60
protected Class getSocketFactoryClass()
62
return TestSSLSocketFactory.class;
65
public static class TestSSLSocketFactory extends SocketFactory
67
SocketFactory sf = SSLSocketFactory.getDefault();
69
public TestSSLSocketFactory()
73
public Socket createSocket() throws IOException, UnknownHostException
75
return sf.createSocket();
78
public Socket createSocket(String arg0, int arg1) throws IOException, UnknownHostException
80
return sf.createSocket(arg0, arg1);
83
public Socket createSocket(InetAddress arg0, int arg1) throws IOException
85
return sf.createSocket(arg0, arg1);
88
public Socket createSocket(String arg0, int arg1, InetAddress arg2, int arg3) throws IOException,
91
return sf.createSocket(arg0, arg1, arg2, arg3);
94
public Socket createSocket(InetAddress arg0, int arg1, InetAddress arg2, int arg3) throws IOException
96
return sf.createSocket(arg0, arg1, arg2, arg3);