protected void finalize() throws Throwable { if (getShell() != null) { printWarning("resource released without closure."); trace.printStackTrace(err); } super.finalize(); }
protected void finalize() throws Throwable { super.finalize(); if (getShell() != null) { printWarning("resource released without closure."); trace.printStackTrace(err); } }
@Override protected void finalize() throws Throwable { if (getShell() != null) { printWarning("resource released without closure."); trace.printStackTrace(err); } super.finalize(); }
@Override public synchronized void start(String threadName, Map mysqldArgs, boolean populateAllOptions) { if ((getShell() != null) || processRunning()) { printMessage("mysqld already running (process: " + pid() + ")"); return;
public synchronized void start(String threadName, Map pMysqldArgs, boolean populateAllOptions) { if ((getShell() != null) || processRunning()) { printMessage("mysqld already running (process: " + pid() + ")"); return;
public void testUseDatabase() throws Exception { String url = "jdbc:mysql://localhost:" + testUtil.testPort() + "/test"; String threadName = "testLaunch"; assertFalse("mysqld should not be running", mysqldResource.isRunning()); startMysql(threadName); Shell s1 = mysqldResource.getShell(); /* this asserts the thread starts */ assertRunning(); /* pause for mysqld to bind to port */ for (int i = 0; i < 100 && !mysqldResource.isReadyForConnections(); i++) { threads.pause(25); } testUtil.assertConnectViaJDBC(url); mysqldResource.start(threadName, new HashMap()); Shell s2 = mysqldResource.getShell(); assertEquals(s1, s2); assertTrue(s1.isDaemon()); assertRunningThenShutdown(); }
public void testLaunch() throws Exception { Map args = new HashMap(); String port = "" + testUtil.testPort(); args.put(MysqldResourceI.PORT, port); String url = "jdbc:mysql://localhost:" + port + "/test"; String threadName = "testLaunch"; assertFalse("mysqld should not be running", mysqldResource.isRunning()); mysqldResource.start(threadName, args); Shell s1 = mysqldResource.getShell(); /* this asserts the thread starts */ assertRunning(); /* pause for mysqld to bind to port */ for (int i = 0; i < 100 && !mysqldResource.isReadyForConnections(); i++) { threads.pause(25); } testUtil.assertConnectViaJDBC(url, true); mysqldResource.start(threadName, args); Shell s2 = mysqldResource.getShell(); assertEquals(s1, s2); assertTrue(s1.isDaemon()); assertRunningThenShutdown(); }
if ((getShell() != null) || processRunning()) { printMessage("mysqld already running (process: " + pid() + ")"); return;
public void testUseDatabase() throws Exception { String url = "jdbc:mysql://localhost:" + testUtil.testPort() + "/test"; String threadName = "testLaunch"; assertFalse("mysqld should not be running", mysqldResource.isRunning()); startMysql(threadName); Shell s1 = mysqldResource.getShell(); /* this asserts the thread starts */ assertRunning(); /* pause for mysqld to bind to port */ for (int i = 0; i < 100 && !mysqldResource.isReadyForConnections(); i++) { utils.threads().pause(25); } testUtil.assertConnectViaJDBC(url); if (!mysqldResource.isWindows()) { File sockFile = new File(mysqldResource.getDataDir(), "mysql.sock"); assertTrue(sockFile.exists()); } mysqldResource.start(threadName, new HashMap()); Shell s2 = mysqldResource.getShell(); assertEquals(s1, s2); assertTrue(s1.isDaemon()); assertRunningThenShutdown(); }
public void testLaunch() throws Exception { Map args = new HashMap(); String port = "" + testUtil.testPort(); args.put(MysqldResourceI.PORT, port); String url = "jdbc:mysql://localhost:" + port + "/test"; String threadName = "testLaunch"; assertFalse("mysqld should not be running", mysqldResource.isRunning()); mysqldResource.start(threadName, args); Shell s1 = mysqldResource.getShell(); /* this asserts the thread starts */ assertRunning(); /* pause for mysqld to bind to port */ for (int i = 0; i < 100 && !mysqldResource.isReadyForConnections(); i++) { utils.threads().pause(25); } testUtil.assertConnectViaJDBC(url, true); mysqldResource.start(threadName, args); Shell s2 = mysqldResource.getShell(); assertEquals(s1, s2); assertTrue(s1.isDaemon()); assertRunningThenShutdown(); }
boolean haveShell = (getShell() != null); if (!pidFile.exists() && !haveShell) { printMessage("Mysqld not running. No file: " + pidFile);
boolean haveShell = (getShell() != null); if (!pidFile.exists() && !haveShell) { printMessage("Mysqld not running. No file: " + pidFile);
boolean haveShell = (getShell() != null); if (!pidFile().exists() && !haveShell) { printMessage("Mysqld not running. No file: " + pidFile());