public void testBug35804() { testCreateDbFiles(); File dbDataDir = new File(dataDir, "mysql"); File host_frm = new File(dbDataDir, "host.frm"); assertTrue(host_frm.delete()); assertFalse(host_frm.exists()); mysqldResource.ensureEssentialFilesExist(); assertFalse(host_frm.exists()); }
private void setSytemPropertiesToLinux() { mysqldResource.setOsAndArch("Linux", "i386"); assertFalse(mysqldResource.isWindows()); }
private void setSytemPropertiesToLinux() { mysqldResource.setOsAndArch("Linux", "i386"); assertFalse(mysqldResource.isWindows()); }
private void assertNotRunning() { for (int i = 0; i < 500; i++) { if (!mysqldResource.isRunning()) break; threads.pause(25); } assertFalse("mysqld should not be running", mysqldResource.isRunning()); }
private void assertNotRunning() { for (int i = 0; i < 500; i++) { if (!mysqldResource.isRunning()) break; utils.threads().pause(25); } assertFalse("mysqld should not be running", mysqldResource.isRunning()); }
public void testForceKill() { startMysql("killMe"); assertTrue(mysqldResource.isRunning()); mysqldResource.issueForceKill(); assertFalse(mysqldResource.isRunning()); }
public void testForceKill() { startMysql("killMe"); assertTrue(mysqldResource.isRunning()); mysqldResource.issueForceKill(); assertFalse(mysqldResource.isRunning()); }
public void testCanConnectToServer() { assertFalse(mysqldResource.canConnectToServer(testUtil.testPort(), 1)); startMysql("testCanConnectToServer"); assertTrue(mysqldResource.canConnectToServer(testUtil.testPort(), 1)); }
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(); }
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(); }
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 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(); }