2
Copyright (C) 2002-2004 MySQL AB
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of version 2 of the GNU General Public License as
6
published by the Free Software Foundation.
8
There are special exceptions to the terms and conditions of the GPL
9
as it is applied to this software. View the full text of the
10
exception in file EXCEPTIONS-CONNECTOR-J in the directory of this
11
software distribution.
13
This program 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
16
GNU General Public License for more details.
18
You should have received a copy of the GNU General Public License
19
along with this program; if not, write to the Free Software
20
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
package testsuite.regression;
27
import java.util.Properties;
29
import sun.applet.AppletSecurity;
30
import testsuite.BaseTestCase;
33
* Tests various applet-related issues.
35
* @author Mark Matthews
36
* @version $Id: AppletRegressionTest.java,v 1.1.2.1 2005/05/13 18:58:38
39
public class AppletRegressionTest extends BaseTestCase {
40
private final static String TOGGLE_RUN_PROPERTY = "com.mysql.jdbc.testsuite.regression.runAppletRegressionTest";
47
public AppletRegressionTest(String name) {
50
// TODO Auto-generated constructor stub
54
* Runs all test cases in this test suite
58
public static void main(String[] args) {
59
System.setProperty(TOGGLE_RUN_PROPERTY, "true");
60
junit.textui.TestRunner.run(AppletRegressionTest.class);
64
* Tests if the driver wors with an Applet security manager installed.
69
public void testAppletSecurityManager() throws Exception {
70
if ("true".equalsIgnoreCase(System.getProperty(TOGGLE_RUN_PROPERTY))) {
71
System.setSecurityManager(new CustomAppletSecurity());
73
getConnectionWithProps(new Properties());
78
* We need to customize the security manager a 'bit', so that JUnit still
79
* works (and we can connect to various databases).
81
class CustomAppletSecurity extends AppletSecurity {
85
* @see java.lang.SecurityManager#checkAccess(java.lang.Thread)
87
public synchronized void checkAccess(Thread arg0) {
93
* @see java.lang.SecurityManager#checkConnect(java.lang.String, int,
96
public void checkConnect(String host, int port, Object context) {
102
* @see java.lang.SecurityManager#checkConnect(java.lang.String, int)
104
public void checkConnect(String host, int port) {